query
stringlengths
7
33.1k
document
stringlengths
7
335k
metadata
dict
negatives
listlengths
3
101
negative_scores
listlengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { pn_mostrar = new javax.swing.JScrollPane(); txt_mostrar = new javax.swing.JTextArea(); setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); setClosable(true); setMaximizable(true); setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); txt_mostrar.setEditable(false); txt_mostrar.setBackground(new java.awt.Color(51, 51, 51)); txt_mostrar.setColumns(20); txt_mostrar.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N txt_mostrar.setForeground(new java.awt.Color(255, 255, 255)); txt_mostrar.setRows(5); txt_mostrar.setSelectionColor(new java.awt.Color(51, 255, 0)); pn_mostrar.setViewportView(txt_mostrar); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(pn_mostrar, javax.swing.GroupLayout.DEFAULT_SIZE, 298, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(pn_mostrar, javax.swing.GroupLayout.DEFAULT_SIZE, 222, Short.MAX_VALUE) ); pack(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Form() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public frmRectangulo() {\n initComponents();\n }", "public form() {\n initComponents();\n }", "public AdjointForm() {\n initComponents();\n setDefaultCloseOperation(HIDE_ON_CLOSE);\n }", "public FormListRemarking() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n \n }", "public FormPemilihan() {\n initComponents();\n }", "public GUIForm() { \n initComponents();\n }", "public FrameForm() {\n initComponents();\n }", "public TorneoForm() {\n initComponents();\n }", "public FormCompra() {\n initComponents();\n }", "public muveletek() {\n initComponents();\n }", "public Interfax_D() {\n initComponents();\n }", "public quanlixe_form() {\n initComponents();\n }", "public SettingsForm() {\n initComponents();\n }", "public RegistrationForm() {\n initComponents();\n this.setLocationRelativeTo(null);\n }", "public Soru1() {\n initComponents();\n }", "public FMainForm() {\n initComponents();\n this.setResizable(false);\n setLocationRelativeTo(null);\n }", "public soal2GUI() {\n initComponents();\n }", "public EindopdrachtGUI() {\n initComponents();\n }", "public MechanicForm() {\n initComponents();\n }", "public AddDocumentLineForm(java.awt.Frame parent) {\n super(parent);\n initComponents();\n myInit();\n }", "public BloodDonationGUI() {\n initComponents();\n }", "public quotaGUI() {\n initComponents();\n }", "public Customer_Form() {\n initComponents();\n setSize(890,740);\n \n \n }", "public PatientUI() {\n initComponents();\n }", "public myForm() {\n\t\t\tinitComponents();\n\t\t}", "public Oddeven() {\n initComponents();\n }", "public intrebarea() {\n initComponents();\n }", "public Magasin() {\n initComponents();\n }", "public RadioUI()\n {\n initComponents();\n }", "public NewCustomerGUI() {\n initComponents();\n }", "public ZobrazUdalost() {\n initComponents();\n }", "public FormUtama() {\n initComponents();\n }", "public p0() {\n initComponents();\n }", "public INFORMACION() {\n initComponents();\n this.setLocationRelativeTo(null); \n }", "public ProgramForm() {\n setLookAndFeel();\n initComponents();\n }", "public AmountReleasedCommentsForm() {\r\n initComponents();\r\n }", "public form2() {\n initComponents();\n }", "public MainForm() {\n\t\tsuper(\"Hospital\", List.IMPLICIT);\n\n\t\tstartComponents();\n\t}", "public kunde() {\n initComponents();\n }", "public LixeiraForm() {\n initComponents();\n setLocationRelativeTo(null);\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n setRequestFocusEnabled(false);\n setVerifyInputWhenFocusTarget(false);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 465, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 357, Short.MAX_VALUE)\n );\n }", "public frmMain() {\n initComponents();\n }", "public frmMain() {\n initComponents();\n }", "public MusteriEkle() {\n initComponents();\n }", "public DESHBORDPANAL() {\n initComponents();\n }", "public GUIForm() {\n initComponents();\n inputField.setText(NO_FILE_SELECTED);\n outputField.setText(NO_FILE_SELECTED);\n progressLabel.setBackground(INFO);\n progressLabel.setText(SELECT_FILE);\n }", "public frmVenda() {\n initComponents();\n }", "public Botonera() {\n initComponents();\n }", "public FrmMenu() {\n initComponents();\n }", "public OffertoryGUI() {\n initComponents();\n setTypes();\n }", "public JFFornecedores() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setBackground(new java.awt.Color(255, 255, 255));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 983, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 769, Short.MAX_VALUE)\n );\n\n pack();\n }", "public EnterDetailsGUI() {\n initComponents();\n }", "public vpemesanan1() {\n initComponents();\n }", "public Kost() {\n initComponents();\n }", "public UploadForm() {\n initComponents();\n }", "public FormHorarioSSE() {\n initComponents();\n }", "public frmacceso() {\n initComponents();\n }", "public HW3() {\n initComponents();\n }", "public Managing_Staff_Main_Form() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n getContentPane().setLayout(null);\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n }", "public sinavlar2() {\n initComponents();\n }", "public P0405() {\n initComponents();\n }", "public IssueBookForm() {\n initComponents();\n }", "public MiFrame2() {\n initComponents();\n }", "public Choose1() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n\n String oldAuthor = prefs.get(\"AUTHOR\", \"\");\n if(oldAuthor != null) {\n this.authorTextField.setText(oldAuthor);\n }\n String oldBook = prefs.get(\"BOOK\", \"\");\n if(oldBook != null) {\n this.bookTextField.setText(oldBook);\n }\n String oldDisc = prefs.get(\"DISC\", \"\");\n if(oldDisc != null) {\n try {\n int oldDiscNum = Integer.parseInt(oldDisc);\n oldDiscNum++;\n this.discNumberTextField.setText(Integer.toString(oldDiscNum));\n } catch (Exception ex) {\n this.discNumberTextField.setText(oldDisc);\n }\n this.bookTextField.setText(oldBook);\n }\n\n\n }", "public GUI_StudentInfo() {\n initComponents();\n }", "public JFrmPrincipal() {\n initComponents();\n }", "public Lihat_Dokter_Keseluruhan() {\n initComponents();\n }", "public bt526() {\n initComponents();\n }", "public Pemilihan_Dokter() {\n initComponents();\n }", "public Ablak() {\n initComponents();\n }", "@Override\n\tprotected void initUi() {\n\t\t\n\t}", "@SuppressWarnings(\"unchecked\")\n\t// <editor-fold defaultstate=\"collapsed\" desc=\"Generated\n\t// Code\">//GEN-BEGIN:initComponents\n\tprivate void initComponents() {\n\n\t\tlabel1 = new java.awt.Label();\n\t\tlabel2 = new java.awt.Label();\n\t\tlabel3 = new java.awt.Label();\n\t\tlabel4 = new java.awt.Label();\n\t\tlabel5 = new java.awt.Label();\n\t\tlabel6 = new java.awt.Label();\n\t\tlabel7 = new java.awt.Label();\n\t\tlabel8 = new java.awt.Label();\n\t\tlabel9 = new java.awt.Label();\n\t\tlabel10 = new java.awt.Label();\n\t\ttextField1 = new java.awt.TextField();\n\t\ttextField2 = new java.awt.TextField();\n\t\tlabel14 = new java.awt.Label();\n\t\tlabel15 = new java.awt.Label();\n\t\tlabel16 = new java.awt.Label();\n\t\ttextField3 = new java.awt.TextField();\n\t\ttextField4 = new java.awt.TextField();\n\t\ttextField5 = new java.awt.TextField();\n\t\tlabel17 = new java.awt.Label();\n\t\tlabel18 = new java.awt.Label();\n\t\tlabel19 = new java.awt.Label();\n\t\tlabel20 = new java.awt.Label();\n\t\tlabel21 = new java.awt.Label();\n\t\tlabel22 = new java.awt.Label();\n\t\ttextField6 = new java.awt.TextField();\n\t\ttextField7 = new java.awt.TextField();\n\t\ttextField8 = new java.awt.TextField();\n\t\tlabel23 = new java.awt.Label();\n\t\ttextField9 = new java.awt.TextField();\n\t\ttextField10 = new java.awt.TextField();\n\t\ttextField11 = new java.awt.TextField();\n\t\ttextField12 = new java.awt.TextField();\n\t\tlabel24 = new java.awt.Label();\n\t\tlabel25 = new java.awt.Label();\n\t\tlabel26 = new java.awt.Label();\n\t\tlabel27 = new java.awt.Label();\n\t\tlabel28 = new java.awt.Label();\n\t\tlabel30 = new java.awt.Label();\n\t\tlabel31 = new java.awt.Label();\n\t\tlabel32 = new java.awt.Label();\n\t\tjButton1 = new javax.swing.JButton();\n\n\t\tlabel1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel1.setText(\"It seems that some of the buttons on the ATM machine are not working!\");\n\n\t\tlabel2.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel2.setText(\"Unfortunately these numbers are exactly what Professor has to use to type in his password.\");\n\n\t\tlabel3.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel3.setText(\n\t\t\t\t\"If you want to eat tonight, you have to help him out and construct the numbers of the password with the working buttons and math operators.\");\n\n\t\tlabel4.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tlabel4.setText(\"Denver's Password: 2792\");\n\n\t\tlabel5.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel5.setText(\"import java.util.Scanner;\\n\");\n\n\t\tlabel6.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel6.setText(\"public class ATM{\");\n\n\t\tlabel7.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel7.setText(\"public static void main(String[] args){\");\n\n\t\tlabel8.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel8.setText(\"System.out.print(\");\n\n\t\tlabel9.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel9.setText(\" -\");\n\n\t\tlabel10.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel10.setText(\");\");\n\n\t\ttextField1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\ttextField1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tlabel14.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel14.setText(\"System.out.print( (\");\n\n\t\tlabel15.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel15.setText(\"System.out.print(\");\n\n\t\tlabel16.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel16.setText(\"System.out.print( ( (\");\n\n\t\tlabel17.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel17.setText(\")\");\n\n\t\tlabel18.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel18.setText(\" +\");\n\n\t\tlabel19.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel19.setText(\");\");\n\n\t\tlabel20.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel20.setText(\" /\");\n\n\t\tlabel21.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel21.setText(\" %\");\n\n\t\tlabel22.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel22.setText(\" +\");\n\n\t\tlabel23.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel23.setText(\");\");\n\n\t\tlabel24.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel24.setText(\" +\");\n\n\t\tlabel25.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel25.setText(\" /\");\n\n\t\tlabel26.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel26.setText(\" *\");\n\n\t\tlabel27.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));\n\t\tlabel27.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel27.setText(\")\");\n\n\t\tlabel28.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel28.setText(\")\");\n\n\t\tlabel30.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel30.setText(\"}\");\n\n\t\tlabel31.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel31.setText(\"}\");\n\n\t\tlabel32.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel32.setText(\");\");\n\n\t\tjButton1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tjButton1.setText(\"Check\");\n\t\tjButton1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\tjButton1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tjavax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n\t\tlayout.setHorizontalGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(28).addGroup(layout\n\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING).addComponent(getDoneButton()).addComponent(jButton1)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, 774, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addGap(92).addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15, GroupLayout.PREFERRED_SIZE, 145,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(2)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(37))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(174)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(7)))\n\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label22, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label23, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20).addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(23).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel10, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16, GroupLayout.PREFERRED_SIZE, 177,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));\n\t\tlayout.setVerticalGroup(\n\t\t\t\tlayout.createParallelGroup(Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap()\n\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\tlayout.createSequentialGroup().addGroup(layout.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(3)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(19)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(78)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(76)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(75)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tShort.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(27))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label22,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlayout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(3)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel23,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(29)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))))\n\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t.addGap(30)\n\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(25)\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(26).addComponent(jButton1).addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(getDoneButton()).addContainerGap(23, Short.MAX_VALUE)));\n\t\tthis.setLayout(layout);\n\n\t\tlabel16.getAccessibleContext().setAccessibleName(\"System.out.print( ( (\");\n\t\tlabel17.getAccessibleContext().setAccessibleName(\"\");\n\t\tlabel18.getAccessibleContext().setAccessibleName(\" +\");\n\t}", "public Pregunta23() {\n initComponents();\n }", "public FormMenuUser() {\n super(\"Form Menu User\");\n initComponents();\n }", "public AvtekOkno() {\n initComponents();\n }", "public busdet() {\n initComponents();\n }", "public ViewPrescriptionForm() {\n initComponents();\n }", "public Ventaform() {\n initComponents();\n }", "public Kuis2() {\n initComponents();\n }", "public CreateAccount_GUI() {\n initComponents();\n }", "public POS1() {\n initComponents();\n }", "public Carrera() {\n initComponents();\n }", "public EqGUI() {\n initComponents();\n }", "public JFriau() {\n initComponents();\n this.setLocationRelativeTo(null);\n this.setTitle(\"BuNus - Budaya Nusantara\");\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setBackground(new java.awt.Color(204, 204, 204));\n setMinimumSize(new java.awt.Dimension(1, 1));\n setPreferredSize(new java.awt.Dimension(760, 402));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 750, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n }", "public nokno() {\n initComponents();\n }", "public dokter() {\n initComponents();\n }", "public ConverterGUI() {\n initComponents();\n }", "public hitungan() {\n initComponents();\n }", "public Modify() {\n initComponents();\n }", "public frmAddIncidencias() {\n initComponents();\n }", "public FP_Calculator_GUI() {\n initComponents();\n \n setVisible(true);\n }" ]
[ "0.73197734", "0.72914416", "0.72914416", "0.72914416", "0.72862023", "0.72487676", "0.7213741", "0.7207628", "0.7196503", "0.7190263", "0.71850693", "0.71594703", "0.7147939", "0.7093137", "0.70808756", "0.70566356", "0.6987119", "0.69778043", "0.6955563", "0.6953879", "0.6945632", "0.6943359", "0.69363457", "0.6931661", "0.6927987", "0.6925778", "0.6925381", "0.69117576", "0.6911631", "0.68930036", "0.6892348", "0.6890817", "0.68904495", "0.6889411", "0.68838716", "0.6881747", "0.6881229", "0.68778914", "0.6876094", "0.6874808", "0.68713", "0.6859444", "0.6856188", "0.68556464", "0.6855074", "0.68549985", "0.6853093", "0.6853093", "0.68530816", "0.6843091", "0.6837124", "0.6836549", "0.6828579", "0.68282986", "0.68268806", "0.682426", "0.6823653", "0.6817904", "0.68167645", "0.68102163", "0.6808751", "0.680847", "0.68083245", "0.6807882", "0.6802814", "0.6795573", "0.6794048", "0.6792466", "0.67904556", "0.67893785", "0.6789265", "0.6788365", "0.67824304", "0.6766916", "0.6765524", "0.6765339", "0.67571205", "0.6755559", "0.6751974", "0.67510027", "0.67433685", "0.67390305", "0.6737053", "0.673608", "0.6733373", "0.67271507", "0.67262334", "0.67205364", "0.6716807", "0.67148036", "0.6714143", "0.67090863", "0.67077154", "0.67046666", "0.6701339", "0.67006236", "0.6699842", "0.66981244", "0.6694887", "0.6691074", "0.66904294" ]
0.0
-1
1 Accessing local variables
@Test public void test1() { // num must be implicitly final for the code to compile. final int num = 1; // We can read final local variables from the outer scope of lambda expressions Converter<Integer, String> stringConverter = (from) -> String.valueOf(from + num); System.out.println(stringConverter.convert(2)); // 3 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private LocalVariables locals(){\n\t\treturn frame.getLocals();\n\t}", "public int get_return(){\r\n return local_return;\r\n }", "public Variable[] getLocals();", "public void method(int a) {\r\n\t\tint tot = 7;\r\n\t\tSystem.out.println(\"localvariable a: \"+a);\r\n\t\tint b = a + 4;\r\n\t\tSystem.out.println(\"localvariable b: \"+b);\r\n\t\t\r\n\t}", "private static int testOne(){\n var var = 10;\n return var;\n }", "public LocalDebugInfo[] locals();", "public java.lang.String get_return(){\n return local_return;\n }", "public java.lang.String get_return(){\n return local_return;\n }", "public java.lang.String get_return(){\n return local_return;\n }", "public java.lang.String get_return(){\n return local_return;\n }", "@Override\n\tpublic void visitXlocal(Xlocal p) {\n\n\t}", "Variable getReturn();", "public java.lang.String getParam0(){\n return localParam0;\n }", "public java.lang.String getParam0(){\n return localParam0;\n }", "public java.lang.String getParam0(){\n return localParam0;\n }", "public java.lang.String getParam0(){\n return localParam0;\n }", "public void someMethod() {\n\t\tint localInt = ExampleDriver.counter;\n\t\t//int localInt2 = ExampleDriver.nonStaticCounter;\n\t\tExampleDriver exampleDriver = new ExampleDriver();\n\t\tint localInt2 = exampleDriver.nonStaticCounter;\n\t}", "int realnVars();", "public void MIPSme()\n\t{\n\t\t\n\t\tTEMP varAddress = null;\n\t\t//v := v - this is the right side of the assignment - we want to load the value of v from memory\n\t\tif (isRight){\n\t\t\tif(isParamFromStack){\n\t\t\t\t// we want value from stack\n\t\t\t\tsir_MIPS_a_lot.getInstance().loadFromFrame(dst,(this.localVarOffset+1)*4);\n\t\t\t}\n\t\t\t//need to be modified\n\t\t\telse{\n\t\t\t\tsir_MIPS_a_lot.getInstance().loadFromFrame(dst,-(this.localVarOffset+1)*4);\n\t\t\t}\n\t\t}\n\t\t//left side - we want to get variable address into temp t \n\t\telse{\n\t\t\t//variable is a parameter of a function\n\t\t\tif (isParamFromStack){\n\t\t\t\tvarAddress = sir_MIPS_a_lot.getInstance().addressParamVar(this.localVarOffset);\n\t\t\t}\n\t\t\t//for now it represents local variable but need to be changed.... (data members, globals...) \n\t\t\telse{\n\t\t\t\tvarAddress = sir_MIPS_a_lot.getInstance().addressLocalVar(this.localVarOffset);\n\t\t\t}\n\t\t\tsir_MIPS_a_lot.getInstance().move(dst,varAddress);\n\t\t}\n\t}", "public void foo() {\n\tint j;\n\tint jj = 0;\n\t// System.out.println(i); Will not compile; local variables must be initialized\n\tSystem.out.println(jj);\n }", "void m1() {\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(outer); // can access the outer CLASS context elements\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(finalVariable); // can access to the outer METHOD context elements if FINAL\n\t\t\t\t\tSystem.out.println(effectivellyFinal); // can access to the outer METHOD context elements if EFFECTIVELY FINAL\n\t\t\t\t}", "public boolean getParam0(){\n return localParam0;\n }", "public void method(){\n\t\t\n\t\tint a=3;//only for this method//local variable\n\t\tSystem.out.println(a);\n\t\tSystem.out.println(this.a);\n\t\tSystem.out.print(a+this.a);\n\t}", "public boolean get_return(){\n return local_return;\n }", "private zzfl$zzg$zzc() {\n void var3_1;\n void var2_-1;\n void var1_-1;\n this.value = var3_1;\n }", "public java.lang.String[] get_return(){\r\n return local_return;\r\n }", "private void updateVars()\n {\n\n }", "@Override\r\n public int getSecondArg() {\n return localsNum;\r\n }", "private void declareLocals() {\r\n\t\t// declare locals\r\n\t\tfor(Local local: method.retrieveActiveBody().getLocals()) {\r\n\t\t\tString cType = null;\r\n\t\t\t// null types need special treatment, we don't output them\r\n\t\t\t// we also won't generate statements that use a nullType\r\n\t\t\t// as a target.\r\n\t\t\tif(local.getType() instanceof NullType) {\r\n\t\t\t\tcType = \"java_lang_Object*\";\r\n\t\t\t} else {\r\n\t\t\t\tcType = CTypes.toCType(local.getType());\r\n\t\t\t}\r\n\t\t\twriter.wl(cType + \" \" + local.getName() + \" = 0;\");\r\n\t\t}\r\n\t\twriter.wl(\"java_lang_Object* _exception = 0;\");\r\n\t}", "String getVariable();", "boolean getVarReturn();", "public static void main(String[] args) {\n\nint x = 5;\nint y;\n// int z = x+y; // DOES NOT COMPILE\n // Local variables need to be initialized before use\n\n\n}", "@Override // Runnable hat nur eine Methode => run()\n public void run() {\n System.out.println(localVariable);\n System.out.println(Excursus.this.outerAttribute);\n Excursus.this.outerMethod(localVariable);\n\n }", "public void resetLocals()\n {\n maxLocalSize = 0;\n localCnt = localIntCnt = localDoubleCnt = localStringCnt = localItemCnt = 0;\n locals = lastLocal = new LocalVariable(null, null, null);\n }", "private void localVariableDeclaration(Modifier modify, Scope scope, Vector queue)\r\n {\r\n if (nextSymbol == Keyword.FINALSY)\r\n {\r\n modify.add(nextSymbol.value);\r\n lookAhead();\r\n }\r\n\r\n modify.check(modify.fields | modify.access);\r\n Type t = type();\r\n\r\n variableDeclarators(modify, t, scope, queue);\r\n }", "String getVarDeclare();", "public String getVariable();", "public java.util.Collection<VariableInfo> getLocalVariables(){\n\t\tjava.util.Collection<VariableInfo> variables = new java.util.ArrayList<VariableInfo>();\n\n\t\treturn variables;\n\t}", "public void add()\n {\n\n\t\tint a= 4; //local variable \n\t //printing sum of local + global 'a'\n\t int b= a+this.a;\n\t int d= a+this.b; //or a+b\n\t System.out.println(\"Sum=\" + b + \"and\" + d);\n\t \n }", "public int getResult(){\n return localResult;\n }", "private void computeOutput(RefactoringStatus status) {\n FlowContext flowContext = new FlowContext(0, fMaxVariableId + 1);\n flowContext.setConsiderAccessMode(true);\n flowContext.setComputeMode(FlowContext.RETURN_VALUES);\n FlowInfo returnInfo = new InOutFlowAnalyzer(flowContext).perform(getSelectedNodes());\n IVariableBinding[] returnValues = returnInfo.get(flowContext, FlowInfo.WRITE | FlowInfo.WRITE_POTENTIAL | FlowInfo.UNKNOWN);\n // Compute a selection that exactly covers the selected nodes\n IRegion region = getSelectedNodeRange();\n Selection selection = Selection.createFromStartLength(region.getOffset(), region.getLength());\n List<IVariableBinding> localReads = new ArrayList();\n flowContext.setComputeMode(FlowContext.ARGUMENTS);\n FlowInfo argInfo = new InputFlowAnalyzer(flowContext, selection, true).perform(fEnclosingBodyDeclaration);\n IVariableBinding[] reads = argInfo.get(flowContext, FlowInfo.READ | FlowInfo.READ_POTENTIAL | FlowInfo.UNKNOWN);\n outer: for (int i = 0; i < returnValues.length && localReads.size() < returnValues.length; i++) {\n IVariableBinding binding = returnValues[i];\n for (int x = 0; x < reads.length; x++) {\n if (reads[x] == binding) {\n localReads.add(binding);\n fReturnValue = binding;\n continue outer;\n }\n }\n }\n switch(localReads.size()) {\n case 0:\n fReturnValue = null;\n break;\n case 1:\n break;\n default:\n fReturnValue = null;\n StringBuffer affectedLocals = new StringBuffer();\n for (int i = 0; i < localReads.size(); i++) {\n IVariableBinding binding = localReads.get(i);\n String bindingName = BindingLabelProvider.getBindingLabel(binding, BindingLabelProvider.DEFAULT_TEXTFLAGS | JavaElementLabels.F_PRE_TYPE_SIGNATURE);\n affectedLocals.append(bindingName);\n if (i != localReads.size() - 1) {\n affectedLocals.append('\\n');\n }\n }\n String message = MessageFormat.format(RefactoringCoreMessages.ExtractMethodAnalyzer_assignments_to_local, new Object[] { affectedLocals.toString() });\n status.addFatalError(message, JavaStatusContext.create(fCUnit, getSelection()));\n return;\n }\n List<IVariableBinding> callerLocals = new ArrayList(5);\n FlowInfo localInfo = new InputFlowAnalyzer(flowContext, selection, false).perform(fEnclosingBodyDeclaration);\n IVariableBinding[] writes = localInfo.get(flowContext, FlowInfo.WRITE | FlowInfo.WRITE_POTENTIAL | FlowInfo.UNKNOWN);\n for (int i = 0; i < writes.length; i++) {\n IVariableBinding write = writes[i];\n if (getSelection().covers(ASTNodes.findDeclaration(write, fEnclosingBodyDeclaration)))\n callerLocals.add(write);\n }\n fCallerLocals = callerLocals.toArray(new IVariableBinding[callerLocals.size()]);\n if (fReturnValue != null && getSelection().covers(ASTNodes.findDeclaration(fReturnValue, fEnclosingBodyDeclaration)))\n fReturnLocal = fReturnValue;\n }", "protected void initVars() {}", "public int get_int() {\n return local_int;\n }", "public Fact get_return() {\r\n return local_return;\r\n }", "public LocalVariable latestLocalVariable()\n {\n return lastLocal;\n }", "final public void varcall() throws ParseException {\n jj_consume_token(VARIABLE);\n if(userVals.get(token.image)==null) {\n {if (true) throw new ParseException(\"La variable no ha sido definida.\");}\n }\n }", "Variables createVariables();", "public Object getValue(String name) {\n Object value = localScope.get(name);\n if ( value!=null ) {\n return value;\n }\n // if not found\n BFlatGUI.debugPrint(0, \"undefined variable \"+name);\n return null;\n }", "boolean isLocal();", "void mo4827a(Context context, C0152fo foVar);", "@Override\n public void visitLocalVariable(String name, String descriptor, String signature, Label start, Label end, int index) {\n if(this.preserveDebuggability){\n super.visitLocalVariable(name, descriptor, signature, start, end, index);\n }\n }", "Var getVar();", "public static void show_local() {\n\n\t}", "@Override String opStr() { return \"var\"; }", "public int func_176881_a() {\n/* */ return this.field_176893_h;\n/* */ }", "public boolean isLocal()\n {\n return true;\n }", "private void tempVariableExample() {\r\n\tfor(int i =0; i < age; i++)\r\n\t{\r\n\t\t//print i\r\n\t}\r\n\r\n\r\n}", "private Integer varOffset( String defun, String varname ) {\n\treturn symbolTable.get( defun ).get( varname );\n }", "public DataNode locals() {\n return locals;\n }", "public LocalVariableGen addLocalVariable2(String name, Type type, InstructionHandle start) {\n/* 177 */ return addLocalVariable(name, type, this._slotAllocator.allocateSlot(type), start, null);\n/* */ }", "private LocalParameters() {\n\n\t}", "public LocalVariableGen addLocalVariable(String name, Type type, InstructionHandle start, InstructionHandle end) {\n/* 170 */ return this._allocatorInit ? addLocalVariable2(name, type, start) : super.addLocalVariable(name, type, start, end);\n/* */ }", "public String func_176882_c() {\n/* */ return this.field_176891_j;\n/* */ }", "public int getTotalVariables() ;", "@Override\n\tpublic IBasicObject getAccessedWithinVar() {\n\t\treturn heldObj.getAccessedWithinVar();\n\t}", "Aliasing getVariable();", "VariableDeclarationWithInitCS getResultVariable();", "public int maxLocals();", "Variable getSourceVariable();", "private void a(String paramString, int paramInt1, int paramInt2, int paramInt3, boolean paramBoolean)\r\n/* 578: */ {\r\n/* 579:581 */ List<String> localList = c(paramString, paramInt3);\r\n/* 580:582 */ for (String str : localList)\r\n/* 581: */ {\r\n/* 582:583 */ a(str, paramInt1, paramInt2, paramInt3, this.q, paramBoolean);\r\n/* 583:584 */ paramInt2 += this.a;\r\n/* 584: */ }\r\n/* 585: */ }", "static boolean VarDetails(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"VarDetails\")) return false;\n if (!nextTokenIs(b, \"\", OP_ASSIGN, K_EXTERNAL)) return false;\n boolean r;\n Marker m = enter_section_(b);\n r = VarValueAssignment(b, l + 1);\n if (!r) r = ExternalVarPart(b, l + 1);\n exit_section_(b, m, null, r);\n return r;\n }", "Node getVariable();", "public static void checkLocal(Token t) {\n int k = find(t.instanc);\n if (k == -1) {\n checkGlobal(t);\n }\n }", "@Override\r\n\tpublic void initVariables() {\n\t\t\r\n\t}", "private Value findLocalVDef(SootMethod method, Value value) {\n\t\tValue localV = null;\n\t\t//find the def of given value\n\t\tExceptionalUnitGraph ug = new ExceptionalUnitGraph(method.getActiveBody());\n\t\tfor(Iterator it = ug.iterator(); it.hasNext();){\n\n\t\t\tUnit u = (Unit)it.next();\n\t\t\tList<ValueBox> list = u.getDefBoxes();\n\t\t\tfor(ValueBox box : list){\n\t\t\t\tif(!box.getValue().equals(value)){\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tList<ValueBox> useList = u.getUseBoxes();\n\t\t\t\tfor(ValueBox use: useList){\n\t\t\t\t\tValue val = use.getValue();\n\t\t\t\t\tif(val instanceof Local){\n\t\t\t\t\t\tDebug.printOb(\"local\");\n\t\t\t\t\t}else{\n\t\t\t\t\t\tlocalV = val;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn localV;\n\t}", "int getVar() {\n\n return super.var; //Line n3. refer to its immediate parents variable of var\n }", "int getVarsCount();", "public String getVariableName() {\n return _vname;\n }", "public LocalContext(int returnip, int nlocals) {\n\t\tthis.returnip = returnip;\n\t\tlocals = new Object[nlocals];\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tint i=10;//local variable\n\t\tSystem.out.println(i);\n\t\tDay3LocalvsGlobal obj= new Day3LocalvsGlobal();\n\t\t//copy of non static method and variable are given to object new Day3LocalvsGlobal() \n\t\tSystem.out.println(obj.name);\n\t\tSystem.out.println(obj.age);\n\t\t\n\n\t}", "public String getVar()\n {\n return var;\n }", "private synchronized void updateVariables() throws DebugException {\n\t\tif (lastUpdated == target.getSuspendCount()\n\t\t\t\t|| (variables != null && oldLineNumber == lineNumber))\n\t\t\treturn;\n\t\t\n\t\tSynchronizer frontend = target.getFrontend();\n\t\tif (frontend != null) {\n\t\t\t// get local variables\n\t\t\tString localsSausage = frontend.GetLocals(thread.getID(),frameNumber);\n\t\t\tString[] locals;\n\t\t\tif (localsSausage == null || localsSausage.equals(\"--\")\n\t\t\t\t\t|| localsSausage.equals(\"\"))\n\t\t\t\tlocals = new String[0];\n\t\t\telse\n\t\t\t\tlocals = localsSausage.split(\" \");\n\t\t\t// get parameters\n\t\t\tString paramsSausage = frontend.GetParameters(thread.getID(),frameNumber);\n\t\t\tString[] params;\n\t\t\tif (paramsSausage == null || paramsSausage.equals(\"--\")\n\t\t\t\t\t|| paramsSausage.equals(\"\"))\n\t\t\t\tparams = new String[0];\n\t\t\telse\n\t\t\t\tparams = paramsSausage.split(\" \");\n\t\t\t// get static fields of the current class\n\t\t\tString className;\n\t\t\ttry {\n\t\t\t\tclassName = methodName.substring(0, methodName.lastIndexOf('.'));\n\t\t\t} catch (StringIndexOutOfBoundsException e) {\n\t\t\t\tclassName = \"\";\n\t\t\t}\n\t\t\tString staticsSausage = frontend.PtypeFieldsOnly(thread.getID(),frameNumber,\n\t\t\t\t\tclassName,true);\n\t\t\tString[] statics;\n\t\t\tif (staticsSausage == null || staticsSausage.equals(\"--\")\n\t\t\t\t\t|| staticsSausage.equals(\"\"))\n\t\t\t\tstatics = new String[0];\n\t\t\telse\n\t\t\t\tstatics = staticsSausage.split(\" \");\n\t\t\t// determine if \"this\" is valid\n\t\t\tboolean _this = true;\n\t\t\tif (frontend.PtypeFieldsOnly(thread.getID(),frameNumber,\"this\",false).equals(\"--\"))\n\t\t\t\t_this = false;\n\t\t\t\n\t\t\t// create variable objects\n\t\t\tIVariable[] tempVariables = new EmonicVariable[locals.length + params.length\n\t\t\t + statics.length + (_this ? 1 : 0)];\n\n\t\t\tif (variables == null || variables.length != tempVariables.length) {\n\t\t\t\t// something changed\n\t\t\t\tint index = 0;\n\t\t\t\tif (_this) {\n\t\t\t\t\ttempVariables[0] = new EmonicVariable(this,\"this\",null);\n\t\t\t\t\tindex++;\n\t\t\t\t}\n\t\t\t\tArrays.sort(locals);\n\t\t\t\tfor (int i=0; i<locals.length; i++) {\n\t\t\t\t\ttempVariables[i+index] = new EmonicVariable(this,locals[i],null);\n\t\t\t\t}\n\t\t\t\tindex+=locals.length;\n\t\t\t\tArrays.sort(params);\n\t\t\t\tfor (int i=0; i<params.length; i++) {\n\t\t\t\t\ttempVariables[i+index] = new EmonicVariable(this,params[i],null);\n\t\t\t\t}\n\t\t\t\tindex+=params.length;\n\t\t\t\tArrays.sort(statics);\n\t\t\t\tfor (int i=0; i<statics.length; i++) {\n\t\t\t\t\ttempVariables[i+index] = new EmonicVariable(this,statics[i],null);\n\t\t\t\t}\n\t\t\t\tvariables = tempVariables;\n\t\t\t} \n\t\t}\n\t\tlastUpdated = target.getSuspendCount();\n//\t\toldLineNumber = lineNumber;\n\t}", "public void method_6438(int var1) {\r\n this.field_6227 = var1;\r\n }", "void resetLocal();", "public abstract int nVars();", "private int getMY() {\n\t\treturn 0;\r\n\t}", "public IVariable getInternalVariable(String name) {\n return fInternalVariables.get(name);\n }", "public LocalRec LocalRec(RecVar recvar, LocalType body)\n\t{\n\t\t//return new LocalRec(self, recvar, body);\n\t\treturn new LocalRec(recvar, body);\n\t}", "private void j()\n/* */ {\n/* 223 */ c localc = this.b;\n/* 224 */ this.b = this.c;\n/* 225 */ this.c = localc;\n/* 226 */ this.c.b();\n/* */ }", "@Test\n\tpublic void testMakeSureVarVariablesCanShadowLetVariables()\n\t{\n\t\tString[] code = {\n\t\t\t\"let a = 1;\",\n\t\t \"let b = 2;\",\n\t\t \"var c = 3;\",\n\n\t\t \"function sup(a) {\",\n\t\t \"var b = 4;\",\n\t\t \"let c = 5;\",\n\t\t \"let d = 6;\",\n\t\t \"if (false) {\",\n\t\t \"var d = 7;\",\n\t\t \"}\",\n\t\t \"return b + c + a + d;\",\n\t\t \"}\",\n\n\t\t \"sup();\"\n\t\t};\n\t\t\n\t\tth.addError(1, 5, \"'a' is defined but never used.\");\n\t th.addError(2, 5, \"'b' is defined but never used.\");\n\t th.addError(3, 5, \"'c' is defined but never used.\");\n\t th.addError(9, 5, \"'d' has already been declared.\");\n\t\tth.test(code, new LinterOptions().set(\"esnext\", true).set(\"unused\", true).set(\"undef\", true).set(\"funcscope\", true));\n\t}", "public boolean _is_local() {\n throw new NO_IMPLEMENT(reason);\n }", "public void lavar() {\n\t\t// TODO Auto-generated method stub\n\t\t\n\t}", "public void set_return(int param){\r\n \r\n // setting primitive attribute tracker to true\r\n local_returnTracker =\r\n param != java.lang.Integer.MIN_VALUE;\r\n \r\n this.local_return=param;\r\n \r\n\r\n }", "public boolean get_return() {\r\n return local_return;\r\n }", "private boolean putLocalVar(String name){\n if(currentVariables == null) return false;\n if(get(name) != null) return false;\n\n for (int i = 0; i < Integer.MAX_VALUE - 1; i++) {\n if(!currentVariables.containsValue(i)){\n currentVariables.put(name, i); \n return true;\n }\n }\n return false;\n }", "private int somemethod3(){\n return this.data;\n }", "public List<LocalVariable> getLocalVariables() {\n\t\treturn localVariables;\n\t}", "public String variable()\n\t{\n\t\treturn _var;\n\t}", "public Variable[] getStackVariables();", "void mo12648a(C3676k kVar);", "@Override\r\n\tpublic void multLocal(ShaderVar var) {\n\t}" ]
[ "0.7018394", "0.67549115", "0.6725285", "0.6605533", "0.6417888", "0.6393038", "0.63056415", "0.63056415", "0.63056415", "0.63056415", "0.6258631", "0.62334895", "0.6231274", "0.6231274", "0.6231274", "0.6231274", "0.6185678", "0.6169181", "0.61130035", "0.6106513", "0.61016166", "0.6062117", "0.60600305", "0.6058478", "0.6031808", "0.60085195", "0.59957975", "0.59402555", "0.59255004", "0.58733207", "0.58621037", "0.5839502", "0.5829691", "0.58169293", "0.57903886", "0.578607", "0.5785471", "0.5784284", "0.57837766", "0.5782502", "0.5777742", "0.57552135", "0.5753427", "0.5736911", "0.5710377", "0.570786", "0.5699355", "0.5692156", "0.56900877", "0.56802344", "0.5676786", "0.5676696", "0.5670561", "0.56699365", "0.56697917", "0.56424713", "0.5628556", "0.5621381", "0.5618561", "0.56161547", "0.56142086", "0.5612113", "0.5601713", "0.5589575", "0.55860615", "0.5565171", "0.55626935", "0.5524444", "0.5511219", "0.55079436", "0.54987574", "0.54957813", "0.54953444", "0.54942614", "0.548861", "0.54760426", "0.5475095", "0.54721516", "0.54687446", "0.5464181", "0.545388", "0.54494697", "0.5441921", "0.5434487", "0.5433789", "0.5429133", "0.54148006", "0.541005", "0.54037136", "0.5391939", "0.53915936", "0.53824097", "0.5381838", "0.5367231", "0.5360241", "0.5359779", "0.53508973", "0.5350455", "0.53498507", "0.5348152", "0.5341362" ]
0.0
-1
3 Accessing Default Interface Methods
interface Formula { double calculate(int a); default double sqrt(int a) { return Math.sqrt(a); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public default void defaultMethod(){\r\n System.out.println(\"This is a method from Other Interface and can be overriden.\");\r\n }", "interface I{\n\n public void m1();\n public void m2();\n default void m3(){\n System.out.println(\"Default methods in interface\");\n }\n}", "public Object _get_interface()\n {\n throw new NO_IMPLEMENT(reason);\n }", "public interface A {\n default void oi(){\n System.out.println(\"Dentro do oi de A\");\n }\n}", "default void defaultMethod() {\n System.out.println(\"from InterfaceA, default method...\");\n }", "interface Interface1 {\n\n\tdefault void add() {\n\t\tSystem.out.println(\"Interface1 add method\");\n\t}\n\n\tdefault void display() {\n\t\tSystem.out.println(\"Interface1 display\");\n\t}\n\n\t//static methods can be invoked only using InterfaceName.methodName\n\tstatic void print() {\n\t\tSystem.out.println(\"Interface1 print\");\n\t}\n\n\tstatic void printV2() {\n\t\tSystem.out.println(\"Interface1 printV2\");\n\t}\n}", "default void display1(){\n\t\tSystem.out.println(\"Default Method inside interface\");\n\t}", "interface TestInterface1\n{\n // default method\n default void show()\n {\n System.out.println(\"Default TestInterface1\");\n }\n \n public static void show2()\n {\n System.out.println(\"Default TestInterface2\");\n }\n}", "public interface IMy extends IA, IB{\n int a = 10;\n int []b = {1,2,3,4,5,6,7};\n\n void m();\n static void sm(){\n System.out.println(\"hi from static method\");\n }\n default void dm(){\n System.out.println(\"hi from default method\");\n }\n}", "public interface InterfaceA {\n\n default String message() {\n return \"Message from Interface A\";\n }\n\n}", "public interface i {\n int a();\n\n boolean b();\n\n void c();\n}", "public interface IUserService {\n\n static void test(){\n System.out.println(123);\n }\n\n default void teset1(String name){\n System.out.println(name);\n }\n\n int a = 0;\n\n}", "interface Sample {\n\tvoid method(String a);\n\t// New in Java 1.8 - default interface methods\n\tdefault void method_default() {\n\t System.out.println(\"Hello from default method!\");\n\t}\n }", "Interface getInterface();", "Interface getInterface();", "public interface MyInterface2 {\n default void hello(){\n System.out.println(\"hello again\");\n }\n}", "@Override\n public void defaultMethod() {\n I4.super.defaultMethod();\n }", "public interface HasFins{\n // default Methods: Pueden ser implementados en una interface\n // y siguen las mismas reglas sobre overriding\n public default int getNumberOfFins(){\n return 4;\n }\n\n public default double getLongestFinLength(){\n return 20.0;\n }\n\n public default boolean doFinsHaveScales(){\n return true;\n }\n\n //public default boolean doThat(); // Tiene que ser implementado si tiene el modificador default\n\n}", "public interface J {\n\n void f();\n\n default void g() {\n System.out.println(\"This is the default method of J\");\n }\n\n public static void h() {\n System.out.println(\"This is the static method of J\");\n }\n}", "public interface AbstractC3386kV0 {\n boolean b();\n\n void d();\n\n void dismiss();\n\n ListView f();\n}", "public interface C22486a {\n void bGQ();\n\n void cMy();\n }", "default void printMyName(){ // interfaces can have only 1 method type with body and have default prefix as a keyword\n System.out.println(\"My name is bla bla\");\n }", "interface InterfaceForDisplaying {\n default void displayDefault() {\n System.out.println(\"I'm a default method defined in an interface\");\n }\n\n static void displayStatic() {\n System.out.println(\"I'm a static method defined in an interface\");\n }\n\n void displayAbstract();\n}", "interface I {}", "public interface FlyingAnimal extends Animal {\n @Override\n default String identifyMyself(){\n return \"I am an animal and I can fly\";\n }\n}", "public interface MyInterface {\n\n String returnString(String string);\n\n default int returnInt() {\n return 105;\n }\n}", "public interface ITestInterface {\n\t\tdefault public void sayHello() {\n\t\t\tSystem.out.println(\"Hi World!\");\n\t\t}\n\t}", "interface C34503a {\n void bMl();\n }", "public interface IOverride extends IMeasurement_descriptor{\n\n\tpublic IRI iri();\n\n}", "public Object _get_interface_def()\n {\n // First try to call the delegate implementation class's\n // \"Object get_interface_def(..)\" method (will work for JDK1.2\n // ORBs).\n // Else call the delegate implementation class's\n // \"InterfaceDef get_interface(..)\" method using reflection\n // (will work for pre-JDK1.2 ORBs).\n\n throw new NO_IMPLEMENT(reason);\n }", "interface Interface1 {\n\tpublic void getA();\n\n\tpublic void printA();\n}", "public abstract Object getInterface(String strInterfaceName_p, Object oObject_p) throws Exception;", "private static interface Base {\n\n public void foo();\n }", "interface I4 {\n public default void m1() { // <- Modifier 'public' is redundant for interface methods\n System.out.println(\"I4.m1()\");\n } // public is redundant\n\n /**\n * it is public, but NOT abstract (error: Illegal combination of modifiers: 'abstract' and 'default')\n */\n default void m2() {\n System.out.println(\"I4.m2()\");\n }\n}", "public interface ICamera {\r\n void takePhoto(); // abstract method\r\n void changeAperture();\r\n\r\n default void takeHdrPhoto() {\r\n System.out.println(\"take 3 photos with different exposures and combine them together\");\r\n }\r\n\r\n default void shootVideo() {\r\n System.out.println(\"shooting a video\");\r\n }\r\n}", "public interface AbstractC14990nD {\n void ACi(View view);\n\n void ACk(View view);\n\n void ACo(View view);\n}", "interface in12 \n{ \n\tfinal int a = 10; \n\tdefault void display() \n\t{ \n\t\tSystem.out.println(\"hello\"); \n\t} \n\tdefault void display1() \n\t{\t\n\t\tSystem.out.println(\"hello displa1\"); \n\t}\n}", "public interface AbstractC03680oI {\n}", "interface Interface3 {\n\tpublic void getC();\n\n\tpublic void printC();\n}", "public interface C11922a {\n void bvR();\n }", "public abstract Object mo1771a();", "interface A {\n default void m() {\n System.out.println(\"I am default method\");\n }\n}", "public interface def2 {\n default void go(){\n System.out.println(\"def2\");\n }\n}", "public interface Walk {\n\n public default void status() {\n System.out.println(\"Walking\");\n }\n}", "default void helloDefault() {\n\t\tSystem.out.println(\"Hello from default method definitions from Java8 within interfaces\");\n\t}", "public interface a {\n void a();\n }", "public interface a {\n void a();\n }", "public interface i {\n}", "public interface AbstractC7617o0oOO {\n void OooO00o(View view);\n\n void OooO0O0(View view);\n\n void OooO0OO(View view);\n}", "Interface_decl getInterface();", "public interface C11859a {\n void bvs();\n }", "public interface C1061nc extends IInterface {\n /* renamed from: a */\n String mo2800a();\n\n /* renamed from: a */\n String mo2801a(String str);\n\n /* renamed from: a */\n void mo2802a(String str, boolean z);\n\n /* renamed from: a */\n boolean mo2803a(boolean z);\n}", "public interface AbstractC0211Dj0 {\n void a(int i);\n}", "public interface a extends com.bankeen.d.b.b.a {\n void a();\n\n void b();\n }", "public interface AbstractC1953c50 {\n}", "public interface AbstractC1645a {\n /* renamed from: a */\n String mo17375a();\n }", "public void interfaceMethod() {\n\t\tSystem.out.println(\"overriden method from interface\");\t\t\r\n\t}", "public interface AbstractC7729o0ooOoo {\n void OooO00o();\n}", "interface InterfaceChild extends InterfaceParent {\n default String introduce() {\n return \"InterfaceChild\";\n }\n}", "public interface AbstractC2502fH1 extends IInterface {\n}", "interface TakesScreenshot{\n\tString $FILE_EXTENSION=\".png\"; //COMPILER ADDs 'public static final' automatically \t\n\tvoid takesScreenshot();\n\t//added from jdk 1.8\nstatic void takeSelfie() {\n\t\tSystem.out.println(\"I am defined static method of TakesScreenshot interface\");\n\t}\ndefault void takePictures() {\n\t\tSystem.out.println(\"I am default defined method of TakesScreenshot interface\");\n\t}\n}", "interface NewInterface extends Interface1,Interface2,Interface3{\n\n\tpublic void getD();\n\n}", "public interface AbstractC0386gl {\n}", "interface A {\n void a();\n}", "public interface InterfaceA {\n\n\tpublic void methodFromInterfaceA();\n\n\t// Before Java 8, the interface only contains method signatures. \n\t// With Java 8 new feature Default Methods or Defender Methods, \n\t// you can include method body within the interface.\n\tdefault void defaultMethod() {\n System.out.println(\"from InterfaceA, default method...\");\n }\n\t\n\tstatic void someStaticMethod() {\n System.out.println(\"from InterfaceA static method...\");\n }\n\t\n\t/*\n\t * Why do we need to implement a method within the interface?\n\t * \n * Let's say you have an interface which has multiple methods, \n * and multiple classes are implementing this interface. One \n * of the method implementations can be common across the classes, \n * we can make that method as a default method, so that the \n * implementation is common for all classes.\n *\n * How to work with existing interfaces?\n * \n\t * Second scenario where you have already existing application, \n\t * for a new requirement we have to add a method to the existing \n\t * interface. If we add new method then we need to implement it \n\t * through out the implementation classes. By using the Java 8 \n\t * default method we can add a default implementation of that \n\t * method which resolves the problem.\n\t */\n}", "public interface b {\n int a();\n }", "@Override\n public boolean isInterface() { return false; }", "public interface SimpleInterface {\n String interfaceMethod(Integer value);\n}", "public String getInterfaceName();", "interface InterfaceDemo {\n int age =0; //接口中变量都是公开静态常量\n String name =null;\n abstract void aa();\n\n public abstract void display(); //接口中方法都是抽象的\n}", "public interface cr {\n long a();\n\n int b();\n}", "public interface AbstractC6461g {\n /* renamed from: a */\n String mo42332a();\n}", "public interface Defaultable {\n default void notRequired(){\n System.out.println(\"default method\");\n }\n static void staticMethod(){\n System.out.println(\"static method\");\n }\n static Defaultable create(Supplier<Defaultable> supplier){\n return supplier.get();\n }\n}", "interface A {\n\t\tvoid displayA();\n\t}", "public interface AbstractC0273Ek {\n void e();\n}", "interface InterfaceA {\n\tint a = 5;\n\tvoid show();\n\tint display();\n}", "public abstract Object mo26777y();", "public interface C3803p {\n void mo4312a(C3922o c3922o);\n}", "public interface Ops extends OpsOperations, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity \n{\n}", "public interface AbstractC2726a {\n /* renamed from: a */\n void mo36480a(int i, int i2, ImageView imageView, Uri uri);\n\n /* renamed from: a */\n void mo36481a(int i, ImageView imageView, Uri uri);\n\n /* renamed from: a */\n void mo36482a(ImageView imageView, Uri uri);\n\n /* renamed from: b */\n void mo36483b(int i, ImageView imageView, Uri uri);\n}", "public interface SRSTet extends Tetromino {\r\n @Override\r\n default String getName() {\r\n return \"SRS \" + getType();\r\n }\r\n}", "@OOPMultipleInterface\npublic interface I7D {\n @OOPMultipleMethod\n default String f(Object p1, Object p2, Object p3) throws OOPMultipleException {return \"\";}\n @OOPMultipleMethod\n default String f(Integer p1, Object p2, E p3) throws OOPMultipleException {return \"\";}\n}", "public interface AbstractC2883ha {\n boolean a();\n}", "public interface C3222n extends IInterface {\n /* renamed from: a */\n void mo13025a() throws RemoteException;\n\n /* renamed from: b */\n void mo13026b() throws RemoteException;\n}", "public interface C0069a {\n void a();\n }", "public interface AnInterface {\n void f();\n\n void g();\n\n void h();\n}", "public interface DefaultStat extends SwitchOptionStatSequence\n{\n}", "public interface Phone {\n\t\n\tpublic abstract void interfaceInfo();\n\t\t//System.out.println(\"interface is a class - can't be implemented/declared only\");\n\t\n\tpublic abstract void call();\n\tpublic abstract void message();\n\tpublic abstract void camera();\n\t//we can implement these abstract methods by writing in a concrete class- or Iphone1 (see the codes in Iphone1 class)\n\t\n\tpublic default void battery() {\n\t\tSystem.out.println(\"battery is a default method from Java 1.8\");\n\t}\n\tpublic static void wireless() {\n\t\tSystem.out.println(\"wireless is a static method from Java 1.8\");\n\t}\n\t\n\t\n\t\n\t//We can only apply extends keyword but NOT implements for inheritance in interface. \n\t//Interface can inherit multiple interfaces using extends keyword.\n\t\n\t\n\t\n\n}", "public interface C21597a {\n }", "public interface C22379d {\n}", "public interface i {\n void D(String str);\n\n void H();\n\n void L(String str);\n\n void b0(Response response);\n\n void c(List<DomainExpired> list);\n\n void h(Map<String, List<ExtendedMail>> map);\n\n void p(ApiError apiError);\n}", "public interface d {\n void a();\n}", "org.omg.CORBA.Object _get_interface_def();", "interface U {\n public void A() ;\n public void B() ;\n public void C() ;\n}", "public interface AInterface {\n\n public void say();\n\n}", "public interface C13719g {\n}", "public interface am extends ak {\r\n /* renamed from: a */\r\n void mo194a(int i) throws RemoteException;\r\n\r\n /* renamed from: a */\r\n void mo195a(List<LatLng> list) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo196b(float f) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo197b(boolean z);\r\n\r\n /* renamed from: c */\r\n void mo198c(boolean z) throws RemoteException;\r\n\r\n /* renamed from: g */\r\n float mo199g() throws RemoteException;\r\n\r\n /* renamed from: h */\r\n int mo200h() throws RemoteException;\r\n\r\n /* renamed from: i */\r\n List<LatLng> mo201i() throws RemoteException;\r\n\r\n /* renamed from: j */\r\n boolean mo202j();\r\n\r\n /* renamed from: k */\r\n boolean mo203k();\r\n}", "public interface CurrentMaintenanceOperationIterator_I extends CurrentMaintenanceOperationIterator_IOperations, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity \n{\n}", "interface Interface2 {\n\tpublic void getB();\n\n\tpublic void printB();\n}", "public interface zzo\n extends IInterface\n{\n\n public abstract void zze(AdRequestParcel adrequestparcel);\n}", "public static interface _cls9\n{\n\n public abstract void userCancelledSignIn();\n\n public abstract void userSuccessfullySignedIn();\n}" ]
[ "0.70118076", "0.7004439", "0.69679654", "0.6957273", "0.68909544", "0.6856834", "0.6848284", "0.6739417", "0.66758984", "0.66695267", "0.6636924", "0.66031617", "0.6576519", "0.656194", "0.656194", "0.6557238", "0.6541587", "0.6523369", "0.6511529", "0.65019614", "0.6493288", "0.6484969", "0.6484873", "0.64745367", "0.6468414", "0.6458046", "0.6434707", "0.64265525", "0.6396794", "0.63917416", "0.6389683", "0.63834566", "0.6367154", "0.63609105", "0.635771", "0.63528067", "0.63468117", "0.63293403", "0.6303301", "0.63022715", "0.6301526", "0.62717634", "0.62695026", "0.62691283", "0.6263161", "0.625828", "0.625828", "0.62473595", "0.6235792", "0.62197304", "0.62115955", "0.6206686", "0.62037617", "0.62002057", "0.6198911", "0.6198133", "0.61960506", "0.61726975", "0.6167934", "0.61605334", "0.6153439", "0.6149781", "0.6135628", "0.61329997", "0.6129761", "0.6122687", "0.61185104", "0.610847", "0.6102665", "0.60767895", "0.6076545", "0.6074249", "0.60685724", "0.60670775", "0.6061705", "0.6059892", "0.605758", "0.60507977", "0.60417926", "0.6039939", "0.6039627", "0.60352874", "0.603105", "0.603101", "0.6029602", "0.6028703", "0.6026024", "0.6024406", "0.60217845", "0.6021781", "0.6016359", "0.6013372", "0.60054225", "0.6004798", "0.6001264", "0.60005516", "0.5997985", "0.5994705", "0.5988338", "0.5985541", "0.5984693" ]
0.0
-1
accessed from formula instance
@Test public void test3() { Formula formula = new FormulaImpl(); double result = formula.calculate(100); System.out.println(result); // accessed from formula instance including anonymous objects. result = new Formula() { @Override public double calculate(int n) { return n * 2; } }.sqrt(100); System.out.println(result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Formulas() { }", "public String getFormula() {\r\n return formula;\r\n }", "public String getFormula() {\n return formula;\n }", "public String getFormula() {\n return formula;\n }", "public IComplexFormula getFormula(){\r\n\t\treturn formula;\r\n\t}", "@Override\r\n\tpublic String asFormula(){\n\t\treturn null;\r\n\t}", "public void calculate();", "public abstract double calcular();", "public String getFormula() {\n\t\treturn null;\n\t}", "@Override\n public BigDecimal evaluate(TextMap args, String variableName) {\n return null;\n\n// return first.getBonus();\n }", "public void setFormula(String formula) {\r\n this.formula = formula;\r\n }", "protected abstract SoyValue compute();", "protected abstract Object doCalculations();", "public abstract void calculate();", "public void setFormula(String text) {\n\t\t\n\t}", "public abstract void recalc();", "public Formula() {\t\n\t\t// TODO: implement this.\n\t\t// throw new RuntimeException(\"not yet implemented.\");\n\t\tclauses=new EmptyImList<Clause>();\n\t}", "@Override\n\tpublic void getResultat() {\n\t\tcalcul();\n\t}", "@Override\r\n\tpublic String asFormula(double step){\n\t\treturn null;\r\n\t}", "public TypeFormula getFirstFormula ( ) ;", "public void setFormula(IComplexFormula f){\r\n\t\tformula = f;\r\n\t}", "public String getContents()\r\n/* 156: */ {\r\n/* 157:282 */ return this.formulaString;\r\n/* 158: */ }", "@Override\n\tpublic double evaluate() {\n\t\t// TODO Auto-generated method stub\n\t\treturn 0;\n\t}", "@Override\n\tpublic void calcularArea() {\n\t\t\n\t}", "public interface Value extends Formula {\n\n /**\n * Accepts a value visitor and gets the corresponding value/output to be used.\n *\n * @param visitor type of ValueVisitor (SumVisitor/ProductVisitor/etc)\n * @return evaluated output that will be used in other objects (namely in Product/Sum/etc.)\n */\n <R> R accept(ValueVisitor<R> visitor);\n\n}", "public dFormula asFormula() {\n\t\treturn new ElementaryFormula(0, phonstringCondition);\n\t}", "public boolean isFormulaUsed() {\n return getBooleanProperty(\"IsFormulaUsed\");\n }", "public String getFormula() {\n return chemicalFormula;\n }", "public void addFormulas() {\n countFormulas++;\n }", "@Override\r\n\tprotected void compute() {\n\t\t\r\n\t}", "void evaluate()\n\t{\n\t\toperation.evaluate();\n\t}", "double getActiveOperand();", "public abstract double calcSA();", "private Formula (Clause c, ImList<Clause> r) {\n\t\t//System.out.println(\"Test1\"+r.toString());\n\t\t//System.out.println(\"Test1\"+c);\n\t\tclauses=r.add(c);\n\t\t//System.out.println(\"Test2\"+clauses.toString());\n\t\tcheckRep();\n\t}", "Calcul createCalcul();", "public void mpgCalculations() {\n\n }", "public abstract double calculateTax();", "interface Formula {\n\t double calculate(int a);\n\t \n\t default double sqrt(int a) {\n\t return Math.sqrt(a);\n\t }\n\t}", "@Override\r\n\tpublic void compute() {\n\t\t\r\n\t}", "@Override\n public Float calc() {\n\treturn null;\n }", "@Override\r\n\tpublic double calculate() {\n\r\n\t\treturn n1 + n2;\r\n\t}", "public void evaluate() {\r\n Statistics.evaluate(this);\r\n }", "public abstract Object eval();", "@Override\n public void visit(CalcExpr node) {\n }", "public mathMethods() {\n initComponents();\n }", "protected abstract Value evaluate();", "private void runFormulas() {\r\n // updates all of the formula cells in the excel file to display the\r\n // changes that were made to the parameter values\r\n FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator();\r\n for (Row r : currentWorksheet) {\r\n for (Cell c : r) {\r\n if (c.getCellType() == Cell.CELL_TYPE_FORMULA) {\r\n try {\r\n evaluator.evaluateFormulaCell(c);\r\n } catch (Throwable t) {\r\n t.printStackTrace();\r\n }\r\n \r\n }\r\n }\r\n }\r\n }", "public void calcOutput()\n\t{\n\t}", "public void calculateBonuses(){\n\n\n }", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "void valueChanged(CalcModel model);", "void valueChanged(CalcModel model);", "public String mo81e() {\n throw new RuntimeException(\"3D references need a workbook to determine formula text\");\n }", "void calculateRange() {\n //TODO: See Rules\n }", "private void equate()\n\t{\n\t\t\tif(Fun == Function.ADD)\n\t\t\t{\t\t\t\n\t\t\t\tresult = calc.sum ( );\n\t\t\t\tupdateText();\n\t\t\t\tsetLeftValue();\n\t\t\t\tFun = null;\n\t\t\t}//end ADD condition\n\t\t\t\n\t\t\telse if(Fun == Function.SUBTRACT)\n\t\t\t{\n\t\t\t\tresult = calc.subtract ();\n\t\t\t\tupdateText();\n\t\t\t\tsetLeftValue();\n\t\t\t\tFun = null;\n\t\t\t}//end SUBTRACT condition\n\t\t\t\n\t\t\telse if (Fun == Function.MULTIPLY)\n\t\t\t{\n\t\t\t\tresult = calc.multiply ();\n\t\t\t\tupdateText();\n\t\t\t\tsetLeftValue();\n\t\t\t\tFun = null;\n\t\t\t}//end MULTIPLY condition\n\t\t\t\n\t\t\telse if (Fun == Function.DIVIDE)\n\t\t\t{\n\t\t\t\tresult = calc.divide ();\n\t\t\t\tupdateText();\n\t\t\t\tsetLeftValue();\n\t\t\t\tFun = null;\n\t\t\t}\n\t\t\t\t\n\t}", "double getAxon();", "public void cal_AdjustedFuelMoist(){\r\n\tADFM=0.9*FFM+0.5+9.5*Math.exp(-BUO/50);\r\n}", "private void xSquared()\n\t{\n\t\tif(Fun == null)\n\t\t{\n\t\t\tsetLeftValue();\n\t\t\tresult = calc.squared ();\n\t\t\tupdateText();\n\t\t\tsetLeftValue();\n\t\t}\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public Formula formulaWithInc() {\n\t\treturn formula();\n\t}", "@Override\r\n\t\tvoid calculate() {\r\n\t\t\tnum3=num1+num2;\r\n\t\t\t\r\n\t\t}", "public interface Value extends Formula {\n /**\n * Returns the raw Value.\n */\n public Object getRawValue();\n\n /**\n * Returns true if this value is a double.\n */\n public boolean isDouble();\n\n /**\n * Returns true if this value is a string.\n */\n public boolean isString();\n\n /**\n * Returns true if this value is a boolean.\n */\n public boolean isBoolean();\n\n}", "public abstract double getReference();", "public abstract double getReference();", "protected abstract BigDecimal calculate();", "private void fnMeanSale() {\n }", "@Override\r\n\tpublic void calcArea() {\n\t\t\r\n\t}", "public Calculate() {\n initComponents();\n setIcon();\n }", "@Override\r\n public void calculate() {\r\n // do the calculations\r\n this.categories = new String[]{\"one\", \"two\"};\r\n this.data = new double[]{75, 50};\r\n }", "protected IExpressionValue expression() throws TableFunctionMalformedException,\r\n\t\t\t\t\t\t\t\t\t\t\t\t InvalidProbabilityRangeException,\r\n\t\t\t\t\t\t\t\t\t\t\t\t SomeStateUndeclaredException{\r\n\t\t\r\n\t\t// temp table already created by upper caller\r\n\t\t\r\n\t\tIExpressionValue temp1 = term();\r\n\t\tIExpressionValue temp2 = null;\r\n\t\t\r\n\t\tFloat temp1Value = null;\r\n\t\tFloat temp2Value = null;\r\n\t\t// LOOK FOR +/- (OPTIONAL)\r\n\t\tswitch (look) {\r\n\t\tcase '+':\r\n\t\t\tmatch('+');\r\n\t\t\ttemp2 = term();\r\n\t\t\ttry {\r\n\t\t\t\ttemp1Value = Float.parseFloat(temp1.getValue());\r\n\t\t\t} catch (NumberFormatException e) {\r\n\t\t\t\ttemp1Value = Float.NaN;\r\n\t\t\t}\r\n\t\t\ttry {\r\n\t\t\t\ttemp2Value = Float.parseFloat(temp2.getValue());\r\n\t\t\t} catch (NumberFormatException e) {\r\n\t\t\t\ttemp2Value = Float.NaN;\r\n\t\t\t}\r\n\t\t\tif (!Float.isNaN(temp1Value) && !Float.isNaN(temp2Value)) {\r\n\t\t\t\t// TODO cut the subtree if it is a known value...\r\n\t\t\t\ttemp1 = new AddOperationProbabilityValue(\r\n\t\t\t\t\t\ttemp1.isFixedValue()?(new SimpleProbabilityValue(temp1Value)):temp1 ,\r\n\t\t\t\t\t\t\t\ttemp2.isFixedValue()?(new SimpleProbabilityValue(temp2Value)):temp2);\r\n\t\t\t}\t\t\r\n\t\t\tbreak;\r\n\t\tcase '-':\r\n\t\t\tmatch('-');\r\n\t\t\ttemp2 = term();\r\n\t\t\ttry {\r\n\t\t\t\ttemp1Value = Float.parseFloat(temp1.getValue());\r\n\t\t\t} catch (NumberFormatException e) {\r\n\t\t\t\ttemp1Value = Float.NaN;\r\n\t\t\t}\r\n\t\t\ttry {\r\n\t\t\t\ttemp2Value = Float.parseFloat(temp2.getValue());\r\n\t\t\t} catch (NumberFormatException e) {\r\n\t\t\t\ttemp2Value = Float.NaN;\r\n\t\t\t}\r\n\t\t\tif (!Float.isNaN(temp1Value) && !Float.isNaN(temp2Value)){\r\n\t\t\t\t// TODO cut the subtree if it is known value...\r\n\t\t\t\ttemp1 = new SubtractOperationProbabilityValue(\r\n\t\t\t\t\t\ttemp1.isFixedValue()?(new SimpleProbabilityValue(temp1Value)):temp1 ,\r\n\t\t\t\t\t\t\t\ttemp2.isFixedValue()?(new SimpleProbabilityValue(temp2Value)):temp2);\r\n\t\t\t}\t\t\t\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\t// Debug.println(\"Expression returned \" + temp1.getProbability());\r\n\t\treturn temp1;\r\n\t}", "private void stage1_2() {\n\n\t\tString s = \"E $:( 3E0 , 3E0 ) ( $:( 3E0 , 3E0 ) \";\n\n//\t s = SymbolicString.makeConcolicString(s);\n\t\tStringReader sr = new StringReader(s);\n\t\tSystem.out.println(s);\n\t\tFormula formula = new Formula(s);\n\t\tMap<String, Decimal> actual = formula.getVariableValues();\n\t}", "public void logic(){\r\n\r\n\t}", "public void financialCrisis() {}", "int calculate() {\n return getSum() + b1;\n }", "@Override\r\n\tpublic double calculate() {\n\t\treturn n1 * n2;\r\n\t}", "org.openxmlformats.schemas.drawingml.x2006.main.STGeomGuideFormula xgetFmla();", "public FitRealFunction() {\t\t\r\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "double eval();", "public abstract void mo91573a(StarCashierViewModel eVar);", "private static void equationsTest() {\n }", "protected void saveIndirectTotalValues(){\n\n }", "public double x() { return _x; }", "public ArrayList < TypeFormula > getAllFormulas ( ) ;", "@Override\r\n\tprotected void processCost() {\n\r\n\t}", "@Override\r\n\tpublic double calculate() {\n\t\treturn n1 / n2;\r\n\t}", "public FormulaManager getFormulaManager()\n\t{\n\t\treturn fm;\n\t}", "private void reciprocal()\n\t{\n\t\tif(Fun == null)\n\t\t{\n\t\t\tsetLeftValue();\n\t\t\tresult = calc.reciprocal ( );\n\t\t\tupdateText();\n\t\t\tsetLeftValue();\n\t\t}\n\t}", "public interface ICalcView {\n\n // 문자를 입력 받는다\n void append(String factor);\n\n // 결과를 출력한다\n String showresult(String result);\n // 식을 분리하는 메서드\n\n // 입력된 값을 넘겨주는 메서드\n String transferSentece();\n\n}", "Exp\ngetExp1();", "@Override\n\tpublic void addArg(FormulaElement arg){\n\t}", "public void compute() {}", "public double calculate() {\n\t\treturn area*1800;\r\n\t}", "public ElementList getDefiningFormula() {\r\n return definingFormula;\r\n }", "Hojas eval();", "@Override\n\tpublic void calc() {\n\t\tcalculated = true;\n\t\tanswer=operand1-operand2;\n\t}", "protected String getIntermediateFormula() {\n if ( isGlobal() ) {\n return globalConstraint;\n } else if ( isRoleBased() ) {\n return roleMapToFormula();\n } else {\n // rls is disabled\n return EMPTY_STRING;\n }\n }", "public abstract double evaluer(SolutionPartielle s);", "public void limpiarDuplicarFormulaProceso() {\n duplicarFormulaProceso = new FormulasProcesos();\n duplicarFormulaProceso.setProceso(new Procesos());\n }" ]
[ "0.7043834", "0.6629843", "0.6512177", "0.6512177", "0.6418681", "0.6335893", "0.621891", "0.61501306", "0.6131787", "0.6106797", "0.61002195", "0.6070349", "0.60511404", "0.60501903", "0.6038371", "0.6018929", "0.5977893", "0.5965907", "0.59495246", "0.5912288", "0.5832945", "0.581985", "0.5756164", "0.5655907", "0.56536645", "0.5638126", "0.56335413", "0.56311405", "0.56174695", "0.5616202", "0.5611421", "0.5611068", "0.56005985", "0.5588745", "0.5569774", "0.5564132", "0.5551762", "0.55419266", "0.55394435", "0.5522894", "0.5511883", "0.5493228", "0.5491582", "0.54760873", "0.5470809", "0.5469508", "0.54671925", "0.5466696", "0.5443888", "0.5433593", "0.5422635", "0.5422635", "0.5422492", "0.5422155", "0.54199475", "0.5413673", "0.5412264", "0.54100543", "0.5386166", "0.5386166", "0.5385084", "0.53797543", "0.5377328", "0.53579175", "0.53579175", "0.53535295", "0.5350716", "0.5345301", "0.5339044", "0.5338262", "0.53371227", "0.53293854", "0.5328609", "0.5327053", "0.5323666", "0.5323442", "0.53190815", "0.5318866", "0.5308867", "0.53050685", "0.52998954", "0.5278324", "0.52756363", "0.5262148", "0.5249451", "0.52438426", "0.5231723", "0.5231259", "0.52305454", "0.5228975", "0.52265525", "0.522408", "0.5222009", "0.5220682", "0.52184594", "0.5212435", "0.5212421", "0.52088374", "0.52079296", "0.52048635" ]
0.5865977
20
Constructor for the WebCrawler
public WebCrawler(MultithreadedInvertedIndex index, int limit) { this.index = index; this.limit = limit; this.queue = new WorkQueue(limit); this.urls = new ArrayList<URL>(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public WebCrawler(final URL startURL) {\n this.baseUrl = startURL.toString();\n this.links = new HashSet<>();\n this.startTime = System.currentTimeMillis();\n depth = 0;\n pagesVisited = 0;\n crawl(initURLS(startURL));\n try {\n goThroughLinks();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public WebCrawler(String urlSeed) {\n\t\t\n\n\t\t\n\t\tconnection = db.openConnection();\n\n\t\t\ttry {\n\t\t\t\tthis.urlSeed = new URL(urlSeed);\n\t\t\t} catch(MalformedURLException ex) {\n\t\t\t\tlog.error(\"please input the right url with protocol part!\");\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t\tworkers = new WorkQueue(10);\n\t\t\tthis.count = 0;\n\t\t\tthis.pending = 0;\n\t\t\turlList = new ArrayList<String>();\n\t\t\t//index = new InvertedIndex();\n\t\t\tlong start = System.currentTimeMillis();\n\t\t\tthis.HTMLFetcher();\n\t\t\tlong end = System.currentTimeMillis();\n\t\t\tlog.info(\"Running time for htmlFetcher: \" + (end - start));\n\t\t\tList<String> suggestedQuery = index.getSuggestedQuery();\n\t\t\tdb.updateSuggestedQuery(connection, suggestedQuery);\n\t\t\tdb.closeConnection(connection);\n\t}", "public DaumWebSearcher() {\n\n }", "public Crawler(String domain) {\n this.domain = domain;\n this.startUrl = \"http://\" + domain;\n init();\n }", "public CrawlerConfiguration() {\n\t\tinitConfiguration();\n\t}", "void startCrawler() throws ParserConfigurationException, SAXException, IOException;", "public Crawler(Config conf) {\n \t\tthis.conf = conf;\n \t}", "public CrawlWorker(String url) {\n\t\t\tthis.url = url;\n\t\t}", "public WebPage(){\n dom = new LinkedList<String>() /* TODO\n//Initialize this to some kind of List */;\n }", "public TLWebPage() {\n super();\n }", "public static void main(String[] args) {\n\t\t\n\t\t/*MultiThreadedCrawler crawler = new MultiThreadedCrawler(\"https://cs.uic.edu\", \"uic.edu\", \"main\");\n\t\tcrawler.start();\n\t\tList<Map> p = new ArrayList<>();\n\t\tp.add(crawler.getResults());\n\t\t\n\t\ttry {\n\t\t\tGlobals.urlSet.add(new URL(\"https://disabilityresources.uic.edu\"));\n\t\t\tGlobals.urlSet.add(new URL(\"http://disabilityresources.uic.edu\"));\n\t\t\tGlobals.urlSet.add(new URL(\"http://cmhsrp.uic.edu/nrtc\")); \n\n\t\t} catch (MalformedURLException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\t\n\t\t\n\t\tMultiThreadedCrawler c1 = new MultiThreadedCrawler(\"\", \"uic.edu\", \"c1\");\n\t\tMultiThreadedCrawler c2 = new MultiThreadedCrawler(\"\", \"uic.edu\", \"c2\");\n\t\tMultiThreadedCrawler c3 = new MultiThreadedCrawler(\"\", \"uic.edu\", \"c3\");\n\t\tMultiThreadedCrawler c4 = new MultiThreadedCrawler(\"\", \"uic.edu\", \"c4\");\n\t\tMultiThreadedCrawler c5 = new MultiThreadedCrawler(\"\", \"uic.edu\", \"c5\");\n\t\tMultiThreadedCrawler c6 = new MultiThreadedCrawler(\"\", \"uic.edu\", \"c6\");\n\t\t//MultiThreadedCrawler c7 = new MultiThreadedCrawler(\"https://housing.uic.edu\", \"uic.edu\", \"housing\");\n\t\t//MultiThreadedCrawler c8 = new MultiThreadedCrawler(\"https://grad.uic.edu\", \"uic.edu\", \"grad\");\n\t\t//MultiThreadedCrawler c9 = new MultiThreadedCrawler(\"https://today.uic.edu\", \"uic.edu\", \"today\");\n\t\t\n\t\t\n\t\t\n\t\tList<Thread> crawlers = new ArrayList<>();\n\t\tcrawlers.add(new Thread(c1, \"c1\"));\n\t\tcrawlers.add(new Thread(c2, \"c2\"));\n\t\tcrawlers.add(new Thread(c3, \"c3\"));\n\t\tcrawlers.add(new Thread(c4, \"c4\"));\n\t\tcrawlers.add(new Thread(c5, \"c5\"));\n\t\tcrawlers.add(new Thread(c6, \"c6\"));\n\t\tcrawlers.add(new Thread(c7, \"housing\"));\n\t\tcrawlers.add(new Thread(c8, \"grad\"));\n\t\tcrawlers.add(new Thread(c9, \"today\"));\n\t\t\n\t\t\n\t\tfor(Thread t: crawlers) {\n\t\t\tt.start();\n\t\t}\n\t\t\n\t\tfor(Thread t: crawlers) {\n\t\t\ttry {\n\t\t\t\tt.join();\n\t\t\t}catch(InterruptedException e) {\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tp.add(c1.getResults());\n\t\tp.add(c2.getResults());\n\t\tp.add(c3.getResults());\n\t\tp.add(c4.getResults());\n\t\tp.add(c5.getResults());\n\t\tp.add(c6.getResults());\n\t\t//p.add(c7.getResults());\n\t\t//p.add(c8.getResults());\n\t\t//p.add(c9.getResults());\n\t\t\n\t\t\n\t\twhile(true) {\n\t\t\tfor(Map m: p) {\n\t\t\t\tif(m == null)\n\t\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tSystem.out.println(\"All done\");\n\t\tmergeResults(p);\n\t\tUtil.updateDocVectLenMap();\n\t\tSystem.out.println(\"Total in collection: \" + Globals.pageDataMap.size());\n\t\tUtil.writeInvertedIndexTfMapAndMaxFreqMapToFile();*/\n\t\t\n\t\t\n\t\tUtil.loadDataFromFile();\n\t\tUtil.updateDocVectLenMap();\n\t\tSpringApplication.run(SearchApplication.class, args);\n\t}", "public static void main(String[] args) throws Exception {\n\t\tString crawlStorageFolder = \"/data/crawl\";\r\n\t\tint numberOfCrawlers = 1;\r\n\t\t\r\n\t\tCrawlConfig config = new CrawlConfig();\r\n\t\tconfig.setCrawlStorageFolder(crawlStorageFolder);\r\n\t\tconfig.setMaxPagesToFetch(5000);\r\n\t\tconfig.setMaxDepthOfCrawling(5);\r\n\t\tconfig.setPolitenessDelay(500);\r\n\t\t\r\n\t\tconfig.setIncludeBinaryContentInCrawling(true);\r\n\t\t//config.setUserAgentString(userAgentString);\r\n\t\t\r\n\t\tPageFetcher pageFetcher = new PageFetcher(config);\r\n\t\tRobotstxtConfig robotstxtConfig = new RobotstxtConfig();\r\n\t\tRobotstxtServer robotstxtServer = new RobotstxtServer(robotstxtConfig,pageFetcher );\r\n\t\tCrawlController controller = new CrawlController(config,pageFetcher,robotstxtServer);\r\n\t\t\r\n\t\tcontroller.addSeed(\"http://www.marshall.usc.edu/\");\r\n\t\tcontroller.start(MyCrawler.class, numberOfCrawlers);\r\n\t\tSystem.out.println(\"All urls processed:\"+MyCrawler.URL_Count);\r\n\t\tSystem.out.println(\"All unique urls processed:\"+MyCrawler.hs.size());\r\n\t\tSystem.out.println(\"unique School urls processed:\"+MyCrawler.hs_uniqueSchool.size());\r\n\t\tSystem.out.println(\"unique USC urls processed:\"+MyCrawler.hs_uniqueUSC.size());\r\n\t\tSystem.out.println(\"other unique urls processed:\"+MyCrawler.hs_unique.size());\r\n\t\tSet set = MyCrawler.HM_Status.entrySet();\r\n\t Iterator i = set.iterator();\r\n\t while(i.hasNext()) {\r\n\t Map.Entry me = (Map.Entry)i.next();\r\n\t System.out.print(me.getKey() + \": \");\r\n\t System.out.println(me.getValue());\r\n\t }\r\n\t set=MyCrawler.HM_CT.entrySet();\r\n\t i = set.iterator();\r\n\t while(i.hasNext()) {\r\n\t Map.Entry me = (Map.Entry)i.next();\r\n\t System.out.print(me.getKey() + \": \");\r\n\t System.out.println(me.getValue());\r\n\t }\r\n\t System.out.println(\"F1:\"+MyCrawler.F1);\r\n\t System.out.println(\"F2:\"+MyCrawler.F2);\r\n\t System.out.println(\"F3:\"+MyCrawler.F3);\r\n\t System.out.println(\"F4:\"+MyCrawler.F4);\r\n\t \r\n\t System.out.println(\"Size < 1kb:\"+MyCrawler.size1);\r\n\t System.out.println(\"Size 1kb~10kb:\"+MyCrawler.size2);\r\n\t System.out.println(\"Size 10kb~100kb:\"+MyCrawler.size3);\r\n\t System.out.println(\"Size 100kb~1mb:\"+MyCrawler.size4);\r\n\t System.out.println(\"Size > 1mb:\"+MyCrawler.size5);\r\n\t \r\n\t}", "WebCrawler setUserAgent(String userAgent);", "WebCrawler addExtractor(Extractor extractor);", "public static void main(String[] args) {\n\t\t\r\n\t\tWebCrawler crawlerObj = new WebCrawler(\"https://www.flipkart.com/\",\"flipkart.com\",2);\r\n\t\t//WebCrawler crawlerObj = new WebCrawler(\"http://localhost:80/webCrawl/Web//\",\"localhost:80/webCrawl/Web\",3);\r\n\t\t\r\n\t\tSystem.out.println(\"Crawling Started..\");\r\n\t\tcrawlerObj.crawl();\r\n\t\tSystem.out.println(\"Reading from Database..\");\r\n\t\tcrawlerObj.printLinks();\r\n\t\t\r\n\t}", "public HttpTrafficGenerator() {\n\n\t\tworker = new Thread(this, \"HttpTrafficGenerator\");\n\t\ttry {\n\t\t\twebsite = new URL(\"http://google.com\");\n\t\t} catch (MalformedURLException e) {\n\t\t\tthrow new IllegalStateException(\"Internal error\", e);\n\t\t}\n\t}", "Collection<PageLink> crawl(CrawlerArgs args);", "public TestWebClient() {\n\t\tresources = new LinkedList<Resource>();\n\t}", "private WebRequest() {\n initFields();\n }", "public AbstractHtmlParser(final String url) {\n super(url);\n }", "public CasterSite() {\n\t}", "public void crawl() {\n\t\tOOSpider.create(Site.me().setSleepTime(3000).setRetryTimes(3).setDomain(\"movie.douban.com\")//.setHttpProxy(httpProxy)\n .setUserAgent(\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.67 Safari/537.36\"),\n filmInfoDaoPipeline, DoubanFilm.class)\n .addUrl(\"https://movie.douban.com/top250\")//entry url\n .thread(1)\n .run();\n }", "WebCrawlerData retrieve(String url);", "public interface Crawler {\n\t/**\n\t * Gets the location where crawled content is saved.\n\t * \n\t * @return location string of crawled content\n\t */\n\tpublic String getDumpLocation();\n\n\t/**\n\t * Starts the crawling from the root source of target.\n\t * \n\t * @throws IOException\n\t */\n\tpublic void disperse() throws IOException;\n\n\t/**\n\t * Crawls every <code>url</code> within the <code>target</code> url\n\t * \n\t * @param url\n\t * url which is either <code>target</code> or the one nested\n\t * inside\n\t * @param target\n\t * the target url declared to crawl\n\t * @throws IOException\n\t */\n\tpublic void crawl(final String url, final String target) throws IOException;\n\n\t/**\n\t * Picks up data from webpage.\n\t * \n\t * @param doc\n\t * <code>Document</code> retrieved from <code>url</code>\n\t * @param url\n\t * @return list of <code>Nugget</code> objects consisting of relevant data\n\t */\n\tpublic List<Nugget> scavenge(final Document doc, final String url);\n\n}", "private WebXmlIo()\n {\n // Voluntarily empty constructor as utility classes should not have a public or default\n // constructor\n }", "public WebDataSource() {}", "public WebpageFactoryImpl() {\n\t\tsuper();\n\t}", "public ContentfulCrawler(ContentCrawlConfiguration configuration) {\n Preconditions.checkNotNull(configuration, \"Crawler configuration can't be null\");\n Preconditions.checkNotNull(configuration.getElasticSearch(), \"ElasticSearch configuration can't be null\");\n Preconditions.checkNotNull(configuration.getContentful(), \"Contentful configuration can't be null\");\n this.configuration = configuration.getContentful();\n cdaClient = buildCdaClient();\n cmaClient = buildCmaClient();\n esClient = buildEsClient(configuration.getElasticSearch());\n esConfiguration = configuration.getElasticSearch();\n }", "private URLs() {\n }", "public JSoupMain(){\n Log.d(TAG, \"constructor.\");\n }", "public Scraper() {\n\n\t\tsuper();\n\t\tMorphiaManager.setup(MorphiaConstants.HOST, MorphiaConstants.PORT);\n\t\tthis.mDBh= new MongoDBHandler();\n\t}", "public void crawl(String url);", "public SearchResultsPage(WebDriver page) {\n super(page);\n }", "public Page(WebDriver webDriver) {\n this.webDriver = webDriver;\n\t}", "public void crawlSite()\n {\n /** Init the logger */\n WorkLogger.log(\"WebCrawler start at site \" + this.urlStart.getFullUrl() + \" and maxDepth = \" + this.maxDepth);\n WorkLogger.log(\"====== START ======\");\n WorkLogger.log(\"\");\n /** Save the start time of crawling */\n long startTime = System.currentTimeMillis();\n /** Start our workers */\n this.taskHandler.startTask(this.urlStart, maxDepth);\n /** Check workers finished their work; in case then all workers wait, then no ones work, that leads no more tasks -> the program finished */\n while(this.taskHandler.isEnd() == false)\n {\n /** Default timeout for 1 sec cause the socket timeout I set to 1 sec */\n try{Thread.sleep(1000);}catch(Exception e){}\n }\n this.taskHandler.stopTasks();\n /** End the log file and add the time elapsed and total sites visited */\n WorkLogger.log(\"\\r\\n====== END ======\");\n WorkLogger.log(\"Time elapsed: \" + (System.currentTimeMillis() - startTime)/1000.);\n WorkLogger.log(\"Total visited sites: \" + this.pool.getVisitedSize());\n }", "public SearchResults() {\n\t\tPageFactory.initElements(driver, this);\n\t}", "public CrawlerResult crawl(URL url){\n //Creating the crawler result\n CrawlerResult rslt = new CrawlerResult(url);\n logger.info(url +\" started crawling....\");\n try{\n //Get the Document from the URL\n Document doc = Jsoup.connect(url.toString()).get();\n\n rslt.setTitle(doc.title());\n\n //links on the page\n Elements links = doc.select(\"a\");\n\n //Links on the page\n for(Element link : links){\n rslt.addLinksOnPage(new URL(link.attr(\"abs:href\")));\n }\n }catch(Exception e){\n //TODO\n }\n logger.info(url +\" finished crawled.\");\n return rslt;\n }", "public Indexer crawl() \n\t{\n\t\t// This redirection may effect performance, but its OK !!\n\t\tSystem.out.println(\"Crawling: \"+u.toString());\n\t\treturn crawl(crawlLimitDefault);\n\t}", "public DOMParser() { ; }", "public Site() {\n\n\t}", "public Page() {\n PageFactory.initElements(getDriver(), this); //snippet to use for @FindBy\n }", "public PageList() { \n// fileIO = new CharFileIO(\"utf-8\");\n// We are not currently using this to extract 'title' because it doesn't work \n// for whose title and meta-description tags are not explicitly specified;\n// Such as pages written in scripting languages like .jsp, .asp etc \n// parseJob = new ParseJob();\n }", "public interface Crawler {\n int size();\n boolean visited(String link);\n void addNewLinkToSitemap(String link);\n void addToChildSitemap(String parent, String child);\n void addVisited(String s, Integer depth);\n void startCrawling(String requestid, String link, int maxDepth);\n ForkJoinPool getMainPool();\n Map<String, Collection<String>> getSiteMap();\n}", "public static void init() {\n\n\t\tcontentDirectory = new Document();\n\n\t\t//For ass\n\t\t//////////////////////////////////////////////////////////////////////////////////////////\n\t\t//list of links to places (on reddit for example) to scrape from\n\t\tArrayList<String> redditAssLinks = new ArrayList<>();\n\t\tredditAssLinks.add(\"http://www.reddit.com/r/fffffffuuuuuuuuuuuu\"); //add sites here\n\n\t\tredditAssLinks.add(\"http://www.reddit.com/r/memes\");\n\t\tredditAssLinks.add(\"https://www.reddit.com/r/funnymeme/\");\n\t\tredditAssLinks.add(\"https://www.reddit.com/r/adviceanimals\");\n\t\tredditAssLinks.add(\"https://www.reddit.com/r/vertical\");\n\t\tredditAssLinks.add(\"https://www.reddit.com/r/firstworldproblems\");\n\t\tDocument redditAssDoc = new Document();\n\t\tredditAssDoc.append(\"reddit\", redditAssLinks);\n\n\t\t//could also append this when imgur implementation is ready:\n\t\t//contentDirectory.append(\"ass\", imgurAssDoc);\n\t\tcontentDirectory.append(\"ass\", redditAssDoc);\n\t\t//////////////////////////////////////////////////////////////////////////////////////////\n\n\t\t//for workout\n\t\t//////////////////////////////////////////////////////////////////////////////////////////\n\t\tArrayList<String> redditWorkoutLinks = new ArrayList<>();\n\t\tredditWorkoutLinks.add(\"http://www.reddit.com/r/gymfails\");\n\t\tredditWorkoutLinks.add(\"http://www.reddit.com/r/gymmemes\");\n\t\tredditWorkoutLinks.add(\"https://www.reddit.com/r/bodybuilding/\");\n\t\tredditWorkoutLinks.add(\"https://www.reddit.com/r/weightlifting\");\n\t\tDocument redditWorkoutDoc = new Document();\n\t\tredditWorkoutDoc.append(\"reddit\", redditWorkoutLinks);\n\n\t\tcontentDirectory.append(\"workout\", redditWorkoutDoc);\n\t\t//////////////////////////////////////////////////////////////////////////////////////////\n\n\t\t//for minecraft\n\t\t//////////////////////////////////////////////////////////////////////////////////////////\n\t\tArrayList<String> redditMinecraftLinks = new ArrayList<>();\n\t\tredditMinecraftLinks.add(\"http://www.reddit.com/r/Minecraft/\");\n\t\tredditMinecraftLinks.add(\"http://www.reddit.com/r/MinecraftSuggestions\");\n\t\tDocument redditMinecraftDoc = new Document();\n\t\tredditMinecraftDoc.append(\"reddit\", redditMinecraftLinks);\n\n\t\tcontentDirectory.append(\"minecraft\", redditMinecraftDoc);\n\t\t//////////////////////////////////////////////////////////////////////////////////////////\n\n\n\t\t//for minecraft\n\t\t//////////////////////////////////////////////////////////////////////////////////////////\n\t\tArrayList<String> redditKSPLinks = new ArrayList<>();\n\t\tredditKSPLinks.add(\"https://www.reddit.com/r/KerbalSpaceProgram/\");\n\t\tredditKSPLinks.add(\"https://www.reddit.com/r/KSPMemes\");\n\t\tredditKSPLinks.add(\"http://www.reddit.com/r/KerbalAcademy\");\n\t\tredditKSPLinks.add(\"https://www.reddit.com/r/RealSolarSystem/\");\n\t\tDocument redditKSPDoc = new Document();\n\t\tredditKSPDoc.append(\"reddit\", redditKSPLinks);\n\n\t\tcontentDirectory.append(\"KSP\", redditKSPDoc);\n\t\t//////////////////////////////////////////////////////////////////////////////////////////\n\n\t\t//for weed\n\t\t//////////////////////////////////////////////////////////////////////////////////////////\n\t\tArrayList<String> redditWeedLinks = new ArrayList<>();\n\t\tredditWeedLinks.add(\"https://www.reddit.com/r/weed/\");\n\t\tredditWeedLinks.add(\"https://www.reddit.com/r/trees/\");\n\t\tredditWeedLinks.add(\"https://www.reddit.com/r/Picturesoftrees/\");\n\t\tredditWeedLinks.add(\"https://www.reddit.com/r/bakedart/\");\n\t\tredditWeedLinks.add(\"https://www.reddit.com/r/treecomics/\");\n\t\tredditWeedLinks.add(\"https://www.reddit.com/r/nugs/\");\n\t\tredditWeedLinks.add(\"https://www.reddit.com/r/nugporn/\");\n\t\tredditWeedLinks.add(\"https://www.reddit.com/r/TokeSpot/\");\n\n\t\tDocument redditWeedDoc = new Document();\n\t\tredditWeedDoc.append(\"reddit\", redditWeedLinks);\n\n\t\tcontentDirectory.append(\"weed\", redditWeedDoc);\n\t\t//////////////////////////////////////////////////////////////////////////////////////////\n\n\t\t//for drug\n\t\t//////////////////////////////////////////////////////////////////////////////////////////\n\t\tArrayList<String> redditDrugLinks = new ArrayList<>();\n\t\tredditDrugLinks.add(\"https://www.reddit.com/r/DrugArt/\");\n\t\tredditDrugLinks.add(\"https://www.reddit.com/r/trippy/\");\n\t\tredditDrugLinks.add(\"https://www.reddit.com/r/drugmemes/\");\n\t\tDocument redditDrugDoc = new Document();\n\t\tredditDrugDoc.append(\"reddit\", redditDrugLinks);\n\n\t\tcontentDirectory.append(\"drug\", redditDrugDoc);\n\t\t//////////////////////////////////////////////////////////////////////////////////////////\n\n\t\t//for cute animals\n\t\t//////////////////////////////////////////////////////////////////////////////////////////\n\t\tArrayList<String> redditCanimalLinks = new ArrayList<>();\n\t\tredditCanimalLinks.add(\"https://www.reddit.com/r/aww/\");\n\t\tredditCanimalLinks.add(\"http://www.reddit.com/r/cats/\");\n\t\tredditCanimalLinks.add(\"https://www.reddit.com/r/babyanimals/\");\n\t\tredditCanimalLinks.add(\"https://www.reddit.com/r/AnimalsBeingBros\");\n\t\tredditCanimalLinks.add(\"https://www.reddit.com/r/woof_irl/\");\n\t\tDocument reddiCanimalDoc = new Document();\n\t\treddiCanimalDoc.append(\"reddit\", redditCanimalLinks);\n\n\t\tcontentDirectory.append(\"canimal\", reddiCanimalDoc);\n\t\t//////////////////////////////////////////////////////////////////////////////////////////\n\n\n\t}", "@Test\n public void testCrawlMalformedInitalUrl() {\n new Crawl();\n\n }", "public Crawler crawl() throws ParseException, IOException {\n\t\tlong start = System.currentTimeMillis();\n\n\t\tCrawler c = new Crawler(\"https://cs.purdue.edu\", 250);\n\t\tc.crawl();\n\n \tlong end = System.currentTimeMillis();\n \tSystem.out.println(\"Stats: \");\n \tSystem.out.println(\"Number of parsed pages: \" + c.getParsed().size());\n \tSystem.out.println(\"Number of words: \" + c.getWords().size());\n \t\n \tSystem.out.println(\"Total time: \" + (end - start) + \"ms.\");\n\n \treturn c;\n\t}", "public static void main(String[] args) {\n\t\t//\n\t\t//\n\t\t//\n\t\t//\n\t\tMyAbstractWebSpider mywebspider1=new MyConcreteWebSpider();\n\t\t//\n\t\t//\n\t\t//\n\t\tRunnable runnableProcessSpider=new ProcessSpider(mywebspider1);\n\t\tnew Thread(runnableProcessSpider).start();\n\t\t//\n\t\t//\n\t\tRunnable runnableDownLoadPicFactory=new DownLoadPicFactory(mywebspider1);\n\t\tnew Thread(runnableDownLoadPicFactory).start();\n\t\t//\n\t\t//\n\t\t//\n\t\t//\n\t\t//\n\t\t//\n\t\tMyThreadSleep.sleep10s();\n\t\tMyThreadSleep.sleep10s();\n\t\tProcessSpider runnableProcessSpiderToCatchAnswer1=new ProcessSpider(mywebspider1){\n\t\t\t@Override\n\t\t\tpublic void myprocess()\n\t\t\t{\n\t\t\t\t//存在有可能跟其他线程先后进入了同个收藏夹一起进行遍历,此时该收藏夹的搜索就由多个线程一起爬,但是已收入的答案就不会收入url队列里了\n\t\t\t\tfor(;this.getMyWebSpider1().getUrlWarehouse1().sizeStrqueueCollectionUrlToRequest1()>=0;)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"getStrqueueImgUrlToRequest1 size!!!!!!!!!!!!!!!!:\"+this.getMyWebSpider1().getUrlWarehouse1().sizeStrqueueImgUrlToRequest1() );\n\t\t\t\t\tif(this.getMyWebSpider1().getUrlWarehouse1().sizeStrqueueCollectionUrlToRequest1()<=0)\n\t\t\t\t\t{\n\t\t\t\t\t\tMyThreadSleep.sleep5s();\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tMyThreadSleep.sleep2s();\n\t\t\t\t\tfor(int overI=0;overI<=this.getMyWebSpider1().getUrlWarehouse1().sizeStrqueueCollectionUrlToRequest1()-1;overI++)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.getWebDriver1().navigate().to(this.getMyWebSpider1().getUrlWarehouse1().pollStrqueueCollectionUrlToRequest1());\n\t\t\t\t\t\tMyThreadSleep.sleep2s();\n\t\t\t\t\t\t//搜寻每个收藏夹的答案(路径包括问题)\n\t\t\t\t\t\t//mywebspider1.getQuesionUrlWithoutAnswerUrlInSpecifiedPage(driver1);\n\t\t\t\t\t\tthis.getMyWebSpider1().getQuesionUrlWithAnswerUrlInSpecifiedPage(this.getWebDriver1());\n\t\t\t\t\t\tthis.getMyWebSpider1().getUrlToTurnToNextPageInInSpecifiedPage(this.getWebDriver1());\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t};\n\t\tnew Thread((Runnable)runnableProcessSpiderToCatchAnswer1).start();\n\t\t//\n\t\t//\n/*\t\tMyThreadSleep.sleep10s();\n\t\tMyThreadSleep.sleep10s();\n\t\tProcessSpider runnableProcessSpiderToCatchAnswer2=new ProcessSpider(mywebspider1){\n\t\t\t@Override\n\t\t\tpublic void myprocess()\n\t\t\t{\n\t\t\t\t//存在有可能跟其他线程先后进入了同个收藏夹一起进行遍历,此时该收藏夹的搜索就由多个线程一起爬,但是已收入的答案就不会收入url队列里了\n\t\t\t\tfor(;this.getMyWebSpider1().getUrlWarehouse1().sizeStrqueueCollectionUrlToRequest1()>=0;)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"getStrqueueImgUrlToRequest1 size!!!!!!!!!!!!!!!!:\"+this.getMyWebSpider1().getUrlWarehouse1().sizeStrqueueImgUrlToRequest1() );\n\t\t\t\t\tif(this.getMyWebSpider1().getUrlWarehouse1().sizeStrqueueCollectionUrlToRequest1()<=0)\n\t\t\t\t\t{\n\t\t\t\t\t\tMyThreadSleep.sleep5s();\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tMyThreadSleep.sleep2s();\n\t\t\t\t\tfor(int overI=0;overI<=this.getMyWebSpider1().getUrlWarehouse1().sizeStrqueueCollectionUrlToRequest1()-1;overI++)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.getWebDriver1().navigate().to(this.getMyWebSpider1().getUrlWarehouse1().pollStrqueueCollectionUrlToRequest1());\n\t\t\t\t\t\tMyThreadSleep.sleep2s();\n\t\t\t\t\t\t//搜寻每个收藏夹的答案(路径包括问题)\n\t\t\t\t\t\t//mywebspider1.getQuesionUrlWithoutAnswerUrlInSpecifiedPage(driver1);\n\t\t\t\t\t\tthis.getMyWebSpider1().getQuesionUrlWithAnswerUrlInSpecifiedPage(this.getWebDriver1());\n\t\t\t\t\t\tthis.getMyWebSpider1().getUrlToTurnToNextPageInInSpecifiedPage(this.getWebDriver1());\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t};\n\t\tnew Thread((Runnable)runnableProcessSpiderToCatchAnswer2).start();*/\n\t\t//\n\t\t//\n\t\t//\n\t\t//\n\t\tMyThreadSleep.sleep10s();\n\t\tMyThreadSleep.sleep10s();\n\t\tProcessSpider runnableProcessSpiderToCatchContent=new ProcessSpider(mywebspider1){\n\t\t\t@Override\n\t\t\tpublic void myprocess()\n\t\t\t{\n\t\t\t\tfor(;this.getMyWebSpider1().getUrlWarehouse1().sizeStrqueueAnswerUrlToRequest1()>=0;)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"sizeStrqueueAnswerUrlToRequest1 size!!!!!!!!!!!!!!!!:\"+this.getMyWebSpider1().getUrlWarehouse1().sizeStrqueueAnswerUrlToRequest1() );\n\t\t\t\t\tif(this.getMyWebSpider1().getUrlWarehouse1().sizeStrqueueAnswerUrlToRequest1()<=0)\n\t\t\t\t\t{\n\t\t\t\t\t\tMyThreadSleep.sleep5s();\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tthis.getWebDriver1().navigate().to(this.getMyWebSpider1().getUrlWarehouse1().pollStrqueueAnswerUrlToRequest1());\n\t\t\t\t\t//\n\t\t\t\t\tMyThreadSleep.sleep1s();\n\t\t\t\t\t//\n\t\t\t\t\tint scrollLength=0;\n\t\t\t\t\t//\n\t\t\t\t\tfor(int overI=0;overI<=100-1;overI++)\n\t\t\t\t\t{\n\t\t\t\t\t\tJavascriptExecutor jsDriverTemp = (JavascriptExecutor)this.getWebDriver1();\n\t\t\t\t\t\tscrollLength=scrollLength+200;\n\t\t\t\t\t\tString js=\"document.body.scrollTop =\"+scrollLength;\n\t\t\t\t\t\tjsDriverTemp.executeScript(js);\n\t\t\t\t\t\t//\n\t\t\t\t\t\tMyThreadSleep.sleep100ms();\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t\t//get pic url in specified page\n\t\t\t\t\tthis.getMyWebSpider1().getSpecifiedAnswerContent2(this.getWebDriver1());\n\t\t\t\t\t//\n\t\t\t\t\t//\n\n\t\t\t\t\t//\n\t\t\t\t\t//\n\t\t\t\t}\n\n\t\t\t}\n\t\t};\n\t\tnew Thread((Runnable)runnableProcessSpiderToCatchContent).start();\n\t}", "public CrawlHandler(){\n\t\tthis.idToItem=new HashMap<String,Item>();\n\t\tthis.parser=new ItemReviewsPageParser();\n\t}", "public BasePageObject() {\n this.driver = BrowserManager.getInstance().getDriver();\n this.wait = BrowserManager.getInstance().getWait();\n PageFactory.initElements(driver, this);\n }", "public ScrapeInfo() {\n initComponents();\n }", "public Crawler(String seedUrlStr, int toDiscover)\n throws InterruptedException, FileNotFoundException,\n UnsupportedEncodingException {\n HTMLFetcher fetcher = null;\n urlQueue.add(seedUrlStr);\n String urlStr = \"\";\n while (discoveredUrls < toDiscover) {\n urlStr = urlQueue.poll(TIMEOUT_VAL, TimeUnit.SECONDS);\n\n if (urlStr == null) {\n // Happens if the crawler has waited for a new URL in the queue\n // for more than the timeout value. This means that all leafs\n // have been found and the crawler cannot continue.\n break;\n }\n\n // Acquire mutex to avoid collision when adding and\n // comparing at the same time\n mutex.acquireUninterruptibly();\n polledUrls.add(urlStr);\n mutex.release();\n\n System.out.println(\"Crawling: \" + urlStr);\n try {\n fetcher = new HTMLFetcher(new URL(urlStr), this);\n } catch (MalformedURLException e) {\n continue;\n }\n\n fetcherExecutor.execute(fetcher);\n }\n System.out.println(\"DONE: Discovered \" + discoveredUrls + \" URLs\");\n\n System.out.println(\"Dumping them into: urls.txt\");\n Collection<String> toDump = new LinkedList<String>(polledUrls);\n toDump.addAll(urlQueue);\n dumpCollection(toDump, \"urls.txt\");\n\n System.out.println(\"Waiting for \" + TIMEOUT_VAL + \" seconds for \"\n + Thread.activeCount() + \" threads to terminate...\");\n fetcherExecutor.awaitTermination(TIMEOUT_VAL, TimeUnit.SECONDS);\n }", "private DOMs() {\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic Indexer crawl (int limit) \n\t{\n\t\n\t\t////////////////////////////////////////////////////////////////////\n\t // Write your Code here as part of Priority Based Spider assignment\n\t // \n\t ///////////////////////////////////////////////////////////////////\n\t\tPQueue q=new PQueue();\n \t\n\t\ttry\n \t{\n\t\t\t final String authUser = \"iiit-63\";\n\t\t\t\tfinal String authPassword = \"MSIT123\";\n\n\t\t\t\tSystem.setProperty(\"http.proxyHost\", \"proxy.iiit.ac.in\");\n\t\t\t\tSystem.setProperty(\"http.proxyPort\", \"8080\");\n\t\t\t\tSystem.setProperty(\"http.proxyUser\", authUser);\n\t\t\t\tSystem.setProperty(\"http.proxyPassword\", authPassword);\n\n\t\t\t\tAuthenticator.setDefault(\n\t\t\t\t new Authenticator() \n\t\t\t\t {\n\t\t\t\t public PasswordAuthentication getPasswordAuthentication()\n\t\t\t\t {\n\t\t\t\t return new PasswordAuthentication(authUser, authPassword.toCharArray());\n\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t);\n\n\t\t\t\tSystem.setProperty(\"http.proxyUser\", authUser);\n\t\t\t\tSystem.setProperty(\"http.proxyPassword\", authPassword);\n \t\tURLTextReader in = new URLTextReader(u);\n \t\t// Parse the page into its elements\n \t\tPageLexer elts = new PageLexer(in, u);\t\t\n \t\tint count1=0;\n \t\t// Print out the tokens\n \t\tint count = 0;\n \t\t\n \t\twhile (elts.hasNext()) \n \t\t{\n \t\t\tcount++;\n \t\t\tPageElementInterface elt = (PageElementInterface)elts.next();\t\t\t \n \t\t\tif (elt instanceof PageHref)\n \t\t\tif(count1<limit)\n \t\t\t{\n \t\t\t\tif(q.isempty())\n \t\t\t\t{\n \t\t\t\t\tq.enqueue(elt.toString(),count);\n\t\t\t\t\t}\n \t\t\t\telse\n \t\t\t\t{\n \t\t\t\t\tif(q.search(elt.toString(),count))\n \t\t\t\t\t{\n \t\t\t\t\t\tq.enqueue(elt.toString(),count);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\tcount1++;\n \t\t\t\tSystem.out.println(\"link: \"+elt);\n \t\t\t\t\n \t\t\t}\n \t\t}\n \t\tSystem.out.println(\"links retrieved: \"+count1);\n \t\tq.display();\n \t\twhile(limit !=0)\n \t\t{\n \t\t\tObject elt=q.dequeue();\n \t\t\tURL u1=new URL(elt.toString());\n \t\t\tURLTextReader in1= new URLTextReader(u1);\n \t\t\t// Parse the page into its elements\n \t\t\tPageLexer elt1 = new PageLexer(in1, u1);\n \t\t\twhile (elt1.hasNext()) \n \t\t\t{\n \t\t\t\tPageElementInterface elts2= (PageElementInterface)elt1.next();\n \t\t\t\tif (elts2 instanceof PageWord)\n \t\t\t\t{\n \t\t\t\t\tv.add(elts2);\n \t\t\t\t}\n \t\t\t\tSystem.out.println(\"words:\"+elts2);\n \t\t\t} \t\t\t\n\t\t\t\tObjectIterator OI=new ObjectIterator(v);\n\t\t\t\ti.addPage(u1,OI);\n\t\t\t\tfor(int j=0;j<v.size();j++);\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"hello\"+v.get(count));\n\t\t\t\t}\n\t\t\t\tlimit--;\n \t\t}\n \t\t\n \t}\n \tcatch (Exception e)\n \t{\n \t\tSystem.out.println(\"Bad file or URL specification\");\n \t}\n return i;\n\t}", "public SearchPage() {\n\t\tPageFactory.initElements(driver, this);\n\t\t\n\t}", "public QueryWiki() {\n }", "public AbstractWebSite(final String siteUrl) {\r\n this(WebDriverFactory.defaultWebDriver());\r\n open(siteUrl);\r\n }", "public Links() {\n }", "private XhtmlUtils()\n\t{\n\t}", "public Parser(URL url) {\n \t\t\ttry {\n \t\t\t\tload(url.openStream());\n \t\t\t} catch (Exception e) {\n \t\t\t\t// continue ... actual parsing will report errors\n \t\t\t}\n \t\t}", "public TrackCoach() {\n\n\t}", "public WebElement() {}", "public HtmlTree()\n {\n // do nothing\n }", "public HtmlParserImpl(final String url) throws ParserException {\n\t\tsuper(url);\n\t}", "public LinkElement() { }", "private WebContext() {\n }", "public TestClassLoader(URL[] urls) {\n super(new URL[0]);\n this.urls = urls;\n }", "public void beginCrawling() {\n\n if (urlsFile != null\n && emailsFile != null\n && urlsWriter != null\n && emailsWriter != null) {\n crawl(startUrl);\n }\n }", "public Zip_Code(WebDriver driver){\n super();\n PageFactory.initElements(driver,this);\n //local page logger gets set to abstract class logger when you use it in\n //page object\n this.logger = super.logger;\n\n }", "@Override\n\tpublic void initialize(UimaContext context){\n\t\t\n\t\ttry {\n\t\t\tsuper.initialize(context);\n\t\t} catch (ResourceInitializationException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\ttry {\n\t\t//\tread = true;\n\t\t\tdocument = Jsoup.connect(\"https://en.wikipedia.org/wiki/Ubiquitous_Knowledge_Processing_Lab\").get();\n\t\t\tdocElements = document.select(\"body\");\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n//\t\t title = doc.title();\n\t}", "private YahooMeteoRetriever() {\r\n\t\tsuper();\r\n\t}", "public Parser()\n {\n //nothing to do\n }", "public PageUtil() {\n\n\t}", "private void startCrawler()\n {\n String[] enteredKeywords = getKeywordsFromBar();\n \n if(spider.numSeeds() == 0)\n JOptionPane.showMessageDialog(null, \"Please add some seed URL's\");\n \n else if(spider.numWorkers() == 0)\n JOptionPane.showMessageDialog(null, \"Please add atleast one worker\");\n \n else if(enteredKeywords == null)\n JOptionPane.showMessageDialog(null, \"Please enter some keywords to search for\");\n \n else if(spider.getIndexer() == null)\n JOptionPane.showMessageDialog(null, \"No index found, please create or open one\");\n \n else\n {\n playButton.setEnabled(false);\n startCrawlerItem.setEnabled(false);\n stopButton.setEnabled(true);\n stopCrawlerItem.setEnabled(true);\n spider.initKeywords(enteredKeywords);\n \n if(!canResume) spider.crawl();\n else \n {\n spider.resumeCrawling();\n canResume = false;\n }\n }\n }", "public ControlUrlControler() {\r\n\r\n }", "public Scraper(String cId) {\n\n\t\tcrawlingId=cId;\n\t\tMorphiaManager.setup(MorphiaConstants.HOST, MorphiaConstants.PORT);\n\t\tmDBh= new MongoDBHandler();\n\t}", "public void run() {\n\t\t\tString html = \"\";\n\t\t\ttry {\n\t\t\t\thtml = HTTPFetcher.fetchHTML(this.url);\n\t\t\t} catch (UnknownHostException e) {\n\t\t\t\tSystem.out.println(\"Unknown host\");\n\t\t\t} catch (MalformedURLException e) {\n\t\t\t\tSystem.out.println(\"MalformedURL\");\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.out.println(\"IOException\");\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tif(html != null) {\n\t\t\t\t\tthis.newLinks = LinkParser.listLinks(new URL(this.url), html);\n\t\t\t\t}\n\t\t\t} catch (MalformedURLException e) {\n\t\t\t\tSystem.out.println(\"MalformedURL\");\n\t\t\t}\n\t\t\tif(newLinks != null) {\n\t\t\t\tfor(URL theURL : newLinks) {\n\t\t\t\t\tif(!(urls.contains(theURL))) {\n\t\t\t\t\t\tsynchronized(urls) {\n\t\t\t\t\t\t\turls.add(theURL);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tinnerCrawl(theURL, limit);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tInvertedIndex local = new InvertedIndex();\n\t\t\t\tString no_html = HTMLCleaner.stripHTML(html.toString());\n\t\t\t\tString[] the_words = WordParser.parseWords(no_html);\n\t\t\t\tlocal.addAll(the_words, this.url);\n\t\t\t\tindex.addAll(local);\n\t\t\t}\n\t\t}", "public Webinar() {\n\t\t\n\t}", "public TennisCoach() {\r\n\t\t// just to check whether it is called or not(just for own debugging)\r\n\t\tSystem.out.println(\">> TennisCoach: inside default constructor\");\r\n\t}", "public SearchServiceRestClientImpl() {\n this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()).build());\n }", "public TennisCoach () {\n\t\tSystem.out.println(\">> inside default constructor.\");\n\t}", "public FeedPage() {\n }", "public static void main(String[] args) {\n MultiProtocolURI url;\n try {\n url = new MultiProtocolURI(args[0]);\n byte[] content = url.get(HTTPLoader.crawlerUserAgent, 3000);\n Document[] document = new htmlParser().parse(url, \"text/html\", null, new ByteArrayInputStream(content));\n String title = document[0].dc_title();\n System.out.println(title);\n System.out.println(CharacterCoding.unicode2html(title, false));\n } catch (MalformedURLException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (Parser.Failure e) {\n e.printStackTrace();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }", "public static void main(String[] args) {\n String url = crawlYanolja();\n }", "public Network () {\n buildNetwork();\n }", "public GoogleSearch() {\n\n\n }", "public Selector() {\n }", "public PageTransporter() {\n System.out.println(ReadProperties.getInstance().getUrl());\n driver.get(ReadProperties.getInstance().getUrl());\n }", "@Override\n public void crawl() {\n Document doc;\n try {\n\n\n doc = Jsoup.connect(rootURL).userAgent(\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/7046A194A\").get();\n\n Elements articles = doc.select(\"section.list article\");\n\n System.out.println(\"Number of articles found:\"+articles.size());\n //list of links found\n for(Element article: articles){\n\n Element titleLink = article.select(\"a\").first();\n System.out.println(titleLink.attr(\"abs:href\"));\n\n //if the url found is in the cache, do not retrieve the url.\n if(urlCache.contains(titleLink.attr(\"abs:href\"))) {\n System.out.println(\"Doucment found in cache, ignoring document\");\n continue;\n }\n\n storeDocument(Jsoup.connect(titleLink.attr(\"abs:href\")).get());\n\n //add the URL to the cache so that we don't retrieve it again.\n urlCache.add(titleLink.attr(\"abs:href\"));\n }\n\n\n } catch (Exception e){\n logger.log(Level.SEVERE, \"Error Retrieving from URL\", e);\n e.printStackTrace();\n }\n }", "public TrecWebDocument() {\r\n try {\r\n startTag = XML_START_TAG.getBytes(\"utf-8\");\r\n endTag = XML_END_TAG.getBytes(\"utf-8\");\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n }", "public AbstractWebSite(final WebDriver webDriver) {\r\n assertNotNull(webDriver);\r\n this.webDriver = webDriver;\r\n }", "public static void main(String[] args0)\r\n\t{\r\n\t\tmain = new WebCrawlerConsole();\r\n\t\tmain.run();\r\n\t}", "public FetchRule() {\n }", "public void run() {\n\t\tHtmlPage page = null;\n\t\tHtmlSelect select = null;\n\t\tHtmlOption option = null;\n\t\tDataStreamWriter connection = null;\n\t\tWebClient client = new WebClient(BrowserVersion.FIREFOX_3);\n\t\t/* eseguo i job assegnati al thread in esecuzione */\n\t\tfor(int j = 0; j < this.jobs.length; j++) {\n\t\t\tint currentJob = this.jobs[j];\n\t\t\ttry {\n\t\t\t\t/* faccio dei tentativi per collegarmi alle pagine */\n\t\t\t\tpage = getPage(client, this.getDataSourceURL());\n\t\t\t\t/* seleziono l'opzione relativa alla regione assegnata al task */\n\t\t\t\tselect = (HtmlSelect) page.getByXPath(\"//select\").get(0);\n\t\t\t\toption = select.getOption(currentJob);\n\t\t\t\toption.setSelected(true);\n\t\t\t\tString regione = option.asText();\n\t\t\t\t/* seleziono l'opzione ed ottengo la pagina aggiornata */\n\t\t\t\tpage = (HtmlPage) select.fireEvent(Event.TYPE_CHANGE).getNewPage();\n\t\t\t\t\n\t\t\t\t/* estraggo i dati e li salvo nello \"storage\" */\n\t\t\t\tconnection = this.storageFacade.getDataStreamWriter();\n\t\t\t\tconnection.openStreamWriter();\n\t\t\t\tthis.extractData(client, connection, page, regione);\n\t\t\t}\n\t\t\tcatch (HTMLCrawlerException e) {\n\t\t\t\tSystem.err.println(\"@ HTMLCrawlerException : Extracting Data Error\");\n\t\t\t\tSystem.err.println(e.getMessage());\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\t//client.closeAllWindows();\n\t\t\t\tif (connection != null)\n\t\t\t\t\tconnection.closeStreamWriter();\n\t\t\t}\n\t\t}\n\t\tclient.closeAllWindows();\n\t}", "public HTMLFile (URL url) {\n this.inFile = null;\n inURL = url;\n inName = url.toString();\n commonConstruction();\n }", "public AbstractSearchEngine() {}", "protected void construct()\n\t{\n\t\tassert(driver != null);\n\t\t// V�rification que l'on est bien sur la bonne page\n\t String sTitle = driver.getTitle();\n\t\tif(!sTitle.equals(TITLE)) {\n throw new IllegalStateException(\"This is not Login Page, current page is: \" +driver.getCurrentUrl());\n\t\t}\t\t\n\t\ttbUserName = driver.findElement(ByUserName);\n\t\ttbPassword = driver.findElement(ByPassword);\n\t\tbtnConnect = driver.findElement(ByConnect);\n\t}", "public SeleniumServerConfiguration() {\n }", "public GuiUrlGrabber() {\n initComponents();\n }", "protected MovieRepository(String url) {\n URL = url;\n }", "public Page(WebDriver webDriver) {\n\t\tthis.webDriver = webDriver;\n wait = new WebDriverWait(webDriver, 10);\n\t}" ]
[ "0.7610384", "0.7022109", "0.68937355", "0.6796549", "0.66958296", "0.663888", "0.6633106", "0.6505772", "0.64253736", "0.6417725", "0.6416178", "0.63828653", "0.63579553", "0.63525647", "0.63399523", "0.63198507", "0.6313425", "0.6238752", "0.6238493", "0.62220836", "0.619772", "0.6190726", "0.6182546", "0.6172225", "0.61687255", "0.6156043", "0.61558896", "0.6149674", "0.61307627", "0.61110383", "0.607844", "0.60700417", "0.60313624", "0.6015144", "0.6002244", "0.5958364", "0.59463674", "0.59463656", "0.594446", "0.59394693", "0.5935703", "0.5921488", "0.58745706", "0.5873412", "0.58601016", "0.5833928", "0.5831375", "0.5817534", "0.58160484", "0.5815984", "0.580338", "0.5800513", "0.57935184", "0.5750557", "0.5747385", "0.5742557", "0.5739375", "0.5734155", "0.5729008", "0.5728143", "0.57127553", "0.5708672", "0.5704312", "0.5701197", "0.5698292", "0.5689345", "0.56497055", "0.5626819", "0.56209713", "0.5620007", "0.5605503", "0.5599517", "0.55984783", "0.5590557", "0.5589997", "0.55838627", "0.55834544", "0.55831194", "0.5582749", "0.5577524", "0.5575049", "0.55613506", "0.5557397", "0.555247", "0.55524445", "0.5547615", "0.5540589", "0.5537496", "0.55362767", "0.55336195", "0.5531338", "0.5530436", "0.55279744", "0.55237347", "0.5514612", "0.55135006", "0.5508873", "0.54996264", "0.54985017", "0.5490589" ]
0.67250365
4
Simply adds the seed URL to the list of URLs and that calls execute on the queue with a new CrawlWorker.
public void crawl(URL url, int limit) { urls.add(url); queue.execute(new CrawlWorker(url.toString())); queue.finish(); queue.shutdown(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public WebCrawler(String urlSeed) {\n\t\t\n\n\t\t\n\t\tconnection = db.openConnection();\n\n\t\t\ttry {\n\t\t\t\tthis.urlSeed = new URL(urlSeed);\n\t\t\t} catch(MalformedURLException ex) {\n\t\t\t\tlog.error(\"please input the right url with protocol part!\");\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t\tworkers = new WorkQueue(10);\n\t\t\tthis.count = 0;\n\t\t\tthis.pending = 0;\n\t\t\turlList = new ArrayList<String>();\n\t\t\t//index = new InvertedIndex();\n\t\t\tlong start = System.currentTimeMillis();\n\t\t\tthis.HTMLFetcher();\n\t\t\tlong end = System.currentTimeMillis();\n\t\t\tlog.info(\"Running time for htmlFetcher: \" + (end - start));\n\t\t\tList<String> suggestedQuery = index.getSuggestedQuery();\n\t\t\tdb.updateSuggestedQuery(connection, suggestedQuery);\n\t\t\tdb.closeConnection(connection);\n\t}", "public CrawlWorker(String url) {\n\t\t\tthis.url = url;\n\t\t}", "public Crawler(String seedUrlStr, int toDiscover)\n throws InterruptedException, FileNotFoundException,\n UnsupportedEncodingException {\n HTMLFetcher fetcher = null;\n urlQueue.add(seedUrlStr);\n String urlStr = \"\";\n while (discoveredUrls < toDiscover) {\n urlStr = urlQueue.poll(TIMEOUT_VAL, TimeUnit.SECONDS);\n\n if (urlStr == null) {\n // Happens if the crawler has waited for a new URL in the queue\n // for more than the timeout value. This means that all leafs\n // have been found and the crawler cannot continue.\n break;\n }\n\n // Acquire mutex to avoid collision when adding and\n // comparing at the same time\n mutex.acquireUninterruptibly();\n polledUrls.add(urlStr);\n mutex.release();\n\n System.out.println(\"Crawling: \" + urlStr);\n try {\n fetcher = new HTMLFetcher(new URL(urlStr), this);\n } catch (MalformedURLException e) {\n continue;\n }\n\n fetcherExecutor.execute(fetcher);\n }\n System.out.println(\"DONE: Discovered \" + discoveredUrls + \" URLs\");\n\n System.out.println(\"Dumping them into: urls.txt\");\n Collection<String> toDump = new LinkedList<String>(polledUrls);\n toDump.addAll(urlQueue);\n dumpCollection(toDump, \"urls.txt\");\n\n System.out.println(\"Waiting for \" + TIMEOUT_VAL + \" seconds for \"\n + Thread.activeCount() + \" threads to terminate...\");\n fetcherExecutor.awaitTermination(TIMEOUT_VAL, TimeUnit.SECONDS);\n }", "public void run() {\n\t\t\tString html = \"\";\n\t\t\ttry {\n\t\t\t\thtml = HTTPFetcher.fetchHTML(this.url);\n\t\t\t} catch (UnknownHostException e) {\n\t\t\t\tSystem.out.println(\"Unknown host\");\n\t\t\t} catch (MalformedURLException e) {\n\t\t\t\tSystem.out.println(\"MalformedURL\");\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.out.println(\"IOException\");\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tif(html != null) {\n\t\t\t\t\tthis.newLinks = LinkParser.listLinks(new URL(this.url), html);\n\t\t\t\t}\n\t\t\t} catch (MalformedURLException e) {\n\t\t\t\tSystem.out.println(\"MalformedURL\");\n\t\t\t}\n\t\t\tif(newLinks != null) {\n\t\t\t\tfor(URL theURL : newLinks) {\n\t\t\t\t\tif(!(urls.contains(theURL))) {\n\t\t\t\t\t\tsynchronized(urls) {\n\t\t\t\t\t\t\turls.add(theURL);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tinnerCrawl(theURL, limit);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tInvertedIndex local = new InvertedIndex();\n\t\t\t\tString no_html = HTMLCleaner.stripHTML(html.toString());\n\t\t\t\tString[] the_words = WordParser.parseWords(no_html);\n\t\t\t\tlocal.addAll(the_words, this.url);\n\t\t\t\tindex.addAll(local);\n\t\t\t}\n\t\t}", "public static void Execute ()\n\t{\n\t\tReceiveCollection (SpawnCrawler (target));\n\t\t\n\t\tList<String> initialCollection = overCollection;\n\t\t\n\t\tif ( ! initialCollection.isEmpty ())\n\t\t{\n\t\t\n\t\t\tfor (String collected : initialCollection)\n\t\t\t{\n\t\t\t\t\n\t\t\t\tif (collected.contains (\"http\"))\n\t\t\t\t\tReceiveCollection (SpawnCrawler (collected));\n\t\t\t\telse\n\t\t\t\t\tReceiveCollection (SpawnCrawler (target + collected));\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t\t/*\n\t\t * Several loops should commence here where the system reiteratively goes over all the newly acquired URLs\n\t\t * so it may extend itself beyond the first and second depth.\n\t\t * However this process should be halted once it reaches a certain configurable depth.\n\t\t */\n\t\tint depth = 0;\n\t\tint newFoundings = 0;\n\t\t\n\t\tdepthLoop: while (depth <= MAX_DEPTH)\n\t\t{\n\t\t\t\n\t\t\tfor (String collected : overCollection)\n\t\t\t{\n\t\t\t\t\n\t\t\t\tif (collected.contains (\"http\"))\n\t\t\t\t\tSpawnCrawler (collected);\n\t\t\t\telse\n\t\t\t\t\tSpawnCrawler (target + collected);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif (newFoundings <= 0)\n\t\t\t\tbreak depthLoop;\n\t\t\t\n\t\t\tdepth++;\n\t\t\t\t\t\t\n\t\t}\n\t\t\n\t}", "public void run() {\n\t\t\t\twhile (queue.size() > 0) {\n\t\t\t\t\tJobQueue urlList = queue.poll();\n\t\t\t\t\tdoRequests(urlList);\n\t\t\t\t}\n\t\t\t}", "@Async\n\tpublic void start() {\n\t\tUrl url = null;\n\t\twhile (true) {\n\t\t\ttry {\n\t\t\t\turl = urlRepository.findFirstByDateScannedOrderByIdAsc(null);\n\t\t\t\tif (url == null) {\n\t\t\t\t\twhile (url == null) {\n\t\t\t\t\t\turl = WebSiteLoader.getRandomUrl();\n\n\t\t\t\t\t\tif (urlExists(url)) {\n\t\t\t\t\t\t\turl = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\turl = urlRepository.saveAndFlush(url);\n\t\t\t\t}\n\t\t\t\tlog.info(\"Crawling URL : \" + url);\n\n\t\t\t\tWebPage webPage = WebSiteLoader.readPage(url);\n\t\t\t\tif (webPage != null) {\n\t\t\t\t\tReport report = textAnalyzer.analyze(webPage.getText());\n\t\t\t\t\t\n\t\t\t\t\tfor(SentenceReport sentenceReport : report.getSentenceReports()){\n\t\t\t\t\t\tSentence sentence = sentenceReport.getSentence();\n\t\t\t\t\t\tsentence = sentenceRepository.saveAndFlush(sentence);\n\t\t\t\t\t\tsentenceReport.setSentence(sentence);\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor(Occurrence occurrence : sentenceReport.getOccurences()){\n\t\t\t\t\t\t\toccurrence = occurrenceRepository.saveAndFlush(occurrence);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tSentenceOccurrence so = new SentenceOccurrence();\n\t\t\t\t\t\t\tSentenceOccurrenceId soId = new SentenceOccurrenceId();\n\t\t\t\t\t\t\tso.setSentenceOccurrenceId(soId);\n\t\t\t\t\t\t\tsoId.setOccurenceId(occurrence.getId());\n\t\t\t\t\t\t\tsoId.setSentenceId(sentence.getId());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tsentenceOccurrenceRepository.saveAndFlush(so);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\taddUrls(webPage.getUrls());\n\t\t\t\t}\n\n\t\t\t\tlog.info(\"Done crawling URL : \" + url);\n\t\t\t} catch (PageNotInRightLanguageException ex) {\n\t\t\t\tlog.info(\"Page not in the right language : \" + ex.getText());\n\t\t\t} catch (Exception ex) {\n\t\t\t\tlog.error(\"Error while crawling : \" + url, ex);\n\t\t\t}\n\t\t\t\n\t\t\turl.setDateScanned(new Date());\n\t\t\turlRepository.saveAndFlush(url);\n\t\t\t\n\t\t\tif(stop){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public URLSpout() {\n \tURLSpout.activeThreads = new AtomicInteger();\n \tlog.debug(\"Starting URL spout\");\n \t\n \ttry { \t\t\n\t\t\treader = new BufferedReader(new FileReader(\"URLDisk.txt\"));\n\t\t\tint num_lines = XPathCrawler.getInstance().getFileCount().get();\n\t\t\tfor (int i = 0; i < num_lines; i++) {\n\t\t\t\treader.readLine(); //set reader to latest line\n\t\t\t}\t\t\t\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n }", "public void crawlSite()\n {\n /** Init the logger */\n WorkLogger.log(\"WebCrawler start at site \" + this.urlStart.getFullUrl() + \" and maxDepth = \" + this.maxDepth);\n WorkLogger.log(\"====== START ======\");\n WorkLogger.log(\"\");\n /** Save the start time of crawling */\n long startTime = System.currentTimeMillis();\n /** Start our workers */\n this.taskHandler.startTask(this.urlStart, maxDepth);\n /** Check workers finished their work; in case then all workers wait, then no ones work, that leads no more tasks -> the program finished */\n while(this.taskHandler.isEnd() == false)\n {\n /** Default timeout for 1 sec cause the socket timeout I set to 1 sec */\n try{Thread.sleep(1000);}catch(Exception e){}\n }\n this.taskHandler.stopTasks();\n /** End the log file and add the time elapsed and total sites visited */\n WorkLogger.log(\"\\r\\n====== END ======\");\n WorkLogger.log(\"Time elapsed: \" + (System.currentTimeMillis() - startTime)/1000.);\n WorkLogger.log(\"Total visited sites: \" + this.pool.getVisitedSize());\n }", "public void crawl(String url);", "public void threadedCrawl(String url) {\n this.executor.submit(new Task(url));\n }", "void execute(String link) throws CrawlerWorkerException;", "@Override\n public void crawl() throws IOException {\n final String seedURL = url;\n Queue<String> currentDepthQueue = new LinkedList<>();\n currentDepthQueue.add(seedURL);\n crawl(visitedURL, 1, currentDepthQueue);\n customObjectWriter.flush();\n }", "public static void main(String[] args) {\n \n FCrawler fc = new FCrawler();\n \n \n \n // now start all of the worker threads\n \n int N = 5;\n ArrayList<Thread> thread = new ArrayList<Thread>(N);\n for (int i = 0; i < N; i++) {\n Thread t = new Thread(fc.createWorker());\n thread.add(t);\n t.start();\n }\n \n// now place each directory into the workQ\n \n // fc.processDirectory(Args[0]);\n \n fc.processDirectory(\"D://\");\n// indicate that there are no more directories to add\n \n fc.workQ.finish();\n \n for (int i = 0; i < N; i++){\n try {\n thread.get(i).join();\n } catch (Exception e) {};\n }\n }", "@Override\n public void run() {\n try {\n List<String> list = Lists.newArrayList();\n for (; ; ) {\n String url = Engine.routeQueue.poll();\n if (url == null && list.size() > 0) {\n File file = new File(\"./half-moil.db\");\n if (!file.exists()) file.createNewFile();\n FileWriter writer = new FileWriter(file, true);\n\n writer.write(Joiner.on(\"\\r\\n\").join(list) + \"\\r\\n\");\n writer.flush();\n writer.close();\n writer = null;\n logger.info(\"文件已保存,新增{}条\", list.size());\n list.clear();\n } else if (url != null) {\n list.add(url);\n } else {\n Thread.sleep(5000L);\n }\n }\n } catch (Exception e) {\n logger.error(e);\n }\n }", "public void crawlAndIndex(String url) throws Exception {\r\n\t\t// TODO : Add code here\r\n\t\tQueue<String> queue=new LinkedList<>();\r\n\t\tqueue.add(url);\r\n\t\twhile (!queue.isEmpty()){\r\n\t\t\tString currentUrl=queue.poll();\r\n\t\t\tif(internet.getVisited(currentUrl)){\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tArrayList<String> urls = parser.getLinks(currentUrl);\r\n\t\t\tArrayList<String> contents = parser.getContent(currentUrl);\r\n\t\t\tupdateWordIndex(contents,currentUrl);\r\n\t\t\tinternet.addVertex(currentUrl);\r\n\t\t\tinternet.setVisited(currentUrl,true);\r\n\t\t\tfor(String u:urls){\r\n\t\t\t\tinternet.addVertex(u);\r\n\t\t\t\tinternet.addEdge(currentUrl,u);\r\n\t\t\t\tqueue.add(u);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "private void innerCrawl(URL url, int limit) {\n\t\t\tsynchronized(urls) {\n\t\t\t\tif(urls.size() <= limit) {\n\t\t\t\t\tqueue.execute(new CrawlWorker(url.toString()));\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public void crawl(String url) {\n Queue<String> queue = new LinkedList<>();\n queue.add(url);\n this.visited_urls.put(url, 1);\n Set<String> urls;\n\n while (!queue.isEmpty()) {\n String link = queue.remove();\n try {\n urls = WebCrawlerUtil.getLinks(link);\n } catch (IOException e) {\n logger.debug(\"unable to parse link \" + link);\n continue;\n }\n System.out.println(WebCrawlerUtil.formatOutput(link, urls));\n for (String neighbor : urls) {\n if (!this.visited_urls.containsKey(neighbor)) {\n this.visited_urls.put(neighbor, 1);\n queue.add(neighbor);\n }\n }\n }\n }", "synchronized void crawledList_add(HashSet _crawledList, String url)\n {\n _crawledList.add(url);\n System.out.println(\"Added\"+\"\\t\"+url);\n }", "public void run() {\n for (CrawlTask newTask = queue.pop(level); newTask != null; newTask = queue.pop(level))\n /*while (queue.getQueueSize(currentLevel)>0)*/ {\n//\t\t\tObject newTask = queue.pop(currentLevel);\n // Tell the message receiver what we're doing now\n mainCrawler.receiveMessage(newTask, id);\n // Process the newTask\n process(newTask);\n // If there are less threads running than it could, try\n // starting more threads\n if (tc.getMaxThreads() > tc.getRunningThreads()) {\n try {\n tc.startThreads();\n } catch (Exception e) {\n System.err.println(\"[\" + id + \"] \" + e.toString());\n }\n }\n }\n // Notify the ThreadController that we're done\n tc.finished(id);\n }", "protected void storeChildUrls(final CrawlerContext crawlerContext, final Set<RequestData> childUrlList, final String url,\n final int depth, final String encoding) {\n final Set<String> urlSet = new HashSet<>();\n final List<UrlQueue<?>> childList = childUrlList.stream().filter(d -> StringUtil.isNotBlank(d.getUrl())\n && urlSet.add(d.getUrl() + \"\\n\" + d.getMetaData()) && crawlerContext.getUrlFilter().match(d.getUrl())).map(d -> {\n final UrlQueue<?> uq = crawlerContainer.getComponent(\"urlQueue\");\n uq.setCreateTime(SystemUtil.currentTimeMillis());\n uq.setDepth(depth);\n uq.setMethod(d.getMethod().name());\n uq.setEncoding(encoding);\n uq.setParentUrl(url);\n uq.setSessionId(crawlerContext.getSessionId());\n uq.setUrl(d.getUrl());\n uq.setMetaData(d.getMetaData());\n return uq;\n }).collect(Collectors.toList());\n\n if (!childList.isEmpty()) {\n CrawlingParameterUtil.getUrlQueueService().offerAll(crawlerContext.getSessionId(), childList);\n }\n }", "private void updateQueue(String url)\r\n\t{\r\n\t\tQueue temp = new Queue(SIZE);\r\n\t\tObject temp2 = ' ';\r\n\t\tObject target = ' ';\r\n\t\t\r\n\t\tfor (int i = 0; i < siteVisited; i++)\r\n\t\t{\r\n\t\t\ttemp2 = rChronological.dequeue();\r\n\t\t\tif (!url.equals(temp2))\r\n\t\t\t\ttemp.enqueue(temp2);\r\n\t\t\telse\r\n\t\t\t\ttarget = temp2;\r\n\t\t}\r\n\t\t\r\n\t\tfor (int i = 0; i < siteVisited - 1; i++)\r\n\t\t\trChronological.enqueue(temp.dequeue());\r\n\t\trChronological.enqueue(target);\r\n\t}", "public void addQueue(){\n StringRequest stringRequest = new StringRequest(Request.Method.GET, page.getUrl(),\n new Response.Listener<String>() {\n @Override\n public void onResponse(String response) {\n //textView.setText(getBody(response));\n textView.setText(HtmlCompat.fromHtml(getBody(response),0));\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n textView.setText(\"Invalid URL\");\n }\n });\n\n queue.add(stringRequest);\n }", "public void doRequests(JobQueue urlList) {\n\t\tsynchronized(connections) {\n\t\t\t++connections;\n\t\t}\n \tHttpHost httpHost = new HttpHost(urlList.getHost());\n \t\n\t\twhile (! urlList.isEmpty()) {\n\t\t\tJob2 job = urlList.poll();\n\t\t\t\n\t \t// Do a HEAD request\n\t \tHttpRequest httpRequest = new HttpHead(job.getPath());\n\n\t\t\tString url = urlList.getUrl(job);\n\t\t\tLOG.info(\"Submitting \" + url);\n\n\t\t\ttry {\n\t\t\t\tHttpResponse httpResponse = httpClient.execute(httpHost, httpRequest);\n\t\t\t\tStatusLine statusLine = httpResponse.getStatusLine();\n\t\t\t\tLOG.info(statusLine.getStatusCode() + \" on \" + url);\n\t\t\t\t\n\t\t\t} catch (ClientProtocolException cpe) {\n\t\t\t\tLOG.info(\"CPE on \" + url, cpe);\n\t\t\t} catch (IOException ioe) {\n\t\t\t\tLOG.info(\"IOE on \" + url, ioe);\n\t\t\t}\n\n\t\t}\n\t\t\n\t\tsynchronized(connections) {\n\t\t\t--connections;\n\t\t\tif (connections == 0) {\n\t\t\t\tsynchronized(monitor) {\n\t\t\t\t\tmonitor.notify();\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t}", "public void addSeed(String url) {\n\t\tseedList.add(url);\n\t}", "Collection<PageLink> crawl(CrawlerArgs args);", "@Override\n public void run() {\n numStarted ++;\n\n while (true) {\n try {\n // pull a link from the link queue\n URL url = new URL(SharedLinkQueue.getNextLink());\n\n // download the HTML page text at the given URL\n HttpURLConnection connection = (HttpURLConnection) url.openConnection();\n BufferedReader download = new BufferedReader(new InputStreamReader(connection.getInputStream()));\n\n // store the HTML page text on the page queue as a string\n String pageText = \"\";\n String inputLine;\n while ((inputLine = download.readLine()) != null) {\n pageText += inputLine;\n }\n SharedPageQueue.addPage(pageText);\n\n download.close();\n } catch (MalformedURLException e) {\n errorCount ++;\n System.out.println(\"MalformedURLException: \" + e.getMessage());\n } catch (IOException e) {\n errorCount ++;\n System.out.println(\"IOException: \" + e.getMessage());\n } catch (InterruptedException e) {\n errorCount ++;\n System.out.println(\"InterruptedException: \" + e.getMessage());\n }\n }\n }", "private static void addSeedURL()\r\n\t{\r\n\t\tSystem.out.println(\"Enter a website to search for keywords.\");\r\n\t\tString userInput = input.nextLine();\r\n\t\t\r\n\t\tif(userInput.length() >= 7 && !(userInput.substring(0, 6).equals(\"https://\")))\r\n\t\t{\r\n\t\t\tuserInput = \"http://\" + userInput;\r\n\t\t\t\r\n\t\t\ttry \r\n\t\t\t{\r\n\t\t\t\tSharedLink.addLink(userInput);\r\n\t\t\t} \r\n\t\t\tcatch (InterruptedException e) \r\n\t\t\t{\r\n\t\t\t\t//do nothing\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n\t\t//\n\t\t//\n\t\t//\n\t\t//\n\t\tMyAbstractWebSpider mywebspider1=new MyConcreteWebSpider();\n\t\t//\n\t\t//\n\t\t//\n\t\tRunnable runnableProcessSpider=new ProcessSpider(mywebspider1);\n\t\tnew Thread(runnableProcessSpider).start();\n\t\t//\n\t\t//\n\t\tRunnable runnableDownLoadPicFactory=new DownLoadPicFactory(mywebspider1);\n\t\tnew Thread(runnableDownLoadPicFactory).start();\n\t\t//\n\t\t//\n\t\t//\n\t\t//\n\t\t//\n\t\t//\n\t\tMyThreadSleep.sleep10s();\n\t\tMyThreadSleep.sleep10s();\n\t\tProcessSpider runnableProcessSpiderToCatchAnswer1=new ProcessSpider(mywebspider1){\n\t\t\t@Override\n\t\t\tpublic void myprocess()\n\t\t\t{\n\t\t\t\t//存在有可能跟其他线程先后进入了同个收藏夹一起进行遍历,此时该收藏夹的搜索就由多个线程一起爬,但是已收入的答案就不会收入url队列里了\n\t\t\t\tfor(;this.getMyWebSpider1().getUrlWarehouse1().sizeStrqueueCollectionUrlToRequest1()>=0;)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"getStrqueueImgUrlToRequest1 size!!!!!!!!!!!!!!!!:\"+this.getMyWebSpider1().getUrlWarehouse1().sizeStrqueueImgUrlToRequest1() );\n\t\t\t\t\tif(this.getMyWebSpider1().getUrlWarehouse1().sizeStrqueueCollectionUrlToRequest1()<=0)\n\t\t\t\t\t{\n\t\t\t\t\t\tMyThreadSleep.sleep5s();\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tMyThreadSleep.sleep2s();\n\t\t\t\t\tfor(int overI=0;overI<=this.getMyWebSpider1().getUrlWarehouse1().sizeStrqueueCollectionUrlToRequest1()-1;overI++)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.getWebDriver1().navigate().to(this.getMyWebSpider1().getUrlWarehouse1().pollStrqueueCollectionUrlToRequest1());\n\t\t\t\t\t\tMyThreadSleep.sleep2s();\n\t\t\t\t\t\t//搜寻每个收藏夹的答案(路径包括问题)\n\t\t\t\t\t\t//mywebspider1.getQuesionUrlWithoutAnswerUrlInSpecifiedPage(driver1);\n\t\t\t\t\t\tthis.getMyWebSpider1().getQuesionUrlWithAnswerUrlInSpecifiedPage(this.getWebDriver1());\n\t\t\t\t\t\tthis.getMyWebSpider1().getUrlToTurnToNextPageInInSpecifiedPage(this.getWebDriver1());\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t};\n\t\tnew Thread((Runnable)runnableProcessSpiderToCatchAnswer1).start();\n\t\t//\n\t\t//\n/*\t\tMyThreadSleep.sleep10s();\n\t\tMyThreadSleep.sleep10s();\n\t\tProcessSpider runnableProcessSpiderToCatchAnswer2=new ProcessSpider(mywebspider1){\n\t\t\t@Override\n\t\t\tpublic void myprocess()\n\t\t\t{\n\t\t\t\t//存在有可能跟其他线程先后进入了同个收藏夹一起进行遍历,此时该收藏夹的搜索就由多个线程一起爬,但是已收入的答案就不会收入url队列里了\n\t\t\t\tfor(;this.getMyWebSpider1().getUrlWarehouse1().sizeStrqueueCollectionUrlToRequest1()>=0;)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"getStrqueueImgUrlToRequest1 size!!!!!!!!!!!!!!!!:\"+this.getMyWebSpider1().getUrlWarehouse1().sizeStrqueueImgUrlToRequest1() );\n\t\t\t\t\tif(this.getMyWebSpider1().getUrlWarehouse1().sizeStrqueueCollectionUrlToRequest1()<=0)\n\t\t\t\t\t{\n\t\t\t\t\t\tMyThreadSleep.sleep5s();\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tMyThreadSleep.sleep2s();\n\t\t\t\t\tfor(int overI=0;overI<=this.getMyWebSpider1().getUrlWarehouse1().sizeStrqueueCollectionUrlToRequest1()-1;overI++)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.getWebDriver1().navigate().to(this.getMyWebSpider1().getUrlWarehouse1().pollStrqueueCollectionUrlToRequest1());\n\t\t\t\t\t\tMyThreadSleep.sleep2s();\n\t\t\t\t\t\t//搜寻每个收藏夹的答案(路径包括问题)\n\t\t\t\t\t\t//mywebspider1.getQuesionUrlWithoutAnswerUrlInSpecifiedPage(driver1);\n\t\t\t\t\t\tthis.getMyWebSpider1().getQuesionUrlWithAnswerUrlInSpecifiedPage(this.getWebDriver1());\n\t\t\t\t\t\tthis.getMyWebSpider1().getUrlToTurnToNextPageInInSpecifiedPage(this.getWebDriver1());\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t};\n\t\tnew Thread((Runnable)runnableProcessSpiderToCatchAnswer2).start();*/\n\t\t//\n\t\t//\n\t\t//\n\t\t//\n\t\tMyThreadSleep.sleep10s();\n\t\tMyThreadSleep.sleep10s();\n\t\tProcessSpider runnableProcessSpiderToCatchContent=new ProcessSpider(mywebspider1){\n\t\t\t@Override\n\t\t\tpublic void myprocess()\n\t\t\t{\n\t\t\t\tfor(;this.getMyWebSpider1().getUrlWarehouse1().sizeStrqueueAnswerUrlToRequest1()>=0;)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"sizeStrqueueAnswerUrlToRequest1 size!!!!!!!!!!!!!!!!:\"+this.getMyWebSpider1().getUrlWarehouse1().sizeStrqueueAnswerUrlToRequest1() );\n\t\t\t\t\tif(this.getMyWebSpider1().getUrlWarehouse1().sizeStrqueueAnswerUrlToRequest1()<=0)\n\t\t\t\t\t{\n\t\t\t\t\t\tMyThreadSleep.sleep5s();\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tthis.getWebDriver1().navigate().to(this.getMyWebSpider1().getUrlWarehouse1().pollStrqueueAnswerUrlToRequest1());\n\t\t\t\t\t//\n\t\t\t\t\tMyThreadSleep.sleep1s();\n\t\t\t\t\t//\n\t\t\t\t\tint scrollLength=0;\n\t\t\t\t\t//\n\t\t\t\t\tfor(int overI=0;overI<=100-1;overI++)\n\t\t\t\t\t{\n\t\t\t\t\t\tJavascriptExecutor jsDriverTemp = (JavascriptExecutor)this.getWebDriver1();\n\t\t\t\t\t\tscrollLength=scrollLength+200;\n\t\t\t\t\t\tString js=\"document.body.scrollTop =\"+scrollLength;\n\t\t\t\t\t\tjsDriverTemp.executeScript(js);\n\t\t\t\t\t\t//\n\t\t\t\t\t\tMyThreadSleep.sleep100ms();\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t\t//get pic url in specified page\n\t\t\t\t\tthis.getMyWebSpider1().getSpecifiedAnswerContent2(this.getWebDriver1());\n\t\t\t\t\t//\n\t\t\t\t\t//\n\n\t\t\t\t\t//\n\t\t\t\t\t//\n\t\t\t\t}\n\n\t\t\t}\n\t\t};\n\t\tnew Thread((Runnable)runnableProcessSpiderToCatchContent).start();\n\t}", "public static synchronized void sendUrlQueue(String url)\n {\n if(urlModel != null)\n {\n SwingUtilities.invokeLater(() ->\n {\n urlModel.addElement(url);\n });\n }\n }", "private void startCrawler()\n {\n String[] enteredKeywords = getKeywordsFromBar();\n \n if(spider.numSeeds() == 0)\n JOptionPane.showMessageDialog(null, \"Please add some seed URL's\");\n \n else if(spider.numWorkers() == 0)\n JOptionPane.showMessageDialog(null, \"Please add atleast one worker\");\n \n else if(enteredKeywords == null)\n JOptionPane.showMessageDialog(null, \"Please enter some keywords to search for\");\n \n else if(spider.getIndexer() == null)\n JOptionPane.showMessageDialog(null, \"No index found, please create or open one\");\n \n else\n {\n playButton.setEnabled(false);\n startCrawlerItem.setEnabled(false);\n stopButton.setEnabled(true);\n stopCrawlerItem.setEnabled(true);\n spider.initKeywords(enteredKeywords);\n \n if(!canResume) spider.crawl();\n else \n {\n spider.resumeCrawling();\n canResume = false;\n }\n }\n }", "public static void main(String[] args) throws Exception {\n\t\tString crawlStorageFolder = \"/data/crawl\";\r\n\t\tint numberOfCrawlers = 1;\r\n\t\t\r\n\t\tCrawlConfig config = new CrawlConfig();\r\n\t\tconfig.setCrawlStorageFolder(crawlStorageFolder);\r\n\t\tconfig.setMaxPagesToFetch(5000);\r\n\t\tconfig.setMaxDepthOfCrawling(5);\r\n\t\tconfig.setPolitenessDelay(500);\r\n\t\t\r\n\t\tconfig.setIncludeBinaryContentInCrawling(true);\r\n\t\t//config.setUserAgentString(userAgentString);\r\n\t\t\r\n\t\tPageFetcher pageFetcher = new PageFetcher(config);\r\n\t\tRobotstxtConfig robotstxtConfig = new RobotstxtConfig();\r\n\t\tRobotstxtServer robotstxtServer = new RobotstxtServer(robotstxtConfig,pageFetcher );\r\n\t\tCrawlController controller = new CrawlController(config,pageFetcher,robotstxtServer);\r\n\t\t\r\n\t\tcontroller.addSeed(\"http://www.marshall.usc.edu/\");\r\n\t\tcontroller.start(MyCrawler.class, numberOfCrawlers);\r\n\t\tSystem.out.println(\"All urls processed:\"+MyCrawler.URL_Count);\r\n\t\tSystem.out.println(\"All unique urls processed:\"+MyCrawler.hs.size());\r\n\t\tSystem.out.println(\"unique School urls processed:\"+MyCrawler.hs_uniqueSchool.size());\r\n\t\tSystem.out.println(\"unique USC urls processed:\"+MyCrawler.hs_uniqueUSC.size());\r\n\t\tSystem.out.println(\"other unique urls processed:\"+MyCrawler.hs_unique.size());\r\n\t\tSet set = MyCrawler.HM_Status.entrySet();\r\n\t Iterator i = set.iterator();\r\n\t while(i.hasNext()) {\r\n\t Map.Entry me = (Map.Entry)i.next();\r\n\t System.out.print(me.getKey() + \": \");\r\n\t System.out.println(me.getValue());\r\n\t }\r\n\t set=MyCrawler.HM_CT.entrySet();\r\n\t i = set.iterator();\r\n\t while(i.hasNext()) {\r\n\t Map.Entry me = (Map.Entry)i.next();\r\n\t System.out.print(me.getKey() + \": \");\r\n\t System.out.println(me.getValue());\r\n\t }\r\n\t System.out.println(\"F1:\"+MyCrawler.F1);\r\n\t System.out.println(\"F2:\"+MyCrawler.F2);\r\n\t System.out.println(\"F3:\"+MyCrawler.F3);\r\n\t System.out.println(\"F4:\"+MyCrawler.F4);\r\n\t \r\n\t System.out.println(\"Size < 1kb:\"+MyCrawler.size1);\r\n\t System.out.println(\"Size 1kb~10kb:\"+MyCrawler.size2);\r\n\t System.out.println(\"Size 10kb~100kb:\"+MyCrawler.size3);\r\n\t System.out.println(\"Size 100kb~1mb:\"+MyCrawler.size4);\r\n\t System.out.println(\"Size > 1mb:\"+MyCrawler.size5);\r\n\t \r\n\t}", "@Scheduled(fixedRate = checkRate - 1000) // Un minuto menos\n public void getUrls() {\n urlList = shortURLRepository.listAll();\n }", "public void crawl() {\n\t\tOOSpider.create(Site.me().setSleepTime(3000).setRetryTimes(3).setDomain(\"movie.douban.com\")//.setHttpProxy(httpProxy)\n .setUserAgent(\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.67 Safari/537.36\"),\n filmInfoDaoPipeline, DoubanFilm.class)\n .addUrl(\"https://movie.douban.com/top250\")//entry url\n .thread(1)\n .run();\n }", "WebCrawler addExtractor(Extractor extractor);", "public DealwithURL(BlockingQueue<Page> queue){\n\t\tthis.queue = queue;\n\t}", "public void enqueue(String url) {\n while(is_locked){\n try {\n // timer_counter = timer_counter + 1;\n // if (timer_counter == 20) {\n // is_locked = false;\n // }\n Thread.sleep(100);\n } catch(InterruptedException ex) {\n Thread.currentThread().interrupt();\n }\n }\n\n is_locked = true;\n queue.add(url);\n is_locked = false;\n \n }", "public void run() {\n long creationInterval = MILLISEC_PER_SEC / this.generationRate;\n\n int curIndex = 0;\n long startTime, endTime, diff, sleepTime, dur = this.test_duration;\n\n do {\n // startTime = System.nanoTime();\n startTime = System.currentTimeMillis();\n\n Request r = new DataKeeperRequest((HttpClient) this.clients[curIndex], this.appserverID, this.url);\n curIndex = (curIndex + 1) % clientsPerNode;\n this.requests.add(r);\n\n try {\n r.setEnterQueueTime();\n this.requestQueue.put(r);\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n\n // endTime = System.nanoTime();\n endTime = System.currentTimeMillis();\n diff = endTime - startTime;\n dur -= diff;\n sleepTime = creationInterval - diff;\n if (sleepTime < 0) {\n continue;\n }\n\n try {\n // Thread.sleep(NANO_PER_MILLISEC / sleepTime, (int) (NANO_PER_MILLISEC % sleepTime));\n Thread.sleep(sleepTime);\n } catch (InterruptedException e) {\n throw new RuntimeException(e);\n }\n\n dur -= sleepTime;\n } while (dur > 0);\n\n try {\n this.requestQueue.put(new ExitRequest());\n this.requestQueueHandler.join();\n } catch (InterruptedException e) {\n throw new RuntimeException(e);\n }\n }", "public Indexer crawl() \n\t{\n\t\t// This redirection may effect performance, but its OK !!\n\t\tSystem.out.println(\"Crawling: \"+u.toString());\n\t\treturn crawl(crawlLimitDefault);\n\t}", "public void indexing(String seedPage) {\n webCrawler wbc = new webCrawler();\n webPage wbp = new webPage();\n urlList = wbc.crawl(seedPage);\n for(int i = 0; i < urlList.size(); i++) {\n String url = urlList.get(i);\n try {\n Document doc = wbp.getContent(url);\n finalWords = wbp.getAllWords(url);\n } catch(Exception e) {\n e.printStackTrace();\n }\n }\n }", "public void beginCrawling() {\n\n if (urlsFile != null\n && emailsFile != null\n && urlsWriter != null\n && emailsWriter != null) {\n crawl(startUrl);\n }\n }", "public void run()\n\t\t{\n\t\t\tint num = 0;\n\t\t\ttry{\n\t\t\t\tlog.debug(\"Dealing with: \" + url.toString() + \" From : \" + urlp);\n\t\t\t\t\n\t\t\t\tSocket socket = new Socket(url.getHost(), PORT);\n\t\t\t\tPrintWriter writer = new PrintWriter(socket.getOutputStream());\n\t\t\t\tBufferedReader reader = \n\t\t\t\t\tnew BufferedReader(new InputStreamReader(socket.getInputStream()));\n\t\t\t\tString request = \"GET \" + url.getPath() + \" HTTP/1.1\\n\" +\n\t\t\t\t\t\t\t\t\"Host: \" + url.getHost() + \"\\n\" +\n\t\t\t\t\t\t\t\t\"Connection: close\\n\" + \n\t\t\t\t\t\t\t\t\"\\r\\n\";\n\t\t\t\twriter.println(request);\n\t\t\t\twriter.flush();\n\t\t\n\t\t\t\tString line = reader.readLine();\n\t\t\t\t// filter the head message of the response\n\t\t\t\twhile(line != null && line.length() != 0)\n\t\t\t\t{\n\t\t\t\t\tline = reader.readLine();\n\t\t\t\t}\n\t\t\t\t// keep the html context\n\t\t\t\twhile (line != null) \n\t\t\t\t{\n\t\t\t\t\tcontext += line + \"\\n\";\n\t\t\t\t\tline = reader.readLine();\n\t\t\t\t}\n\t\t\t\treader.close();\n\t\t\t\twriter.close();\n\t\t\t\tsocket.close();\n\t\t\t\t//log.debug(context);\n\t\t\t\tstripper = new TagStripper(context);\n\t\t\t\tlog.debug(\"Removing script and style from: \" + url.toString());\n\t\t\t\tstripper.removeComments();\n\t\t\t\tstripper.removeScript();\n\t\t\t\tstripper.removeStyle();\n\t\t\t\tlog.debug(\"Getting links from: \" + url.toString());\n\t\t\t\tArrayList<String> link = new ArrayList<String>();\n\t\t\t\tstripper.buildLinks(url.toString());\n\t\t\t\t\n\t\t\t\tlink = stripper.getLinks();\n\t\t\t\tfor(String tmp : link) {\n\t\t\t\t\tif(getCount() < pageNum ) {\n\t\t\t\t\t\t// find if the link has been already visited\n\t\t\t\t\t\tif(!urlList.contains(tmp)) {\n\t\t\t\t\t\t\tworkers.execute(new SingleHTMLFetcher(new URL(tmp), this.url.toString()));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tString title = stripper.getTitle();\n\t\t\t\tif(title == null)\n\t\t\t\t\ttitle = \"NO title\";\n\t\t\t\ttitle = title.replaceAll(\"&[^;]*;\", \"\");\n\t\t\t\tlog.debug(\"Removing tags from: \" + url.toString());\n\t\t\t\tstripper.removeTags();\n\t\t\t\tstripper.removeSymbol();\n\t\t\t\tString snippet = stripper.getSnippet(title);\n\t\t\t\tdb.savePageInfo(connection, title, snippet, url.toString());\n\t\t\t\tcontext = stripper.getContext();\n\t\t\t\tString[] words = context.toLowerCase().split(\"\\\\s\");\n\t\t\t\tArrayList<String> wordsList = new ArrayList<String>();\n\t\t\t\tfor (int i = 0; i < words.length; i++) {\n\t\t\t\t\t// delete non-word character\n\t\t\t\t\twords[i] = words[i].replaceAll(\"\\\\W\", \"\").replace(\"_\",\n\t\t\t\t\t\t\t\"\");\n\t\t\t\t\tif(words[i].length() != 0)\n\t\t\t\t\t\twordsList.add(words[i]);\n\t\t\t\t}\n\t\t\t\tfor (String w : wordsList) {\n\t\t\t\t\tif (w.length() != 0) {\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tindex.addNum(w, url.toString(), num);\n\t\t\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\tnum++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tlog.debug(\"URL: \" + url.toString() + \" is finished!\");\n\t\t\t\tdecrementPending();\n\t\t\t}catch(Exception ex) {\n\t\t\t\tex.printStackTrace();\n\t\t\t}\n\t\t}", "public synchronized static void toCrawlList_add(ArrayList<String> _toCrawlList,String url)\n\t{\n\n\t\tif(!(arrayList_contain(_toCrawlList,url)) && _toCrawlList.size() < ARRAYLIST_SIZE)\n\t\t\t_toCrawlList.add(url);\n\t}", "public CrawlerResult crawl(URL url){\n //Creating the crawler result\n CrawlerResult rslt = new CrawlerResult(url);\n logger.info(url +\" started crawling....\");\n try{\n //Get the Document from the URL\n Document doc = Jsoup.connect(url.toString()).get();\n\n rslt.setTitle(doc.title());\n\n //links on the page\n Elements links = doc.select(\"a\");\n\n //Links on the page\n for(Element link : links){\n rslt.addLinksOnPage(new URL(link.attr(\"abs:href\")));\n }\n }catch(Exception e){\n //TODO\n }\n logger.info(url +\" finished crawled.\");\n return rslt;\n }", "public WebCrawler(final URL startURL) {\n this.baseUrl = startURL.toString();\n this.links = new HashSet<>();\n this.startTime = System.currentTimeMillis();\n depth = 0;\n pagesVisited = 0;\n crawl(initURLS(startURL));\n try {\n goThroughLinks();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void addURLSeries(List urls) {\n/* 143 */ List listToAdd = null;\n/* 144 */ if (urls != null) {\n/* 145 */ listToAdd = new ArrayList(urls);\n/* */ }\n/* 147 */ this.urlSeries.add(listToAdd);\n/* */ }", "public String crawl() throws IOException {\n // FILL THIS IN!\n if(queue.isEmpty()){\n \treturn null;\n }\n String url = queue.remove();\n \tSystem.out.println(\"crawling \"+url);\n Elements paragraphs;\n \tif(index.isIndexed(url))\n \t{\n \t\tSystem.out.println(url+\" is already indexed\");\n \t\treturn null;\n \t}\n \tparagraphs = wf.fetchWikipedia(url);\n index.indexPage(url,paragraphs);\n queueInternalLinks(paragraphs);\t \n\t\treturn url;\n\t}", "@Override\r\n\tpublic void run()\r\n\t{\r\n\t\twhile(true)\r\n\t\t{\r\n\t\t\t//System.out.println(\"beginning of Parser code\");\r\n\t\t\t\r\n\t\t\t//pull a page from the page que\r\n\t\t\ttry \r\n\t\t\t{\r\n\t\t\t\tpageText = SharedPage.getNextPage();\r\n\t\t\t\t//System.out.println(\"Parser Page Pulled\");\r\n\t\t\t} \r\n\t\t\tcatch (InterruptedException e) \r\n\t\t\t{\r\n\t\t\t\t//do nothing\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//search the page for all links in anchor (<a href=\"\") elements\r\n\t\t\t\r\n\t\t\t//Regex\r\n\t\t\t//loop will execute for each link found\r\n\t\t\tPattern pattern = Pattern.compile(\"href=\\\"(http:.*?)\\\"\");\r\n\t\t\tMatcher matcher = null;\r\n\t\t\t\r\n\t\t\t//Some pages are returning null values\r\n\t\t\tif(pageText != null)\r\n\t\t\t{\r\n\t\t\t\tmatcher = pattern.matcher(pageText);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//add each link found to the link queue\r\n\t\t\t\r\n\t\t\t//sometimes matcher is returning null values\r\n\t\t\twhile(matcher != null && matcher.find())\r\n\t\t\t{\r\n\t\t\t\tString link = matcher.group(1);\r\n\t\t\t\r\n\t\t\t\ttry \r\n\t\t\t\t{\r\n\t\t\t\t\tSharedLink.addLink(link);\r\n\t\t\t\t} \r\n\t\t\t\tcatch (InterruptedException e) \r\n\t\t\t\t{\r\n\t\t\t\t\t//do nothing\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//search the page for keywords specified by the user of the webcrawler\r\n\t\t\tArrayList<String> keywords = WebCrawlerConsole.getKeywords();\r\n\t\t\t\r\n\t\t\t\tfor(String word : keywords)\r\n\t\t\t\t{\r\n\t\t\t\t\t//cannot split pageText if it is null\r\n\t\t\t\t\tif(pageText != null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tString[] keywordSearch = pageText.split(word);\r\n\t\t\t\t\t\tfor(int i=0; i < keywordSearch.length; i++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tWebCrawlerConsole.keywordHit();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t//System.out.println(\"end of Parser code\");\r\n\t\t}\r\n\t}", "public CoverFlow(final List<String> urls) {\r\n\t\tregisterRpc(this.rpc);\r\n\r\n\t\tsetUrlList(urls);\r\n\t}", "private void startBackgroundWorker() {\n\t\tworker.execute(new Runnable() {\n\t\t\tpublic void run() {\n\t\t\t\twhile (true) {\n\t\t\t\t\tif (!buildList.isEmpty()) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tTestsResultQueueEntry testsResultQueueEntry = buildList.get(0);\n\t\t\t\t\t\t\tTestsResult testsResult = pluginServices.getTestsResult(testsResultQueueEntry.jobId, testsResultQueueEntry.buildId);\n\t\t\t\t\t\t\tOctaneResponse response = pushTestsResult(testsResult);\n\t\t\t\t\t\t\tif (response.getStatus() == HttpStatus.SC_ACCEPTED) {\n\t\t\t\t\t\t\t\tlogger.info(\"tests result push SUCCEED\");\n\t\t\t\t\t\t\t\tbuildList.remove(0);\n\t\t\t\t\t\t\t} else if (response.getStatus() == HttpStatus.SC_SERVICE_UNAVAILABLE) {\n\t\t\t\t\t\t\t\tlogger.info(\"tests result push FAILED, service unavailable; retrying after a breathe...\");\n\t\t\t\t\t\t\t\tbreathe(SERVICE_UNAVAILABLE_BREATHE_INTERVAL);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// case of any other fatal error\n\t\t\t\t\t\t\t\tlogger.error(\"tests result push FAILED, status \" + response.getStatus() + \"; dropping this item from the queue\");\n\t\t\t\t\t\t\t\tbuildList.remove(0);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\tlogger.error(\"tests result push failed; will retry after \" + SERVICE_UNAVAILABLE_BREATHE_INTERVAL + \"ms\", e);\n\t\t\t\t\t\t\tbreathe(SERVICE_UNAVAILABLE_BREATHE_INTERVAL);\n\t\t\t\t\t\t} catch (Throwable t) {\n\t\t\t\t\t\t\tlogger.error(\"tests result push failed; dropping this item from the queue \", t);\n\t\t\t\t\t\t\tbuildList.remove(0);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbreathe(LIST_EMPTY_INTERVAL);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "public interface Crawler {\n int size();\n boolean visited(String link);\n void addNewLinkToSitemap(String link);\n void addToChildSitemap(String parent, String child);\n void addVisited(String s, Integer depth);\n void startCrawling(String requestid, String link, int maxDepth);\n ForkJoinPool getMainPool();\n Map<String, Collection<String>> getSiteMap();\n}", "public static void main(String[] args) {\n\t\t\n\t\t/*MultiThreadedCrawler crawler = new MultiThreadedCrawler(\"https://cs.uic.edu\", \"uic.edu\", \"main\");\n\t\tcrawler.start();\n\t\tList<Map> p = new ArrayList<>();\n\t\tp.add(crawler.getResults());\n\t\t\n\t\ttry {\n\t\t\tGlobals.urlSet.add(new URL(\"https://disabilityresources.uic.edu\"));\n\t\t\tGlobals.urlSet.add(new URL(\"http://disabilityresources.uic.edu\"));\n\t\t\tGlobals.urlSet.add(new URL(\"http://cmhsrp.uic.edu/nrtc\")); \n\n\t\t} catch (MalformedURLException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\t\n\t\t\n\t\tMultiThreadedCrawler c1 = new MultiThreadedCrawler(\"\", \"uic.edu\", \"c1\");\n\t\tMultiThreadedCrawler c2 = new MultiThreadedCrawler(\"\", \"uic.edu\", \"c2\");\n\t\tMultiThreadedCrawler c3 = new MultiThreadedCrawler(\"\", \"uic.edu\", \"c3\");\n\t\tMultiThreadedCrawler c4 = new MultiThreadedCrawler(\"\", \"uic.edu\", \"c4\");\n\t\tMultiThreadedCrawler c5 = new MultiThreadedCrawler(\"\", \"uic.edu\", \"c5\");\n\t\tMultiThreadedCrawler c6 = new MultiThreadedCrawler(\"\", \"uic.edu\", \"c6\");\n\t\t//MultiThreadedCrawler c7 = new MultiThreadedCrawler(\"https://housing.uic.edu\", \"uic.edu\", \"housing\");\n\t\t//MultiThreadedCrawler c8 = new MultiThreadedCrawler(\"https://grad.uic.edu\", \"uic.edu\", \"grad\");\n\t\t//MultiThreadedCrawler c9 = new MultiThreadedCrawler(\"https://today.uic.edu\", \"uic.edu\", \"today\");\n\t\t\n\t\t\n\t\t\n\t\tList<Thread> crawlers = new ArrayList<>();\n\t\tcrawlers.add(new Thread(c1, \"c1\"));\n\t\tcrawlers.add(new Thread(c2, \"c2\"));\n\t\tcrawlers.add(new Thread(c3, \"c3\"));\n\t\tcrawlers.add(new Thread(c4, \"c4\"));\n\t\tcrawlers.add(new Thread(c5, \"c5\"));\n\t\tcrawlers.add(new Thread(c6, \"c6\"));\n\t\tcrawlers.add(new Thread(c7, \"housing\"));\n\t\tcrawlers.add(new Thread(c8, \"grad\"));\n\t\tcrawlers.add(new Thread(c9, \"today\"));\n\t\t\n\t\t\n\t\tfor(Thread t: crawlers) {\n\t\t\tt.start();\n\t\t}\n\t\t\n\t\tfor(Thread t: crawlers) {\n\t\t\ttry {\n\t\t\t\tt.join();\n\t\t\t}catch(InterruptedException e) {\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tp.add(c1.getResults());\n\t\tp.add(c2.getResults());\n\t\tp.add(c3.getResults());\n\t\tp.add(c4.getResults());\n\t\tp.add(c5.getResults());\n\t\tp.add(c6.getResults());\n\t\t//p.add(c7.getResults());\n\t\t//p.add(c8.getResults());\n\t\t//p.add(c9.getResults());\n\t\t\n\t\t\n\t\twhile(true) {\n\t\t\tfor(Map m: p) {\n\t\t\t\tif(m == null)\n\t\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tSystem.out.println(\"All done\");\n\t\tmergeResults(p);\n\t\tUtil.updateDocVectLenMap();\n\t\tSystem.out.println(\"Total in collection: \" + Globals.pageDataMap.size());\n\t\tUtil.writeInvertedIndexTfMapAndMaxFreqMapToFile();*/\n\t\t\n\t\t\n\t\tUtil.loadDataFromFile();\n\t\tUtil.updateDocVectLenMap();\n\t\tSpringApplication.run(SearchApplication.class, args);\n\t}", "public static void main(String args[]) {\n if (args.length < 3 || args.length > 5) {\n System.out.println(\"Usage: Crawler {start URL} {database environment path} {max doc size in MB} {number of files to index}\");\n System.exit(1);\n }\n\n System.out.println(\"Crawler starting\");\n String startUrl = args[0];\n String envPath = args[1];\n Integer size = Integer.valueOf(args[2]);\n Integer count = args.length == 4 ? Integer.valueOf(args[3]) : 100;\n\n StorageInterface db = StorageFactory.getDatabaseInstance(envPath);\n\n Crawler crawler = new Crawler(startUrl, db, size, count);\n\n System.out.println(\"Starting crawl of \" + count + \" documents, starting at \" + startUrl);\n crawler.start();\n\n while (!crawler.isDone())\n try {\n Thread.sleep(10);\n } catch (InterruptedException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n\n // TODO: final shutdown\n\n System.out.println(\"Done crawling!\");\n }", "public void Crawl(String startUrl) {\n HashSet crawledList = new HashSet();\n LinkedHashSet toCrawlList = new LinkedHashSet();\n // Add start URL to the To Crawl list.\n toCrawlList.add(startUrl);\n\n // Get URL at bottom of the list.\n String url = (String) toCrawlList.iterator().next();\n // Remove URL from the To Crawl list.\n toCrawlList.remove(url);\n // Convert string url to URL object.\n URL verifiedUrl = verifyUrl(url);\n\n // Add page to the crawled list.\n crawledList.add(url);\n // Download the page at the given URL.\n String pageContents = downloadPage(verifiedUrl);\n\n if (pageContents != null && pageContents.length() > 0) {\n // Retrieve list of valid links from page.\n ArrayList links = retrieveLinks(verifiedUrl, pageContents, crawledList);\n // Add links to the To Crawl list.\n toCrawlList.addAll(links);\n\n }\n\n System.out.println(pageContents);\n\n }", "private void addUrl(int urlID)\n\t{\n\t\tfor(int i=0;i<urlIDs.size();i++)\n\t\t{\n\t\t\tif(urlIDs.get(i)==urlID)\n\t\t\t{\n\t\t\t\tisUrlIDAssociatedWithSetInDatabase.set(i, false);//this will need to be updated\n\t\t\t\tthis.urlCount.set(i, urlCount.get(i)+1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tisUrlIDAssociatedWithSetInDatabase.add(false);\n\t\turlIDs.add(urlID);\n\t\tthis.urlCount.add(1);\n\t}", "public static void main(String[] args) {\n final String filename = \"data/hungryGoWhereV2.csv\";\n try (final BusinessStorage storage = new BusinessStorage(filename)) {\n\n storage.append(Business.getHeader());\n\n final Session session = Session.builder()\n .put(STORAGE_KEY, storage)\n .build();\n\n try (final Crawler crawler = crawler(fetcher(), session).start()) {\n LOGGER.info(\"starting crawler...\");\n\n\n String csvFile = \"data/hungryGoWhere.csv\";\n String line = \"\";\n String cvsSplitBy = \",\";\n int counter = 2;\n ListingHandler handler = new ListingHandler();\n\n try (BufferedReader br = new BufferedReader(new FileReader(csvFile))) {\n int otherCounter = 1;\n while ((line = br.readLine()) != null) {\n String[] information = line.split(cvsSplitBy);\n\n if(counter == otherCounter){\n final String nextPageUrl = information[0];\n crawler.getScheduler().add(new VRequest(nextPageUrl), handler);\n// System.out.println(information[0] + \" \" + counter);\n counter ++;\n }\n otherCounter ++;\n }\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n// final String startUrl = \"https://www.hungrygowhere.com/singapore/cafe_2000/\";\n// crawler.getScheduler().add(new VRequest(startUrl), new ListingHandler());\n } catch (Exception e) {\n LOGGER.error(\"Could not run crawler: \", e);\n }\n\n } catch (IOException e) {\n LOGGER.error(\"unable to open file: {}, {}\", filename, e);\n }\n }", "public void start(){\n log.info(\"PageDownloaderPool started.\");\n downloaders.forEach(PageDownloader::start);\n }", "public WebCrawler(MultithreadedInvertedIndex index, int limit) {\n\t\tthis.index = index;\n\t\tthis.limit = limit;\n\t\tthis.queue = new WorkQueue(limit);\n\t\tthis.urls = new ArrayList<URL>();\n\t}", "protected abstract void startPing(Set<String> urls);", "@SuppressWarnings(\"unchecked\")\n\tpublic Indexer crawl (int limit) \n\t{\n\t\n\t\t////////////////////////////////////////////////////////////////////\n\t // Write your Code here as part of Priority Based Spider assignment\n\t // \n\t ///////////////////////////////////////////////////////////////////\n\t\tPQueue q=new PQueue();\n \t\n\t\ttry\n \t{\n\t\t\t final String authUser = \"iiit-63\";\n\t\t\t\tfinal String authPassword = \"MSIT123\";\n\n\t\t\t\tSystem.setProperty(\"http.proxyHost\", \"proxy.iiit.ac.in\");\n\t\t\t\tSystem.setProperty(\"http.proxyPort\", \"8080\");\n\t\t\t\tSystem.setProperty(\"http.proxyUser\", authUser);\n\t\t\t\tSystem.setProperty(\"http.proxyPassword\", authPassword);\n\n\t\t\t\tAuthenticator.setDefault(\n\t\t\t\t new Authenticator() \n\t\t\t\t {\n\t\t\t\t public PasswordAuthentication getPasswordAuthentication()\n\t\t\t\t {\n\t\t\t\t return new PasswordAuthentication(authUser, authPassword.toCharArray());\n\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t);\n\n\t\t\t\tSystem.setProperty(\"http.proxyUser\", authUser);\n\t\t\t\tSystem.setProperty(\"http.proxyPassword\", authPassword);\n \t\tURLTextReader in = new URLTextReader(u);\n \t\t// Parse the page into its elements\n \t\tPageLexer elts = new PageLexer(in, u);\t\t\n \t\tint count1=0;\n \t\t// Print out the tokens\n \t\tint count = 0;\n \t\t\n \t\twhile (elts.hasNext()) \n \t\t{\n \t\t\tcount++;\n \t\t\tPageElementInterface elt = (PageElementInterface)elts.next();\t\t\t \n \t\t\tif (elt instanceof PageHref)\n \t\t\tif(count1<limit)\n \t\t\t{\n \t\t\t\tif(q.isempty())\n \t\t\t\t{\n \t\t\t\t\tq.enqueue(elt.toString(),count);\n\t\t\t\t\t}\n \t\t\t\telse\n \t\t\t\t{\n \t\t\t\t\tif(q.search(elt.toString(),count))\n \t\t\t\t\t{\n \t\t\t\t\t\tq.enqueue(elt.toString(),count);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\tcount1++;\n \t\t\t\tSystem.out.println(\"link: \"+elt);\n \t\t\t\t\n \t\t\t}\n \t\t}\n \t\tSystem.out.println(\"links retrieved: \"+count1);\n \t\tq.display();\n \t\twhile(limit !=0)\n \t\t{\n \t\t\tObject elt=q.dequeue();\n \t\t\tURL u1=new URL(elt.toString());\n \t\t\tURLTextReader in1= new URLTextReader(u1);\n \t\t\t// Parse the page into its elements\n \t\t\tPageLexer elt1 = new PageLexer(in1, u1);\n \t\t\twhile (elt1.hasNext()) \n \t\t\t{\n \t\t\t\tPageElementInterface elts2= (PageElementInterface)elt1.next();\n \t\t\t\tif (elts2 instanceof PageWord)\n \t\t\t\t{\n \t\t\t\t\tv.add(elts2);\n \t\t\t\t}\n \t\t\t\tSystem.out.println(\"words:\"+elts2);\n \t\t\t} \t\t\t\n\t\t\t\tObjectIterator OI=new ObjectIterator(v);\n\t\t\t\ti.addPage(u1,OI);\n\t\t\t\tfor(int j=0;j<v.size();j++);\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"hello\"+v.get(count));\n\t\t\t\t}\n\t\t\t\tlimit--;\n \t\t}\n \t\t\n \t}\n \tcatch (Exception e)\n \t{\n \t\tSystem.out.println(\"Bad file or URL specification\");\n \t}\n return i;\n\t}", "public void process(CrawlTask crawlTask) {\n\n if (level == 0) {\n try {\n String boardLink = crawlTask.getUrl();\n MongoDatabase db = crawlTask.getDb();\n MongoCollection threadsCollection = db.getCollection(\"threads\");\n ForumConfig forumConfig = crawlTask.getForumConfig();\n\n List<ForumThread> threadList = new ArrayList<>();\n processBoard(forumConfig, boardLink, threadList, threadsCollection);\n System.out.println(\"***********************************************************TOTAL THREADS TO CRAWL IS: \" + threadList.size());\n for (ForumThread thread :\n threadList) {\n try {\n String link = thread.getThreadUrl();\n CrawlTask newTask = new CrawlTask(link, db, forumConfig);\n queue.push(newTask, level + 1);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n } catch (Exception e) {\n e.printStackTrace();\n // process of this object has failed, but we just ignore it here\n }\n } else if (level == 1) {\n try {\n String threadLink = crawlTask.getUrl();\n MongoDatabase db = crawlTask.getDb();\n ForumConfig forumConfig = crawlTask.getForumConfig();\n\n\t\t\t\t/*List<ForumPost> postList = new ArrayList<>();*/\n processThread(forumConfig, threadLink, db);\n\n } catch (Exception e) {\n e.printStackTrace();\n // process of this object has failed, but we just ignore it here\n }\n }\n\n\n }", "private void searchNext(CrawlingSession executor, Link link) {\n HTMLLinkExtractor htmlLinkExtractor = HTMLLinkExtractor.getInstance();\n// htmlLinkExtractor.setWorking(link);\n \n Source source = CrawlingSources.getInstance().getSource(link.getSourceFullName());\n if(source == null) return;\n \n SessionStore store = SessionStores.getStore(source.getCodeName());\n if(store == null) return;\n\n List<Link> collection = htmlLinkExtractor.getLinks(link, /*link.getSource(),*/ pagePaths);\n// List<Link> collection = htmlLinkExtractor.getLinks(srResource);\n List<Link> nextLinks = createNextLink(link, collection);\n if(nextLinks.size() < 1) return;\n if(userPaths == null && contentPaths == null) {\n executor.addElement(nextLinks, link.getSourceFullName());\n return;\n }\n \n \n if(nextLinks.size() < 2) {\n executor.addElement(nextLinks, link.getSourceFullName());\n }\n \n// long start = System.currentTimeMillis();\n \n int [] posts = new int[nextLinks.size()];\n for(int i = 0; i < nextLinks.size(); i++) {\n try {\n posts[i] = PageDownloadedTracker.searchCode(nextLinks.get(i), true);\n } catch (Throwable e) {\n posts[i] = -1;\n LogService.getInstance().setThrowable(link.getSourceFullName(), e);\n// executor.abortSession();\n// return;\n }\n }\n \n int max = 1;\n for(int i = 0; i < posts.length; i++) {\n if(posts[i] > max) max = posts[i];\n }\n \n// System.out.println(\" thay max post la \"+ max);\n \n List<Link> updateLinks = new ArrayList<Link>();\n for(int i = 0; i < posts.length; i++) {\n if(posts[i] >= max) continue;\n updateLinks.add(nextLinks.get(i));\n }\n \n// long end = System.currentTimeMillis();\n// System.out.println(\"step. 4 \"+ link.getUrl()+ \" xu ly cai ni mat \" + (end - start));\n \n executor.addElement(updateLinks, link.getSourceFullName());\n \n /*int minPost = -1;\n Link minLink = null;\n List<Link> updateLinks = new ArrayList<Link>();\n for(int i = 0; i < nextLinks.size(); i++) {\n Link ele = nextLinks.get(i);\n int post = 0;\n try {\n post = PostForumTrackerService2.getInstance().read(ele.getAddressCode());\n } catch (Exception e) {\n LogService.getInstance().setThrowable(link.getSource(), e);\n }\n if(post < 1) {\n updateLinks.add(ele);\n continue;\n } \n\n if(minPost < 0 || post < minPost){\n minLink = ele;\n minPost = post; \n } \n }\n\n if(minLink != null) updateLinks.add(minLink);\n executor.addElement(updateLinks, link.getSource());*/\n }", "public interface Crawler {\n\t/**\n\t * Gets the location where crawled content is saved.\n\t * \n\t * @return location string of crawled content\n\t */\n\tpublic String getDumpLocation();\n\n\t/**\n\t * Starts the crawling from the root source of target.\n\t * \n\t * @throws IOException\n\t */\n\tpublic void disperse() throws IOException;\n\n\t/**\n\t * Crawls every <code>url</code> within the <code>target</code> url\n\t * \n\t * @param url\n\t * url which is either <code>target</code> or the one nested\n\t * inside\n\t * @param target\n\t * the target url declared to crawl\n\t * @throws IOException\n\t */\n\tpublic void crawl(final String url, final String target) throws IOException;\n\n\t/**\n\t * Picks up data from webpage.\n\t * \n\t * @param doc\n\t * <code>Document</code> retrieved from <code>url</code>\n\t * @param url\n\t * @return list of <code>Nugget</code> objects consisting of relevant data\n\t */\n\tpublic List<Nugget> scavenge(final Document doc, final String url);\n\n}", "private void hitURL(String URL){\n Log.v(\".hitURL\", \" now crawling at: \" + URL);\n String refinedURL = NetworkUtils.makeURL(URL).toString();\n visitedLinks.add(refinedURL);\n browser.loadUrl(refinedURL);\n\n\n // OR, you can also load from an HTML string:\n// String summary = \"<html><body>You scored <b>192</b> points.</body></html>\";\n// webview.loadData(summary, \"text/html\", null);\n // ... although note that there are restrictions on what this HTML can do.\n // See the JavaDocs for loadData() and loadDataWithBaseURL() for more info.\n }", "private String nextURL() {\n\n\t\tString url;\n\t\t// Search the next url until the unique url is found\n\t\tdo {\n\t\t\turl = this.pagesToVisit.remove(0);\n\t\t} while (this.pagesVisited.contains(url));\n\t\tthis.pagesVisited.add(url);\n\t\treturn url;\n\n\t}", "public List<URL> newURLs() {\r\n // TODO: Implement this!\r\n return new LinkedList<URL>();\r\n }", "@Override\n\tpublic void process(Page page) {\n\t\tDocument doc = Jsoup.parse(page.getHtml().getFirstSourceText());\n\n\t\tif (isFirst) {\n\t\t\tSystem.out.println(\"添加所有列表链接\");\n\t\t\tArrayList<String> urls = new ArrayList<String>();\n\t\t\t// 33\n\t\t\tfor (int i = 2; i < 30; i++) {\n\t\t\t\turls.add(\"http://zyjy.jiangmen.gov.cn//szqjszbgg/index_\" + i + \".htm\");\n\t\t\t}\n\t\t\tpage.addTargetRequests(urls);\n\t\t\tSystem.out.println(\"这一页一共有 \" + urls.size() + \" 条数据\");\n\n\t\t\tisFirst = false;\n\t\t}\n\n\t\tif (page.getUrl().regex(URL_LIST).match() || page.getUrl().toString().trim().equals(url)) {\n\t\t\tSystem.out.println(\"获取列表数据\");\n\n\t\t\tElements uls = doc.getElementsByAttributeValue(\"class\", \"c1-bline\");\n\t\t\tfor (Element ul : uls) {\n\t\t\t\tString url = ul.getElementsByAttributeValue(\"class\", \"f-left\").get(0).select(\"a\").attr(\"href\").trim();\n\t\t\t\tString title = ul.getElementsByAttributeValue(\"class\", \"f-left\").get(0).text();\n\t\t\t\tString data = ul.getElementsByAttributeValue(\"class\", \"f-right\").get(0).text();\n\t\t\t\tCacheHashMap.cache.put(url, title + \"###\" + data);\n\t\t\t\tMyUtils.addRequestToPage(page, url);\n\t\t\t\tSystem.out.println(url + \" \" + CacheHashMap.cache.get(url));\n\t\t\t}\n\n\t\t}\n\t\tif (page.getUrl().regex(URL_DETAILS).match()) {\n\n\t\t\tProject project = new Project();\n\t\t\tStringBuffer project_article = new StringBuffer();\n\n\t\t\tString urldetails = CacheHashMap.cache.get(page.getUrl().toString().trim());\n\t\t\tSystem.out.println(\"url\" + page.getUrl().toString().trim());\n\t\t\tSystem.out.println(\"urldetails \" + urldetails);\n\n\t\t\tString[] value = urldetails.split(\"###\");\n\t\t\tif (value != null && value.length > 1) {\n\t\t\t\tproject.setProjectName(value[0]);\n\t\t\t\tproject.setPublicStart(value[1]);\n\t\t\t}\n\n\t\t\tElements divs = doc.getElementsByAttributeValue(\"class\", \"contlist minheight\");\n\t\t\tfor (Element div : divs.get(0).children()) {\n\t\t\t\tif (div.nodeName().equals(\"table\")) {\n\t\t\t\t\tElements trs = divs.select(\"tbody\").select(\"tr\");\n\t\t\t\t\tfor (Element tr : trs) {\n\t\t\t\t\t\tproject_article.append(tr.text()).append(\"\\n\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tproject_article.append(div.text()).append(\"\\n\");\n\n\t\t\t\t}\n\t\t\t}\n\t\t\tproject.setUrl(page.getUrl().toString().trim());\n\t\t\tproject.setState(0);\n\t\t\tproject.setWebsiteType(\"江门市\");\n\t\t\tproject.setTime(MyUtils.getcurentTime());\n\t\t\tproject.setRawHtml(divs.toString());\n\n\t\t\tproject.setArticle(project_article.toString());\n\t\t\tSystem.out.println(project);\n\n\t\t\tHibernateUtil.save2Hibernate(project);\n\n\t\t}\n\n\t}", "static public ImageDownloadTask startDownload(String url) throws MalformedURLException {\n\n // Gets a task from the pool or if none available create a new task\n ImageDownloadTask downloadTask = sInstance.imageDownloadTaskWorkQueue.poll();\n if (null == downloadTask) {\n downloadTask = new ImageDownloadTask();\n }\n\n downloadTask.setStringUrl(url);\n\n // Set the task to run in the next available thread queue.\n sInstance.mDownloadThreadPool.execute(downloadTask.getDownloadRunnable());\n\n return downloadTask;\n }", "WebCrawlerData retrieve(String url);", "public void addTracksToQueue() {\n for(String uri : getMoreTracks())\n player.queue(uri);\n }", "public void crawl(final String url, final String target) throws IOException;", "@Override\n\tpublic void run() {\t\n\t\tint maxNum = (maxCustomerNumOnline > maxCustomerNumShop) ? maxCustomerNumOnline : maxCustomerNumShop;\n\t\t\n\t\tfor(int i = 0; i < maxNum; i++) {\n\t\t\t// every number of milliseconds, add customer to end of queue \n\t\t\ttry {\t\t\t\n\t\t\t\t// if online queue exists add to it \n\t\t\t\tif (i < maxCustomerNumOnline) {\n\t\t\t\t\tCustomerQueueOutput out = onlineQueue.addToQueue();\n\t\t\t\t\tCoffeeShop.customerList.put(out.getCustomer().getId(), out.getCustomer());\n\t\t\t\t\t\n\t\t\t\t\tlog.updateLog(\"[QueueHandler]: \"+ \"Queue Handler added customer \" + out.getCustomer().getName() + \n\t\t\t\t\t\t\t\" (ID: \" + out.getCustomer().getId() + \") to online queue -> updated size: \" \n\t\t\t\t\t\t\t+ out.getUpdatedSize());\n\t\t\t\t}\n\n\t\t\t\tif (i < maxCustomerNumShop) {\n\t\t\t\t\t// add to in-shop queue \n\t\t\t\t\tCustomerQueueOutput out = shopQueue.addToQueue();\n\t\t\t\t\tCoffeeShop.customerList.put(out.getCustomer().getId(), out.getCustomer());\n\t\t\t\t\t\n\t\t\t\t\tlog.updateLog(\"[QueueHandler]: \"+ \"Queue Handler added customer \" + out.getCustomer().getName() + \n\t\t\t\t\t\t\t\" (ID: \" + out.getCustomer().getId() + \") to in-shop queue -> updated size: \" \n\t\t\t\t\t\t\t+ out.getUpdatedSize());\n\t\t\t\t}\t\t\t\t\t\t\n\n\t\t\t\t// delay for visualization purposes \n\t\t\t\tThread.sleep(onlineQueue.getDelay());\n\t\t\t\t\n\t\t\t// catch exception for calling sleep() function\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\tlog.updateLog(\"[QueueHandler]: \"+ \"Interuption in queueHandler\");\n\t\t\t\tSystem.out.println(e.getMessage());\n\t\t\t}\n\t\t}\t\t\n\t}", "@Override\n\t\tpublic void run() {\n\t\t\tURL url;\n\t\t\ttry {\n\t\t\t\tThread.sleep(3000);\n\t\t\t\turl = new URL(strUrl);\n\t\t\t\tURLConnection con = url.openConnection();\n\t\t\t\tcon.connect();\n\t\t\t\tInputStream input = con.getInputStream();\n\t\t\t\tList<Map<String,Object>> temp = json.getListItems(input);\n\t\t\t\tif(temp != null){\n\t\t\t\t\tif(merger.mergeTwoList(list, temp, direction))\n\t\t\t\t\t\tmyHandler.sendEmptyMessage(1);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tmyHandler.sendEmptyMessage(5);\n\t\t\t\t\n\t\t\t\t\n\n\t\t\t} catch (MalformedURLException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t}", "public interface CrawlerService {\n\n void processUrl(String url) throws IOException;\n}", "public static void main(String args[]) throws Exception {\n if (args.length < 1) {\n System.out.println(\"Usage: CrawlTool (-local | -ndfs <nameserver:port>) <root_url_file> [-dir d] [-threads n] [-depth i] [-showThreadID]\");\n return;\n }\n\n String fs = \"-local\";\n String nameserver = \"\";\n if (\"-ndfs\".equals(args[0])) {\n fs = \"-ndfs\";\n nameserver = args[1];\n }\n NutchFileSystem nfs = NutchFileSystem.parseArgs(args, 0);\n try {\n String rootUrlFile = null;\n String dir = new File(\"crawl-\" + getDate()).getCanonicalFile().getName();\n int threads = NutchConf.getInt(\"fetcher.threads.fetch\", 10);\n int depth = 5;\n boolean showThreadID = false;\n\n for (int i = 0; i < args.length; i++) {\n if (\"-dir\".equals(args[i])) {\n dir = args[i+1];\n i++;\n } else if (\"-threads\".equals(args[i])) {\n threads = Integer.parseInt(args[i+1]);\n i++;\n } else if (\"-depth\".equals(args[i])) {\n depth = Integer.parseInt(args[i+1]);\n i++;\n } else if (\"-showThreadID\".equals(args[i])) {\n showThreadID = true;\n } else if (args[i] != null) {\n rootUrlFile = args[i];\n }\n }\n\n if (nfs.exists(new File(dir))) {\n throw new RuntimeException(dir + \" already exists.\");\n }\n\n LOG.info(\"crawl started in: \" + dir);\n LOG.info(\"rootUrlFile = \" + rootUrlFile);\n LOG.info(\"threads = \" + threads);\n LOG.info(\"depth = \" + depth);\n\n String db = new File(dir + \"/db\").getCanonicalPath();\n String segments = new File(dir + \"/segments\").getCanonicalPath();\n\n // initialize the web database\n WebDBAdminTool.main(prependFileSystem(fs, nameserver, new String[] { db, \"-create\"}));\n WebDBInjector.main(prependFileSystem(fs, nameserver, new String[] { db, \"-urlfile\", rootUrlFile }));\n\n for (int i = 0; i < depth; i++) {\n // generate a new segment\n FetchListTool.main(prependFileSystem(fs, nameserver, new String[] { db, segments } ));\n String segment = getLatestSegment(nfs, segments);\n Fetcher.main(prependFileSystem(fs, nameserver, new String[] { \"-threads\", \"\"+threads, segment } ));\n UpdateDatabaseTool.main(prependFileSystem(fs, nameserver, new String[] { db, segment } ));\n }\n\n // Re-fetch everything to get the complete set of incoming anchor texts\n // associated with each page. We should fix this, so that we can update\n // the previously fetched segments with the anchors that are now in the\n // database, but until that algorithm is written, we re-fetch.\n \n // delete all the old segment data\n FileUtil.fullyDelete(nfs, new File(segments));\n\n // generate a single segment containing all pages in the db\n FetchListTool.main(prependFileSystem(fs, nameserver, new String[] { db, segments, \"-adddays\", \"\" + Integer.MAX_VALUE } ));\n\n String segment = getLatestSegment(nfs, segments);\n\n // re-fetch everything\n Fetcher.main(prependFileSystem(fs, nameserver, new String[] { \"-threads\", \"\"+threads, segment } ));\n\n // index, dedup & merge\n File workDir = new File(dir, \"workdir\");\n IndexSegment.main(prependFileSystem(fs, nameserver, new String[] { segment, \"-dir\", workDir.getPath() } ));\n DeleteDuplicates.main(prependFileSystem(fs, nameserver, new String[] { segments }));\n IndexMerger.main(prependFileSystem(fs, nameserver, new String[] { new File(dir + \"/index\").getCanonicalPath(), segment } ));\n\n LOG.info(\"crawl finished: \" + dir);\n } finally {\n nfs.close();\n }\n }", "private void pageContent( String url) {\n\t\t\n\t\tif ( !url.matches(URL)) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tList<String> outlinks = null; // out link urls\n\t\tUrlBean bean = null; // basic info of the url\n\t\t\n\t\tbean = new UrlBean();\n\t\ttry {\n\t\t\t\n\t\t\tconn = Jsoup.connect(url).timeout(5000);\n\t\t\tif ( conn == null) {\n\t\t\t\treturn ;\n\t\t\t}\n\t\t\t\n\t\t\tdocument = conn.get(); // 得到网页源代码,超时时间是5秒\n\t\t\t\n\t\t\t/*\n\t\t\t * 文章基本信息\n\t\t\t */\n\t\t\telements = document.getElementsByTag(\"title\");\n\t\t\tif ( elements!= null && elements.size() != 0) {\n\t\t\t\telement = elements.get(0);\n\t\t\t}\n\t\t\tString title = element.text();\n\t\t\tbean.setTitle(title);\n\t\t\tbean.setKeywords(title);\n\t\t\t\n\t\t\telements = document.getElementsByTag(\"a\");\n\t\t\tif ( elements != null) {\n\t\t\t\tString linkUrl = null;\n\t\t\t\toutlinks = new ArrayList<String>();\n\t\t\t\tfor ( int i = 0; i < elements.size(); i++) {\n\t\t\t\t\tlinkUrl = elements.get(i).attr(\"href\");\n\t\t\t\t\tif ( linkUrl.matches(URL)) {\n\t\t\t\t\t\toutlinks.add(linkUrl);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn;\n\t\t} \n\t\t\n\t\tbean.setUrl(url);\n\t\tbean.setId(urlId++);\n\t\tbean.setRank(1);\n\t\tif ( outlinks != null) {\n\t\t\tint count = outlinks.size();\n\t\t\tbean.setOutlinks(count);\n\t\t\tfor ( int i = 0; i < count; i++) {\n\t\t\t\turlsSet.add(outlinks.get(i));\n\t\t\t}\n\t\t\tif ( new AllInterface().addOneUrlInfo(bean, outlinks)) {\n\t\t\t\tSystem.out.println(\"Add to database successfully, url is '\" + url + \"'.\");\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"Fail to add to database, maybe url exists. Url is '\" + url + \"'.\");\n\t\t\t}\n\t\t\tSystem.out.println(\"[\" + count + \" urls remain...]\");\n\t\t\tSystem.out.println();\n\t\t} else {\n\t\t\tSystem.out.println(\"Error occurs in crawl, url is '\" + url + \"'.\");\n\t\t\tSystem.out.println(\"[[FINISHED]]\");\n\t\t\tSystem.out.println();\n\t\t}\n\t\t\n\t}", "public Builder urls(List<URI> urls) {\n if (CollectionUtils.isNotEmpty(urls)) {\n this.servers = Collections.unmodifiableList(urls);\n }\n return this;\n }", "public Crawler(String domain) {\n this.domain = domain;\n this.startUrl = \"http://\" + domain;\n init();\n }", "@Override\n\t\tprotected Void doInBackground( String... urls )\n\t\t{\n\t\t\tJsonObjectRequest jsonRequest = new JsonObjectRequest(\n\t\t\t\t\tRequest.Method.POST,\n\t\t\t\t\turls[ 0 ],\n\t\t\t\t\tnew JSONObject( params ),\t\t\t\t// Convert the supplied params to Json\n\t\t\t\t\tnew Response.Listener<JSONObject>()\n\t\t\t\t\t{\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void onResponse( JSONObject response )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tjsonObject = response;\t\t\t// Set the field to the response\n\n\t\t\t\t\t\t\t// Display the first 500 characters of the response string.\n\t\t\t\t\t\t\tLog.i( LOG_TAG, \"Response is: \" + response.toString() );\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tnew Response.ErrorListener()\n\t\t\t\t\t{\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void onErrorResponse( VolleyError error )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tjsonObject = null;\n\n\t\t\t\t\t\t\tLog.i( LOG_TAG, \"Request failed: \\n\" + error.getMessage() );\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\n\t\t\t// Add the request to the RequestQueue.\n\t\t\tqueue.add( jsonRequest );\n\n\t\t\treturn null;\n\n\t\t}", "@SuppressWarnings(\"unchecked\")\n\tpublic static void main(String[] args) {\n\t\ttry {\n\t\t\tCrawler crawler = new Crawler();\n\t\t\tSystem.setProperty(\"https.proxyHost\", \"192.168.2.101\");\n\t\t\tSystem.setProperty(\"https.proxyPort\", \"1080\");\n\n\t\t\tfillUrls(crawler.url, crawler.urlsToBeCrawled, crawler.depthMap);\n\t\t\tcrawler.addUrl(crawler.url, 1);\n\t\t\tlong start = System.currentTimeMillis();\n\t\t\tSystem.out.println(\"Crawling started\");\n\t\t\tcrawler.begin();\n\t\t\t\n\t\t\twhile (true) {\n\t\t\t\tif (crawler.urlsToBeCrawled.isEmpty() && Thread.activeCount() == 1 || crawler.count == crawler.threadCount) {\n\t\t\t\t\tCollections.sort(crawler.brs, new SortByRating());\n\t\t\t\t\twriteExcel(\"C://test1.xls\", crawler.brs);\n\n\t\t\t\t\tlong end = System.currentTimeMillis();\n\t\t\t\t\tSystem.out.println(\"Total crawl time\" + (end - start) / 1000 + \" seconds\");\n\t\t\t\t\tSystem.exit(1);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void run() {\n\t\tHtmlPage page = null;\n\t\tHtmlSelect select = null;\n\t\tHtmlOption option = null;\n\t\tDataStreamWriter connection = null;\n\t\tWebClient client = new WebClient(BrowserVersion.FIREFOX_3);\n\t\t/* eseguo i job assegnati al thread in esecuzione */\n\t\tfor(int j = 0; j < this.jobs.length; j++) {\n\t\t\tint currentJob = this.jobs[j];\n\t\t\ttry {\n\t\t\t\t/* faccio dei tentativi per collegarmi alle pagine */\n\t\t\t\tpage = getPage(client, this.getDataSourceURL());\n\t\t\t\t/* seleziono l'opzione relativa alla regione assegnata al task */\n\t\t\t\tselect = (HtmlSelect) page.getByXPath(\"//select\").get(0);\n\t\t\t\toption = select.getOption(currentJob);\n\t\t\t\toption.setSelected(true);\n\t\t\t\tString regione = option.asText();\n\t\t\t\t/* seleziono l'opzione ed ottengo la pagina aggiornata */\n\t\t\t\tpage = (HtmlPage) select.fireEvent(Event.TYPE_CHANGE).getNewPage();\n\t\t\t\t\n\t\t\t\t/* estraggo i dati e li salvo nello \"storage\" */\n\t\t\t\tconnection = this.storageFacade.getDataStreamWriter();\n\t\t\t\tconnection.openStreamWriter();\n\t\t\t\tthis.extractData(client, connection, page, regione);\n\t\t\t}\n\t\t\tcatch (HTMLCrawlerException e) {\n\t\t\t\tSystem.err.println(\"@ HTMLCrawlerException : Extracting Data Error\");\n\t\t\t\tSystem.err.println(e.getMessage());\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\t//client.closeAllWindows();\n\t\t\t\tif (connection != null)\n\t\t\t\t\tconnection.closeStreamWriter();\n\t\t\t}\n\t\t}\n\t\tclient.closeAllWindows();\n\t}", "public void startCrawl() throws IOException {\n\t\tElements paragraphs = wf.fetchWikipedia(source);\n\t\tqueueInternalLinks(paragraphs);\n\n\t\t// loop until we index a new page\n\t\tString res;\n\t\tdo {\n\t\t\tres = crawl();\n\n\t\t} while (res == null);\n\t}", "@Override\r\n\tpublic void run() {\n\t\twhile (true) {\r\n\t\t\tif (MatchReqPool.size() == 0) {\r\n\r\n\t\t\t\ttry {\r\n\r\n\t\t\t\t\tmatchReqDao = new MatchReqDaoImpl();\r\n\r\n\t\t\t\t\tList<MatchReq> list = matchReqDao.getAllNewReq();\r\n\r\n\t\t\t\t\tIterator<MatchReq> iterator = list.iterator();\r\n\t\t\t\t\tif (list.size() > 0) {\r\n\t\t\t\t\t\tLogger.info(\"Has New Request....\");\r\n\r\n\t\t\t\t\t\twhile (iterator.hasNext()) {\r\n\t\t\t\t\t\t\tMatchReq req = iterator.next();\r\n\t\t\t\t\t\t\treq.setPoint(\"[0:0]\");\r\n\t\t\t\t\t\t\treq.setStatus(MatchStatus.START);\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tmatchReqDao.update(list);\r\n\t\t\t\t\t\tMatchReqPool.put(list);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} catch (MatchException em) {\r\n\t\t\t\t\tem.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ttry {\r\n\t\t\t\tsleep(5000);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\r\n public void run() {\r\n // mark as starting\r\n state.getStatus().starting();\r\n try {\r\n state.getProcessor().start();\r\n if (ds.getType().equals(\"salesforce\")) {\r\n // leancog registration check\r\n \tRegistrationCheck checker = new RegistrationCheck();\r\n \tif (!checker.verify()) {\r\n \t\tException failed = new Exception(REGISTRATION_ERROR_MSG);\r\n \t\tLOG.error(REGISTRATION_ERROR_MSG, failed);\r\n \t\tstate.getStatus().failed(failed);\r\n \t\treturn;\r\n \t}\r\n \r\n runSalesforceCrawl();\r\n \r\n }\r\n } catch (Throwable t) {\r\n LOG.warn(\"Exception in Salesforce crawl\", t);\r\n state.getStatus().failed(t);\r\n } finally {\r\n boolean commit = ds.getBoolean(DataSource.COMMIT_ON_FINISH, true);\r\n try {\r\n state.getProcessor().finish();\r\n // optional commit - if false then it streamlines multiple small crawls\r\n state.getProcessor().getUpdateController().finish(commit);\r\n } catch (Exception e) {\r\n LOG.error(\"Exception in Salesforce crawl\", e);\r\n }\r\n if (stopped) {\r\n state.getStatus().end(JobState.STOPPED);\r\n } else {\r\n state.getStatus().end(JobState.FINISHED);\r\n }\r\n }\r\n }", "public void addFoundUrl(String url, CrawledUrl fatherUrl) {\n\t\ttry {\n\t\t\t\n\t\t\tFoundUrl fUrl = new FoundUrl();\n\t\t\tfUrl.setUrl(new URL(url));\n\t\t\tfUrl.setCrawledUrl(fatherUrl);\n\t\t\tfatherUrl.getFoundUrls().add(fUrl);\n\t\t\t\n\t\t} catch (MalformedURLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}", "public void start() {\n retainQueue();\n mRequestHandle = mRequestQueue.queueRequest(mUrl, \"GET\", null, this, null, 0);\n }", "@Override\n public void run()\n {\n if(miningInfoLookup.isEmpty() || new Date().getTime() - (5 * 60 * 1000) > lastUpdate.getTime())\n {\n miningInfoLookup.clear();\n try\n {\n lastUpdate = new Date();\n for(String networkServerUrl : ObserverProperties.getNetworkServerUrls())\n {\n GetMiningInfoTask getMiningInfoTask = beanFactory.getBean(GetMiningInfoTask.class, networkServerUrl);\n taskExecutor.execute(getMiningInfoTask);\n }\n }\n catch(Exception e)\n {\n LOG.error(\"Failed receiving Network data.\");\n }\n }\n }", "public static void main(String[] args) {\n\t\tNewsLKSpider spider = new NewsLKSpider();\r\n\t\tint i = 0;\r\n\t\twhile (i <= 280) {\r\n\t\t\tSystem.out.println(i);\r\n\t\t\tString thisUrl = spider.newsURL + String.valueOf(i);\r\n\t\t\tString referer = \"\";\r\n\t\t\tif (i == 0) {\r\n\t\t\t\treferer = spider.newsReferer;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treferer = spider.newsURL + String.valueOf(i - 20);\r\n\t\t\t}\r\n\t\t\tString searchContent = spider.getContent(thisUrl, spider.searchCookie, referer);\r\n\t\t\tspider.getAElement(searchContent);\r\n\t\t\tint times = (int) (Math.random() * 10000 + 10000.);\r\n\t\t\tSystem.out.println(times);\r\n\t\t\ttry {\r\n\t\t\t\tThread.sleep(times);\r\n\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\ti = i + 20;\r\n\t\t}\r\n\t\tSystem.out.println(\"There are \" + spider.aElemenets.size() + \" news in list.\");\r\n\t\ti = 0;\r\n\t\tSet<Entry<String,String>> keyValue= spider.aElemenets.entrySet();\r\n\t\tfor (Entry<String,String> onePaire : keyValue) {\r\n\t\t\tSystem.out.println(i + \" : \" + onePaire.getValue());\r\n\t\t\tspider.getNewsContent(onePaire.getValue(), onePaire.getKey());\r\n\t\t\ti += 1;\r\n\t\t\tint times = (int) (Math.random() * 10000 + 5000.);\r\n\t\t\tSystem.out.println(\"Sleep times :\"+times);\r\n\t\t\ttry {\r\n\t\t\t\tThread.sleep(times);\r\n\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private String nextUrl()\n {\n String nextUrl;\n do\n {\n nextUrl = this.pagesToVisit.remove(0);\n } while(this.pagesVisited.contains(nextUrl));\n this.pagesVisited.add(nextUrl);\n return nextUrl;\n }", "private void getWebUrl()\r\n\t{\r\n\t\tScanner input = new Scanner(System.in);\r\n\t\tString url =\" \";\r\n\t\t\r\n\t\t//prompt user for the URL\r\n\t\tSystem.out.println(\"Enter the web URL (Type Q or q to quit): \");\r\n\t\twhile (!url.equalsIgnoreCase(\"Q\"))\r\n\t\t{\r\n\t\t\turl = input.next();\t\r\n\t\t\tif(url.equalsIgnoreCase(\"Q\"))\r\n\t\t\t\tbreak;\t\t\t\t\t\t\t\t\t\t//ignores all other code in the loop and exits the loop\r\n\t\t\trChronological.enqueue(url);\t\t\t\t\t//store url in queue\r\n\t\t\tqueueCount++;\t\t\t\t\t\t\t\t\t//increment number of elements in queue\r\n\t\t\tif (!checkSiteVisited(url))\t\t\t\t\t\t//if this is the user's first time visiting the url\r\n\t\t\t{\r\n\t\t\t\tchronological.push(url);\t\t\t\t\t//store url in stack\r\n\t\t\t\twebVisited[0][siteVisited] = url;\t\t\t//store url in 2-D array\r\n\t\t\t\twebVisited[1][siteVisited] = 1;\t\t\t\t//store 1 in 2-D array because it is user's first time visiting the site\r\n\t\t\t\tsiteVisited++;\t\t\t\t\t\t\t\t//increment number of websites visited\r\n\t\t\t}\r\n\t\t\telse\t\t\t\t\t\t\t\t\t\t\t//if the user has visited the website before\r\n\t\t\t{\r\n\t\t\t\tupdateStack(url);\t\t\t\t\t\t\t//move the url to the top of the stack\r\n\t\t\t\tupdateNumVisits(url);\t\t\t\t\t\t//increment the number of times the user has visited the site\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void turnOnRss(final String url) {\n ParseFeedTask task = tasks.get(url);\n if (task == null) {\n System.out.println(String.format(\"Rss with url %s is not found\", url));\n return;\n }\n RssConfiguration configuration = task.getConfiguration();\n if (configuration.getTurnOn()) {\n System.out.println(\"Rss is already running\");\n return;\n }\n configuration.setTurnOn(true);\n try {\n PropertiesHandler.writeProperties(configuration);\n ScheduledFuture future = scheduledExecutorService.scheduleWithFixedDelay(task, configuration.getPollPeriod(), configuration.getPollPeriod(), TimeUnit.SECONDS);\n futures.put(url, future);\n System.out.println(String.format(\"Rss %s is running\", url));\n } catch (IOException e) {\n System.out.println(String.format(\"An error occurred during the change poll period for feed %s\", url));\n }\n }", "private void processUrls(){\n // Strip quoted tweet URL\n if(quotedTweetId > 0){\n if(entities.urls.size() > 0 &&\n entities.urls.get(entities.urls.size() - 1)\n .expandedUrl.endsWith(\"/status/\" + String.valueOf(quotedTweetId))){\n // Match! Remove that bastard.\n entities.urls.remove(entities.urls.size() - 1);\n }\n }\n\n // Replace minified URLs\n for(Entities.UrlEntity entity : entities.urls){\n // Find the starting index for this URL\n entity.indexStart = text.indexOf(entity.minifiedUrl);\n // Replace text\n text = text.replace(entity.minifiedUrl, entity.displayUrl);\n // Find the last index for this URL\n entity.indexEnd = entity.indexStart + entity.displayUrl.length();\n }\n }", "public Task(String url) {\n this.url = url;\n logger.debug(\"Created task for \" + url);\n }", "@Override\n public void run()\n {\n Document doc = null;\n try\n {\n // Politeness policy\n try\n {\n // Used so that we don't have multiple threads sleeping, instead the rest just wait on the\n // semaphore\n if (PolitenessPolicy()) return;\n\n doc = Jsoup.connect(threadVertex.getUrl()).get();\n }\n catch (InterruptedException e)\n {\n e.printStackTrace();\n return;\n }\n }\n catch (UnsupportedMimeTypeException e)\n {\n// System.out.println(\"--unsupported document type, do nothing\");\n return;\n }\n catch (HttpStatusException e)\n {\n// System.out.println(\"--invalid link, do nothing\");\n return;\n }\n catch (IOException e)\n {\n e.printStackTrace();\n return;\n }\n finally\n {\n politenessInteger.incrementAndGet();\n }\n\n Elements links = doc.select(\"a[href]\");\n for (Element link : links)\n {\n String v = link.attr(\"abs:href\");\n// System.out.println(\"Found: \" + v);\n\n// Document temp = null;\n if (!Util.ignoreLink(threadVertex.getUrl(), v))\n {\n // This was originally trying to catch invalid links before adding them to the graph\n // but I realized those are also valid notes, just leaf nodes.\n // This also greatly speeds up the execution of the program.\n// try\n// {\n// try\n// {\n// // Used so that we don't have multiple threads sleeping, instead the rest just wait on the\n// // semaphore\n// if (PolitenessPolicy()) return;\n//\n// temp = Jsoup.connect(v).get();\n// }\n// catch (InterruptedException e)\n// {\n// e.printStackTrace();\n// return;\n// }\n// }\n// catch (UnsupportedMimeTypeException e)\n// {\n// System.out.println(\"--unsupported document type, do nothing\");\n// return;\n// }\n// catch (HttpStatusException e)\n// {\n// System.out.println(\"--invalid link, do nothing\");\n// return;\n// }\n// catch (IOException e)\n// {\n// e.printStackTrace();\n// return;\n// }\n\n Vertex newVertex = new Vertex(v);\n\n // We need to synchronize the graph and the queue among each thread\n // This avoids dirty reads and dirty writes\n synchronized(graph)\n {\n synchronized(urlQueue)\n {\n if (!graph.containsKey(newVertex.getUrl()))\n {\n int newVertexDepth = threadVertex.getDepth() + 1;\n int currentPages = graph.size();\n\n if (currentPages < maxPages && newVertexDepth <= maxDepth)\n {\n // Set the new vertex's depth and add an ancestor\n newVertex.setDepth(newVertexDepth);\n newVertex.addAncestor(threadVertex);\n\n // Update the current vertex to have this one as a child\n threadVertex.addChild(newVertex);\n graph.put(threadVertex.getUrl(), threadVertex);\n\n // Place the new vertex in the discovered HashMap and place it in the queue\n graph.put(newVertex.getUrl(), newVertex);\n\n urlQueue.add(newVertex);\n }\n }\n else\n {\n // Done to update relationships of ancestors and children\n Vertex oldVertex = graph.get(newVertex.getUrl());\n\n oldVertex.addAncestor(threadVertex);\n threadVertex.addChild(oldVertex);\n\n graph.put(oldVertex.getUrl(), oldVertex);\n graph.put(threadVertex.getUrl(), threadVertex);\n }\n }\n }\n }\n else\n {\n// System.out.println(\"--ignore\");\n return;\n }\n }\n }", "public native final void setUrls(JsArrayString urls)/*-{\n this.urls = urls;\n }-*/;", "public void setUrlList(final List<String> urls) {\r\n\t\tgetState().urlList = urls;\r\n\t}", "@Override\n \t\t\tpublic void run() {\n \t\t\t\tMessage msg = new Message();\n \t\t\t\tmsg.what = 0;\n \t\t\t\t\n \t\t\t\t// Retrieve the seeds list\n \t\t\t\tmsg.obj = getList();\n \t\t\t\thandler.sendMessage(msg);\n \t\t\t}", "public FetcherThreads(\n\t\t\tfinal BlockingFetchQueues< Callable< ? > > queue,\n\t\t\tfinal int numFetcherThreads,\n\t\t\tfinal IntFunction< String > threadIndexToName )\n\t{\n\t\tfetchers = new ArrayList<>( numFetcherThreads );\n\t\tfor ( int i = 0; i < numFetcherThreads; ++i )\n\t\t{\n\t\t\tfinal Fetcher f = new Fetcher( queue );\n\t\t\tf.setDaemon( true );\n\t\t\tf.setName( threadIndexToName.apply( i ) );\n\t\t\tfetchers.add( f );\n\t\t\tf.start();\n\t\t}\n\t}", "public void visit(String url) {\n current.next = new Node(url);\n current.next.previous = current;\n\n current = current.next;\n }", "protected Void doInBackground(String... urls) {\n /************ Make Post Call To Web Server ***********/\n /*****************************************************/\n return null;\n }" ]
[ "0.6669704", "0.65849596", "0.65647995", "0.6289034", "0.6284374", "0.6205008", "0.61836755", "0.59855276", "0.5962927", "0.59561497", "0.5941636", "0.59407127", "0.5877915", "0.58610106", "0.5805279", "0.57692456", "0.5735567", "0.5665668", "0.56570536", "0.55744183", "0.55724066", "0.5564357", "0.5533804", "0.5515973", "0.5493457", "0.5458073", "0.5440849", "0.54215467", "0.539344", "0.535242", "0.5331725", "0.53188", "0.53046364", "0.52924585", "0.5281808", "0.5271847", "0.52529955", "0.52407646", "0.5237794", "0.5234056", "0.52319753", "0.522327", "0.51409334", "0.5135116", "0.5121666", "0.50837296", "0.50823975", "0.5067104", "0.50611854", "0.50584716", "0.50521594", "0.50430006", "0.5030385", "0.50260687", "0.5022937", "0.50050825", "0.49941766", "0.4984867", "0.49620077", "0.49478862", "0.49163342", "0.49014", "0.48942214", "0.48908445", "0.48842594", "0.48689067", "0.48627084", "0.48615065", "0.485857", "0.48397186", "0.48326927", "0.48321456", "0.48314166", "0.48305395", "0.4829883", "0.48042014", "0.48015517", "0.47967795", "0.47934833", "0.4782473", "0.4778596", "0.4773769", "0.47703475", "0.47694278", "0.476678", "0.47658935", "0.47528717", "0.4750858", "0.47490525", "0.47440478", "0.4730778", "0.47301516", "0.47120982", "0.47116062", "0.46983886", "0.46961462", "0.46953914", "0.46947098", "0.46811885", "0.46793652" ]
0.6451839
3
Constructor for the CrawlWorker, or should I say.....minion!
public CrawlWorker(String url) { this.url = url; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Worker(){\n\n }", "public DataCaseWorker() {\n super();\n }", "public void crawlSite()\n {\n /** Init the logger */\n WorkLogger.log(\"WebCrawler start at site \" + this.urlStart.getFullUrl() + \" and maxDepth = \" + this.maxDepth);\n WorkLogger.log(\"====== START ======\");\n WorkLogger.log(\"\");\n /** Save the start time of crawling */\n long startTime = System.currentTimeMillis();\n /** Start our workers */\n this.taskHandler.startTask(this.urlStart, maxDepth);\n /** Check workers finished their work; in case then all workers wait, then no ones work, that leads no more tasks -> the program finished */\n while(this.taskHandler.isEnd() == false)\n {\n /** Default timeout for 1 sec cause the socket timeout I set to 1 sec */\n try{Thread.sleep(1000);}catch(Exception e){}\n }\n this.taskHandler.stopTasks();\n /** End the log file and add the time elapsed and total sites visited */\n WorkLogger.log(\"\\r\\n====== END ======\");\n WorkLogger.log(\"Time elapsed: \" + (System.currentTimeMillis() - startTime)/1000.);\n WorkLogger.log(\"Total visited sites: \" + this.pool.getVisitedSize());\n }", "BackgroundWorker (String page, String name, String type, Context context) {this.page=page; this.name=name; this.type=type; this.context=context; flag=2;}", "public WorkerMonitor() {\n }", "public Job() {\n\t\t\t\n\t\t}", "public Indexer crawl() \n\t{\n\t\t// This redirection may effect performance, but its OK !!\n\t\tSystem.out.println(\"Crawling: \"+u.toString());\n\t\treturn crawl(crawlLimitDefault);\n\t}", "public WorkerController(){\r\n\t}", "BackgroundWorker (String page, int id, Context context) {this.page=page; this.id=id; this.context=context; flag=3;}", "public WebCrawler(MultithreadedInvertedIndex index, int limit) {\n\t\tthis.index = index;\n\t\tthis.limit = limit;\n\t\tthis.queue = new WorkQueue(limit);\n\t\tthis.urls = new ArrayList<URL>();\n\t}", "public Crawler(Config conf) {\n \t\tthis.conf = conf;\n \t}", "public WebCrawler(String urlSeed) {\n\t\t\n\n\t\t\n\t\tconnection = db.openConnection();\n\n\t\t\ttry {\n\t\t\t\tthis.urlSeed = new URL(urlSeed);\n\t\t\t} catch(MalformedURLException ex) {\n\t\t\t\tlog.error(\"please input the right url with protocol part!\");\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t\tworkers = new WorkQueue(10);\n\t\t\tthis.count = 0;\n\t\t\tthis.pending = 0;\n\t\t\turlList = new ArrayList<String>();\n\t\t\t//index = new InvertedIndex();\n\t\t\tlong start = System.currentTimeMillis();\n\t\t\tthis.HTMLFetcher();\n\t\t\tlong end = System.currentTimeMillis();\n\t\t\tlog.info(\"Running time for htmlFetcher: \" + (end - start));\n\t\t\tList<String> suggestedQuery = index.getSuggestedQuery();\n\t\t\tdb.updateSuggestedQuery(connection, suggestedQuery);\n\t\t\tdb.closeConnection(connection);\n\t}", "public AutomaticJob() {\r\n \r\n }", "public Job() {\n }", "public Job() {\n }", "BackgroundWorker (String page, int id, int ivmin, int ivmax, String attack, String ulti, String name, String username, Context context) {this.context=context; this.page=page; this.id=id; this.ivmin=ivmin; this.ivmax=ivmax; this.attack=attack; this.ulti=ulti; this.name=name; this.username=username; flag=4;}", "public CrawlerConfiguration() {\n\t\tinitConfiguration();\n\t}", "public grayTWorkerSweepRec() {\n }", "public WebCrawler(final URL startURL) {\n this.baseUrl = startURL.toString();\n this.links = new HashSet<>();\n this.startTime = System.currentTimeMillis();\n depth = 0;\n pagesVisited = 0;\n crawl(initURLS(startURL));\n try {\n goThroughLinks();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public Job() {\r\n\t\tSystem.out.println(\"Constructor\");\r\n\t}", "public TrackCoach() {\n\n\t}", "public ModemWorker (IConnection connection) {\n\t\tthis.connection = connection;\n\t}", "public MultiThreadedTabuSearch() {}", "public FetchRule() {\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic Indexer crawl (int limit) \n\t{\n\t\n\t\t////////////////////////////////////////////////////////////////////\n\t // Write your Code here as part of Priority Based Spider assignment\n\t // \n\t ///////////////////////////////////////////////////////////////////\n\t\tPQueue q=new PQueue();\n \t\n\t\ttry\n \t{\n\t\t\t final String authUser = \"iiit-63\";\n\t\t\t\tfinal String authPassword = \"MSIT123\";\n\n\t\t\t\tSystem.setProperty(\"http.proxyHost\", \"proxy.iiit.ac.in\");\n\t\t\t\tSystem.setProperty(\"http.proxyPort\", \"8080\");\n\t\t\t\tSystem.setProperty(\"http.proxyUser\", authUser);\n\t\t\t\tSystem.setProperty(\"http.proxyPassword\", authPassword);\n\n\t\t\t\tAuthenticator.setDefault(\n\t\t\t\t new Authenticator() \n\t\t\t\t {\n\t\t\t\t public PasswordAuthentication getPasswordAuthentication()\n\t\t\t\t {\n\t\t\t\t return new PasswordAuthentication(authUser, authPassword.toCharArray());\n\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t);\n\n\t\t\t\tSystem.setProperty(\"http.proxyUser\", authUser);\n\t\t\t\tSystem.setProperty(\"http.proxyPassword\", authPassword);\n \t\tURLTextReader in = new URLTextReader(u);\n \t\t// Parse the page into its elements\n \t\tPageLexer elts = new PageLexer(in, u);\t\t\n \t\tint count1=0;\n \t\t// Print out the tokens\n \t\tint count = 0;\n \t\t\n \t\twhile (elts.hasNext()) \n \t\t{\n \t\t\tcount++;\n \t\t\tPageElementInterface elt = (PageElementInterface)elts.next();\t\t\t \n \t\t\tif (elt instanceof PageHref)\n \t\t\tif(count1<limit)\n \t\t\t{\n \t\t\t\tif(q.isempty())\n \t\t\t\t{\n \t\t\t\t\tq.enqueue(elt.toString(),count);\n\t\t\t\t\t}\n \t\t\t\telse\n \t\t\t\t{\n \t\t\t\t\tif(q.search(elt.toString(),count))\n \t\t\t\t\t{\n \t\t\t\t\t\tq.enqueue(elt.toString(),count);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\tcount1++;\n \t\t\t\tSystem.out.println(\"link: \"+elt);\n \t\t\t\t\n \t\t\t}\n \t\t}\n \t\tSystem.out.println(\"links retrieved: \"+count1);\n \t\tq.display();\n \t\twhile(limit !=0)\n \t\t{\n \t\t\tObject elt=q.dequeue();\n \t\t\tURL u1=new URL(elt.toString());\n \t\t\tURLTextReader in1= new URLTextReader(u1);\n \t\t\t// Parse the page into its elements\n \t\t\tPageLexer elt1 = new PageLexer(in1, u1);\n \t\t\twhile (elt1.hasNext()) \n \t\t\t{\n \t\t\t\tPageElementInterface elts2= (PageElementInterface)elt1.next();\n \t\t\t\tif (elts2 instanceof PageWord)\n \t\t\t\t{\n \t\t\t\t\tv.add(elts2);\n \t\t\t\t}\n \t\t\t\tSystem.out.println(\"words:\"+elts2);\n \t\t\t} \t\t\t\n\t\t\t\tObjectIterator OI=new ObjectIterator(v);\n\t\t\t\ti.addPage(u1,OI);\n\t\t\t\tfor(int j=0;j<v.size();j++);\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"hello\"+v.get(count));\n\t\t\t\t}\n\t\t\t\tlimit--;\n \t\t}\n \t\t\n \t}\n \tcatch (Exception e)\n \t{\n \t\tSystem.out.println(\"Bad file or URL specification\");\n \t}\n return i;\n\t}", "public void crawl() {\n\t\tOOSpider.create(Site.me().setSleepTime(3000).setRetryTimes(3).setDomain(\"movie.douban.com\")//.setHttpProxy(httpProxy)\n .setUserAgent(\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.67 Safari/537.36\"),\n filmInfoDaoPipeline, DoubanFilm.class)\n .addUrl(\"https://movie.douban.com/top250\")//entry url\n .thread(1)\n .run();\n }", "public static void main(String[] args) throws Exception {\n\t\tString crawlStorageFolder = \"/data/crawl\";\r\n\t\tint numberOfCrawlers = 1;\r\n\t\t\r\n\t\tCrawlConfig config = new CrawlConfig();\r\n\t\tconfig.setCrawlStorageFolder(crawlStorageFolder);\r\n\t\tconfig.setMaxPagesToFetch(5000);\r\n\t\tconfig.setMaxDepthOfCrawling(5);\r\n\t\tconfig.setPolitenessDelay(500);\r\n\t\t\r\n\t\tconfig.setIncludeBinaryContentInCrawling(true);\r\n\t\t//config.setUserAgentString(userAgentString);\r\n\t\t\r\n\t\tPageFetcher pageFetcher = new PageFetcher(config);\r\n\t\tRobotstxtConfig robotstxtConfig = new RobotstxtConfig();\r\n\t\tRobotstxtServer robotstxtServer = new RobotstxtServer(robotstxtConfig,pageFetcher );\r\n\t\tCrawlController controller = new CrawlController(config,pageFetcher,robotstxtServer);\r\n\t\t\r\n\t\tcontroller.addSeed(\"http://www.marshall.usc.edu/\");\r\n\t\tcontroller.start(MyCrawler.class, numberOfCrawlers);\r\n\t\tSystem.out.println(\"All urls processed:\"+MyCrawler.URL_Count);\r\n\t\tSystem.out.println(\"All unique urls processed:\"+MyCrawler.hs.size());\r\n\t\tSystem.out.println(\"unique School urls processed:\"+MyCrawler.hs_uniqueSchool.size());\r\n\t\tSystem.out.println(\"unique USC urls processed:\"+MyCrawler.hs_uniqueUSC.size());\r\n\t\tSystem.out.println(\"other unique urls processed:\"+MyCrawler.hs_unique.size());\r\n\t\tSet set = MyCrawler.HM_Status.entrySet();\r\n\t Iterator i = set.iterator();\r\n\t while(i.hasNext()) {\r\n\t Map.Entry me = (Map.Entry)i.next();\r\n\t System.out.print(me.getKey() + \": \");\r\n\t System.out.println(me.getValue());\r\n\t }\r\n\t set=MyCrawler.HM_CT.entrySet();\r\n\t i = set.iterator();\r\n\t while(i.hasNext()) {\r\n\t Map.Entry me = (Map.Entry)i.next();\r\n\t System.out.print(me.getKey() + \": \");\r\n\t System.out.println(me.getValue());\r\n\t }\r\n\t System.out.println(\"F1:\"+MyCrawler.F1);\r\n\t System.out.println(\"F2:\"+MyCrawler.F2);\r\n\t System.out.println(\"F3:\"+MyCrawler.F3);\r\n\t System.out.println(\"F4:\"+MyCrawler.F4);\r\n\t \r\n\t System.out.println(\"Size < 1kb:\"+MyCrawler.size1);\r\n\t System.out.println(\"Size 1kb~10kb:\"+MyCrawler.size2);\r\n\t System.out.println(\"Size 10kb~100kb:\"+MyCrawler.size3);\r\n\t System.out.println(\"Size 100kb~1mb:\"+MyCrawler.size4);\r\n\t System.out.println(\"Size > 1mb:\"+MyCrawler.size5);\r\n\t \r\n\t}", "public CreateKonceptWorker() {\n\t\tsuper();\n\t\tthis.koncept = new KoncepteParaula();\n\t}", "@Test\n public void testCrawlMalformedInitalUrl() {\n new Crawl();\n\n }", "public interface Crawler {\n int size();\n boolean visited(String link);\n void addNewLinkToSitemap(String link);\n void addToChildSitemap(String parent, String child);\n void addVisited(String s, Integer depth);\n void startCrawling(String requestid, String link, int maxDepth);\n ForkJoinPool getMainPool();\n Map<String, Collection<String>> getSiteMap();\n}", "public AbstractJob(){\n \n }", "public CasterSite() {\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t/*MultiThreadedCrawler crawler = new MultiThreadedCrawler(\"https://cs.uic.edu\", \"uic.edu\", \"main\");\n\t\tcrawler.start();\n\t\tList<Map> p = new ArrayList<>();\n\t\tp.add(crawler.getResults());\n\t\t\n\t\ttry {\n\t\t\tGlobals.urlSet.add(new URL(\"https://disabilityresources.uic.edu\"));\n\t\t\tGlobals.urlSet.add(new URL(\"http://disabilityresources.uic.edu\"));\n\t\t\tGlobals.urlSet.add(new URL(\"http://cmhsrp.uic.edu/nrtc\")); \n\n\t\t} catch (MalformedURLException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\t\n\t\t\n\t\tMultiThreadedCrawler c1 = new MultiThreadedCrawler(\"\", \"uic.edu\", \"c1\");\n\t\tMultiThreadedCrawler c2 = new MultiThreadedCrawler(\"\", \"uic.edu\", \"c2\");\n\t\tMultiThreadedCrawler c3 = new MultiThreadedCrawler(\"\", \"uic.edu\", \"c3\");\n\t\tMultiThreadedCrawler c4 = new MultiThreadedCrawler(\"\", \"uic.edu\", \"c4\");\n\t\tMultiThreadedCrawler c5 = new MultiThreadedCrawler(\"\", \"uic.edu\", \"c5\");\n\t\tMultiThreadedCrawler c6 = new MultiThreadedCrawler(\"\", \"uic.edu\", \"c6\");\n\t\t//MultiThreadedCrawler c7 = new MultiThreadedCrawler(\"https://housing.uic.edu\", \"uic.edu\", \"housing\");\n\t\t//MultiThreadedCrawler c8 = new MultiThreadedCrawler(\"https://grad.uic.edu\", \"uic.edu\", \"grad\");\n\t\t//MultiThreadedCrawler c9 = new MultiThreadedCrawler(\"https://today.uic.edu\", \"uic.edu\", \"today\");\n\t\t\n\t\t\n\t\t\n\t\tList<Thread> crawlers = new ArrayList<>();\n\t\tcrawlers.add(new Thread(c1, \"c1\"));\n\t\tcrawlers.add(new Thread(c2, \"c2\"));\n\t\tcrawlers.add(new Thread(c3, \"c3\"));\n\t\tcrawlers.add(new Thread(c4, \"c4\"));\n\t\tcrawlers.add(new Thread(c5, \"c5\"));\n\t\tcrawlers.add(new Thread(c6, \"c6\"));\n\t\tcrawlers.add(new Thread(c7, \"housing\"));\n\t\tcrawlers.add(new Thread(c8, \"grad\"));\n\t\tcrawlers.add(new Thread(c9, \"today\"));\n\t\t\n\t\t\n\t\tfor(Thread t: crawlers) {\n\t\t\tt.start();\n\t\t}\n\t\t\n\t\tfor(Thread t: crawlers) {\n\t\t\ttry {\n\t\t\t\tt.join();\n\t\t\t}catch(InterruptedException e) {\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tp.add(c1.getResults());\n\t\tp.add(c2.getResults());\n\t\tp.add(c3.getResults());\n\t\tp.add(c4.getResults());\n\t\tp.add(c5.getResults());\n\t\tp.add(c6.getResults());\n\t\t//p.add(c7.getResults());\n\t\t//p.add(c8.getResults());\n\t\t//p.add(c9.getResults());\n\t\t\n\t\t\n\t\twhile(true) {\n\t\t\tfor(Map m: p) {\n\t\t\t\tif(m == null)\n\t\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tSystem.out.println(\"All done\");\n\t\tmergeResults(p);\n\t\tUtil.updateDocVectLenMap();\n\t\tSystem.out.println(\"Total in collection: \" + Globals.pageDataMap.size());\n\t\tUtil.writeInvertedIndexTfMapAndMaxFreqMapToFile();*/\n\t\t\n\t\t\n\t\tUtil.loadDataFromFile();\n\t\tUtil.updateDocVectLenMap();\n\t\tSpringApplication.run(SearchApplication.class, args);\n\t}", "public static void main(String[] args) {\n \n FCrawler fc = new FCrawler();\n \n \n \n // now start all of the worker threads\n \n int N = 5;\n ArrayList<Thread> thread = new ArrayList<Thread>(N);\n for (int i = 0; i < N; i++) {\n Thread t = new Thread(fc.createWorker());\n thread.add(t);\n t.start();\n }\n \n// now place each directory into the workQ\n \n // fc.processDirectory(Args[0]);\n \n fc.processDirectory(\"D://\");\n// indicate that there are no more directories to add\n \n fc.workQ.finish();\n \n for (int i = 0; i < N; i++){\n try {\n thread.get(i).join();\n } catch (Exception e) {};\n }\n }", "worker(long workOn) {\n this.workOn = workOn;\n }", "public JobManager(){\n //Initialize the job manager for use of the system\n }", "public static void main(String args[]) throws Exception {\n if (args.length < 1) {\n System.out.println(\"Usage: CrawlTool (-local | -ndfs <nameserver:port>) <root_url_file> [-dir d] [-threads n] [-depth i] [-showThreadID]\");\n return;\n }\n\n String fs = \"-local\";\n String nameserver = \"\";\n if (\"-ndfs\".equals(args[0])) {\n fs = \"-ndfs\";\n nameserver = args[1];\n }\n NutchFileSystem nfs = NutchFileSystem.parseArgs(args, 0);\n try {\n String rootUrlFile = null;\n String dir = new File(\"crawl-\" + getDate()).getCanonicalFile().getName();\n int threads = NutchConf.getInt(\"fetcher.threads.fetch\", 10);\n int depth = 5;\n boolean showThreadID = false;\n\n for (int i = 0; i < args.length; i++) {\n if (\"-dir\".equals(args[i])) {\n dir = args[i+1];\n i++;\n } else if (\"-threads\".equals(args[i])) {\n threads = Integer.parseInt(args[i+1]);\n i++;\n } else if (\"-depth\".equals(args[i])) {\n depth = Integer.parseInt(args[i+1]);\n i++;\n } else if (\"-showThreadID\".equals(args[i])) {\n showThreadID = true;\n } else if (args[i] != null) {\n rootUrlFile = args[i];\n }\n }\n\n if (nfs.exists(new File(dir))) {\n throw new RuntimeException(dir + \" already exists.\");\n }\n\n LOG.info(\"crawl started in: \" + dir);\n LOG.info(\"rootUrlFile = \" + rootUrlFile);\n LOG.info(\"threads = \" + threads);\n LOG.info(\"depth = \" + depth);\n\n String db = new File(dir + \"/db\").getCanonicalPath();\n String segments = new File(dir + \"/segments\").getCanonicalPath();\n\n // initialize the web database\n WebDBAdminTool.main(prependFileSystem(fs, nameserver, new String[] { db, \"-create\"}));\n WebDBInjector.main(prependFileSystem(fs, nameserver, new String[] { db, \"-urlfile\", rootUrlFile }));\n\n for (int i = 0; i < depth; i++) {\n // generate a new segment\n FetchListTool.main(prependFileSystem(fs, nameserver, new String[] { db, segments } ));\n String segment = getLatestSegment(nfs, segments);\n Fetcher.main(prependFileSystem(fs, nameserver, new String[] { \"-threads\", \"\"+threads, segment } ));\n UpdateDatabaseTool.main(prependFileSystem(fs, nameserver, new String[] { db, segment } ));\n }\n\n // Re-fetch everything to get the complete set of incoming anchor texts\n // associated with each page. We should fix this, so that we can update\n // the previously fetched segments with the anchors that are now in the\n // database, but until that algorithm is written, we re-fetch.\n \n // delete all the old segment data\n FileUtil.fullyDelete(nfs, new File(segments));\n\n // generate a single segment containing all pages in the db\n FetchListTool.main(prependFileSystem(fs, nameserver, new String[] { db, segments, \"-adddays\", \"\" + Integer.MAX_VALUE } ));\n\n String segment = getLatestSegment(nfs, segments);\n\n // re-fetch everything\n Fetcher.main(prependFileSystem(fs, nameserver, new String[] { \"-threads\", \"\"+threads, segment } ));\n\n // index, dedup & merge\n File workDir = new File(dir, \"workdir\");\n IndexSegment.main(prependFileSystem(fs, nameserver, new String[] { segment, \"-dir\", workDir.getPath() } ));\n DeleteDuplicates.main(prependFileSystem(fs, nameserver, new String[] { segments }));\n IndexMerger.main(prependFileSystem(fs, nameserver, new String[] { new File(dir + \"/index\").getCanonicalPath(), segment } ));\n\n LOG.info(\"crawl finished: \" + dir);\n } finally {\n nfs.close();\n }\n }", "public ContentfulCrawler(ContentCrawlConfiguration configuration) {\n Preconditions.checkNotNull(configuration, \"Crawler configuration can't be null\");\n Preconditions.checkNotNull(configuration.getElasticSearch(), \"ElasticSearch configuration can't be null\");\n Preconditions.checkNotNull(configuration.getContentful(), \"Contentful configuration can't be null\");\n this.configuration = configuration.getContentful();\n cdaClient = buildCdaClient();\n cmaClient = buildCmaClient();\n esClient = buildEsClient(configuration.getElasticSearch());\n esConfiguration = configuration.getElasticSearch();\n }", "public GetJobs() {\r\n\t\tsuper();\r\n\t}", "public SfdcCrawler(SfdcCrawlState state) {\r\n this.state = state;\r\n\r\n \r\n this.ds = (CrawlDataSource)state.getDataSource();\r\n \r\n LOG.info(\"salesforce collection=\"+this.ds.getCollection()+ \" ds id=\"+this.ds.getId());\r\n // fetch last_crawl from solr API\r\n LAST_CRAWL = UtilityLib.getLastCrawl( this.ds.getCollection(), this.ds.getId());\r\n \r\n maxSize = ds.getLong(DataSource.MAX_BYTES,\r\n DataSource.defaults.getInt(Group.datasource, DataSource.MAX_BYTES));\r\n depth = ds.getInt(DataSource.CRAWL_DEPTH,\r\n DataSource.defaults.getInt(Group.datasource, DataSource.CRAWL_DEPTH));\r\n if (depth < 1) {\r\n depth = Integer.MAX_VALUE;\r\n }\r\n // initialize PQE\r\n partnerQueryEngine = new PartnerQueryEngine();\r\n\t\r\n }", "protected TaskChain() {\n\t}", "public void beginCrawling() {\n\n if (urlsFile != null\n && emailsFile != null\n && urlsWriter != null\n && emailsWriter != null) {\n crawl(startUrl);\n }\n }", "public interface Crawler {\n\t/**\n\t * Gets the location where crawled content is saved.\n\t * \n\t * @return location string of crawled content\n\t */\n\tpublic String getDumpLocation();\n\n\t/**\n\t * Starts the crawling from the root source of target.\n\t * \n\t * @throws IOException\n\t */\n\tpublic void disperse() throws IOException;\n\n\t/**\n\t * Crawls every <code>url</code> within the <code>target</code> url\n\t * \n\t * @param url\n\t * url which is either <code>target</code> or the one nested\n\t * inside\n\t * @param target\n\t * the target url declared to crawl\n\t * @throws IOException\n\t */\n\tpublic void crawl(final String url, final String target) throws IOException;\n\n\t/**\n\t * Picks up data from webpage.\n\t * \n\t * @param doc\n\t * <code>Document</code> retrieved from <code>url</code>\n\t * @param url\n\t * @return list of <code>Nugget</code> objects consisting of relevant data\n\t */\n\tpublic List<Nugget> scavenge(final Document doc, final String url);\n\n}", "public Worker(int x, int y, int size) {\n super(x, y, size);\n// this.x = x;\n// this.y = y;\n// this.size = size;\n }", "public Crawler(String domain) {\n this.domain = domain;\n this.startUrl = \"http://\" + domain;\n init();\n }", "public LessCSSTask() {\n // empty\n }", "public Clover() {\n\t\tsuper();\n\t}", "public TennisCoach () {\n\t\tSystem.out.println(\">> inside default constructor.\");\n\t}", "public BNHaystackLearnStructureJob() {}", "public ControlWorker(Socket socket) {\n \n }", "void startCrawler() throws ParserConfigurationException, SAXException, IOException;", "public TennisCoach() {\r\n\t\t// just to check whether it is called or not(just for own debugging)\r\n\t\tSystem.out.println(\">> TennisCoach: inside default constructor\");\r\n\t}", "protected TestBench() {}", "public Scraper() {\n\n\t\tsuper();\n\t\tMorphiaManager.setup(MorphiaConstants.HOST, MorphiaConstants.PORT);\n\t\tthis.mDBh= new MongoDBHandler();\n\t}", "public RESTWorkItemHandler() {\n\t}", "public schedulerJob() {\n }", "public void createWorker(Worker worker){\n }", "public MyRunnable(){\t\n\t}", "public HttpTrafficGenerator() {\n\n\t\tworker = new Thread(this, \"HttpTrafficGenerator\");\n\t\ttry {\n\t\t\twebsite = new URL(\"http://google.com\");\n\t\t} catch (MalformedURLException e) {\n\t\t\tthrow new IllegalStateException(\"Internal error\", e);\n\t\t}\n\t}", "private CNWatch() {\n }", "private void innerCrawl(URL url, int limit) {\n\t\t\tsynchronized(urls) {\n\t\t\t\tif(urls.size() <= limit) {\n\t\t\t\t\tqueue.execute(new CrawlWorker(url.toString()));\n\t\t\t\t}\n\t\t\t}\n\t\t}", "private void startCrawler()\n {\n String[] enteredKeywords = getKeywordsFromBar();\n \n if(spider.numSeeds() == 0)\n JOptionPane.showMessageDialog(null, \"Please add some seed URL's\");\n \n else if(spider.numWorkers() == 0)\n JOptionPane.showMessageDialog(null, \"Please add atleast one worker\");\n \n else if(enteredKeywords == null)\n JOptionPane.showMessageDialog(null, \"Please enter some keywords to search for\");\n \n else if(spider.getIndexer() == null)\n JOptionPane.showMessageDialog(null, \"No index found, please create or open one\");\n \n else\n {\n playButton.setEnabled(false);\n startCrawlerItem.setEnabled(false);\n stopButton.setEnabled(true);\n stopCrawlerItem.setEnabled(true);\n spider.initKeywords(enteredKeywords);\n \n if(!canResume) spider.crawl();\n else \n {\n spider.resumeCrawling();\n canResume = false;\n }\n }\n }", "public LinkQueue(){\n }", "public WebWorker(Socket s) {\n socket = s;\n}", "public ThreadPool()\r\n {\r\n // 20 seconds of inactivity and a worker gives up\r\n suicideTime = 20000;\r\n // half a second for the oldest job in the queue before\r\n // spawning a worker to handle it\r\n spawnTime = 500;\r\n jobs = null;\r\n activeThreads = 0;\r\n askedToStop = false;\r\n }", "Collection<PageLink> crawl(CrawlerArgs args);", "public static void main(String[] args) {\n\t\t//\n\t\t//\n\t\t//\n\t\t//\n\t\tMyAbstractWebSpider mywebspider1=new MyConcreteWebSpider();\n\t\t//\n\t\t//\n\t\t//\n\t\tRunnable runnableProcessSpider=new ProcessSpider(mywebspider1);\n\t\tnew Thread(runnableProcessSpider).start();\n\t\t//\n\t\t//\n\t\tRunnable runnableDownLoadPicFactory=new DownLoadPicFactory(mywebspider1);\n\t\tnew Thread(runnableDownLoadPicFactory).start();\n\t\t//\n\t\t//\n\t\t//\n\t\t//\n\t\t//\n\t\t//\n\t\tMyThreadSleep.sleep10s();\n\t\tMyThreadSleep.sleep10s();\n\t\tProcessSpider runnableProcessSpiderToCatchAnswer1=new ProcessSpider(mywebspider1){\n\t\t\t@Override\n\t\t\tpublic void myprocess()\n\t\t\t{\n\t\t\t\t//存在有可能跟其他线程先后进入了同个收藏夹一起进行遍历,此时该收藏夹的搜索就由多个线程一起爬,但是已收入的答案就不会收入url队列里了\n\t\t\t\tfor(;this.getMyWebSpider1().getUrlWarehouse1().sizeStrqueueCollectionUrlToRequest1()>=0;)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"getStrqueueImgUrlToRequest1 size!!!!!!!!!!!!!!!!:\"+this.getMyWebSpider1().getUrlWarehouse1().sizeStrqueueImgUrlToRequest1() );\n\t\t\t\t\tif(this.getMyWebSpider1().getUrlWarehouse1().sizeStrqueueCollectionUrlToRequest1()<=0)\n\t\t\t\t\t{\n\t\t\t\t\t\tMyThreadSleep.sleep5s();\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tMyThreadSleep.sleep2s();\n\t\t\t\t\tfor(int overI=0;overI<=this.getMyWebSpider1().getUrlWarehouse1().sizeStrqueueCollectionUrlToRequest1()-1;overI++)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.getWebDriver1().navigate().to(this.getMyWebSpider1().getUrlWarehouse1().pollStrqueueCollectionUrlToRequest1());\n\t\t\t\t\t\tMyThreadSleep.sleep2s();\n\t\t\t\t\t\t//搜寻每个收藏夹的答案(路径包括问题)\n\t\t\t\t\t\t//mywebspider1.getQuesionUrlWithoutAnswerUrlInSpecifiedPage(driver1);\n\t\t\t\t\t\tthis.getMyWebSpider1().getQuesionUrlWithAnswerUrlInSpecifiedPage(this.getWebDriver1());\n\t\t\t\t\t\tthis.getMyWebSpider1().getUrlToTurnToNextPageInInSpecifiedPage(this.getWebDriver1());\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t};\n\t\tnew Thread((Runnable)runnableProcessSpiderToCatchAnswer1).start();\n\t\t//\n\t\t//\n/*\t\tMyThreadSleep.sleep10s();\n\t\tMyThreadSleep.sleep10s();\n\t\tProcessSpider runnableProcessSpiderToCatchAnswer2=new ProcessSpider(mywebspider1){\n\t\t\t@Override\n\t\t\tpublic void myprocess()\n\t\t\t{\n\t\t\t\t//存在有可能跟其他线程先后进入了同个收藏夹一起进行遍历,此时该收藏夹的搜索就由多个线程一起爬,但是已收入的答案就不会收入url队列里了\n\t\t\t\tfor(;this.getMyWebSpider1().getUrlWarehouse1().sizeStrqueueCollectionUrlToRequest1()>=0;)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"getStrqueueImgUrlToRequest1 size!!!!!!!!!!!!!!!!:\"+this.getMyWebSpider1().getUrlWarehouse1().sizeStrqueueImgUrlToRequest1() );\n\t\t\t\t\tif(this.getMyWebSpider1().getUrlWarehouse1().sizeStrqueueCollectionUrlToRequest1()<=0)\n\t\t\t\t\t{\n\t\t\t\t\t\tMyThreadSleep.sleep5s();\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tMyThreadSleep.sleep2s();\n\t\t\t\t\tfor(int overI=0;overI<=this.getMyWebSpider1().getUrlWarehouse1().sizeStrqueueCollectionUrlToRequest1()-1;overI++)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.getWebDriver1().navigate().to(this.getMyWebSpider1().getUrlWarehouse1().pollStrqueueCollectionUrlToRequest1());\n\t\t\t\t\t\tMyThreadSleep.sleep2s();\n\t\t\t\t\t\t//搜寻每个收藏夹的答案(路径包括问题)\n\t\t\t\t\t\t//mywebspider1.getQuesionUrlWithoutAnswerUrlInSpecifiedPage(driver1);\n\t\t\t\t\t\tthis.getMyWebSpider1().getQuesionUrlWithAnswerUrlInSpecifiedPage(this.getWebDriver1());\n\t\t\t\t\t\tthis.getMyWebSpider1().getUrlToTurnToNextPageInInSpecifiedPage(this.getWebDriver1());\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t};\n\t\tnew Thread((Runnable)runnableProcessSpiderToCatchAnswer2).start();*/\n\t\t//\n\t\t//\n\t\t//\n\t\t//\n\t\tMyThreadSleep.sleep10s();\n\t\tMyThreadSleep.sleep10s();\n\t\tProcessSpider runnableProcessSpiderToCatchContent=new ProcessSpider(mywebspider1){\n\t\t\t@Override\n\t\t\tpublic void myprocess()\n\t\t\t{\n\t\t\t\tfor(;this.getMyWebSpider1().getUrlWarehouse1().sizeStrqueueAnswerUrlToRequest1()>=0;)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"sizeStrqueueAnswerUrlToRequest1 size!!!!!!!!!!!!!!!!:\"+this.getMyWebSpider1().getUrlWarehouse1().sizeStrqueueAnswerUrlToRequest1() );\n\t\t\t\t\tif(this.getMyWebSpider1().getUrlWarehouse1().sizeStrqueueAnswerUrlToRequest1()<=0)\n\t\t\t\t\t{\n\t\t\t\t\t\tMyThreadSleep.sleep5s();\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tthis.getWebDriver1().navigate().to(this.getMyWebSpider1().getUrlWarehouse1().pollStrqueueAnswerUrlToRequest1());\n\t\t\t\t\t//\n\t\t\t\t\tMyThreadSleep.sleep1s();\n\t\t\t\t\t//\n\t\t\t\t\tint scrollLength=0;\n\t\t\t\t\t//\n\t\t\t\t\tfor(int overI=0;overI<=100-1;overI++)\n\t\t\t\t\t{\n\t\t\t\t\t\tJavascriptExecutor jsDriverTemp = (JavascriptExecutor)this.getWebDriver1();\n\t\t\t\t\t\tscrollLength=scrollLength+200;\n\t\t\t\t\t\tString js=\"document.body.scrollTop =\"+scrollLength;\n\t\t\t\t\t\tjsDriverTemp.executeScript(js);\n\t\t\t\t\t\t//\n\t\t\t\t\t\tMyThreadSleep.sleep100ms();\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t\t//get pic url in specified page\n\t\t\t\t\tthis.getMyWebSpider1().getSpecifiedAnswerContent2(this.getWebDriver1());\n\t\t\t\t\t//\n\t\t\t\t\t//\n\n\t\t\t\t\t//\n\t\t\t\t\t//\n\t\t\t\t}\n\n\t\t\t}\n\t\t};\n\t\tnew Thread((Runnable)runnableProcessSpiderToCatchContent).start();\n\t}", "void execute(String link) throws CrawlerWorkerException;", "public TrafficCounter(ScheduledExecutorService executor, String name, long checkInterval)\r\n/* 113: */ {\r\n/* 114:254 */ if (name == null) {\r\n/* 115:255 */ throw new NullPointerException(\"name\");\r\n/* 116: */ }\r\n/* 117:258 */ this.trafficShapingHandler = null;\r\n/* 118:259 */ this.executor = executor;\r\n/* 119:260 */ this.name = name;\r\n/* 120: */ \r\n/* 121:262 */ init(checkInterval);\r\n/* 122: */ }", "public SearchTrack() {\n\t\tsuper();\n\t}", "private CheckingTools() {\r\n super();\r\n }", "public Scheduler()\r\n {\r\n town = new Graph<String>();\r\n }", "public Executor(){\n errorsMade = 0;\n decisionsMade = 0; //total number of decisions made accross all days\n // dailyBenchmark = 4; //number of apps that you shld get right\n disads = 0;\n numApps = 7; //number of apps in one day\n numDay = 1;\n errorThreshold = 3; //number of errors for one disadulation. threshold of 3 = 2 errors allowed. 3rd one is a disad.\n }", "BackgroundWorker (String page, String email, String username, String password, int appversion, Context context) {this.page=page; this.context=context; this.username=username; this.password=password; this.email=email; this.appversion=appversion; flag=6;}", "public Chick() {\n\t}", "private CollectTaskPool() {\n\t\tsuper();\n\t}", "CrawlController build(CrawlParameters parameters) throws Exception;", "public NSEIndexITDImportJob() {\n super() ;\n }", "public CrawlHandler(){\n\t\tthis.idToItem=new HashMap<String,Item>();\n\t\tthis.parser=new ItemReviewsPageParser();\n\t}", "public void crawl(String url);", "@Override\r\n\tpublic void crawl_data() {\n\t\t\r\n\t}", "private RequestExecution() {}", "public ParallelReceptacle() {\n }", "public Warehouse() {\n\t\tindexes = new ArrayList<Integer>();\n\t\tlengths = new ArrayList<Integer>();\n\t\t\n\t\t// Initialize suffix tree\n\t\tin = new GeneralizedSuffixTree();\n\t\t\n\t\t// Get the number of cores available at runtime\n\t\tnumOfCores = Runtime.getRuntime().availableProcessors();\n\t\t\n\t\t// This list has to be synchronized because it gets filled\n\t\t// up by multiple threads\n\t\tsetForTypeahead = Collections.synchronizedSet(new HashSet<String>());\n\t\t\n\t\t// This list has to be synchronized because it gets filled\n\t\t// up by multiple threads\n\t\tsetForSuggestions = Collections.synchronizedSet(new HashSet<StringScore>());\n\t\t\n\t\t// This list has to be synchronized because it gets filled\n\t\t// up by multiple threads\n\t\tsetForPredicates = Collections.synchronizedSet(new HashSet<StringScore>());\n\t\t\n\t\t\n\t\t// Map for semantic relations for words\n\t\tsemanticRelationsMap = new HashMap<String, ArrayList<String>> ();\n\t\t\n\t\t// Stats variables initialized\n\t\tnumOfSearchTasks = numOfIndexHits = 0;\n\t\tpruningPercentage = totalTime = suffixTreeTime = 0.0;\n\t}", "private ThreadUtil() {\n \n }", "public void crawl(URL url, int limit) {\n\t\turls.add(url);\n\t\tqueue.execute(new CrawlWorker(url.toString()));\n\n\t\tqueue.finish();\n\t\tqueue.shutdown();\n\t}", "public void run() {\n\t\t\tString html = \"\";\n\t\t\ttry {\n\t\t\t\thtml = HTTPFetcher.fetchHTML(this.url);\n\t\t\t} catch (UnknownHostException e) {\n\t\t\t\tSystem.out.println(\"Unknown host\");\n\t\t\t} catch (MalformedURLException e) {\n\t\t\t\tSystem.out.println(\"MalformedURL\");\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.out.println(\"IOException\");\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tif(html != null) {\n\t\t\t\t\tthis.newLinks = LinkParser.listLinks(new URL(this.url), html);\n\t\t\t\t}\n\t\t\t} catch (MalformedURLException e) {\n\t\t\t\tSystem.out.println(\"MalformedURL\");\n\t\t\t}\n\t\t\tif(newLinks != null) {\n\t\t\t\tfor(URL theURL : newLinks) {\n\t\t\t\t\tif(!(urls.contains(theURL))) {\n\t\t\t\t\t\tsynchronized(urls) {\n\t\t\t\t\t\t\turls.add(theURL);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tinnerCrawl(theURL, limit);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tInvertedIndex local = new InvertedIndex();\n\t\t\t\tString no_html = HTMLCleaner.stripHTML(html.toString());\n\t\t\t\tString[] the_words = WordParser.parseWords(no_html);\n\t\t\t\tlocal.addAll(the_words, this.url);\n\t\t\t\tindex.addAll(local);\n\t\t\t}\n\t\t}", "public SingleWorkerPoolExecutor() {\n this.worker = new Worker(taskQueue);\n\n // Nothing bad as worker is blocked by an emptiness of a task\n // queue. Adding to this task queue will be possible after worker pool\n // finishes construction\n worker.start();\n }", "public static void main(String args[]) {\n if (args.length < 3 || args.length > 5) {\n System.out.println(\"Usage: Crawler {start URL} {database environment path} {max doc size in MB} {number of files to index}\");\n System.exit(1);\n }\n\n System.out.println(\"Crawler starting\");\n String startUrl = args[0];\n String envPath = args[1];\n Integer size = Integer.valueOf(args[2]);\n Integer count = args.length == 4 ? Integer.valueOf(args[3]) : 100;\n\n StorageInterface db = StorageFactory.getDatabaseInstance(envPath);\n\n Crawler crawler = new Crawler(startUrl, db, size, count);\n\n System.out.println(\"Starting crawl of \" + count + \" documents, starting at \" + startUrl);\n crawler.start();\n\n while (!crawler.isDone())\n try {\n Thread.sleep(10);\n } catch (InterruptedException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n\n // TODO: final shutdown\n\n System.out.println(\"Done crawling!\");\n }", "@Override\r\n public void run() {\r\n // mark as starting\r\n state.getStatus().starting();\r\n try {\r\n state.getProcessor().start();\r\n if (ds.getType().equals(\"salesforce\")) {\r\n // leancog registration check\r\n \tRegistrationCheck checker = new RegistrationCheck();\r\n \tif (!checker.verify()) {\r\n \t\tException failed = new Exception(REGISTRATION_ERROR_MSG);\r\n \t\tLOG.error(REGISTRATION_ERROR_MSG, failed);\r\n \t\tstate.getStatus().failed(failed);\r\n \t\treturn;\r\n \t}\r\n \r\n runSalesforceCrawl();\r\n \r\n }\r\n } catch (Throwable t) {\r\n LOG.warn(\"Exception in Salesforce crawl\", t);\r\n state.getStatus().failed(t);\r\n } finally {\r\n boolean commit = ds.getBoolean(DataSource.COMMIT_ON_FINISH, true);\r\n try {\r\n state.getProcessor().finish();\r\n // optional commit - if false then it streamlines multiple small crawls\r\n state.getProcessor().getUpdateController().finish(commit);\r\n } catch (Exception e) {\r\n LOG.error(\"Exception in Salesforce crawl\", e);\r\n }\r\n if (stopped) {\r\n state.getStatus().end(JobState.STOPPED);\r\n } else {\r\n state.getStatus().end(JobState.FINISHED);\r\n }\r\n }\r\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tWebCrawler crawlerObj = new WebCrawler(\"https://www.flipkart.com/\",\"flipkart.com\",2);\r\n\t\t//WebCrawler crawlerObj = new WebCrawler(\"http://localhost:80/webCrawl/Web//\",\"localhost:80/webCrawl/Web\",3);\r\n\t\t\r\n\t\tSystem.out.println(\"Crawling Started..\");\r\n\t\tcrawlerObj.crawl();\r\n\t\tSystem.out.println(\"Reading from Database..\");\r\n\t\tcrawlerObj.printLinks();\r\n\t\t\r\n\t}", "public Parser()\n{\n //nothing to do\n}", "public void startCrawl() throws IOException {\n\t\tElements paragraphs = wf.fetchWikipedia(source);\n\t\tqueueInternalLinks(paragraphs);\n\n\t\t// loop until we index a new page\n\t\tString res;\n\t\tdo {\n\t\t\tres = crawl();\n\n\t\t} while (res == null);\n\t}", "public QueryWiki() {\n }", "public AbstractParallelAlgorithm()\n {\n this(null);\n }", "public Crawler(String seedUrlStr, int toDiscover)\n throws InterruptedException, FileNotFoundException,\n UnsupportedEncodingException {\n HTMLFetcher fetcher = null;\n urlQueue.add(seedUrlStr);\n String urlStr = \"\";\n while (discoveredUrls < toDiscover) {\n urlStr = urlQueue.poll(TIMEOUT_VAL, TimeUnit.SECONDS);\n\n if (urlStr == null) {\n // Happens if the crawler has waited for a new URL in the queue\n // for more than the timeout value. This means that all leafs\n // have been found and the crawler cannot continue.\n break;\n }\n\n // Acquire mutex to avoid collision when adding and\n // comparing at the same time\n mutex.acquireUninterruptibly();\n polledUrls.add(urlStr);\n mutex.release();\n\n System.out.println(\"Crawling: \" + urlStr);\n try {\n fetcher = new HTMLFetcher(new URL(urlStr), this);\n } catch (MalformedURLException e) {\n continue;\n }\n\n fetcherExecutor.execute(fetcher);\n }\n System.out.println(\"DONE: Discovered \" + discoveredUrls + \" URLs\");\n\n System.out.println(\"Dumping them into: urls.txt\");\n Collection<String> toDump = new LinkedList<String>(polledUrls);\n toDump.addAll(urlQueue);\n dumpCollection(toDump, \"urls.txt\");\n\n System.out.println(\"Waiting for \" + TIMEOUT_VAL + \" seconds for \"\n + Thread.activeCount() + \" threads to terminate...\");\n fetcherExecutor.awaitTermination(TIMEOUT_VAL, TimeUnit.SECONDS);\n }", "private ClinicFileLoader() {\n\t}", "private FlowExecutorUtils()\r\n {\r\n // Private constructor to prevent instantiation\r\n }", "public Task() {\n\t}", "NetThread(){}" ]
[ "0.6954506", "0.66250545", "0.6416182", "0.64066744", "0.63510627", "0.63263303", "0.63006175", "0.6281855", "0.6246946", "0.6239298", "0.6237295", "0.6225297", "0.61722434", "0.6157102", "0.6157102", "0.6144966", "0.6108791", "0.610473", "0.60745233", "0.6066214", "0.6056755", "0.60479593", "0.6047681", "0.60195124", "0.60048264", "0.5996097", "0.5991554", "0.5975848", "0.5968931", "0.5932717", "0.59253204", "0.591791", "0.5917085", "0.59120387", "0.5904076", "0.5900996", "0.58878565", "0.5878137", "0.58689195", "0.5863665", "0.5863554", "0.58444464", "0.5844192", "0.5840652", "0.5836305", "0.58357143", "0.58351266", "0.5831686", "0.58283705", "0.58123773", "0.57979584", "0.5775614", "0.57445985", "0.57314336", "0.5726089", "0.57205683", "0.5715991", "0.5699177", "0.5697668", "0.56824034", "0.56727135", "0.56664604", "0.56108356", "0.56083286", "0.55999005", "0.5592413", "0.5590349", "0.55674195", "0.5558318", "0.55539143", "0.5549281", "0.55450463", "0.5543827", "0.55428386", "0.5541104", "0.55353", "0.5530025", "0.5529904", "0.5529313", "0.5523013", "0.55159277", "0.5513141", "0.55110854", "0.5510414", "0.55059713", "0.5500269", "0.5494268", "0.54937065", "0.5493035", "0.5492644", "0.5491808", "0.5483778", "0.5473018", "0.5467548", "0.54622114", "0.54588234", "0.5456147", "0.54509664", "0.54502875", "0.5448083" ]
0.7437721
0
Used to create a new task for the queue when a worker has found a new, unique link.
private void innerCrawl(URL url, int limit) { synchronized(urls) { if(urls.size() <= limit) { queue.execute(new CrawlWorker(url.toString())); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void newTask()\n {\n \t//TODO add alarm\n \tTask task = new Task(taskName.getText().toString(), taskDetails.getText().toString());\n \tdb.createTask(task);\n \t//TODO Tie notification to an alarm\n \t//Create notification\n \tIntent notifyIntent = new Intent(this, TaskNotification.class);\n \tnotifyIntent.putExtra(\"title\", task.name); //add title name\n \tnotifyIntent.putExtra(\"id\", (int) task.id); //add id\n \tstartActivity(notifyIntent); //create the intent\n \t\n \trefreshData();\n }", "private void queueTask(Version theTask) {\n\tsynchronized(_taskQueue) {\n\t _taskQueue.add(theTask);\n\t}\n }", "Task createTask();", "Task createTask();", "Task createTask();", "@Override\n\tpublic void addTask(ISimpleTask task) {\n\t\ttry {\n\t\t\tqueue.put(task);\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void createTasks(Integer _optID, String _tupleTag, String _taskType, String _info1, String _info2, String _destIP, String _port, String _location, long timestamp, Object _appSpecific){ \r\n //System.out.print(\"Create tasks\");\r\n boolean flag = false;\r\n String defaultIP = \"-1\";\r\n String defaultPort = \"-1\";\r\n \r\n //use wildcard to let one worker randomly choose the job to run\r\n //System.out.println(\"---What is optID: \" +_optID);\r\n if(_destIP.equals(\"RANDOM\")){\r\n int tempTaskID = getUpdatedTaskID();\r\n \r\n insertIntoParaList(tempTaskID, _optID, _tupleTag, _taskType,defaultIP,_info1,_info2,defaultPort,_location, timestamp,_appSpecific);\r\n flag = true;\r\n addEntryToResultList(_optID,flag);\r\n //------THE TASK IS INSERTED HERE\r\n insertTask(tempTaskID);\r\n }\r\n //send tuples to all\r\n else if(_destIP.equals(\"ALL\")){\r\n //Iterate through all sites that subscribe to certain types of task \r\n //System.out.println(\"infoSys.getSiteList(): \"+infoSys.getSiteList());\r\n Iterator it = infoSys.getSiteList().entrySet().iterator();\r\n while (it.hasNext()) {\r\n Map.Entry entry = (Map.Entry) it.next();\r\n _destIP = ((String) entry.getKey());\r\n ConcurrentHashMap<String, String> subscribeType = (ConcurrentHashMap<String, String>) entry.getValue();\r\n \r\n //option 2, if there is multiple subscribers of a certain taskType in one site\r\n Iterator subIt = subscribeType.entrySet().iterator();\r\n while (subIt.hasNext()) {\r\n Map.Entry subEntry = (Map.Entry) subIt.next();\r\n String[] typeAndAssociate = subEntry.getValue().toString().split(\",\");\r\n if (typeAndAssociate[0].equals(_tupleTag) && typeAndAssociate[1].equals(_taskType)) {\r\n _port = subEntry.getKey().toString();\r\n\r\n int tempTaskID = getUpdatedTaskID();\r\n insertIntoParaList(tempTaskID, _optID, _tupleTag, _taskType,_destIP, _info1,_info2,_port,_location, timestamp,_appSpecific);\r\n //System.out.println(\"Master out: \"+\"--\"+_tupleTag+\"--\"+_taskType+\"--\"+_optID+\"--\"+_destIP+\"--\"+_budget+\"--\"+_deadline+\"--\"+_port);\r\n flag = true;\r\n addEntryToResultList(_optID,flag);\r\n //------THE TASK IS INSERTED HERE\r\n insertTask(tempTaskID);\r\n \r\n }\r\n }\r\n }\r\n }\r\n //if user choose one specific worker, only send the message to it\r\n else{ \r\n //System.out.println(infoSys.getSiteList());\r\n //Check if this subscriber exists\r\n if (infoSys.hasAssociateSubscriber(_destIP, _port)) {\r\n int tempTaskID = getUpdatedTaskID();\r\n //System.out.println(\"Master out: \"+\"--\"+_tupleTag+\"--\"+_taskType+\"--\"+_optID+\"--\"+_destIP+\"--\"+_budget+\"--\"+_deadline+\"--\"+_port);\r\n insertIntoParaList(tempTaskID, _optID, _tupleTag, _taskType,_destIP,_info1,_info2,_port,_location, timestamp,_appSpecific);\r\n flag = true;\r\n addEntryToResultList(_optID,flag);\r\n insertTask(tempTaskID);\r\n } else {\r\n System.out.println(\"Incorrect destIP or destPort for creating task!\");\r\n }\r\n } \r\n //create entry in resultList\r\n addEntryToResultList(_optID,flag);\r\n }", "private void assignWork(String worker, String task) {\n System.out.println(\"assign work and create node \" + worker + \"/task\");\n zk.setData(worker, task.getBytes(), -1,\n (rc, path, ctx, data) -> {\n System.out.println(KeeperException.Code.get(rc));\n logger.info(\"DISTMASTER: task \" + task + \" has been created\");\n }, null);\n }", "String addTask(Task task);", "private static void addTask() {\n Task task = new Task();\n System.out.println(\"Podaj tytuł zadania\");\n task.setTitle(scanner.nextLine());\n System.out.println(\"Podaj datę wykonania zadania (yyyy-mm-dd)\");\n\n while (true) {\n try {\n LocalDate parse = LocalDate.parse(scanner.nextLine(), DateTimeFormatter.ISO_LOCAL_DATE);\n task.setExecuteDate(parse);\n break;\n } catch (DateTimeParseException e) {\n System.out.println(\"Nieprawidłowy format daty. Spróbuj YYYY-MM-DD\");\n }\n }\n\n task.setCreationDate(LocalDate.now());\n\n queue.offer(task);\n System.out.println(\"tutuaj\");\n }", "protected abstract void createTasks();", "public void createTask()\n {\n boolean copy = false;\n if(check.checkTask(taskName.getText()))\n {\n // Go through list and make sure task isnt already there\n // If there is one already in list, then tell user there it is on list\n if(!(Item.getToDoList().isEmpty()))\n {\n for(Item task : Item.getToDoList())\n {\n if(task.getTask().equals(taskName.getText()))\n {\n status.setText(\"Task is already on the list. \");\n copy = true;\n }\n }\n\n if(!copy)\n {\n // If not copy, add the task to the list by calling method\n addTaskAndDisplay(taskName.getText(), completionDate.getText(), taskCompletedCheckBox.isSelected());\n }\n }\n\n // If list is empty, then no need to check if task is copy\n else\n {\n addTaskAndDisplay(taskName.getText(), completionDate.getText(), taskCompletedCheckBox.isSelected());\n }\n\n }\n\n // If task is invalid, alert user\n else\n {\n status.setText(\"Task invalid. Try again. \");\n }\n\n }", "void addSubTask(AuctionTask task);", "public abstract AbstractTask createTask(String repositoryUrl, String id, String summary);", "public void newTask() {\r\n\r\n todoTaskGui(\"Create\", null);\r\n }", "final void pushTask(Runnable t) {\n Runnable[] q = queue;\n int mask = q.length - 1;\n int s = sp;\n setSlot(q, s & mask, t);\n storeSp(++s);\n if ((s -= base) == 1)\n pool.signalWork();\n else if (s >= mask)\n growQueue();\n }", "public Task getNext()\n {\n\treturn new Task(toDo.get(0));\n }", "public void createWorker(Worker worker){\n }", "int insertTask(TaskInfo taskInfo);", "public Task makeTask() {\n Task new_task = new Task();\n new_task.setAction(this);\n new_task.setDeadline(\n new Date(System.currentTimeMillis() + deadlineSeconds() * 1000L));\n\n return new_task;\n }", "private synchronized void addTask(Runnable runnable) {\r\n mTaskQueue.add(runnable);\r\n try {\r\n if (mPoolThreadHandler==null){\r\n mSemaphorePoolThreadHandler.acquire();\r\n }\r\n } catch (InterruptedException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n mPoolThreadHandler.sendEmptyMessage(0x110);\r\n }", "void allocateWorker(Work work);", "public void add(Task task){ this.tasks.add(task);}", "@Override\n\t\tprotected String doInBackground(Task... arg0) {\n\t\t\tString taskID = TfTaskRepository.addTask(arg0[0], \n\t\t\t getApplicationContext());\n\t\t\t\n\t\t\ttaskID = taskID + \"\\n\";\n\t\t\t\n\t\t\t//saving the ID local\n\t\t\tlt.saveTaskId(taskID, getApplicationContext());\n\t\t\t\n\t\t\treturn null;\n\t\t}", "boolean addTask(Task newTask);", "protected void onPostExecute(Void v) {\n if(repeating) {\n Toast.makeText(Dash.this, \"Task will be re-added!\", Toast.LENGTH_LONG).show();\n }\n\n // reload task list\n mTaskRetriever = new TaskRetriever();\n mTaskRetriever.execute((Void) null);\n }", "private void addTaskToServer() {\n\t\twriter.println();\n\t\tSystem.out.println();\n\t\tNumberFormat formatter = new DecimalFormat(\"#0.00000\");\n\t\tfor (Iterator<Task> iterator = this.generatedTasks.iterator(); iterator.hasNext();) {\n\t\t\tTask t = iterator.next();\n\t\t\twriter.println(\"current time=\" + currentTime + \" ,tasks not assigned \" + t.getArrivalTime() + \" \"\n\t\t\t\t\t+ t.getprocessingTime());\n\t\t\tSystem.out.println(\"current time=\" + currentTime + \" ,tasks not assigned \" + t.getArrivalTime() + \" \"\n\t\t\t\t\t+ t.getprocessingTime());\n\t\t\tif (t.getArrivalTime() == currentTime || t.isLateProcessing()) {\n\t\t\t\t// if it can be dispatched\n\t\t\t\tif (this.scheduler.dispatchTask(t) == true)\n\t\t\t\t\titerator.remove();\n\t\t\t\telse\n\t\t\t\t\tt.setLateProcessing(true);\n\t\t\t}\n\t\t}\n\t}", "public void enqueue(String url) {\n while(is_locked){\n try {\n // timer_counter = timer_counter + 1;\n // if (timer_counter == 20) {\n // is_locked = false;\n // }\n Thread.sleep(100);\n } catch(InterruptedException ex) {\n Thread.currentThread().interrupt();\n }\n }\n\n is_locked = true;\n queue.add(url);\n is_locked = false;\n \n }", "void onNewTaskComplete(String name, String notes, int position);", "void addTask(Task task);", "public Task(String url) {\n this.url = url;\n logger.debug(\"Created task for \" + url);\n }", "void addTask(Task person) throws UniqueTaskList.DuplicateTaskException;", "@Override\n\tpublic void addTask(Task task) {\n\t\t\n\t}", "@Override\n public <T> void onCreate(Task<T> task) {\n\n final String taskId = task.getTaskId();\n\n if (!StringUtils.isEmpty(taskId)) {\n if (inProgressQueue.containsKey(taskId)) {\n// task.setSkipExecution(true);\n } else {\n inProgressQueue.put(taskId, task);\n// task.setSkipExecution(false);\n }\n } else {\n logger.warn(\"Task Id can not be null for qnqueing task\");\n }\n }", "public void createTask() {\n \tSystem.out.println(\"Inside createTask()\");\n \tTask task = Helper.inputTask(\"Please enter task details\");\n \t\n \ttoDoList.add(task);\n \tSystem.out.println(toDoList);\n }", "int createParentTask();", "@Override\n\tprotected Intent doInBackground(Integer... params)\n\t{\n\t\tDataBaseHelper myDbHelper = new DataBaseHelper(context);\n\t\tmyDbHelper.open();\n\t\t\n\t\tint taskId = params[0];\n\t\tTask task = myDbHelper.getTask(taskId, false);\n\t\t\n\t\tif (task == null) // just finished last task\n\t\t{\n\t\t\tIntent intent = new Intent();\n\t\t\tintent.setClass(context, EndActivity.class);\n\t\t\tmyDbHelper.close();\n\t\t\treturn intent;\n\t\t}\n\t\t\n\t\tLog.i(TAG, \"New task id=\"+task.getId()+\", type=\"+task.getType());\n\t\t\n\t\tIntent intent = new Intent(Task.A_NEW_TASK);\n\t\tintent.putExtra(Task.class.getSimpleName(), task);\n\t\t\n\t\tswitch (task.getType())\n\t\t{\n\t\tcase ARCHITECTURAL_ELEMENT:\n\t\t\tintent.setClass(context, TaskArchElemActivity.class);\n\t\t\tbreak;\n\t\tcase PLACE:\n\t\t\tintent.setClass(context, TaskPlaceActivity.class);\n\t\t\tbreak;\n\t\tcase ANSWER:\n\t\t\tintent.setClass(context, TaskAnswerActivity.class);\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tmyDbHelper.close();\n\t\t\n\t\treturn intent;\n\t}", "void addDoneTask(Task task);", "private UniqueElementSingleThreadWorker()\n {\n _state = ActivityState.INITIALIZING;\n _taskQueue = new UniqueTagQueue<String, Runnable>();\n \n _taskThread = new Thread(\"UniqueElementSingleThreadWorker-\" + COUNTER.incrementAndGet())\n {\n @Override\n public void run()\n {\n while(true)\n {\n try\n {\n Runnable task = _taskQueue.blockingPop();\n if(task == SHUTDOWN_TASK)\n {\n break;\n }\n task.run();\n }\n catch(InterruptedException ex) { }\n //Catch run time exceptions that the runnable might throw so that the thread does not die\n catch(RuntimeException ex)\n {\n ErrorReporter.reportUncaughtException(ex);\n }\n }\n \n _state = ActivityState.SHUT_DOWN;\n }\n };\n }", "public Key<Microtask> assignSpecificMicrotask( final String workerID, final String currentKey)\n\t{\n\t\tloggedInWorkers.add( workerID );\n\n\t\t// Look for a microtask, checking constraints on it along the way\n\t\tString microtaskKey = currentKey;\n\t\tBoolean isReview = false, canAssign = false;\n\t\t\n\t\t//Checks if microtask is in Review or Microtask Queue\n\t\tif(reviewQueue.contains(microtaskKey)){\n\t\t\tisReview = true;\n\t\t\tcanAssign = true;\n\t\t}\n\t\telse if(microtaskQueue.contains(microtaskKey)){\n\t\t\tcanAssign = true;\t\t\t\n\t\t}\n\t\t\n\t\tMicrotask microtask=null;\n\t\t// If there are no more microtasks currently available, return null\n\t\t//&& assignmentIsValid( microtaskKey, workerID)\n\t\tif ( microtaskKey != null && canAssign ) {\n\t\t\tMicrotask mtask = ofy().load().key( Microtask.stringToKey(microtaskKey) ).now();\n\t\t\tif( mtask!=null ){\n\n\t\t\t\tif( isReview ){\n\t\t\t\t\treviewQueue.remove( microtaskKey );\n\t\t\t\t\tFirebaseService.writeReviewQueue(new QueueInFirebase(reviewQueue), project.getID() );\n\t\t\t\t} else {\n\t\t\t\t\tmicrotaskQueue.remove( microtaskKey );\n\t\t\t\t\tFirebaseService.writeMicrotaskQueue(new QueueInFirebase(microtaskQueue), project.getID() );\n\t\t\t\t}\n\t\t\t\t// assign it to the worker\n\t\t\t\tmtask.setWorkerId( workerID );\n\t\t\t\tmicrotaskAssignments.put( workerID, Microtask.keyToString( mtask.getKey() ) );\n\n\t\t\t\t//ofy().save().entity(mtask).now();\n\t\t\t\tmicrotask=mtask;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tSystem.out.println(\"((((((((((((erroooor mtask null\");\n\t\t\t}\n\t\t}\n\n\n\n\t\tif( microtask != null ){\n\n\t\t\tFirebaseService.writeMicrotaskAssigned( Microtask.keyToString( microtask.getKey() ), workerID, project.getID(), true);\n\n\t\t\tHistoryLog\n\t\t\t\t.Init(project.getID())\n\t\t\t\t.addEvent( new MicrotaskDequeued(microtask));\n\n\t\t\tHistoryLog\n\t\t\t\t.Init(project.getID())\n\t\t\t\t.addEvent(new MicrotaskAssigned(microtask,workerID,\"picked\"));\n\n\t\t\t// return the assigned microtask key\n\t\t\treturn microtask.getKey();\n\t\t}\n\n\t\treturn null;\n\t}", "public Task task()\n {\n return _link.first;\n }", "public void startTaskTriggerCheckerThread() {\n new Thread(new Runnable() {\n @Override\n public void run() {\n canRunEnqueueTaskThread.set(true);\n while(canRunEnqueueTaskThread.get()) {\n try {\n Thread.sleep(1000);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n if(taskEnqueued.get() || canRunTaskThread.get()) { //do not enqueue the task if an instance of that task is already enqueued or running.\n continue;\n //log(PrioritizedReactiveTask.this.getClass().getSimpleName() + \" already in queue or is currently executing\");\n } else if(shouldTaskActivate()) {\n System.out.println(\"Thread \" + Thread.currentThread().getId() + \" enqueued task: \" + this.getClass().getSimpleName());\n taskQueue.add(PrioritizedReactiveTask.this);\n activeTasks.add(PrioritizedReactiveTask.this);\n taskEnqueued.set(true);\n try {\n Thread.sleep(5000);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n }\n }\n }).start();\n }", "protected void addWorker(IWorkerConfiguration workerCfg) {\n if (!workerCfg.activate())\n return;\n \n log.debug(\"Adding new worker to the pool\");\n \n try {\n Class taskClass = Class.forName(workerCfg.getWorkerTask());\n\n int numWorker = (workerCfg.getConcurrentExecutions() == 0 ? 1 : workerCfg.getConcurrentExecutions());\n for(int i = 0; i < numWorker; i++) {\n RunningWorkerInstance rWorker = new RunningWorkerInstance();\n rWorker.workerName = workerCfg.getName();\n rWorker.task = (IWorkerTask) taskClass.newInstance();\n rWorker.task.setName(workerCfg.getName() + \":\" + i);\n rWorker.task.setParameters(workerCfg.getTaskParameters());\n\n Interval interval = workerCfg.getInterval();\n if (interval != null) \n rWorker.runningWorker = pool.scheduleWithFixedDelay(rWorker.task, 0, interval.getLength(), interval.getUnit());\n else\n rWorker.runningWorker = pool.submit(rWorker.task);\n\n workers.add(rWorker);\n \n log.debug(\"Added new worker instance [\" + workerCfg.getName() + \"] to the pool\");\n }\n } catch (ClassNotFoundException cnfe) {\n log.error(\"Unable to add worker \" + workerCfg.getName() + \" because task class [\" + workerCfg.getWorkerTask() + \"] could not be found\");\n } catch (InstantiationException ie) { \n log.error(\"Unable to add worker \" + workerCfg.getName() + \" because task class [\" + workerCfg.getWorkerTask() + \"] could not be created\");\n } catch (IllegalAccessException iae) {\n log.error(\"Unable to add worker \" + workerCfg.getName() + \" because task class [\" + workerCfg.getWorkerTask() + \"] could not be created\");\n } catch (ClassCastException cce) {\n log.error(\"Unable to add worker \" + workerCfg.getName() + \" because task class [\" + workerCfg.getWorkerTask() + \"] is not a WorkerTask object\");\n } catch (TaskConfigurationException tce) {\n log.error(\"Unable to add worker \" + workerCfg.getName() + \" because task could not be configured correctly [\" + tce.getMessage() + \"]\");\n }\n }", "public Task makeTask() {\n Task genTask = new Task(this, state, generateLocationInNeighborhood());\n\n\n //state.printlnSynchronized(\"base bounty in neighborhood \" + id + \" is = \" + (totalTime / count));\n genTask.setBaseBounty(getBaseBounty(genTask.getJob().jobType, genTask));\n double br = getBountyRate(genTask.getLocation(),genTask.getJob().jobType);\n totalBr += br;\n genTask.setBountyRate(br);\n\n\n totalBaseBounty += genTask.getBounty();\n tasks.add(genTask);\n\n totalNumTasksGenerated++;\n return genTask;\n }", "Map<String, Object> forceStartTaskInstance(User loginUser, int queueId);", "private void m1557a(Task task) {\n synchronized (f1826f) {\n if (f1827g == null) {\n f1827g = new SideChannelManager(this.f1828d.getApplicationContext());\n }\n f1827g.queueTask(task);\n }\n }", "private void workOnQueue() {\n }", "private void enterToRunwayQueue() {\n\t\tqueue.insert(this);\n\t}", "@Override\n\tpublic void run() {\n\t\tlong starttime = System.currentTimeMillis();\n\n\t\tboolean started = statusMap.get(type);\n\t\tif (!started) {\n\n\t\t\tstatusMap.put(type, true);\n\t\t\tlogger.info(\n\t\t\t\t\t\"task of id add to queue of busType : {} started,current milestone : {}\",\n\t\t\t\t\tAptConstants.BUS_NAME_MAP.get(type), milestone);\n\t\t\ttry {\n\t\t\t\tIdGeneratorQueue queue = QueueUtil\n\t\t\t\t\t\t.getIdGeneratorQueue(AptConstants.BUS_NAME_MAP.get(type));\n\n\t\t\t\tif (null == queue) {\n\t\t\t\t\tlogger.error(\n\t\t\t\t\t\t\t\"task of add id to queue faile , no queue of name: {} finded\",\n\t\t\t\t\t\t\tAptConstants.BUS_NAME_MAP.get(type));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tlogger.info(\"queue : {} has {} id not uesed.\", queue.getSize());\n\t\t\t\tlong nextMilestone = generatorService.nextMilestone(type);\n\t\t\t\tlogger.info(\"task of add id to queue,nextMilestone is {}\", nextMilestone);\n\n\t\t\t\tif (nextMilestone <= milestone) {\n\t\t\t\t\tlogger.error(\n\t\t\t\t\t\t\t\"task of get next milestone error,nextMileStone is smaller, busType: {},miletone : {}\",\n\t\t\t\t\t\t\tAptConstants.BUS_NAME_MAP.get(type), milestone);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tlong start = milestone + 1;\n\t\t\t\tlong end = nextMilestone + 1;\n\n\t\t\t\tlogger.info(\"start add id to queue : {},start : {},end : {}\",\n\t\t\t\t\t\tAptConstants.BUS_NAME_MAP.get(type), start, end);\n\t\t\t\tqueue.setMileStone(nextMilestone);\n\t\t\t\t//填充数据 满等待\n\t\t\t\tfor (long i = start; i <= end; i++) {\n\t\t\t\t\tqueue.putId(i);\n\t\t\t\t}\n\t\t\t\tlogger.info(\"success add id to queue! busType : {}\",\n\t\t\t\t\t\tAptConstants.BUS_NAME_MAP.get(type));\n\t\t\t\tstatusMap.put(type, false);\n\n\t\t\t} catch (Exception e) {\n\t\t\t\tlogger.error(\"task of id add to queue of busType : {} failed \",\n\t\t\t\t\t\tAptConstants.BUS_NAME_MAP.get(type));\n\t\t\t\tlogger.error(\"\", e);\n\t\t\t}\n\t\t}\n\t\tlong endtime = System.currentTimeMillis();\n\n\t\tlogger.info(\"task off add to queue ended,busType : {},usetime : {}\",\n\t\t\t\tAptConstants.BUS_NAME_MAP.get(type), endtime - starttime);\n\t}", "public void addNewTask() {\n Intent i = new Intent(this, StartNewActivity.class);\n startActivityForResult(i, REQUEST_CODE);\n }", "@Override\n\tpublic void run() {\n\t\twhile (running) {\n\t\t\tif (debug)\n\t\t\t\tSystem.out.println(\"WORKER THREAD \" + threadID + \" Waiting for new task\");\n\n\t\t\t// get the next task from the blocking queue\n\t\t\tSelectionKey newTask = manager.nextTask();\n\n\t\t\t// if(debug)\n\t\t\t// System.out.println(\"Worker Thread \" + threadID + \" received new task\");\n\n\t\t\tif (newTask != null) {\n\t\t\t\tif (debug)\n\t\t\t\t\tSystem.out.println(\"Worker Thread \" + threadID + \" received new task: \" + newTask.toString());\n\t\t\t\tSocketChannel channel = (SocketChannel) newTask.channel();\n\t\t\t\tByteBuffer buffer = ByteBuffer.allocate(8000);\n\t\t\t\ttry {\n\t\t\t\t\tchannel.read(buffer);\n\t\t\t\t\tbyte[] packet = buffer.array();\n\t\t\t\t\tif (debug)\n\t\t\t\t\t\tSystem.out.println(\"Worker Thread \" + threadID + \" received new message: \" + packet.toString());\n\t\t\t\t\tMessage message = Serializer.deserializeMessage(packet);\n\t\t\t\t\tif (debug)\n\t\t\t\t\t\tSystem.out\n\t\t\t\t\t\t\t\t.println(\"Worker Thread \" + threadID + \" received new message: \" + message.toString());\n\t\t\t\t\tString messageCode = message.getType();\n\t\t\t\t\tbuffer.flip();\n\t\t\t\t\tbuffer.clear();\n\t\t\t\t\tnewTask.interestOps(SelectionKey.OP_WRITE);\n\t\t\t\t\tswitch (messageCode) {\n\t\t\t\t\t/**\n\t\t\t\t\t * This switch statement should be the only thing that has to get edited from\n\t\t\t\t\t * here on out. When we want to add functionality, it should always either be\n\t\t\t\t\t * adding a new case, if a new wireform is needed, or by altering code in the\n\t\t\t\t\t * case of the message being responded to.\n\t\t\t\t\t */\n\t\t\t\t\tcase (USER_REGISTRATION): {\n\t\t\t\t\t\tUserRegistration registrationMessage = (UserRegistration) message;\n\t\t\t\t\t\tString username = registrationMessage.getUsername();\n\t\t\t\t\t\tString password = registrationMessage.getPasswordHash();\n\n\t\t\t\t\t\tboolean created = sql.addUser(new Account(username, password));\n\t\t\t\t\t\tMessage outgoing = null;\n\n\t\t\t\t\t\tif (created) {\n\t\t\t\t\t\t\toutgoing = new UserRegistrationResponse(true, \"User was created successfully\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\toutgoing = new UserRegistrationResponse(false,\n\t\t\t\t\t\t\t\t\t\"Most likely a duplicated username, could also be a failed SQL connection\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsend(outgoing, buffer, channel, debug);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tcase (USER_LOGON): {\n\t\t\t\t\t\tUserLogon logonMessage = (UserLogon) message;\n\n\t\t\t\t\t\tString username = logonMessage.getUsername();\n\t\t\t\t\t\tString password = logonMessage.getPasswordHash();\n\t\t\t\t\t\t// Returns true if the user is validated\n\t\t\t\t\t\tboolean loggedIn = sql.checkLogin(username, password);\n\t\t\t\t\t\tMessage outgoing = null;\n\n\t\t\t\t\t\tif (loggedIn) {\n\t\t\t\t\t\t\tAccount acc = sql.getAccount(username, password);\n\t\t\t\t\t\t\toutgoing = new UserLogonResponse(true, \"User was verified and logged in\", acc);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\toutgoing = new UserLogonResponse(false, \"User was not Verified.\", null);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Outgoing is the reply to the client program\n\t\t\t\t\t\tsend(outgoing, buffer, channel, debug);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase (RECORDS_REQUEST): {\n\t\t\t\t\t\tRecordsRequest requestMessage = (RecordsRequest) message;\n\t\t\t\t\t\tString requestUser = requestMessage.getUsername();\n\n\t\t\t\t\t\t// done, but relies on methods that are themselves TODO\n\t\t\t\t\t\tAccount update = sql.getAccount(requestUser);\n\t\t\t\t\t\tSystem.out.println(\"ACC: \" + update.getUsername());\n\t\t\t\t\t\tList<Game> games = sql.getGames(update);\n\n\t\t\t\t\t\tfor (Game g : games) {\n\t\t\t\t\t\t\tSystem.out.println(g.toString());\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tsend(new RecordsRequestResponse(games, update), buffer, channel, debug);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase (CREATE_INVITATION): {\n\t\t\t\t\t\tCreateInvitation inviteMessage = (CreateInvitation) message;\n\t\t\t\t\t\tString inviter = inviteMessage.getInviter();\n\t\t\t\t\t\tString invitee = inviteMessage.getInvitee();\n\n\t\t\t\t\t\tAccount inviteeAccount = sql.getAccount(invitee);\n\t\t\t\t\t\tinviteeAccount.addInvite(new Invitation(inviter, invitee));\n\t\t\t\t\t\tsql.setAccount(inviteeAccount);\n\n\t\t\t\t\t\tsend(new CreateInvitationResponse(true, \"Invitation Sent\"), buffer, channel, debug);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase (RESPOND_TO_INVITATION): {\n\t\t\t\t\t\tRespondToInvitation respondMessage = (RespondToInvitation) message;\n\t\t\t\t\t\tInvitation acceptedInvite = respondMessage.getInvitation();\n\t\t\t\t\t\tString recipient = acceptedInvite.getRecipient();\n\t\t\t\t\t\tString sender = acceptedInvite.getSender();\n\t\t\t\t\t\tAccount updateRecipient = sql.getAccount(recipient);\n\t\t\t\t\t\tAccount updateSender = sql.getAccount(sender);\n\n\t\t\t\t\t\tif (updateRecipient.getInvites().remove(acceptedInvite)) {\n\t\t\t\t\t\t\tSystem.out.println(\"----------------------------- Removed invite from account: \" + updateRecipient.getUsername());\n\t\t\t\t\t\t\tsql.setAccount(updateRecipient);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (respondMessage.isAccept()) {\n\t\t\t\t\t\t\tPlayer attacker = new Player(updateSender, \"black\");\n\t\t\t\t\t\t\tPlayer defender = new Player(updateRecipient, \"white\");\n\n\t\t\t\t\t\t\tupdateSender.addPlayer(attacker);\n\t\t\t\t\t\t\tupdateRecipient.addPlayer(defender);\n\n\t\t\t\t\t\t\tsql.setAccount(updateSender);\n\t\t\t\t\t\t\tsql.setAccount(updateRecipient);\n\n\t\t\t\t\t\t\tGame g1 = new Game(new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\").toString(), attacker,\n\t\t\t\t\t\t\t\t\tdefender);\n\t\t\t\t\t\t\tsql.addGame(sender, recipient, g1);\n\n\t\t\t\t\t\t\tsend(new RespondToInvitationResponse(true, \"Game Added to Account\"), buffer, channel,\n\t\t\t\t\t\t\t\t\tdebug);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsend(new RespondToInvitationResponse(true, \"Invited Rejected\"), buffer, channel, debug);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase (SUBMIT_MOVE): {\n\t\t\t\t\t\tSubmitMove moveMessage = (SubmitMove) message;\n\t\t\t\t\t\tGame gameUpdate = moveMessage.getGameUpdate();\n\t\t\t\t\t\tGame oldGame = sql.getGame(gameUpdate.getAttacker(), gameUpdate.getDefender());\n\n\t\t\t\t\t\tGameResult status;\n\t\t\t\t\t\tif(gameUpdate.getResult() ==GameResult.CONTINUE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tgameUpdate = rules.processCaptures(oldGame, gameUpdate);\n\t\t\t\t\t\t\tstatus = rules.gameHasEnded(gameUpdate);\n\t\t\t\t\t\t\tgameUpdate.setResult(status);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tstatus = gameUpdate.getResult();\n\t\t\t\t\t\tif (status != GameResult.CONTINUE) {\n\t\t\t\t\t\t\tgameUpdate.setEndTime(new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\").toString());\n\t\t\t\t\t\t\tAccount defender = gameUpdate.getDefender().getAccount();\n\t\t\t\t\t\t\tAccount attacker = gameUpdate.getAttacker().getAccount();\n\t\t\t\t\t\t\tif (status == GameResult.WHITE) {\n\t\t\t\t\t\t\t\tattacker.getStats().addLoss();\n\t\t\t\t\t\t\t\tdefender.getStats().addWin();\n\t\t\t\t\t\t\t} else if (status == GameResult.BLACK) {\n\t\t\t\t\t\t\t\tattacker.getStats().addWin();\n\t\t\t\t\t\t\t\tdefender.getStats().addLoss();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tattacker.getStats().addLoss();\n\t\t\t\t\t\t\t\tdefender.getStats().addLoss();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsql.setAccount(defender);\n\t\t\t\t\t\t\tsql.setAccount(attacker);\n\t\t\t\t\t\t\tsql.deleteGame(attacker, defender);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\tgameUpdate.changeTurns();\n\t\t\t\t\t\tsql.updateGame(gameUpdate.getAttacker(), gameUpdate.getDefender(), gameUpdate);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsend(new SubmitMoveResponse(true, \"Move Submitted\"), buffer, channel, debug);\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tbuffer.flip();\n\t\t\t\t\tbuffer.clear();\n\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tnewTask.cancel();\n\t\t\t\t\ttry {\n\t\t\t\t\t\tchannel.close();\n\t\t\t\t\t} catch (IOException e1) {\n\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tnewTask.interestOps(SelectionKey.OP_READ);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"THREAD \" + threadID + \" terminating\");\n\t}", "public void addTask(Task t){\n\t\ttry {\n\t\t\taction.put(t);\n\t\t} catch (InterruptedException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "void addToQueuing(int tu){\n\t\tfor(Request req : queue.list){\n\t\t\tif(req.getReqTime() * 2 > tu){\t//大于当前时间的就不管了\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tif(req.getValid() == true){\t//如果没被删除,拷贝一份,删之,并将拷贝添加到Queuing里面\n\t\t\t\tRequest tmp = req.cloneAnObj();\t\t//克隆一个新的对象\n\t\t\t\treq.setValid(false);\n\t\t\t\tqueuing.list.add(tmp);\t//可以用引用对Queuing进行操作\n\t\t\t}\n\t\t}\n\t}", "public abstract void queue(@Nonnull LimiterPair task);", "@Override\n\tpublic void addTask(Teatask ta)\n\t{\n\t\tteataskMapper.addTask(ta);\n\t}", "public void queueTitle(Title title){\n homeDir = p.getHomeDir();\n if(dt.getStatus() == AsyncTask.Status.PENDING || dt.getStatus() == AsyncTask.Status.FINISHED) {\n dt = new downloadTitle();\n titles.add(title);\n dt.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);\n //System.out.println(\"pp async idle, starting async process\");\n }else{\n titles.add(title);\n status = 1;\n setStatus();\n sendQueue(titles.size());\n //System.out.println(\"pp async busy, queueing process\");\n }\n }", "public void invokeLater(Runnable task) {\n queue.add(task);\n }", "public void creatTask(int uid,String title,String detail,int money,String type,int total_num,Timestamp end_time,String state);", "private void tryToCreateNewConnByAsyn() {\r\n do {\r\n int curAddSize = needAddConnSize.get();\r\n int updAddSize = curAddSize + 1;\r\n if (connArray.length + updAddSize > poolMaxSize) return;\r\n if (needAddConnSize.compareAndSet(curAddSize, updAddSize)) {\r\n if (createConnThreadState.get() == THREAD_WAITING && createConnThreadState.compareAndSet(THREAD_WAITING, THREAD_WORKING))\r\n unpark(this);\r\n return;\r\n }\r\n } while (true);\r\n }", "public Key<Microtask> assignMicrotask( final String workerID)\n\t{\n\t\t// Ensure that the worker is marked as logged in\n\t\tloggedInWorkers.add( workerID );\n\n\t\t// Look for a microtask, checking constraints on it along the way\n\t\tString microtaskKey = null;\n\t\tBoolean isReview = false;\n\t\t// First, check if there any review microtasks queued.\n\t\t// Review microtasks get priority, as they need to be done quickly.\n\t\tfor ( String potentialMicrotaskKey : reviewQueue ){\n\t\t\tif ( microtaskKey == null && assignmentIsValid( potentialMicrotaskKey, workerID ) ){\n\t\t\t\tmicrotaskKey = potentialMicrotaskKey;\n\t\t\t\tisReview = true;\n\t\t\t}\n\t\t}\n\n\t\tif( microtaskKey == null ){\n\t\t\tfor ( String potentialMicrotaskKey : microtaskQueue ){\n\t\t\t\tif ( microtaskKey == null && assignmentIsValid( potentialMicrotaskKey, workerID) ){\n\t\t\t\t\tmicrotaskKey = potentialMicrotaskKey;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tMicrotask microtask=null;\n\t\t// If there are no more microtasks currently available, return null\n\t\tif ( microtaskKey != null) {\n\t\t\tMicrotask mtask = ofy().load().key( Microtask.stringToKey(microtaskKey) ).now();\n\t\t\tif( mtask!=null ){\n\n\t\t\t\tif( isReview ){\n\t\t\t\t\treviewQueue.remove( microtaskKey );\n\t\t\t\t\tFirebaseService.writeReviewQueue(new QueueInFirebase(reviewQueue), project.getID() );\n\t\t\t\t} else {\n\t\t\t\t\tmicrotaskQueue.remove( microtaskKey );\n\t\t\t\t\tFirebaseService.writeMicrotaskQueue(new QueueInFirebase(microtaskQueue), project.getID() );\n\t\t\t\t}\n\t\t\t\t// assign it to the worker\n\t\t\t\tmtask.setWorkerId( workerID );\n\t\t\t\tmicrotaskAssignments.put( workerID, Microtask.keyToString( mtask.getKey() ) );\n\n\t\t\t\t//ofy().save().entity(mtask).now();\n\t\t\t\tSystem.out.println(\"assigning \"+ mtask.getKey() +\" to worker \"+workerID);\n\t\t\t\tmicrotask=mtask;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tSystem.out.println(\"((((((((((((erroooor mtask null\");\n\t\t\t}\n\t\t}\n\n\n\n\t\tif( microtask != null ){\n\n\t\t\tFirebaseService.writeMicrotaskAssigned( Microtask.keyToString( microtask.getKey() ), workerID, project.getID(), true);\n\n\t\t\tHistoryLog\n\t\t\t\t.Init(project.getID())\n\t\t\t\t.addEvent( new MicrotaskDequeued(microtask));\n\n\t\t\tHistoryLog\n\t\t\t\t.Init(project.getID())\n\t\t\t\t.addEvent(new MicrotaskAssigned(microtask,workerID,\"assigned\"));\n\n\t\t\t// return the assigned microtask key\n\t\t\treturn microtask.getKey();\n\t\t}\n\n\t\treturn null;\n\t}", "public void addTask(Task task) {\n\t\tMessage msg=new Message(null, null, task);\n\t\ttry {\n\t\t\tchannel.send(msg);\n\t\t}\n\t\tcatch (Exception ex) {\n\t\t\t//Runtime exception with info for use in debugging\n\t\t\tthrow new RuntimeException(ex.getMessage());\n\t\t}\n\t}", "private Task createTask(StressTest test)\n\t{\n\t\treturn new ClientServerTask(test);\n\t}", "protected Task<Void> createTask() {\n\n\t\t\treturn new Task<Void>() {\n\n\t\t\t\tprotected Void call() {\n\t\t\t\t\t_button.setDisable(true);\n\t\t\t\t\tTaskScheduler.executeAlgorithm(_digraph);\n\n\t\t\t\t\treturn null;\n\n\n\t\t\t\t}\n\t\t\t};\n\t\t}", "public void add(Task newTask) {\n tasks.add(newTask);\n }", "public Task getTask(Integer tid);", "private void scheduleJob() {\n\n }", "public void pathwayScan() {\n ScanPathwayBasedAssocSwingWorker worker = new ScanPathwayBasedAssocSwingWorker();\n // buildTask = buildTask.create(buildingThread); //the task is not started yet\n buildTask = RP.create(worker); //the task is not started yet\n buildTask.schedule(0); //start the task\n }", "@Override\n public BlueRun create(StaplerRequest request) {\n job.checkPermission(Item.BUILD);\n if (job instanceof Queue.Task) {\n ScheduleResult scheduleResult;\n\n List<ParameterValue> parameterValues = getParameterValue(request);\n int expectedBuildNumber = job.getNextBuildNumber();\n if(parameterValues.size() > 0) {\n scheduleResult = Jenkins.get()\n .getQueue()\n .schedule2((Queue.Task) job, 0, new ParametersAction(parameterValues),\n new CauseAction(new Cause.UserIdCause()));\n }else {\n scheduleResult = Jenkins.get()\n .getQueue()\n .schedule2((Queue.Task) job, 0, new CauseAction(new Cause.UserIdCause()));\n }\n // Keep FB happy.\n // scheduleResult.getItem() will always return non-null if scheduleResult.isAccepted() is true\n final Queue.Item item = scheduleResult.getItem();\n if(scheduleResult.isAccepted() && item != null) {\n return new QueueItemImpl(\n pipeline.getOrganization(),\n item,\n pipeline,\n expectedBuildNumber, pipeline.getLink().rel(\"queue\").rel(Long.toString(item.getId())),\n pipeline.getLink()\n ).toRun();\n } else {\n throw new ServiceException.UnexpectedErrorException(\"Queue item request was not accepted\");\n }\n } else {\n throw new ServiceException.NotImplementedException(\"This pipeline type does not support being queued.\");\n }\n }", "public Task(String description) {\n\n this.description = description;\n this.isDone = false;\n taskCounter++;\n }", "@Override\n\t\t\tpublic void subTask(String name) {\n\t\t\t\t\n\t\t\t}", "@Override\n public CompletableFuture<Void> addTask(String queueName, GarbageCollector.TaskInfo task) {\n Preconditions.checkNotNull(queueName, \"queueName\");\n Preconditions.checkNotNull(task, \"task\");\n try {\n val processor = eventProcessorMap.get(queueName);\n Preconditions.checkArgument(null != processor, \"Attempt to add to non existent queue (%s).\", queueName);\n return Futures.toVoid(processor.add(SERIALIZER.serialize(task), Duration.ofMillis(1000)));\n } catch (Throwable e) {\n return CompletableFuture.failedFuture(e);\n }\n }", "void add(final Task task);", "public ScheduleNotifAsync(MainFragmentActivity context, boolean jumpToNextNotif){\n\t\tthis.context = context;\n\t\tthis.onCreate = false;\n\t\tthis.expirationDate = null;\n\t\tthis.jumpToNextNotif = jumpToNextNotif;\n\t}", "public void newQueue(){\r\n\t\tgenerateQueue();\r\n\t\trefreshLeft = true;\r\n\t}", "public synchronized boolean taskAdd(byte[] b, SelectionKey k) {\n\t\treturn this.taskList.add(new Task(b, k));\n\t}", "protected void onQueued() {}", "public void createTask(Task task) {\n ContentValues values = new ContentValues();\n values.put(SQLiteHelper.COLUMN_NAME, task.getName());\n database.insert(SQLiteHelper.TABLE_TASKS, null, values);\n }", "void scheduleWorker(HttpServletRequest req, AppEngineJobContext context,\n TaskAttemptID taskAttemptId, int sliceNumber) {\n Preconditions.checkArgument(\n context.getJobID().equals(taskAttemptId.getJobID()),\n \"Worker task must be for this MR job\");\n \n String taskName = (\"worker_\" + taskAttemptId + \"__\" + sliceNumber).replace('_', '-');\n try {\n context.getWorkerQueue().add(\n TaskOptions.Builder.withMethod(TaskOptions.Method.POST)\n .url(getBase(req) + MAPPER_WORKER_PATH)\n .param(AppEngineTaskAttemptContext.TASK_ATTEMPT_ID_PARAMETER_NAME, \n \"\" + taskAttemptId)\n .param(AppEngineJobContext.JOB_ID_PARAMETER_NAME, \"\" + taskAttemptId.getJobID())\n .param(AppEngineJobContext.SLICE_NUMBER_PARAMETER_NAME, \"\" + sliceNumber)\n .taskName(taskName));\n } catch (TaskAlreadyExistsException e) {\n log.warning(\"Worker task \" + taskName + \" already exists.\");\n }\n }", "private void handleUnassignedTask(String path) {\n if (ZKSplitLog.isRescanNode(watcher, path)) {\n return;\n }\n Task task = findOrCreateOrphanTask(path);\n if (task.isOrphan() && (task.incarnation.get() == 0)) {\n LOG.info(\"resubmitting unassigned orphan task \" + path);\n // ignore failure to resubmit. The timeout-monitor will handle it later\n // albeit in a more crude fashion\n resubmitTask(path, task, FORCE);\n }\n }", "public void updateTask() {}", "public Task getNextTask(final String name) {\n return null;\n }", "public void addTask(Task task) {\n\t\tSystem.out.println(\"Inside createTask()\");\n\t\t\n\t\ttoDoList.add(task);\n\t\tdisplay();\n\t}", "Link createLink();", "@Override\n public boolean offer(Runnable e) {\n if (duplicatePolicy != null) {\n if (contains(e)) {\n if (duplicatePolicy == DuplicatePolicy.DISCARD_OLD) {\n remove(e);\n Logger.getDefault().vv(\"drop old task: \", e);\n } else if (duplicatePolicy == DuplicatePolicy.DISCARD_NEW) {\n Logger.getDefault().vv(\"drop new task: \", e);\n // drop the new task by doing nothing and telling the\n // caller that everything goes well.\n return true;\n }\n }\n }\n // enqueue task\n return LIFO ? super.offerFirst(e) : super.offer(e);\n }", "private void addTask(ToDoList toDoList, JSONObject jsonObject) {\n String name = jsonObject.getString(\"title\");\n LocalDate dueDate = LocalDate.parse(jsonObject.getString(\"dueDate\"));\n boolean complete = jsonObject.getBoolean(\"complete\");\n boolean important = jsonObject.getBoolean(\"important\");\n Task newTask = new Task(name, dueDate);\n newTask.setComplete(complete);\n newTask.setImportant(important);\n\n toDoList.addTask(newTask);\n }", "public void run() {\n User user = userFactory.create();\n queue.add(user);\n }", "public void add(MiningTask mt) {\n miningTasks.add(mt);\n }", "public Task(String task, boolean isDone) {\n this.task = task;\n this.isDone = isDone;\n }", "public Task(String name) {\n this.name = name;\n this.isDone = false;\n }", "SessionTask(long scheduleNext) {\n delayBeforeNext = scheduleNext;\n taskid = taskcount++;\n }", "protected abstract Worker createWorker(final T task, final WorkerTaskData workerTaskData)\n throws TaskRejectedException, InvalidTaskException;", "private void m6941a() {\n getAsyncTaskQueue().a(new RoutesSelfFrag$1(this), new String[0]);\n }", "protected final void spawn(Task<?>... task) {\n // Gets a list of tasks, make a forLoop, and add it the the queue of that specific task\n for (int i=0; i<task.length; i++){\n // We want the pool to add a given task.\n // pool.addTask(task[i], id); <- this function needs to increase aswell.\n myProcessor.getPool().addTask(task[i], myProcessor.getProcessorID());\n //\tSystem.out.println(\"Spawned \" + i + \" new tasks\");\n }\n }", "public void submit(Runnable task){\n\t\tStatusTask stask = new StatusTask(task,this);\n\t\tpending.add(stask);\n\t}", "worker(long workOn) {\n this.workOn = workOn;\n }", "private void createQueue(RoutingContext routingContext) {\n LOGGER.debug(\"Info: createQueue method started;\");\n JsonObject requestJson = routingContext.getBodyAsJson();\n HttpServerRequest request = routingContext.request();\n HttpServerResponse response = routingContext.response();\n String instanceID = request.getHeader(HEADER_HOST);\n JsonObject authenticationInfo = new JsonObject();\n authenticationInfo.put(API_ENDPOINT, \"/management/queue\");\n requestJson.put(JSON_INSTANCEID, instanceID);\n if (request.headers().contains(HEADER_TOKEN)) {\n authenticationInfo.put(HEADER_TOKEN, request.getHeader(HEADER_TOKEN));\n authenticator.tokenInterospect(requestJson.copy(), authenticationInfo, authHandler -> {\n LOGGER.debug(\"Info: Authenticating response ;\".concat(authHandler.result().toString()));\n if (authHandler.succeeded()) {\n Future<Boolean> validNameResult =\n isValidName(requestJson.copy().getString(JSON_QUEUE_NAME));\n validNameResult.onComplete(validNameHandler -> {\n if (validNameHandler.succeeded()) {\n Future<JsonObject> brokerResult = managementApi.createQueue(requestJson, databroker);\n brokerResult.onComplete(brokerResultHandler -> {\n if (brokerResultHandler.succeeded()) {\n LOGGER.info(\"Success: Creating Queue\");\n handleSuccessResponse(response, ResponseType.Created.getCode(),\n brokerResultHandler.result().toString());\n } else if (brokerResultHandler.failed()) {\n LOGGER.error(\"Fail: Bad request\" + brokerResultHandler.cause().getMessage());\n processBackendResponse(response, brokerResultHandler.cause().getMessage());\n }\n });\n } else {\n LOGGER.error(\"Fail: Bad request\");\n handleResponse(response, ResponseType.BadRequestData, MSG_INVALID_EXCHANGE_NAME);\n }\n\n });\n } else if (authHandler.failed()) {\n LOGGER.error(\"Fail: Unauthorized;\" + authHandler.cause().getMessage());\n handleResponse(response, ResponseType.AuthenticationFailure);\n }\n });\n } else {\n LOGGER.error(\"Fail: Unauthorized\");\n handleResponse(response, ResponseType.AuthenticationFailure);\n }\n }", "public static boolean addressNonWaiting(){\n boolean addressedSomething = false;\n for(int i = 0 ; i < taskPointers.length; i ++){\n int pointerIndex = taskPointers[i];\n Task currTask = taskList.get(i);\n\n if(currTask.terminateTime == - 1 && (currTask.isAborted == false) && Collections.disjoint(waitingList, currTask.instructionList)){\n // see if we can allocate resources\n\n\n Instruction currInstruction = currTask.instructionList.get(pointerIndex);\n Type instructionType = currInstruction.instructionType;\n int resourceType = currInstruction.resourceType;\n\n if(instructionType == Type.initiate){\n currTask.startTime = time;\n addressedSomething = true;\n //System.out.println(\"Task \" + currTask.taskNumber + \" was initiated\");\n }else if(instructionType == Type.request){\n if(request(currInstruction)){\n addressedSomething = true;\n //System.out.println(\"Task \" + currTask.taskNumber + \" had its request completed\");\n }else{\n //System.out.println(\"Task \" + currTask.taskNumber + \" could not be completed\");\n }\n }// when it is time to add the waitingInstructions what you should do is something along the lines of\n else if(instructionType == Type.compute){\n int numberCycles = currInstruction.numberCycles;\n if(currTask.computeTime == 0){\n currTask.computeTime = currInstruction.numberCycles;\n }\n currTask.computeTime -= 1;\n\n //System.out.println(\"Task \" + currTask.taskNumber + \" computes \" + (currInstruction.numberCycles - currTask.computeTime));\n\n addressedSomething = true;\n }else if(instructionType == Type.release){\n int amountReleased = currInstruction.resourceAmount;\n release(resourceType, amountReleased, currTask);\n //System.out.println(\"Task \" + currTask.taskNumber + \" released its resources\");\n addressedSomething = true;\n }else{ // if its terminate\n currTask.terminateTime = time;\n // System.out.println(\"Task \" + currTask.taskNumber + \" terminates at time t = \" + time);\n terminatedCount ++;\n releaseAll(currTask);\n addressedSomething = true;\n }\n if(currTask.computeTime == 0){\n taskPointers[i] ++;\n }\n }\n\n }\n return addressedSomething;\n }", "@Override\n public CommandResult execute() {\n tasks.add(taskToAdd);\n try {\n storage.appendToFile(taskToAdd);\n return new CommandResult(String.format(MESSAGE_SUCCESS, taskToAdd));\n } catch (IOException e) {\n return new CommandResult(e.getMessage());\n }\n }", "public void addTask(final BTask t) {\n\t\tbloc.addLast(t);\n\t}", "@Override\n protected Void doInBackground(Void... v) {\n try {\n repeating = ServerCom.removeTask(mAptID, tempTask.getDescription(), tempTask.getAssignee());\n } catch (Exception e) {\n this.exception = e;\n }\n\n return null;\n }", "public boolean addTask(Integer i){\n\n return toget.add(i);\n }" ]
[ "0.59914285", "0.58502257", "0.58426255", "0.58426255", "0.58426255", "0.58118075", "0.56880605", "0.5675754", "0.5593085", "0.55917716", "0.55895185", "0.5573515", "0.550809", "0.5495372", "0.5493614", "0.546358", "0.5459552", "0.5440668", "0.5394876", "0.539375", "0.537949", "0.5375296", "0.5374985", "0.5343273", "0.5333744", "0.5333729", "0.53204006", "0.5315064", "0.5308787", "0.53040975", "0.5287326", "0.5265111", "0.52567285", "0.5241568", "0.5230802", "0.5230551", "0.5219846", "0.52061546", "0.5203223", "0.52018845", "0.5201174", "0.51982886", "0.51913834", "0.51908696", "0.5189742", "0.51816213", "0.51708984", "0.5168021", "0.5148756", "0.5146257", "0.5137142", "0.51259404", "0.5119754", "0.51190645", "0.5108143", "0.51074487", "0.5105317", "0.51040775", "0.51028514", "0.5092177", "0.50831777", "0.50583047", "0.5050218", "0.5037157", "0.5031077", "0.502797", "0.5023752", "0.5018817", "0.50146997", "0.50095236", "0.50043195", "0.49943447", "0.4972971", "0.49725044", "0.49721715", "0.49719647", "0.4968471", "0.49622452", "0.49621692", "0.4960168", "0.49491116", "0.49416578", "0.49415344", "0.49395546", "0.49372205", "0.49345475", "0.49313962", "0.49252456", "0.49237725", "0.49224862", "0.49220154", "0.49173626", "0.4913409", "0.4909858", "0.49079418", "0.49054492", "0.49041504", "0.4901723", "0.49000722", "0.4900047", "0.48995984" ]
0.0
-1
Run method for each CrawlWorker. The HTML get's fetched, then I get the links in the HTML, and then I count the words in the HTML and add to the index.
public void run() { String html = ""; try { html = HTTPFetcher.fetchHTML(this.url); } catch (UnknownHostException e) { System.out.println("Unknown host"); } catch (MalformedURLException e) { System.out.println("MalformedURL"); } catch (IOException e) { System.out.println("IOException"); } try { if(html != null) { this.newLinks = LinkParser.listLinks(new URL(this.url), html); } } catch (MalformedURLException e) { System.out.println("MalformedURL"); } if(newLinks != null) { for(URL theURL : newLinks) { if(!(urls.contains(theURL))) { synchronized(urls) { urls.add(theURL); } innerCrawl(theURL, limit); } } InvertedIndex local = new InvertedIndex(); String no_html = HTMLCleaner.stripHTML(html.toString()); String[] the_words = WordParser.parseWords(no_html); local.addAll(the_words, this.url); index.addAll(local); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void run() {\n\t\tHtmlPage page = null;\n\t\tHtmlSelect select = null;\n\t\tHtmlOption option = null;\n\t\tDataStreamWriter connection = null;\n\t\tWebClient client = new WebClient(BrowserVersion.FIREFOX_3);\n\t\t/* eseguo i job assegnati al thread in esecuzione */\n\t\tfor(int j = 0; j < this.jobs.length; j++) {\n\t\t\tint currentJob = this.jobs[j];\n\t\t\ttry {\n\t\t\t\t/* faccio dei tentativi per collegarmi alle pagine */\n\t\t\t\tpage = getPage(client, this.getDataSourceURL());\n\t\t\t\t/* seleziono l'opzione relativa alla regione assegnata al task */\n\t\t\t\tselect = (HtmlSelect) page.getByXPath(\"//select\").get(0);\n\t\t\t\toption = select.getOption(currentJob);\n\t\t\t\toption.setSelected(true);\n\t\t\t\tString regione = option.asText();\n\t\t\t\t/* seleziono l'opzione ed ottengo la pagina aggiornata */\n\t\t\t\tpage = (HtmlPage) select.fireEvent(Event.TYPE_CHANGE).getNewPage();\n\t\t\t\t\n\t\t\t\t/* estraggo i dati e li salvo nello \"storage\" */\n\t\t\t\tconnection = this.storageFacade.getDataStreamWriter();\n\t\t\t\tconnection.openStreamWriter();\n\t\t\t\tthis.extractData(client, connection, page, regione);\n\t\t\t}\n\t\t\tcatch (HTMLCrawlerException e) {\n\t\t\t\tSystem.err.println(\"@ HTMLCrawlerException : Extracting Data Error\");\n\t\t\t\tSystem.err.println(e.getMessage());\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\t//client.closeAllWindows();\n\t\t\t\tif (connection != null)\n\t\t\t\t\tconnection.closeStreamWriter();\n\t\t\t}\n\t\t}\n\t\tclient.closeAllWindows();\n\t}", "public void run()\n\t\t{\n\t\t\tint num = 0;\n\t\t\ttry{\n\t\t\t\tlog.debug(\"Dealing with: \" + url.toString() + \" From : \" + urlp);\n\t\t\t\t\n\t\t\t\tSocket socket = new Socket(url.getHost(), PORT);\n\t\t\t\tPrintWriter writer = new PrintWriter(socket.getOutputStream());\n\t\t\t\tBufferedReader reader = \n\t\t\t\t\tnew BufferedReader(new InputStreamReader(socket.getInputStream()));\n\t\t\t\tString request = \"GET \" + url.getPath() + \" HTTP/1.1\\n\" +\n\t\t\t\t\t\t\t\t\"Host: \" + url.getHost() + \"\\n\" +\n\t\t\t\t\t\t\t\t\"Connection: close\\n\" + \n\t\t\t\t\t\t\t\t\"\\r\\n\";\n\t\t\t\twriter.println(request);\n\t\t\t\twriter.flush();\n\t\t\n\t\t\t\tString line = reader.readLine();\n\t\t\t\t// filter the head message of the response\n\t\t\t\twhile(line != null && line.length() != 0)\n\t\t\t\t{\n\t\t\t\t\tline = reader.readLine();\n\t\t\t\t}\n\t\t\t\t// keep the html context\n\t\t\t\twhile (line != null) \n\t\t\t\t{\n\t\t\t\t\tcontext += line + \"\\n\";\n\t\t\t\t\tline = reader.readLine();\n\t\t\t\t}\n\t\t\t\treader.close();\n\t\t\t\twriter.close();\n\t\t\t\tsocket.close();\n\t\t\t\t//log.debug(context);\n\t\t\t\tstripper = new TagStripper(context);\n\t\t\t\tlog.debug(\"Removing script and style from: \" + url.toString());\n\t\t\t\tstripper.removeComments();\n\t\t\t\tstripper.removeScript();\n\t\t\t\tstripper.removeStyle();\n\t\t\t\tlog.debug(\"Getting links from: \" + url.toString());\n\t\t\t\tArrayList<String> link = new ArrayList<String>();\n\t\t\t\tstripper.buildLinks(url.toString());\n\t\t\t\t\n\t\t\t\tlink = stripper.getLinks();\n\t\t\t\tfor(String tmp : link) {\n\t\t\t\t\tif(getCount() < pageNum ) {\n\t\t\t\t\t\t// find if the link has been already visited\n\t\t\t\t\t\tif(!urlList.contains(tmp)) {\n\t\t\t\t\t\t\tworkers.execute(new SingleHTMLFetcher(new URL(tmp), this.url.toString()));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tString title = stripper.getTitle();\n\t\t\t\tif(title == null)\n\t\t\t\t\ttitle = \"NO title\";\n\t\t\t\ttitle = title.replaceAll(\"&[^;]*;\", \"\");\n\t\t\t\tlog.debug(\"Removing tags from: \" + url.toString());\n\t\t\t\tstripper.removeTags();\n\t\t\t\tstripper.removeSymbol();\n\t\t\t\tString snippet = stripper.getSnippet(title);\n\t\t\t\tdb.savePageInfo(connection, title, snippet, url.toString());\n\t\t\t\tcontext = stripper.getContext();\n\t\t\t\tString[] words = context.toLowerCase().split(\"\\\\s\");\n\t\t\t\tArrayList<String> wordsList = new ArrayList<String>();\n\t\t\t\tfor (int i = 0; i < words.length; i++) {\n\t\t\t\t\t// delete non-word character\n\t\t\t\t\twords[i] = words[i].replaceAll(\"\\\\W\", \"\").replace(\"_\",\n\t\t\t\t\t\t\t\"\");\n\t\t\t\t\tif(words[i].length() != 0)\n\t\t\t\t\t\twordsList.add(words[i]);\n\t\t\t\t}\n\t\t\t\tfor (String w : wordsList) {\n\t\t\t\t\tif (w.length() != 0) {\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tindex.addNum(w, url.toString(), num);\n\t\t\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\tnum++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tlog.debug(\"URL: \" + url.toString() + \" is finished!\");\n\t\t\t\tdecrementPending();\n\t\t\t}catch(Exception ex) {\n\t\t\t\tex.printStackTrace();\n\t\t\t}\n\t\t}", "public static void main(String[] args) throws Exception {\n\t\tString crawlStorageFolder = \"/data/crawl\";\r\n\t\tint numberOfCrawlers = 1;\r\n\t\t\r\n\t\tCrawlConfig config = new CrawlConfig();\r\n\t\tconfig.setCrawlStorageFolder(crawlStorageFolder);\r\n\t\tconfig.setMaxPagesToFetch(5000);\r\n\t\tconfig.setMaxDepthOfCrawling(5);\r\n\t\tconfig.setPolitenessDelay(500);\r\n\t\t\r\n\t\tconfig.setIncludeBinaryContentInCrawling(true);\r\n\t\t//config.setUserAgentString(userAgentString);\r\n\t\t\r\n\t\tPageFetcher pageFetcher = new PageFetcher(config);\r\n\t\tRobotstxtConfig robotstxtConfig = new RobotstxtConfig();\r\n\t\tRobotstxtServer robotstxtServer = new RobotstxtServer(robotstxtConfig,pageFetcher );\r\n\t\tCrawlController controller = new CrawlController(config,pageFetcher,robotstxtServer);\r\n\t\t\r\n\t\tcontroller.addSeed(\"http://www.marshall.usc.edu/\");\r\n\t\tcontroller.start(MyCrawler.class, numberOfCrawlers);\r\n\t\tSystem.out.println(\"All urls processed:\"+MyCrawler.URL_Count);\r\n\t\tSystem.out.println(\"All unique urls processed:\"+MyCrawler.hs.size());\r\n\t\tSystem.out.println(\"unique School urls processed:\"+MyCrawler.hs_uniqueSchool.size());\r\n\t\tSystem.out.println(\"unique USC urls processed:\"+MyCrawler.hs_uniqueUSC.size());\r\n\t\tSystem.out.println(\"other unique urls processed:\"+MyCrawler.hs_unique.size());\r\n\t\tSet set = MyCrawler.HM_Status.entrySet();\r\n\t Iterator i = set.iterator();\r\n\t while(i.hasNext()) {\r\n\t Map.Entry me = (Map.Entry)i.next();\r\n\t System.out.print(me.getKey() + \": \");\r\n\t System.out.println(me.getValue());\r\n\t }\r\n\t set=MyCrawler.HM_CT.entrySet();\r\n\t i = set.iterator();\r\n\t while(i.hasNext()) {\r\n\t Map.Entry me = (Map.Entry)i.next();\r\n\t System.out.print(me.getKey() + \": \");\r\n\t System.out.println(me.getValue());\r\n\t }\r\n\t System.out.println(\"F1:\"+MyCrawler.F1);\r\n\t System.out.println(\"F2:\"+MyCrawler.F2);\r\n\t System.out.println(\"F3:\"+MyCrawler.F3);\r\n\t System.out.println(\"F4:\"+MyCrawler.F4);\r\n\t \r\n\t System.out.println(\"Size < 1kb:\"+MyCrawler.size1);\r\n\t System.out.println(\"Size 1kb~10kb:\"+MyCrawler.size2);\r\n\t System.out.println(\"Size 10kb~100kb:\"+MyCrawler.size3);\r\n\t System.out.println(\"Size 100kb~1mb:\"+MyCrawler.size4);\r\n\t System.out.println(\"Size > 1mb:\"+MyCrawler.size5);\r\n\t \r\n\t}", "@Override\r\n\tpublic void run()\r\n\t{\r\n\t\twhile(true)\r\n\t\t{\r\n\t\t\t//System.out.println(\"beginning of Parser code\");\r\n\t\t\t\r\n\t\t\t//pull a page from the page que\r\n\t\t\ttry \r\n\t\t\t{\r\n\t\t\t\tpageText = SharedPage.getNextPage();\r\n\t\t\t\t//System.out.println(\"Parser Page Pulled\");\r\n\t\t\t} \r\n\t\t\tcatch (InterruptedException e) \r\n\t\t\t{\r\n\t\t\t\t//do nothing\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//search the page for all links in anchor (<a href=\"\") elements\r\n\t\t\t\r\n\t\t\t//Regex\r\n\t\t\t//loop will execute for each link found\r\n\t\t\tPattern pattern = Pattern.compile(\"href=\\\"(http:.*?)\\\"\");\r\n\t\t\tMatcher matcher = null;\r\n\t\t\t\r\n\t\t\t//Some pages are returning null values\r\n\t\t\tif(pageText != null)\r\n\t\t\t{\r\n\t\t\t\tmatcher = pattern.matcher(pageText);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//add each link found to the link queue\r\n\t\t\t\r\n\t\t\t//sometimes matcher is returning null values\r\n\t\t\twhile(matcher != null && matcher.find())\r\n\t\t\t{\r\n\t\t\t\tString link = matcher.group(1);\r\n\t\t\t\r\n\t\t\t\ttry \r\n\t\t\t\t{\r\n\t\t\t\t\tSharedLink.addLink(link);\r\n\t\t\t\t} \r\n\t\t\t\tcatch (InterruptedException e) \r\n\t\t\t\t{\r\n\t\t\t\t\t//do nothing\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//search the page for keywords specified by the user of the webcrawler\r\n\t\t\tArrayList<String> keywords = WebCrawlerConsole.getKeywords();\r\n\t\t\t\r\n\t\t\t\tfor(String word : keywords)\r\n\t\t\t\t{\r\n\t\t\t\t\t//cannot split pageText if it is null\r\n\t\t\t\t\tif(pageText != null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tString[] keywordSearch = pageText.split(word);\r\n\t\t\t\t\t\tfor(int i=0; i < keywordSearch.length; i++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tWebCrawlerConsole.keywordHit();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t//System.out.println(\"end of Parser code\");\r\n\t\t}\r\n\t}", "public void crawlAndIndex(String url) throws Exception {\r\n\t\t// TODO : Add code here\r\n\t\tQueue<String> queue=new LinkedList<>();\r\n\t\tqueue.add(url);\r\n\t\twhile (!queue.isEmpty()){\r\n\t\t\tString currentUrl=queue.poll();\r\n\t\t\tif(internet.getVisited(currentUrl)){\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tArrayList<String> urls = parser.getLinks(currentUrl);\r\n\t\t\tArrayList<String> contents = parser.getContent(currentUrl);\r\n\t\t\tupdateWordIndex(contents,currentUrl);\r\n\t\t\tinternet.addVertex(currentUrl);\r\n\t\t\tinternet.setVisited(currentUrl,true);\r\n\t\t\tfor(String u:urls){\r\n\t\t\t\tinternet.addVertex(u);\r\n\t\t\t\tinternet.addEdge(currentUrl,u);\r\n\t\t\t\tqueue.add(u);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "@Override\n public void run() {\n numStarted ++;\n\n while (true) {\n try {\n // pull a link from the link queue\n URL url = new URL(SharedLinkQueue.getNextLink());\n\n // download the HTML page text at the given URL\n HttpURLConnection connection = (HttpURLConnection) url.openConnection();\n BufferedReader download = new BufferedReader(new InputStreamReader(connection.getInputStream()));\n\n // store the HTML page text on the page queue as a string\n String pageText = \"\";\n String inputLine;\n while ((inputLine = download.readLine()) != null) {\n pageText += inputLine;\n }\n SharedPageQueue.addPage(pageText);\n\n download.close();\n } catch (MalformedURLException e) {\n errorCount ++;\n System.out.println(\"MalformedURLException: \" + e.getMessage());\n } catch (IOException e) {\n errorCount ++;\n System.out.println(\"IOException: \" + e.getMessage());\n } catch (InterruptedException e) {\n errorCount ++;\n System.out.println(\"InterruptedException: \" + e.getMessage());\n }\n }\n }", "public void run() {\n LOG.info(\"Starting Contentful crawling\");\n //Partition of ContentTypes: TRUE: vocabularies and FALSE: non-vocabularies/web content\n Map<Boolean, List<CMAContentType>> contentTypes = getContentTypes();\n List<CMAContentType> vocContentTypes = contentTypes.get(Boolean.TRUE);\n List<CMAContentType> webContentTypes = contentTypes.get(Boolean.FALSE);\n\n //Extract vocabularies meta data\n VocabularyTerms vocabularyTerms = getVocabularyTerms(vocContentTypes);\n\n //Mapping generator can be re-used for all content types\n MappingGenerator mappingGenerator = new MappingGenerator(vocContentTypes);\n\n //Gets the ContentType.resourceId for news and articles, which vary by space\n newsContentTypeId = getContentTypeId(webContentTypes, configuration.getNewsContentType());\n articleContentTypeId = getContentTypeId(webContentTypes, configuration.getArticleContentType());\n projectContentTypeId = getContentTypeId(webContentTypes, configuration.getProjectContentType());\n\n\n //Crawl all Content Types, except for vocabularies\n crawlContentTypes(webContentTypes, mappingGenerator, vocabularyTerms);\n LOG.info(\"Contentful crawling has finished\");\n }", "public void indexing(String seedPage) {\n webCrawler wbc = new webCrawler();\n webPage wbp = new webPage();\n urlList = wbc.crawl(seedPage);\n for(int i = 0; i < urlList.size(); i++) {\n String url = urlList.get(i);\n try {\n Document doc = wbp.getContent(url);\n finalWords = wbp.getAllWords(url);\n } catch(Exception e) {\n e.printStackTrace();\n }\n }\n }", "public void startCrawl() throws IOException {\n\t\tElements paragraphs = wf.fetchWikipedia(source);\n\t\tqueueInternalLinks(paragraphs);\n\n\t\t// loop until we index a new page\n\t\tString res;\n\t\tdo {\n\t\t\tres = crawl();\n\n\t\t} while (res == null);\n\t}", "@Async\n\tpublic void start() {\n\t\tUrl url = null;\n\t\twhile (true) {\n\t\t\ttry {\n\t\t\t\turl = urlRepository.findFirstByDateScannedOrderByIdAsc(null);\n\t\t\t\tif (url == null) {\n\t\t\t\t\twhile (url == null) {\n\t\t\t\t\t\turl = WebSiteLoader.getRandomUrl();\n\n\t\t\t\t\t\tif (urlExists(url)) {\n\t\t\t\t\t\t\turl = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\turl = urlRepository.saveAndFlush(url);\n\t\t\t\t}\n\t\t\t\tlog.info(\"Crawling URL : \" + url);\n\n\t\t\t\tWebPage webPage = WebSiteLoader.readPage(url);\n\t\t\t\tif (webPage != null) {\n\t\t\t\t\tReport report = textAnalyzer.analyze(webPage.getText());\n\t\t\t\t\t\n\t\t\t\t\tfor(SentenceReport sentenceReport : report.getSentenceReports()){\n\t\t\t\t\t\tSentence sentence = sentenceReport.getSentence();\n\t\t\t\t\t\tsentence = sentenceRepository.saveAndFlush(sentence);\n\t\t\t\t\t\tsentenceReport.setSentence(sentence);\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor(Occurrence occurrence : sentenceReport.getOccurences()){\n\t\t\t\t\t\t\toccurrence = occurrenceRepository.saveAndFlush(occurrence);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tSentenceOccurrence so = new SentenceOccurrence();\n\t\t\t\t\t\t\tSentenceOccurrenceId soId = new SentenceOccurrenceId();\n\t\t\t\t\t\t\tso.setSentenceOccurrenceId(soId);\n\t\t\t\t\t\t\tsoId.setOccurenceId(occurrence.getId());\n\t\t\t\t\t\t\tsoId.setSentenceId(sentence.getId());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tsentenceOccurrenceRepository.saveAndFlush(so);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\taddUrls(webPage.getUrls());\n\t\t\t\t}\n\n\t\t\t\tlog.info(\"Done crawling URL : \" + url);\n\t\t\t} catch (PageNotInRightLanguageException ex) {\n\t\t\t\tlog.info(\"Page not in the right language : \" + ex.getText());\n\t\t\t} catch (Exception ex) {\n\t\t\t\tlog.error(\"Error while crawling : \" + url, ex);\n\t\t\t}\n\t\t\t\n\t\t\turl.setDateScanned(new Date());\n\t\t\turlRepository.saveAndFlush(url);\n\t\t\t\n\t\t\tif(stop){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public void crawlSite()\n {\n /** Init the logger */\n WorkLogger.log(\"WebCrawler start at site \" + this.urlStart.getFullUrl() + \" and maxDepth = \" + this.maxDepth);\n WorkLogger.log(\"====== START ======\");\n WorkLogger.log(\"\");\n /** Save the start time of crawling */\n long startTime = System.currentTimeMillis();\n /** Start our workers */\n this.taskHandler.startTask(this.urlStart, maxDepth);\n /** Check workers finished their work; in case then all workers wait, then no ones work, that leads no more tasks -> the program finished */\n while(this.taskHandler.isEnd() == false)\n {\n /** Default timeout for 1 sec cause the socket timeout I set to 1 sec */\n try{Thread.sleep(1000);}catch(Exception e){}\n }\n this.taskHandler.stopTasks();\n /** End the log file and add the time elapsed and total sites visited */\n WorkLogger.log(\"\\r\\n====== END ======\");\n WorkLogger.log(\"Time elapsed: \" + (System.currentTimeMillis() - startTime)/1000.);\n WorkLogger.log(\"Total visited sites: \" + this.pool.getVisitedSize());\n }", "public WebCrawler(String urlSeed) {\n\t\t\n\n\t\t\n\t\tconnection = db.openConnection();\n\n\t\t\ttry {\n\t\t\t\tthis.urlSeed = new URL(urlSeed);\n\t\t\t} catch(MalformedURLException ex) {\n\t\t\t\tlog.error(\"please input the right url with protocol part!\");\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t\tworkers = new WorkQueue(10);\n\t\t\tthis.count = 0;\n\t\t\tthis.pending = 0;\n\t\t\turlList = new ArrayList<String>();\n\t\t\t//index = new InvertedIndex();\n\t\t\tlong start = System.currentTimeMillis();\n\t\t\tthis.HTMLFetcher();\n\t\t\tlong end = System.currentTimeMillis();\n\t\t\tlog.info(\"Running time for htmlFetcher: \" + (end - start));\n\t\t\tList<String> suggestedQuery = index.getSuggestedQuery();\n\t\t\tdb.updateSuggestedQuery(connection, suggestedQuery);\n\t\t\tdb.closeConnection(connection);\n\t}", "public void crawl(String url);", "public static void main(String[] args) {\n\t\t\n\t\t/*MultiThreadedCrawler crawler = new MultiThreadedCrawler(\"https://cs.uic.edu\", \"uic.edu\", \"main\");\n\t\tcrawler.start();\n\t\tList<Map> p = new ArrayList<>();\n\t\tp.add(crawler.getResults());\n\t\t\n\t\ttry {\n\t\t\tGlobals.urlSet.add(new URL(\"https://disabilityresources.uic.edu\"));\n\t\t\tGlobals.urlSet.add(new URL(\"http://disabilityresources.uic.edu\"));\n\t\t\tGlobals.urlSet.add(new URL(\"http://cmhsrp.uic.edu/nrtc\")); \n\n\t\t} catch (MalformedURLException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\t\n\t\t\n\t\tMultiThreadedCrawler c1 = new MultiThreadedCrawler(\"\", \"uic.edu\", \"c1\");\n\t\tMultiThreadedCrawler c2 = new MultiThreadedCrawler(\"\", \"uic.edu\", \"c2\");\n\t\tMultiThreadedCrawler c3 = new MultiThreadedCrawler(\"\", \"uic.edu\", \"c3\");\n\t\tMultiThreadedCrawler c4 = new MultiThreadedCrawler(\"\", \"uic.edu\", \"c4\");\n\t\tMultiThreadedCrawler c5 = new MultiThreadedCrawler(\"\", \"uic.edu\", \"c5\");\n\t\tMultiThreadedCrawler c6 = new MultiThreadedCrawler(\"\", \"uic.edu\", \"c6\");\n\t\t//MultiThreadedCrawler c7 = new MultiThreadedCrawler(\"https://housing.uic.edu\", \"uic.edu\", \"housing\");\n\t\t//MultiThreadedCrawler c8 = new MultiThreadedCrawler(\"https://grad.uic.edu\", \"uic.edu\", \"grad\");\n\t\t//MultiThreadedCrawler c9 = new MultiThreadedCrawler(\"https://today.uic.edu\", \"uic.edu\", \"today\");\n\t\t\n\t\t\n\t\t\n\t\tList<Thread> crawlers = new ArrayList<>();\n\t\tcrawlers.add(new Thread(c1, \"c1\"));\n\t\tcrawlers.add(new Thread(c2, \"c2\"));\n\t\tcrawlers.add(new Thread(c3, \"c3\"));\n\t\tcrawlers.add(new Thread(c4, \"c4\"));\n\t\tcrawlers.add(new Thread(c5, \"c5\"));\n\t\tcrawlers.add(new Thread(c6, \"c6\"));\n\t\tcrawlers.add(new Thread(c7, \"housing\"));\n\t\tcrawlers.add(new Thread(c8, \"grad\"));\n\t\tcrawlers.add(new Thread(c9, \"today\"));\n\t\t\n\t\t\n\t\tfor(Thread t: crawlers) {\n\t\t\tt.start();\n\t\t}\n\t\t\n\t\tfor(Thread t: crawlers) {\n\t\t\ttry {\n\t\t\t\tt.join();\n\t\t\t}catch(InterruptedException e) {\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tp.add(c1.getResults());\n\t\tp.add(c2.getResults());\n\t\tp.add(c3.getResults());\n\t\tp.add(c4.getResults());\n\t\tp.add(c5.getResults());\n\t\tp.add(c6.getResults());\n\t\t//p.add(c7.getResults());\n\t\t//p.add(c8.getResults());\n\t\t//p.add(c9.getResults());\n\t\t\n\t\t\n\t\twhile(true) {\n\t\t\tfor(Map m: p) {\n\t\t\t\tif(m == null)\n\t\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tSystem.out.println(\"All done\");\n\t\tmergeResults(p);\n\t\tUtil.updateDocVectLenMap();\n\t\tSystem.out.println(\"Total in collection: \" + Globals.pageDataMap.size());\n\t\tUtil.writeInvertedIndexTfMapAndMaxFreqMapToFile();*/\n\t\t\n\t\t\n\t\tUtil.loadDataFromFile();\n\t\tUtil.updateDocVectLenMap();\n\t\tSpringApplication.run(SearchApplication.class, args);\n\t}", "@Override\n public void crawl() {\n Document doc;\n try {\n\n\n doc = Jsoup.connect(rootURL).userAgent(\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/7046A194A\").get();\n\n Elements articles = doc.select(\"section.list article\");\n\n System.out.println(\"Number of articles found:\"+articles.size());\n //list of links found\n for(Element article: articles){\n\n Element titleLink = article.select(\"a\").first();\n System.out.println(titleLink.attr(\"abs:href\"));\n\n //if the url found is in the cache, do not retrieve the url.\n if(urlCache.contains(titleLink.attr(\"abs:href\"))) {\n System.out.println(\"Doucment found in cache, ignoring document\");\n continue;\n }\n\n storeDocument(Jsoup.connect(titleLink.attr(\"abs:href\")).get());\n\n //add the URL to the cache so that we don't retrieve it again.\n urlCache.add(titleLink.attr(\"abs:href\"));\n }\n\n\n } catch (Exception e){\n logger.log(Level.SEVERE, \"Error Retrieving from URL\", e);\n e.printStackTrace();\n }\n }", "public Indexer crawl() \n\t{\n\t\t// This redirection may effect performance, but its OK !!\n\t\tSystem.out.println(\"Crawling: \"+u.toString());\n\t\treturn crawl(crawlLimitDefault);\n\t}", "public static void main(String[] args) {\n \n FCrawler fc = new FCrawler();\n \n \n \n // now start all of the worker threads\n \n int N = 5;\n ArrayList<Thread> thread = new ArrayList<Thread>(N);\n for (int i = 0; i < N; i++) {\n Thread t = new Thread(fc.createWorker());\n thread.add(t);\n t.start();\n }\n \n// now place each directory into the workQ\n \n // fc.processDirectory(Args[0]);\n \n fc.processDirectory(\"D://\");\n// indicate that there are no more directories to add\n \n fc.workQ.finish();\n \n for (int i = 0; i < N; i++){\n try {\n thread.get(i).join();\n } catch (Exception e) {};\n }\n }", "public static void Execute ()\n\t{\n\t\tReceiveCollection (SpawnCrawler (target));\n\t\t\n\t\tList<String> initialCollection = overCollection;\n\t\t\n\t\tif ( ! initialCollection.isEmpty ())\n\t\t{\n\t\t\n\t\t\tfor (String collected : initialCollection)\n\t\t\t{\n\t\t\t\t\n\t\t\t\tif (collected.contains (\"http\"))\n\t\t\t\t\tReceiveCollection (SpawnCrawler (collected));\n\t\t\t\telse\n\t\t\t\t\tReceiveCollection (SpawnCrawler (target + collected));\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t\t/*\n\t\t * Several loops should commence here where the system reiteratively goes over all the newly acquired URLs\n\t\t * so it may extend itself beyond the first and second depth.\n\t\t * However this process should be halted once it reaches a certain configurable depth.\n\t\t */\n\t\tint depth = 0;\n\t\tint newFoundings = 0;\n\t\t\n\t\tdepthLoop: while (depth <= MAX_DEPTH)\n\t\t{\n\t\t\t\n\t\t\tfor (String collected : overCollection)\n\t\t\t{\n\t\t\t\t\n\t\t\t\tif (collected.contains (\"http\"))\n\t\t\t\t\tSpawnCrawler (collected);\n\t\t\t\telse\n\t\t\t\t\tSpawnCrawler (target + collected);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif (newFoundings <= 0)\n\t\t\t\tbreak depthLoop;\n\t\t\t\n\t\t\tdepth++;\n\t\t\t\t\t\t\n\t\t}\n\t\t\n\t}", "protected void reduce(Text mainUrl, Iterable<Text> links, Context context) throws IOException, InterruptedException {\n\n LinkedList<String> linksIn = new LinkedList<>();\n LinkedList<String> linksOut = new LinkedList<>();\n\n for (Text link : links) {\n char who = link.toString().trim().charAt(0);\n String content = link.toString().trim().substring(1);\n if (who == '>') {\n linksOut.add(content);\n } else if (who == '<') {\n linksIn.add(content);\n }\n }\n\n // Собираем статистику\n context.getCounter(\"TOPS\", \"ALL\").increment(1);\n if (linksOut.size() == 0) {\n context.getCounter(\"TOPS\", \"HANGING\").increment(1);\n }\n\n context.write(mainUrl, new Text(\"###\\t\" + String.join(\"\\t\", linksOut) + \"\\t###\\t\" + String.join(\"\\t\", linksIn)));\n }", "public void crawl() {\n\t\tOOSpider.create(Site.me().setSleepTime(3000).setRetryTimes(3).setDomain(\"movie.douban.com\")//.setHttpProxy(httpProxy)\n .setUserAgent(\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.67 Safari/537.36\"),\n filmInfoDaoPipeline, DoubanFilm.class)\n .addUrl(\"https://movie.douban.com/top250\")//entry url\n .thread(1)\n .run();\n }", "@Override\r\n\tpublic void run() {\n while(true) {\r\n\r\n\r\n\r\n\t\t\tsynchronized(lock)\r\n\t\t\t{\r\n\t\t\t\ttry {\r\n\t\t\t\t\trecv_from_crawler();\r\n\t\t\t\t\tSystem.out.println(\"url from crawler 2--->\"+url.toString()+ \" thread---> \"+Thread.currentThread().getName());\r\n\r\n\t\t\t\t} catch (ClassNotFoundException e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\ttry{\r\n\r\n\t\t\t\tget_document_from_db();\r\n\t textTags2.indexing(d,url.toString(),is_Recrawling);\r\n\t }catch (IOException e){\r\n\t\t\t System.out.println(e);\r\n\t }\r\n\r\n\t\t\t// System.out.println(\"time indexer for one doc--->\"+(System.nanoTime()-startTime));\r\n\t\t //System.out.println(\"total time indexing--->\"+(System.nanoTime()-startTime));\r\n\r\n\t\t}\r\n\r\n\t}", "public static void run() throws Exception\n\t{\n\t\tSystem.out.println(\"Web Crawler started... \"+new Timestamp(new java.util.Date().getTime()));\n\n\t\tcrawler.search(\"http://mail-archives.apache.org/mod_mbox/maven-users/\",\"2014\", false);\n\n\t\tSystem.out.println(\"Web Crawler run complete... \"+new Timestamp(new java.util.Date().getTime()));\n\t}", "void execute(String link) throws CrawlerWorkerException;", "public void beginCrawling() {\n\n if (urlsFile != null\n && emailsFile != null\n && urlsWriter != null\n && emailsWriter != null) {\n crawl(startUrl);\n }\n }", "@Override\n\tpublic void process(Page page) {\n\t\tDocument doc = Jsoup.parse(page.getHtml().getFirstSourceText());\n\n\t\tif (isFirst) {\n\t\t\tSystem.out.println(\"添加所有列表链接\");\n\t\t\tArrayList<String> urls = new ArrayList<String>();\n\t\t\t// 33\n\t\t\tfor (int i = 2; i < 30; i++) {\n\t\t\t\turls.add(\"http://zyjy.jiangmen.gov.cn//szqjszbgg/index_\" + i + \".htm\");\n\t\t\t}\n\t\t\tpage.addTargetRequests(urls);\n\t\t\tSystem.out.println(\"这一页一共有 \" + urls.size() + \" 条数据\");\n\n\t\t\tisFirst = false;\n\t\t}\n\n\t\tif (page.getUrl().regex(URL_LIST).match() || page.getUrl().toString().trim().equals(url)) {\n\t\t\tSystem.out.println(\"获取列表数据\");\n\n\t\t\tElements uls = doc.getElementsByAttributeValue(\"class\", \"c1-bline\");\n\t\t\tfor (Element ul : uls) {\n\t\t\t\tString url = ul.getElementsByAttributeValue(\"class\", \"f-left\").get(0).select(\"a\").attr(\"href\").trim();\n\t\t\t\tString title = ul.getElementsByAttributeValue(\"class\", \"f-left\").get(0).text();\n\t\t\t\tString data = ul.getElementsByAttributeValue(\"class\", \"f-right\").get(0).text();\n\t\t\t\tCacheHashMap.cache.put(url, title + \"###\" + data);\n\t\t\t\tMyUtils.addRequestToPage(page, url);\n\t\t\t\tSystem.out.println(url + \" \" + CacheHashMap.cache.get(url));\n\t\t\t}\n\n\t\t}\n\t\tif (page.getUrl().regex(URL_DETAILS).match()) {\n\n\t\t\tProject project = new Project();\n\t\t\tStringBuffer project_article = new StringBuffer();\n\n\t\t\tString urldetails = CacheHashMap.cache.get(page.getUrl().toString().trim());\n\t\t\tSystem.out.println(\"url\" + page.getUrl().toString().trim());\n\t\t\tSystem.out.println(\"urldetails \" + urldetails);\n\n\t\t\tString[] value = urldetails.split(\"###\");\n\t\t\tif (value != null && value.length > 1) {\n\t\t\t\tproject.setProjectName(value[0]);\n\t\t\t\tproject.setPublicStart(value[1]);\n\t\t\t}\n\n\t\t\tElements divs = doc.getElementsByAttributeValue(\"class\", \"contlist minheight\");\n\t\t\tfor (Element div : divs.get(0).children()) {\n\t\t\t\tif (div.nodeName().equals(\"table\")) {\n\t\t\t\t\tElements trs = divs.select(\"tbody\").select(\"tr\");\n\t\t\t\t\tfor (Element tr : trs) {\n\t\t\t\t\t\tproject_article.append(tr.text()).append(\"\\n\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tproject_article.append(div.text()).append(\"\\n\");\n\n\t\t\t\t}\n\t\t\t}\n\t\t\tproject.setUrl(page.getUrl().toString().trim());\n\t\t\tproject.setState(0);\n\t\t\tproject.setWebsiteType(\"江门市\");\n\t\t\tproject.setTime(MyUtils.getcurentTime());\n\t\t\tproject.setRawHtml(divs.toString());\n\n\t\t\tproject.setArticle(project_article.toString());\n\t\t\tSystem.out.println(project);\n\n\t\t\tHibernateUtil.save2Hibernate(project);\n\n\t\t}\n\n\t}", "public ArrayList<String> webCrawling(){\n\t\t\tfor(i=780100; i<790000; i++){\r\n\t\t\t\ttry{\r\n\t\t\t\tdoc = insertPage(i);\r\n\t\t\t\t//Thread.sleep(1000);\r\n\t\t\t\t}catch (Exception e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t\tif(doc != null){\r\n\t\t\t\t\tElement ele = doc.select(\"div.more_comment a\").first();\r\n\t\t\t\t\t//System.out.println(ele.attr(\"href\"));\r\n\t\t\t\t\tcommentCrawling(ele.attr(\"href\"));//��۸�� ���� ��ũ\r\n\t\t\t\t\tcommentCrawlingList(commentURList);\r\n\t\t\t\t\tcommentURList = new ArrayList<String>();//��ũ ����� �ߺ��ǰ� ���̴� �� �����ϱ� ���� �ʱ�ȭ �۾�\r\n\t\t\t\t\tSystem.out.println(i+\"��° ������\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn replyComment;\r\n\t\t//return urlList.get(0);\r\n\t}", "@SuppressWarnings(\"unchecked\")\n\tpublic Indexer crawl (int limit) \n\t{\n\t\n\t\t////////////////////////////////////////////////////////////////////\n\t // Write your Code here as part of Priority Based Spider assignment\n\t // \n\t ///////////////////////////////////////////////////////////////////\n\t\tPQueue q=new PQueue();\n \t\n\t\ttry\n \t{\n\t\t\t final String authUser = \"iiit-63\";\n\t\t\t\tfinal String authPassword = \"MSIT123\";\n\n\t\t\t\tSystem.setProperty(\"http.proxyHost\", \"proxy.iiit.ac.in\");\n\t\t\t\tSystem.setProperty(\"http.proxyPort\", \"8080\");\n\t\t\t\tSystem.setProperty(\"http.proxyUser\", authUser);\n\t\t\t\tSystem.setProperty(\"http.proxyPassword\", authPassword);\n\n\t\t\t\tAuthenticator.setDefault(\n\t\t\t\t new Authenticator() \n\t\t\t\t {\n\t\t\t\t public PasswordAuthentication getPasswordAuthentication()\n\t\t\t\t {\n\t\t\t\t return new PasswordAuthentication(authUser, authPassword.toCharArray());\n\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t);\n\n\t\t\t\tSystem.setProperty(\"http.proxyUser\", authUser);\n\t\t\t\tSystem.setProperty(\"http.proxyPassword\", authPassword);\n \t\tURLTextReader in = new URLTextReader(u);\n \t\t// Parse the page into its elements\n \t\tPageLexer elts = new PageLexer(in, u);\t\t\n \t\tint count1=0;\n \t\t// Print out the tokens\n \t\tint count = 0;\n \t\t\n \t\twhile (elts.hasNext()) \n \t\t{\n \t\t\tcount++;\n \t\t\tPageElementInterface elt = (PageElementInterface)elts.next();\t\t\t \n \t\t\tif (elt instanceof PageHref)\n \t\t\tif(count1<limit)\n \t\t\t{\n \t\t\t\tif(q.isempty())\n \t\t\t\t{\n \t\t\t\t\tq.enqueue(elt.toString(),count);\n\t\t\t\t\t}\n \t\t\t\telse\n \t\t\t\t{\n \t\t\t\t\tif(q.search(elt.toString(),count))\n \t\t\t\t\t{\n \t\t\t\t\t\tq.enqueue(elt.toString(),count);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\tcount1++;\n \t\t\t\tSystem.out.println(\"link: \"+elt);\n \t\t\t\t\n \t\t\t}\n \t\t}\n \t\tSystem.out.println(\"links retrieved: \"+count1);\n \t\tq.display();\n \t\twhile(limit !=0)\n \t\t{\n \t\t\tObject elt=q.dequeue();\n \t\t\tURL u1=new URL(elt.toString());\n \t\t\tURLTextReader in1= new URLTextReader(u1);\n \t\t\t// Parse the page into its elements\n \t\t\tPageLexer elt1 = new PageLexer(in1, u1);\n \t\t\twhile (elt1.hasNext()) \n \t\t\t{\n \t\t\t\tPageElementInterface elts2= (PageElementInterface)elt1.next();\n \t\t\t\tif (elts2 instanceof PageWord)\n \t\t\t\t{\n \t\t\t\t\tv.add(elts2);\n \t\t\t\t}\n \t\t\t\tSystem.out.println(\"words:\"+elts2);\n \t\t\t} \t\t\t\n\t\t\t\tObjectIterator OI=new ObjectIterator(v);\n\t\t\t\ti.addPage(u1,OI);\n\t\t\t\tfor(int j=0;j<v.size();j++);\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"hello\"+v.get(count));\n\t\t\t\t}\n\t\t\t\tlimit--;\n \t\t}\n \t\t\n \t}\n \tcatch (Exception e)\n \t{\n \t\tSystem.out.println(\"Bad file or URL specification\");\n \t}\n return i;\n\t}", "@Override\n public void run()\n {\n Document doc = null;\n try\n {\n // Politeness policy\n try\n {\n // Used so that we don't have multiple threads sleeping, instead the rest just wait on the\n // semaphore\n if (PolitenessPolicy()) return;\n\n doc = Jsoup.connect(threadVertex.getUrl()).get();\n }\n catch (InterruptedException e)\n {\n e.printStackTrace();\n return;\n }\n }\n catch (UnsupportedMimeTypeException e)\n {\n// System.out.println(\"--unsupported document type, do nothing\");\n return;\n }\n catch (HttpStatusException e)\n {\n// System.out.println(\"--invalid link, do nothing\");\n return;\n }\n catch (IOException e)\n {\n e.printStackTrace();\n return;\n }\n finally\n {\n politenessInteger.incrementAndGet();\n }\n\n Elements links = doc.select(\"a[href]\");\n for (Element link : links)\n {\n String v = link.attr(\"abs:href\");\n// System.out.println(\"Found: \" + v);\n\n// Document temp = null;\n if (!Util.ignoreLink(threadVertex.getUrl(), v))\n {\n // This was originally trying to catch invalid links before adding them to the graph\n // but I realized those are also valid notes, just leaf nodes.\n // This also greatly speeds up the execution of the program.\n// try\n// {\n// try\n// {\n// // Used so that we don't have multiple threads sleeping, instead the rest just wait on the\n// // semaphore\n// if (PolitenessPolicy()) return;\n//\n// temp = Jsoup.connect(v).get();\n// }\n// catch (InterruptedException e)\n// {\n// e.printStackTrace();\n// return;\n// }\n// }\n// catch (UnsupportedMimeTypeException e)\n// {\n// System.out.println(\"--unsupported document type, do nothing\");\n// return;\n// }\n// catch (HttpStatusException e)\n// {\n// System.out.println(\"--invalid link, do nothing\");\n// return;\n// }\n// catch (IOException e)\n// {\n// e.printStackTrace();\n// return;\n// }\n\n Vertex newVertex = new Vertex(v);\n\n // We need to synchronize the graph and the queue among each thread\n // This avoids dirty reads and dirty writes\n synchronized(graph)\n {\n synchronized(urlQueue)\n {\n if (!graph.containsKey(newVertex.getUrl()))\n {\n int newVertexDepth = threadVertex.getDepth() + 1;\n int currentPages = graph.size();\n\n if (currentPages < maxPages && newVertexDepth <= maxDepth)\n {\n // Set the new vertex's depth and add an ancestor\n newVertex.setDepth(newVertexDepth);\n newVertex.addAncestor(threadVertex);\n\n // Update the current vertex to have this one as a child\n threadVertex.addChild(newVertex);\n graph.put(threadVertex.getUrl(), threadVertex);\n\n // Place the new vertex in the discovered HashMap and place it in the queue\n graph.put(newVertex.getUrl(), newVertex);\n\n urlQueue.add(newVertex);\n }\n }\n else\n {\n // Done to update relationships of ancestors and children\n Vertex oldVertex = graph.get(newVertex.getUrl());\n\n oldVertex.addAncestor(threadVertex);\n threadVertex.addChild(oldVertex);\n\n graph.put(oldVertex.getUrl(), oldVertex);\n graph.put(threadVertex.getUrl(), threadVertex);\n }\n }\n }\n }\n else\n {\n// System.out.println(\"--ignore\");\n return;\n }\n }\n }", "public void start(){\n\t\tboolean readFromFile = readFromIndex();\r\n\t\tif (!readFromFile){\t\r\n\t\t\tfor (int i = 0;i<1000;++i){\r\n\t\t\t\tString file = \"../crawler/pages/page\"+i+\".html\";\r\n\t\t\t\taddFile(file);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public interface Crawler {\n\t/**\n\t * Gets the location where crawled content is saved.\n\t * \n\t * @return location string of crawled content\n\t */\n\tpublic String getDumpLocation();\n\n\t/**\n\t * Starts the crawling from the root source of target.\n\t * \n\t * @throws IOException\n\t */\n\tpublic void disperse() throws IOException;\n\n\t/**\n\t * Crawls every <code>url</code> within the <code>target</code> url\n\t * \n\t * @param url\n\t * url which is either <code>target</code> or the one nested\n\t * inside\n\t * @param target\n\t * the target url declared to crawl\n\t * @throws IOException\n\t */\n\tpublic void crawl(final String url, final String target) throws IOException;\n\n\t/**\n\t * Picks up data from webpage.\n\t * \n\t * @param doc\n\t * <code>Document</code> retrieved from <code>url</code>\n\t * @param url\n\t * @return list of <code>Nugget</code> objects consisting of relevant data\n\t */\n\tpublic List<Nugget> scavenge(final Document doc, final String url);\n\n}", "Map<String, Integer> getSearchResults(String searchTerm) {\n\n Map<String, Integer> libCount = new ConcurrentHashMap<>();\n\n try {\n Document document = Jsoup.connect(google + URLEncoder.encode(searchTerm, charset))\n .userAgent(userAgent)\n .referrer(\"http://www.google.com\")\n .get();\n\n Elements links = document.select(\"a[href]\");\n Set<String> urls = new HashSet<>();\n for (Element link: links) {\n if (link.attr(\"href\") != null && link.attr(\"href\").contains(\"=\")) {\n String url = link.attr(\"href\").split(\"=\")[1];\n if (url.contains(\"http\")) {\n urls.add(getDomainName(url));\n }\n }\n }\n\n CountDownLatch latch = new CountDownLatch(urls.size());\n\n for (String url: urls) {\n AnalysePage analysePage = new AnalysePage(url);\n completionService.submit(analysePage);\n }\n\n int completed = 0;\n\n while(completed < urls.size()) {\n try {\n Future<Set<String>> resultFuture = completionService.take();\n Set<String> strings = resultFuture.get();\n for (String lib : strings) {\n Integer count = libCount.get(lib);\n if (count == null) {\n libCount.put(lib, 1);\n } else {\n libCount.put(lib, ++count);\n }\n }\n completed++;\n latch.countDown();\n } catch (InterruptedException | ExecutionException e) {\n e.printStackTrace();\n }\n }\n try {\n latch.await();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n } catch (MalformedURLException e) {\n System.out.println(\"The URL is Malformed\");\n } catch (UnsupportedEncodingException e) {\n System.out.println(\"Incorrect URL encoding\");\n } catch (IOException e) {\n System.out.println(\"Unable to read from google\");\n e.printStackTrace();\n }\n executor.shutdown();\n return libCount;\n }", "public CrawlWorker(String url) {\n\t\t\tthis.url = url;\n\t\t}", "public void incPagesCrawled() {\n pagesCrawled++;\n }", "Collection<PageLink> crawl(CrawlerArgs args);", "public void run() {\n for (CrawlTask newTask = queue.pop(level); newTask != null; newTask = queue.pop(level))\n /*while (queue.getQueueSize(currentLevel)>0)*/ {\n//\t\t\tObject newTask = queue.pop(currentLevel);\n // Tell the message receiver what we're doing now\n mainCrawler.receiveMessage(newTask, id);\n // Process the newTask\n process(newTask);\n // If there are less threads running than it could, try\n // starting more threads\n if (tc.getMaxThreads() > tc.getRunningThreads()) {\n try {\n tc.startThreads();\n } catch (Exception e) {\n System.err.println(\"[\" + id + \"] \" + e.toString());\n }\n }\n }\n // Notify the ThreadController that we're done\n tc.finished(id);\n }", "private void searchNext(CrawlingSession executor, Link link) {\n HTMLLinkExtractor htmlLinkExtractor = HTMLLinkExtractor.getInstance();\n// htmlLinkExtractor.setWorking(link);\n \n Source source = CrawlingSources.getInstance().getSource(link.getSourceFullName());\n if(source == null) return;\n \n SessionStore store = SessionStores.getStore(source.getCodeName());\n if(store == null) return;\n\n List<Link> collection = htmlLinkExtractor.getLinks(link, /*link.getSource(),*/ pagePaths);\n// List<Link> collection = htmlLinkExtractor.getLinks(srResource);\n List<Link> nextLinks = createNextLink(link, collection);\n if(nextLinks.size() < 1) return;\n if(userPaths == null && contentPaths == null) {\n executor.addElement(nextLinks, link.getSourceFullName());\n return;\n }\n \n \n if(nextLinks.size() < 2) {\n executor.addElement(nextLinks, link.getSourceFullName());\n }\n \n// long start = System.currentTimeMillis();\n \n int [] posts = new int[nextLinks.size()];\n for(int i = 0; i < nextLinks.size(); i++) {\n try {\n posts[i] = PageDownloadedTracker.searchCode(nextLinks.get(i), true);\n } catch (Throwable e) {\n posts[i] = -1;\n LogService.getInstance().setThrowable(link.getSourceFullName(), e);\n// executor.abortSession();\n// return;\n }\n }\n \n int max = 1;\n for(int i = 0; i < posts.length; i++) {\n if(posts[i] > max) max = posts[i];\n }\n \n// System.out.println(\" thay max post la \"+ max);\n \n List<Link> updateLinks = new ArrayList<Link>();\n for(int i = 0; i < posts.length; i++) {\n if(posts[i] >= max) continue;\n updateLinks.add(nextLinks.get(i));\n }\n \n// long end = System.currentTimeMillis();\n// System.out.println(\"step. 4 \"+ link.getUrl()+ \" xu ly cai ni mat \" + (end - start));\n \n executor.addElement(updateLinks, link.getSourceFullName());\n \n /*int minPost = -1;\n Link minLink = null;\n List<Link> updateLinks = new ArrayList<Link>();\n for(int i = 0; i < nextLinks.size(); i++) {\n Link ele = nextLinks.get(i);\n int post = 0;\n try {\n post = PostForumTrackerService2.getInstance().read(ele.getAddressCode());\n } catch (Exception e) {\n LogService.getInstance().setThrowable(link.getSource(), e);\n }\n if(post < 1) {\n updateLinks.add(ele);\n continue;\n } \n\n if(minPost < 0 || post < minPost){\n minLink = ele;\n minPost = post; \n } \n }\n\n if(minLink != null) updateLinks.add(minLink);\n executor.addElement(updateLinks, link.getSource());*/\n }", "public void run() {\n System.out.println(\"Running Indexing\");\n Indexer.index();\n }", "public void run() {\n\t\t\t\twhile (queue.size() > 0) {\n\t\t\t\t\tJobQueue urlList = queue.poll();\n\t\t\t\t\tdoRequests(urlList);\n\t\t\t\t}\n\t\t\t}", "public Crawler(String seedUrlStr, int toDiscover)\n throws InterruptedException, FileNotFoundException,\n UnsupportedEncodingException {\n HTMLFetcher fetcher = null;\n urlQueue.add(seedUrlStr);\n String urlStr = \"\";\n while (discoveredUrls < toDiscover) {\n urlStr = urlQueue.poll(TIMEOUT_VAL, TimeUnit.SECONDS);\n\n if (urlStr == null) {\n // Happens if the crawler has waited for a new URL in the queue\n // for more than the timeout value. This means that all leafs\n // have been found and the crawler cannot continue.\n break;\n }\n\n // Acquire mutex to avoid collision when adding and\n // comparing at the same time\n mutex.acquireUninterruptibly();\n polledUrls.add(urlStr);\n mutex.release();\n\n System.out.println(\"Crawling: \" + urlStr);\n try {\n fetcher = new HTMLFetcher(new URL(urlStr), this);\n } catch (MalformedURLException e) {\n continue;\n }\n\n fetcherExecutor.execute(fetcher);\n }\n System.out.println(\"DONE: Discovered \" + discoveredUrls + \" URLs\");\n\n System.out.println(\"Dumping them into: urls.txt\");\n Collection<String> toDump = new LinkedList<String>(polledUrls);\n toDump.addAll(urlQueue);\n dumpCollection(toDump, \"urls.txt\");\n\n System.out.println(\"Waiting for \" + TIMEOUT_VAL + \" seconds for \"\n + Thread.activeCount() + \" threads to terminate...\");\n fetcherExecutor.awaitTermination(TIMEOUT_VAL, TimeUnit.SECONDS);\n }", "public static void main(String[] arg) throws IOException, URISyntaxException, InterruptedException {\n DB = new manageDB();\n Crawler crawler = new Crawler();\n DBLock=new AtomicInteger(0);\n new Thread(new Runnable() {\n @Override\n public void run() {\n try {\n crawler.CrawlerProcess(5);\n } catch (IOException e) {\n e.printStackTrace();\n } catch (InterruptedException e) {\n e.printStackTrace();\n } catch (URISyntaxException e) {\n e.printStackTrace();\n }\n }\n }).start();\n\n new Thread(new Runnable() {\n @Override\n public void run() {\n processedCrawledPages=0;\n outputSection = new HashSet<>();\n while (true) {\n crawlerOutput = crawler.crawlerOutput;\n if (crawlerOutput != null)\n {\n if (crawlerOutput.size() > 0)\n {\n Iterator<Crawler.OutputDoc> itr = crawlerOutput.iterator();\n if(itr.hasNext())\n {\n Crawler.OutputDoc output;\n synchronized (crawlerOutput) {\n output = itr.next();\n outputSection.add(output);\n }\n if(processedCrawledPages%10==0)\n {\n //lock db to be exclusive for POP function\n DBLock.set(1);\n processedCrawledPages=0;\n try {\n Thread popThread=new Thread(new POPClass(outputSection));\n popThread.start();\n popThread.join();\n\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n outputSection.clear();\n \n }\n while(DBLock.intValue()==1);\n processedCrawledPages +=1;\n DB.docProcess(output);\n synchronized (crawlerOutput) {\n crawlerOutput.remove(output);\n }\n }\n\n }\n }\n }\n }\n\n }).start();\n\n\n new Thread(new Runnable() {\n @Override\n public void run() {\n try {\n ServerSocket serverSocket = new ServerSocket(7800);\n System.out.println(\"server is up and running...\");\n while (true) {\n Socket s = serverSocket.accept();\n System.out.println(\"server accepted the query...\");\n DataInputStream DIS = new DataInputStream(s.getInputStream());\n String query_and_flags = DIS.readUTF();\n Boolean imageSearch = false;\n Boolean phraseSearch = false;\n System.out.println(\"query_and_flags=\" + query_and_flags);\n String[] list_query_and_flags = query_and_flags.split(\"@\");\n String query = list_query_and_flags[0];\n if (list_query_and_flags[1].equals(\"phrase\"))\n phraseSearch = true;\n if (list_query_and_flags[2].equals(\"yes\"))\n imageSearch = true;\n\n if (imageSearch)\n manageDB.imageSearch(query);\n else manageDB.rank(query,phraseSearch);\n if (phraseSearch)\n System.out.println(\"it's phrase search\");\n else System.out.println(\"no phrase search\");\n DIS.close();\n s.close();\n\n }\n } catch (IOException | SQLException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }\n }).start();\n\n\n }", "public URLSpout() {\n \tURLSpout.activeThreads = new AtomicInteger();\n \tlog.debug(\"Starting URL spout\");\n \t\n \ttry { \t\t\n\t\t\treader = new BufferedReader(new FileReader(\"URLDisk.txt\"));\n\t\t\tint num_lines = XPathCrawler.getInstance().getFileCount().get();\n\t\t\tfor (int i = 0; i < num_lines; i++) {\n\t\t\t\treader.readLine(); //set reader to latest line\n\t\t\t}\t\t\t\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t\tgetResultByKeyword(page);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t\tgetResultByKeyword(page);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}", "@Override\n\tpublic void run() {\n\t\ttry{\n\t\t\tboolean redirected=false;\n\t\t\tint responseCode=0;\n\t\t\tint tries=0;\n\t\t\tString location=site.getUrl();\n\t\t\tHttpURLConnection urlConnection=null;\n\t\t\tdo{\n\t\t\t\tURL url = new URL(location);\n\t\t\t\turlConnection = (HttpURLConnection) url.openConnection();\n\t\t\t\turlConnection.setRequestProperty(\"User-Agent\", \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11\");\n\t\t\t\turlConnection.setConnectTimeout(Constants.CONNECTION_TIMEOUT);\n\t\t\t\turlConnection.setReadTimeout(Constants.READ_TIMEOUT);\n\t\t\t\turlConnection.setRequestMethod(\"GET\");\n\t\t\t\turlConnection.setInstanceFollowRedirects(true);\n\t\t\t\turlConnection.setUseCaches(false);\n\t\t\t\turlConnection.setAllowUserInteraction(false);\n\t\t\t\turlConnection.setRequestProperty(\"Content-Type\", \"application/x-www-form-urlencoded\");\n\t\t\t\tresponseCode = urlConnection.getResponseCode();\n\t\t\t\t\n\t\t\t\tif(responseCode==HttpURLConnection.HTTP_MOVED_TEMP || responseCode==HttpURLConnection.HTTP_MOVED_PERM){ //handle 302 and 301 redirect. \n\t\t\t\t\tredirected=true;\n\t\t\t\t\tlocation = urlConnection.getHeaderField(\"Location\");\n\t\t\t\t\ttries++;\n\t\t\t\t}else\n\t\t\t\t\tredirected=false;\n\t\t\t}while(redirected && tries<3);\n\t\t\t\n\t\t\tif (responseCode == HttpURLConnection.HTTP_OK){\n\t\t\t\ttry (InputStream is = urlConnection.getInputStream();\n\t\t BufferedReader br = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8))) {\n\t\t String content = br.lines().collect(Collectors.joining(System.lineSeparator()));\n\t \tthis.callback.webContentCallBack(site, content);\n\t\t } \n\t\t\t}else this.callback.webContentCallBack(site, null); //any other case, null is returned as the content. \n\t\t}catch (Exception e) {\n\t\t\tLogger.getLogger(Fetcher.class.getName()).log(Level.WARNING, \"Site:\"+site.getUrl()+\" failed fetching.\", e);\n\t\t\ttry {\n\t\t\t\tthis.callback.webContentCallBack(site, null); //any exception, null is returned as the content. \n\t\t\t} catch (Exception e1) {\n\t\t\t} \n\t\t}\n\t}", "@Override\r\n public void visit(Page page) {\r\n String url = page.getWebURL().getURL();\r\n System.out.println(\"URL: \" + url);\r\n\r\n if (page.getParseData() instanceof HtmlParseData) {\r\n HtmlParseData htmlParseData = (HtmlParseData) page.getParseData();\r\n String text = htmlParseData.getText();\r\n String html = htmlParseData.getHtml();\r\n List<WebURL> links = htmlParseData.getOutgoingUrls();\r\n\r\n System.out.println(\"Text length: \" + text.length());\r\n System.out.println(\"Html length: \" + html.length());\r\n System.out.println(\"Number of outgoing links: \" + links.size());\r\n\r\n try {\r\n Configuration config = new Configuration();\r\n System.setProperty(\"HADOOP_USER_NAME\", \"admin\");\r\n FileSystem fileSystem = FileSystem.get(new URI(\"hdfs://192.168.51.116:8022/\"), config);\r\n FSDataOutputStream outStream = fileSystem.append(new Path(\"/user/admin/crawler-results.txt\"));\r\n\r\n IOUtils.write(text.replace('\\n', ' '), outStream);\r\n outStream.flush();\r\n IOUtils.closeQuietly(outStream);\r\n } catch (Exception ex) {\r\n ex.printStackTrace();\r\n throw new RuntimeException(ex);\r\n }\r\n }\r\n }", "@Override\n\tpublic void visit(Page page) {\n\t\t\n\t\ttry{\n\t\t\tfin=\"\";\n\t\t\tif(flag == 0){\n\t\t\t\tfw = new FileWriter(wrtFile);\n\t\t\t\tfw1 = new FileWriter(wrtFile1);\n\t\t\t\tvisit_url = new HashSet<String>();\n\t\t\t\tall_txt = new HashSet<String>();\n\t\t\t\teng_sen = new ArrayList<String>();\n\t\t\t}\n\t\t\tflag++;\n\t\t\tsynchronized (this) {\n\t\t\t\tif(page.getParseData() instanceof HtmlParseData){\n\t\t\t\t\tHtmlParseData htmlParseData = (HtmlParseData) page.getParseData();\n\t\t\t\t\tString html = htmlParseData.getHtml();\n\t\t\t\t\tString url = page.getWebURL().getURL().toLowerCase();\n\t\t\t\t\t//System.out.println(\"VISIT: \"+ url);\n\t\t\t\t\t//System.out.println(\"HTML: \"+ html);\n\t\t\t\t\tDocument doc = Jsoup.parse(html);\n\t\t\t\t\tdoc.removeClass(\"twitter-tweet\");\n\t\t\t\t\tElements links = doc.select(\"div\");\n\t\t\t\t\tIterator<Element> it = links.iterator();\n\t\t\t\t\t\n\t\t\t\t\tString text=\"\";\n\t\t\t\t\tElement link;\n\t\t\t\t\tElements children;\n\t\t\t\t\twhile(it.hasNext()){\n\t\t\t\t\t\tlink = it.next();\n\t\t\t\t\t\tif(link.attr(\"class\").equals(\"desc\")){\n\t\t\t\t\t\t\t//System.out.println(\"Division Class: \"+ link.attr(\"class\"));\n\t\t\t\t\t\t\t//text.replaceAll(\",\", \"(COMMA)\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tchildren = link.children();\n\t\t\t\t\t\t\tif(!children.isEmpty()){\n\t\t\t\t\t\t\t\tIterator<Element> child_it = children.iterator();\n\t\t\t\t\t\t\t\tElement child;\n\t\t\t\t\t\t\t\twhile(child_it.hasNext()){\n\t\t\t\t\t\t\t\t\tchild = child_it.next(); \n\t\t\t\t\t\t\t\t\tif(child.attr(\"data-lang\").equals(\"en\") || child.attr(\"class\").equals(\"instagram-media\") || child.text().contains(\"Read Also\")){\n\t\t\t\t\t\t\t\t\t\tchild.text(\"\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!text.contains(link.text())){\t\t\n\t\t\t\t\t\t\t\tif(!link.text().matches(\".*Updated (Mon|Tue|Wed|Thu|Fri|Sat|Sun).*\")){\n\t\t\t\t\t\t\t\t\ttext += link.text();\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//System.out.println(\"Text: \"+ text);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(link.attr(\"class\").equals(\"caption\")){\n\t\t\t\t\t\t\t//System.out.println(\"Division Class: \"+ link.attr(\"class\"));\n\t\t\t\t\t\t\t//text.replaceAll(\",\", \"(COMMA)\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tchildren = link.children();\n\t\t\t\t\t\t\tif(!children.isEmpty()){\n\t\t\t\t\t\t\t\tIterator<Element> child_it = children.iterator();\n\t\t\t\t\t\t\t\tElement child;\n\t\t\t\t\t\t\t\twhile(child_it.hasNext()){\n\t\t\t\t\t\t\t\t\tchild = child_it.next(); \n\t\t\t\t\t\t\t\t\tif(child.attr(\"data-lang\").equals(\"en\") || child.attr(\"class\").equals(\"instagram-media\") || child.text().contains(\"Read Also\")){\n\t\t\t\t\t\t\t\t\t\tchild.text(\"\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!text.contains(link.text())){\t\t\n\t\t\t\t\t\t\t\tif(!link.text().matches(\".*Updated (Mon|Tue|Wed|Thu|Fri|Sat|Sun).*\")){\n\t\t\t\t\t\t\t\t\ttext += link.text();\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//System.out.println(\"Text: \"+ text);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(text != \"\"){\n\t\t\t\t\t\tif(!visit_url.contains(url) && !all_txt.contains(text)){\n\t\t\t\t\t\t\tfin = text+\"\\n\";\n\t\t\t\t\t\t\tfin1 = url+\"\\n\";\n\t\t\t\t\t\t\t//System.out.println(\"Text: \"+ text);\n\t\t\t\t\t\t\t//System.out.println(\"URL: \"+ url);\n\t\t\t\t\t\t\tFiles.write(Paths.get(wrtFile), fin.getBytes(), StandardOpenOption.APPEND);\n\t\t\t\t\t\t\tFiles.write(Paths.get(wrtFile1), fin1.getBytes(), StandardOpenOption.APPEND);\n\t\t\t\t\t\t\tall_txt.add(text);\n\t\t\t\t\t\t\tvisit_url.add(url);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public void performCrawl() throws IOException, GitAPIException, SaveException {\n List<QueryResult> results = studyFetcher.crawl();\n studyRepository.persist(results);\n }", "void startCrawler() throws ParserConfigurationException, SAXException, IOException;", "public void run() {\n doProcessDocuments();\n //doReport();\n\n }", "public static void main(String args[]) throws Exception {\n if (args.length < 1) {\n System.out.println(\"Usage: CrawlTool (-local | -ndfs <nameserver:port>) <root_url_file> [-dir d] [-threads n] [-depth i] [-showThreadID]\");\n return;\n }\n\n String fs = \"-local\";\n String nameserver = \"\";\n if (\"-ndfs\".equals(args[0])) {\n fs = \"-ndfs\";\n nameserver = args[1];\n }\n NutchFileSystem nfs = NutchFileSystem.parseArgs(args, 0);\n try {\n String rootUrlFile = null;\n String dir = new File(\"crawl-\" + getDate()).getCanonicalFile().getName();\n int threads = NutchConf.getInt(\"fetcher.threads.fetch\", 10);\n int depth = 5;\n boolean showThreadID = false;\n\n for (int i = 0; i < args.length; i++) {\n if (\"-dir\".equals(args[i])) {\n dir = args[i+1];\n i++;\n } else if (\"-threads\".equals(args[i])) {\n threads = Integer.parseInt(args[i+1]);\n i++;\n } else if (\"-depth\".equals(args[i])) {\n depth = Integer.parseInt(args[i+1]);\n i++;\n } else if (\"-showThreadID\".equals(args[i])) {\n showThreadID = true;\n } else if (args[i] != null) {\n rootUrlFile = args[i];\n }\n }\n\n if (nfs.exists(new File(dir))) {\n throw new RuntimeException(dir + \" already exists.\");\n }\n\n LOG.info(\"crawl started in: \" + dir);\n LOG.info(\"rootUrlFile = \" + rootUrlFile);\n LOG.info(\"threads = \" + threads);\n LOG.info(\"depth = \" + depth);\n\n String db = new File(dir + \"/db\").getCanonicalPath();\n String segments = new File(dir + \"/segments\").getCanonicalPath();\n\n // initialize the web database\n WebDBAdminTool.main(prependFileSystem(fs, nameserver, new String[] { db, \"-create\"}));\n WebDBInjector.main(prependFileSystem(fs, nameserver, new String[] { db, \"-urlfile\", rootUrlFile }));\n\n for (int i = 0; i < depth; i++) {\n // generate a new segment\n FetchListTool.main(prependFileSystem(fs, nameserver, new String[] { db, segments } ));\n String segment = getLatestSegment(nfs, segments);\n Fetcher.main(prependFileSystem(fs, nameserver, new String[] { \"-threads\", \"\"+threads, segment } ));\n UpdateDatabaseTool.main(prependFileSystem(fs, nameserver, new String[] { db, segment } ));\n }\n\n // Re-fetch everything to get the complete set of incoming anchor texts\n // associated with each page. We should fix this, so that we can update\n // the previously fetched segments with the anchors that are now in the\n // database, but until that algorithm is written, we re-fetch.\n \n // delete all the old segment data\n FileUtil.fullyDelete(nfs, new File(segments));\n\n // generate a single segment containing all pages in the db\n FetchListTool.main(prependFileSystem(fs, nameserver, new String[] { db, segments, \"-adddays\", \"\" + Integer.MAX_VALUE } ));\n\n String segment = getLatestSegment(nfs, segments);\n\n // re-fetch everything\n Fetcher.main(prependFileSystem(fs, nameserver, new String[] { \"-threads\", \"\"+threads, segment } ));\n\n // index, dedup & merge\n File workDir = new File(dir, \"workdir\");\n IndexSegment.main(prependFileSystem(fs, nameserver, new String[] { segment, \"-dir\", workDir.getPath() } ));\n DeleteDuplicates.main(prependFileSystem(fs, nameserver, new String[] { segments }));\n IndexMerger.main(prependFileSystem(fs, nameserver, new String[] { new File(dir + \"/index\").getCanonicalPath(), segment } ));\n\n LOG.info(\"crawl finished: \" + dir);\n } finally {\n nfs.close();\n }\n }", "public static void main(String[] args) throws IOException \n\t{\n\t\tScanner sc = new Scanner(System.in);\n\t\tSystem.out.print(\"Please input the keyword: \");\n\t\tString keyword = sc.next();\n\t\tsc.close();\n\t\n\t\tKeywordList kLst = new KeywordList();\t\n\t\tSystem.out.println(\"-------------------------------------------------------\\nRelative Word List: \");\n\t\tkLst.printKeywordList(kLst.getKeywords());\n\t\tSystem.out.print(\"-------------------------------------------------------\\nValid Web Pages for Keyword [\" + keyword + \"]: \\n\");\n\t\tGoogleSearch google = new GoogleSearch(keyword);\n\t\tSystem.out.print(google.toString());\n\t\t\n\t\tArrayList<WebNode> wLst = new ArrayList<WebNode>();\t\n\t\t\n\t\ttry \n\t\t{\t\t\n\t\t\tfor(String title: google.query().keySet()) \n\t\t\t{\n\t\t\t\tString webUrl = google.query().get(title);\t\n\t\t\t\tWebPage rootPage = new WebPage(webUrl, title);\n\t\t\t\tWebTree tree = new WebTree(rootPage);\n\t\t\t\t\t\n\t\t\t\tChildPageQuery childQ = new ChildPageQuery(webUrl);\n\t\t\t\tint count = 0;\n\t\t\t\tif(childQ.query() != null) \n\t\t\t\t{\t\t\t\n\t\t\t\t\tfor(String childUrl: childQ.query()) \n\t\t\t\t\t{\t\t\t\n\t\t\t\t\t\tcount++;\t\t\t\t\t\t\t\n\t\t\t\t\t\ttree.root.addChild(new WebNode(new WebPage(childUrl, count + \"\")));\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\ttree.setPostOrderScore(kLst.getKeywords());\n\t\t\t\t\twLst.add(tree.root);\n\t\t\t\t}\n\t\t\t}\t\n\t\t\t\n\t\t\tWebRating rating = new WebRating(wLst);\n\t\t\trating.sort();\n\t\t\tSystem.out.println(\"-------------------------------------------------------\\n★★★Rating★★★\\n(Title, Total Child Pages, Total Root Page Score)\");\n\t\t\tSystem.out.print(rating.output());\n\t\t} \n\n\t\tcatch(IOException e)\n\t\t{\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public String crawl() throws IOException {\n // FILL THIS IN!\n if(queue.isEmpty()){\n \treturn null;\n }\n String url = queue.remove();\n \tSystem.out.println(\"crawling \"+url);\n Elements paragraphs;\n \tif(index.isIndexed(url))\n \t{\n \t\tSystem.out.println(url+\" is already indexed\");\n \t\treturn null;\n \t}\n \tparagraphs = wf.fetchWikipedia(url);\n index.indexPage(url,paragraphs);\n queueInternalLinks(paragraphs);\t \n\t\treturn url;\n\t}", "@Override\n public void storeParsedText() {\n parsedHtmlPages.parallelStream().forEach(parsedHtmlPage -> {\n FileUtility.writeToFile(parsedHtmlPage, FILE_DIRECTORY_NAME + FILE_SEPARATOR + parsedHtmlPage.getTitle());\n });\n }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\tdoSearch(name, count);\n\t\t\t}", "public Crawler crawl() throws ParseException, IOException {\n\t\tlong start = System.currentTimeMillis();\n\n\t\tCrawler c = new Crawler(\"https://cs.purdue.edu\", 250);\n\t\tc.crawl();\n\n \tlong end = System.currentTimeMillis();\n \tSystem.out.println(\"Stats: \");\n \tSystem.out.println(\"Number of parsed pages: \" + c.getParsed().size());\n \tSystem.out.println(\"Number of words: \" + c.getWords().size());\n \t\n \tSystem.out.println(\"Total time: \" + (end - start) + \"ms.\");\n\n \treturn c;\n\t}", "public void crawlPage() {\n\t\tlogger.info(\"Starting to crawl \" + page.getLink());\n\t\tconsoleLogger.info(\"Starting to crawl \" + page.getLink());\n\n\t\tDocument document = fetchContent(page);\n\t\tif (document == null)\n\t\t\treturn;\n\n\t\tif (shouldSavePage) {\n\t\t\tsavePage(document, page.getLink());\n\t\t}\n\n\t\tlogger.info(\"Done crawling \" + page.getLink());\n\t}", "public static void main() {\n // Since we cant use a global counter for all the different files\n // We use a global accumulator that takes the result from each file\n // After they are done with their respective file and save their result\n // This way they dont share a counter, but rather a place to store their counter\n // when they are done. \n AtomicInteger accumulator = new AtomicInteger(); // Default value = 0\n \n // word -> number of times that it appears over all files\n Map< String, Integer> occurrences = new HashMap<>();\n\n List< String> filenames = List.of(\n \"text1.txt\",\n \"text2.txt\",\n \"text3.txt\",\n \"text4.txt\",\n \"text5.txt\",\n \"text6.txt\",\n \"text7.txt\",\n \"text8.txt\",\n \"text9.txt\",\n \"text10.txt\"\n );\n\n CountDownLatch latch = new CountDownLatch(filenames.size());\n\n filenames.stream()\n .map(filename -> new Thread(() -> {\n int count = computeOccurrences(filename, occurrences);\n accumulator.addAndGet(count);\n latch.countDown();\n }))\n .forEach(Thread::start);\n\n try {\n latch.await();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n System.out.println(accumulator);\n }", "public static void leechCNN(Hdict dict)\r\n {\r\n WebDriver driver = new ChromeDriver();\r\n \r\n String baseUrl = \"https://www.cnn.com/\";\r\n driver.get(baseUrl);\r\n \r\n List<WebElement> links = driver.findElements(By.tagName(\"a\"));\r\n \r\n System.out.println(\"There is a total of \" + links.size() + \" frong page news detected on CNN\");\r\n \r\n Hdict titleDicts = new Hdict();\r\n \r\n for(int i = 0; i < links.size(); i++)\r\n {\r\n //get href links\r\n String url = links.get(i).getAttribute(\"href\");\r\n \r\n Words hUrl = new Words(url, 0);\r\n if(titleDicts.hdict_lookup(hUrl) != null) // if this page is already parsed\r\n {\r\n continue;\r\n }\r\n \r\n //if the page is not parsed\r\n titleDicts.hdict_insert(hUrl);\r\n \r\n for(int o = 0; o < 4; o++) // goes back 4 days\r\n {\r\n String urlname = \"\";\r\n if(month >= 10)\r\n urlname = \"https://www.cnn.com/\" + year + \"/\" + month;\r\n else\r\n urlname = \"https://www.cnn.com/\" + year + \"/0\" + month;\r\n \r\n if(day >= 10)\r\n urlname += \"/\" + (day - o) + \"/\";\r\n else\r\n urlname += \"/0\" + (day - o) + \"/\";\r\n \r\n String[] news = url.split(urlname);\r\n if(news.length > 1 && news[1].length() > 10) // if it is .html and has some other shish, shit solution but works\r\n {\r\n //WebDriver driver1 = new ChromeDriver();\r\n //driver1.get(url);\r\n \r\n //nytimes doesn't have viewers count, so default 2500 effectiveness on all posts\r\n \r\n int reactions = NYTIME_AVG;\r\n \r\n String directory = news[1];\r\n \r\n directory = directory.split(\".html\")[0]; // removes file name and directory\r\n String[] temp = directory.split(\"/\");\r\n String title = temp[temp.length-2]; // get file name, more concise, skip last for CNN, last is index\r\n String[] keys = title.split(\"-\");\r\n \r\n for(String key : keys)\r\n {\r\n if(key.contains(\".html\")) continue; // useless stuff\r\n \r\n boolean integercheck = true;\r\n try{\r\n Integer.parseInt(key);\r\n } catch(Exception e) \r\n {\r\n integercheck = false;\r\n };\r\n if(integercheck) continue; // useless numbers\r\n \r\n if(Arrays.binarySearch(JUNK_WORDS, key) >= 0) continue; // useless words\r\n \r\n Words wkey = new Words(key, reactions * CNN_WORTH);\r\n Words wkey_old = dict.hdict_lookup(wkey);\r\n if(wkey_old == null) dict.hdict_insert(wkey);\r\n else\r\n {\r\n wkey.setPopularity(wkey.getPopularity() + wkey_old.getPopularity());\r\n dict.hdict_insert(wkey);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n //close Chrome\r\n driver.close();\r\n }", "public void iterateThroughtEachElement(){\r\n ArrayList<String> links = examineHTML.getHrefOffers();\r\n \r\n int index = 0;\r\n \r\n for(String link:links){\r\n getHTMLOffer(link, index);\r\n ++index;\r\n }\r\n /*for(int i = 0; i < 10; i++){\r\n getHTMLOffer(links.get(i), index);\r\n ++index;\r\n }*/\r\n \r\n analyzeEachOffer();\r\n }", "private void parseIndex() throws IOException {\n\t\tDocument doc = Jsoup.connect(WOLFF + \"/bioscopen/cinestar/\").get();\n\t\tElements movies = doc.select(\".table_agenda td[width=245] a\");\n\t\t\n\t\tSet<String> urls = new HashSet<String>();\n\t\tfor(Element movie : movies) {\n\t\t\turls.add(movie.attr(\"href\"));\n\t\t}\n\t\t\n\t\tfor(String url: urls) {\n\t\t\tparseMovie(url);\n\t\t}\n\t}", "@Override\n public void doWork(Website site) {\n // TrungDQ: Comment these two lines to parse without crawl\n// CrawlerPipeline crawler = CrawlerPipeline.getInstance();\n// crawler.doWork(site);\n\n List<LinkDetail> linksList = (new LinkDetailDAL()).getLinksByWebsite(site);\n\n // move to Parser pipeline\n ParserPipeline parser = ParserPipeline.getInstance();\n List<ParsedHotel> parsedHotels = parser.doWork(linksList, site);\n\n // convert parsted hotel to normal hotel\n List<Hotel> hotels = new ArrayList<>();\n for (ParsedHotel parstedHotel : parsedHotels) {\n Hotel hotel = null;\n try {\n hotel = CommonObjConverter.toHotel(parstedHotel);\n } catch (Exception ex) {\n Logger.getLogger(Work.class.getName()).log(Level.SEVERE, null, ex);\n }\n hotels.add(hotel);\n }\n\n\n // normalization those hotel\n NormalizationPipeline engine = NormalizationPipeline.getInstance();\n hotels = engine.doWork(hotels);\n\n System.out.println(\"Hotels:::: \" + hotels);\n // save those hotel to database\n for (Hotel hotel : hotels) {\n try {\n if (!hotel.getHotelName().equals(\"0\")) {\n HotelDAL.addHotel(hotel);\n }\n } catch (Exception ex) {\n Logger.getLogger(Work.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n }", "public CrawlerResult crawl(URL url){\n //Creating the crawler result\n CrawlerResult rslt = new CrawlerResult(url);\n logger.info(url +\" started crawling....\");\n try{\n //Get the Document from the URL\n Document doc = Jsoup.connect(url.toString()).get();\n\n rslt.setTitle(doc.title());\n\n //links on the page\n Elements links = doc.select(\"a\");\n\n //Links on the page\n for(Element link : links){\n rslt.addLinksOnPage(new URL(link.attr(\"abs:href\")));\n }\n }catch(Exception e){\n //TODO\n }\n logger.info(url +\" finished crawled.\");\n return rslt;\n }", "@Override\n public void crawl() throws IOException {\n final String seedURL = url;\n Queue<String> currentDepthQueue = new LinkedList<>();\n currentDepthQueue.add(seedURL);\n crawl(visitedURL, 1, currentDepthQueue);\n customObjectWriter.flush();\n }", "public void crawl(URL url, int limit) {\n\t\turls.add(url);\n\t\tqueue.execute(new CrawlWorker(url.toString()));\n\n\t\tqueue.finish();\n\t\tqueue.shutdown();\n\t}", "public void run()\r\n {\n\ttopLevelSearch=FIND_TOP_LEVEL_PAGES;\r\n\ttopLevelPages=new Vector();\r\n\tnextLevelPages=new Vector();\r\n \r\n\t// Check to see if a proxy is being used. If so then we use IP Address rather than host name.\r\n\tproxyDetected=detectProxyServer();\r\n\t \r\n\tstartSearch();\r\n \r\n\tapp.enableButtons();\r\n\tapp.abort.disable();\r\n \r\n\tif(hitsFound == 0 && pageOpened == true)\r\n\t app.statusArea.setText(\"No Matches Found\");\r\n else if(hitsFound==1)\r\n\t app.statusArea.setText(hitsFound+\" Match Found\");\r\n else app.statusArea.setText(hitsFound+\" Matches Found\");\r\n }", "@Override\n public void run() {\n pbCount.setProgress(wordsCount);\n }", "private void startCrawler()\n {\n String[] enteredKeywords = getKeywordsFromBar();\n \n if(spider.numSeeds() == 0)\n JOptionPane.showMessageDialog(null, \"Please add some seed URL's\");\n \n else if(spider.numWorkers() == 0)\n JOptionPane.showMessageDialog(null, \"Please add atleast one worker\");\n \n else if(enteredKeywords == null)\n JOptionPane.showMessageDialog(null, \"Please enter some keywords to search for\");\n \n else if(spider.getIndexer() == null)\n JOptionPane.showMessageDialog(null, \"No index found, please create or open one\");\n \n else\n {\n playButton.setEnabled(false);\n startCrawlerItem.setEnabled(false);\n stopButton.setEnabled(true);\n stopCrawlerItem.setEnabled(true);\n spider.initKeywords(enteredKeywords);\n \n if(!canResume) spider.crawl();\n else \n {\n spider.resumeCrawling();\n canResume = false;\n }\n }\n }", "public static void main(String[] args) throws IOException {\n\t\t\n ArrayList<String> visited = new ArrayList<String>();\n\n\t\tString start = \"https://en.wikipedia.org/wiki/Java_(programming_language)\";\n String finish = \"https://en.wikipedia.org/wiki/Philosophy\";\n String url = start;\n\n for (int i = 0; i < 15; i++) {\n\n if (visited.contains(url)) {\n return;\n }\n else {\n visited.add(url); \n }\n\n Elements paragraphs = fetcher.fetchWikipedia(url);\n Element link = searchPage(paragraphs);\n\n if (link == null) {\n System.err.println(\"No links on this page...\");\n return;\n }\n\n url = link.attr(\"abs:href\");\n System.out.println(\"currently on: \" + url);\n \n if (url.equals(finish)) {\n System.out.println(\"found it!\");\n break;\n }\n }\n\t}", "public void process(CrawlTask crawlTask) {\n\n if (level == 0) {\n try {\n String boardLink = crawlTask.getUrl();\n MongoDatabase db = crawlTask.getDb();\n MongoCollection threadsCollection = db.getCollection(\"threads\");\n ForumConfig forumConfig = crawlTask.getForumConfig();\n\n List<ForumThread> threadList = new ArrayList<>();\n processBoard(forumConfig, boardLink, threadList, threadsCollection);\n System.out.println(\"***********************************************************TOTAL THREADS TO CRAWL IS: \" + threadList.size());\n for (ForumThread thread :\n threadList) {\n try {\n String link = thread.getThreadUrl();\n CrawlTask newTask = new CrawlTask(link, db, forumConfig);\n queue.push(newTask, level + 1);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n } catch (Exception e) {\n e.printStackTrace();\n // process of this object has failed, but we just ignore it here\n }\n } else if (level == 1) {\n try {\n String threadLink = crawlTask.getUrl();\n MongoDatabase db = crawlTask.getDb();\n ForumConfig forumConfig = crawlTask.getForumConfig();\n\n\t\t\t\t/*List<ForumPost> postList = new ArrayList<>();*/\n processThread(forumConfig, threadLink, db);\n\n } catch (Exception e) {\n e.printStackTrace();\n // process of this object has failed, but we just ignore it here\n }\n }\n\n\n }", "@Override\r\n public void run() {\r\n // mark as starting\r\n state.getStatus().starting();\r\n try {\r\n state.getProcessor().start();\r\n if (ds.getType().equals(\"salesforce\")) {\r\n // leancog registration check\r\n \tRegistrationCheck checker = new RegistrationCheck();\r\n \tif (!checker.verify()) {\r\n \t\tException failed = new Exception(REGISTRATION_ERROR_MSG);\r\n \t\tLOG.error(REGISTRATION_ERROR_MSG, failed);\r\n \t\tstate.getStatus().failed(failed);\r\n \t\treturn;\r\n \t}\r\n \r\n runSalesforceCrawl();\r\n \r\n }\r\n } catch (Throwable t) {\r\n LOG.warn(\"Exception in Salesforce crawl\", t);\r\n state.getStatus().failed(t);\r\n } finally {\r\n boolean commit = ds.getBoolean(DataSource.COMMIT_ON_FINISH, true);\r\n try {\r\n state.getProcessor().finish();\r\n // optional commit - if false then it streamlines multiple small crawls\r\n state.getProcessor().getUpdateController().finish(commit);\r\n } catch (Exception e) {\r\n LOG.error(\"Exception in Salesforce crawl\", e);\r\n }\r\n if (stopped) {\r\n state.getStatus().end(JobState.STOPPED);\r\n } else {\r\n state.getStatus().end(JobState.FINISHED);\r\n }\r\n }\r\n }", "public static void main(String[] args) {\n final String filename = \"data/hungryGoWhereV2.csv\";\n try (final BusinessStorage storage = new BusinessStorage(filename)) {\n\n storage.append(Business.getHeader());\n\n final Session session = Session.builder()\n .put(STORAGE_KEY, storage)\n .build();\n\n try (final Crawler crawler = crawler(fetcher(), session).start()) {\n LOGGER.info(\"starting crawler...\");\n\n\n String csvFile = \"data/hungryGoWhere.csv\";\n String line = \"\";\n String cvsSplitBy = \",\";\n int counter = 2;\n ListingHandler handler = new ListingHandler();\n\n try (BufferedReader br = new BufferedReader(new FileReader(csvFile))) {\n int otherCounter = 1;\n while ((line = br.readLine()) != null) {\n String[] information = line.split(cvsSplitBy);\n\n if(counter == otherCounter){\n final String nextPageUrl = information[0];\n crawler.getScheduler().add(new VRequest(nextPageUrl), handler);\n// System.out.println(information[0] + \" \" + counter);\n counter ++;\n }\n otherCounter ++;\n }\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n// final String startUrl = \"https://www.hungrygowhere.com/singapore/cafe_2000/\";\n// crawler.getScheduler().add(new VRequest(startUrl), new ListingHandler());\n } catch (Exception e) {\n LOGGER.error(\"Could not run crawler: \", e);\n }\n\n } catch (IOException e) {\n LOGGER.error(\"unable to open file: {}, {}\", filename, e);\n }\n }", "public static void main(String[] args) {\n\t\t//\n\t\t//\n\t\t//\n\t\t//\n\t\tMyAbstractWebSpider mywebspider1=new MyConcreteWebSpider();\n\t\t//\n\t\t//\n\t\t//\n\t\tRunnable runnableProcessSpider=new ProcessSpider(mywebspider1);\n\t\tnew Thread(runnableProcessSpider).start();\n\t\t//\n\t\t//\n\t\tRunnable runnableDownLoadPicFactory=new DownLoadPicFactory(mywebspider1);\n\t\tnew Thread(runnableDownLoadPicFactory).start();\n\t\t//\n\t\t//\n\t\t//\n\t\t//\n\t\t//\n\t\t//\n\t\tMyThreadSleep.sleep10s();\n\t\tMyThreadSleep.sleep10s();\n\t\tProcessSpider runnableProcessSpiderToCatchAnswer1=new ProcessSpider(mywebspider1){\n\t\t\t@Override\n\t\t\tpublic void myprocess()\n\t\t\t{\n\t\t\t\t//存在有可能跟其他线程先后进入了同个收藏夹一起进行遍历,此时该收藏夹的搜索就由多个线程一起爬,但是已收入的答案就不会收入url队列里了\n\t\t\t\tfor(;this.getMyWebSpider1().getUrlWarehouse1().sizeStrqueueCollectionUrlToRequest1()>=0;)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"getStrqueueImgUrlToRequest1 size!!!!!!!!!!!!!!!!:\"+this.getMyWebSpider1().getUrlWarehouse1().sizeStrqueueImgUrlToRequest1() );\n\t\t\t\t\tif(this.getMyWebSpider1().getUrlWarehouse1().sizeStrqueueCollectionUrlToRequest1()<=0)\n\t\t\t\t\t{\n\t\t\t\t\t\tMyThreadSleep.sleep5s();\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tMyThreadSleep.sleep2s();\n\t\t\t\t\tfor(int overI=0;overI<=this.getMyWebSpider1().getUrlWarehouse1().sizeStrqueueCollectionUrlToRequest1()-1;overI++)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.getWebDriver1().navigate().to(this.getMyWebSpider1().getUrlWarehouse1().pollStrqueueCollectionUrlToRequest1());\n\t\t\t\t\t\tMyThreadSleep.sleep2s();\n\t\t\t\t\t\t//搜寻每个收藏夹的答案(路径包括问题)\n\t\t\t\t\t\t//mywebspider1.getQuesionUrlWithoutAnswerUrlInSpecifiedPage(driver1);\n\t\t\t\t\t\tthis.getMyWebSpider1().getQuesionUrlWithAnswerUrlInSpecifiedPage(this.getWebDriver1());\n\t\t\t\t\t\tthis.getMyWebSpider1().getUrlToTurnToNextPageInInSpecifiedPage(this.getWebDriver1());\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t};\n\t\tnew Thread((Runnable)runnableProcessSpiderToCatchAnswer1).start();\n\t\t//\n\t\t//\n/*\t\tMyThreadSleep.sleep10s();\n\t\tMyThreadSleep.sleep10s();\n\t\tProcessSpider runnableProcessSpiderToCatchAnswer2=new ProcessSpider(mywebspider1){\n\t\t\t@Override\n\t\t\tpublic void myprocess()\n\t\t\t{\n\t\t\t\t//存在有可能跟其他线程先后进入了同个收藏夹一起进行遍历,此时该收藏夹的搜索就由多个线程一起爬,但是已收入的答案就不会收入url队列里了\n\t\t\t\tfor(;this.getMyWebSpider1().getUrlWarehouse1().sizeStrqueueCollectionUrlToRequest1()>=0;)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"getStrqueueImgUrlToRequest1 size!!!!!!!!!!!!!!!!:\"+this.getMyWebSpider1().getUrlWarehouse1().sizeStrqueueImgUrlToRequest1() );\n\t\t\t\t\tif(this.getMyWebSpider1().getUrlWarehouse1().sizeStrqueueCollectionUrlToRequest1()<=0)\n\t\t\t\t\t{\n\t\t\t\t\t\tMyThreadSleep.sleep5s();\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tMyThreadSleep.sleep2s();\n\t\t\t\t\tfor(int overI=0;overI<=this.getMyWebSpider1().getUrlWarehouse1().sizeStrqueueCollectionUrlToRequest1()-1;overI++)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.getWebDriver1().navigate().to(this.getMyWebSpider1().getUrlWarehouse1().pollStrqueueCollectionUrlToRequest1());\n\t\t\t\t\t\tMyThreadSleep.sleep2s();\n\t\t\t\t\t\t//搜寻每个收藏夹的答案(路径包括问题)\n\t\t\t\t\t\t//mywebspider1.getQuesionUrlWithoutAnswerUrlInSpecifiedPage(driver1);\n\t\t\t\t\t\tthis.getMyWebSpider1().getQuesionUrlWithAnswerUrlInSpecifiedPage(this.getWebDriver1());\n\t\t\t\t\t\tthis.getMyWebSpider1().getUrlToTurnToNextPageInInSpecifiedPage(this.getWebDriver1());\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t};\n\t\tnew Thread((Runnable)runnableProcessSpiderToCatchAnswer2).start();*/\n\t\t//\n\t\t//\n\t\t//\n\t\t//\n\t\tMyThreadSleep.sleep10s();\n\t\tMyThreadSleep.sleep10s();\n\t\tProcessSpider runnableProcessSpiderToCatchContent=new ProcessSpider(mywebspider1){\n\t\t\t@Override\n\t\t\tpublic void myprocess()\n\t\t\t{\n\t\t\t\tfor(;this.getMyWebSpider1().getUrlWarehouse1().sizeStrqueueAnswerUrlToRequest1()>=0;)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"sizeStrqueueAnswerUrlToRequest1 size!!!!!!!!!!!!!!!!:\"+this.getMyWebSpider1().getUrlWarehouse1().sizeStrqueueAnswerUrlToRequest1() );\n\t\t\t\t\tif(this.getMyWebSpider1().getUrlWarehouse1().sizeStrqueueAnswerUrlToRequest1()<=0)\n\t\t\t\t\t{\n\t\t\t\t\t\tMyThreadSleep.sleep5s();\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tthis.getWebDriver1().navigate().to(this.getMyWebSpider1().getUrlWarehouse1().pollStrqueueAnswerUrlToRequest1());\n\t\t\t\t\t//\n\t\t\t\t\tMyThreadSleep.sleep1s();\n\t\t\t\t\t//\n\t\t\t\t\tint scrollLength=0;\n\t\t\t\t\t//\n\t\t\t\t\tfor(int overI=0;overI<=100-1;overI++)\n\t\t\t\t\t{\n\t\t\t\t\t\tJavascriptExecutor jsDriverTemp = (JavascriptExecutor)this.getWebDriver1();\n\t\t\t\t\t\tscrollLength=scrollLength+200;\n\t\t\t\t\t\tString js=\"document.body.scrollTop =\"+scrollLength;\n\t\t\t\t\t\tjsDriverTemp.executeScript(js);\n\t\t\t\t\t\t//\n\t\t\t\t\t\tMyThreadSleep.sleep100ms();\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t\t//get pic url in specified page\n\t\t\t\t\tthis.getMyWebSpider1().getSpecifiedAnswerContent2(this.getWebDriver1());\n\t\t\t\t\t//\n\t\t\t\t\t//\n\n\t\t\t\t\t//\n\t\t\t\t\t//\n\t\t\t\t}\n\n\t\t\t}\n\t\t};\n\t\tnew Thread((Runnable)runnableProcessSpiderToCatchContent).start();\n\t}", "@Override\n public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {\n Log.v(\"WVClient.onReceiveError\", \" receieved an error\" + error);\n\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n onSendUpdate(\"WVClient has received an error!\");\n }\n });\n\n //do what would be done in processHTML but avoid anything to do with scraping, move onto next page\n crawlComplete = false;\n\n if (masterEmailSet.size() > 20){\n //if more than twenty emails have been discovered, the crawl is done\n crawlComplete = true;\n }\n\n if (masterEmailSet.size() > 0 && !searchTerm.equals(\"\")){\n //if at least one email with the search term has been found, crawl is done\n crawlComplete = true;\n }\n\n\n if (collectedLinks.iterator().hasNext() && !crawlComplete){\n //if there's another link and crawl isn't deemed complete, hit next URL\n browser.post(new Runnable() {\n @Override\n public void run() {\n Log.v(\"processHTML\", \" loading page on browser:\" + collectedLinks.iterator().next());\n visitedLinks.add(collectedLinks.iterator().next());\n browser.loadUrl(collectedLinks.iterator().next());\n }\n });\n }\n }", "public void threadedCrawl(String url) {\n this.executor.submit(new Task(url));\n }", "@Override\n public void run() {\n int flagcount = 0;\n Map<String, Integer> setBackLinksCounter = new HashMap<>(0);\n Map<String, Integer[]> setPaDaCounter = new HashMap<>(0);\n try {\n for (String domainName : setDomains) {\n setBackLinksCounter.put(domainName.trim(), getBackLinksCount(domainName.trim()));\n setPaDaCounter.put(domainName.trim(), getPaDaCounts(domainName.trim()));\n }\n } catch (Exception ex) {\n l.debug(ex + \" \" + ex.getMessage());\n }\n\n Integer countBackLinks;\n Integer[] countPaDa;\n String domainName;\n Integer keywordId;\n List<Serpkeywords> lstKeywordsURL = new ArrayList<>();\n List<Seokeyworddetails> listUpdatedKeywords = new ArrayList<>();\n try {\n for (Serpkeywords objKeywords : lstKeywords) {\n boolean check = false;\n if (lstKeywordsURL.size() != 0) {\n // System.out.println(\"came to dis section\");\n for (Serpkeywords stringURL : lstKeywordsURL) {\n \n if (stringURL.getUrl().equalsIgnoreCase(objKeywords.getUrl())) {\n System.out.println(\"true\");\n check = true;\n }\n }\n }\n if (check == false) {\n lstKeywordsURL.add(objKeywords);\n }\n }\n } catch (Exception ex) {\n l.debug(ex + \" \" + ex.getMessage());\n }\n \n\n try {\n // for (Serpkeywords objKeywords : lstKeywords) {\n Seokeyworddetails objSeokeyworddetails=null;\n for (Serpkeywords objKeywords : lstKeywordsURL) {\n objSeokeyworddetails = new Seokeyworddetails();\n\n domainName = objKeywords.getUrl().trim();\n keywordId = objKeywords.getKeywordID();\n countBackLinks = setBackLinksCounter.get(domainName);\n countPaDa = setPaDaCounter.get(domainName);\n int pacount = countPaDa[0];\n int dacount = countPaDa[1];\n if (countPaDa[1] == -1) {\n dacount = getDAvalue(domainName);\n }\n System.out.println(\"keywordis:::: \" + keywordId);\n System.out.println(\"Domain:::::: \" + domainName);\n System.out.println(\"da:::: \" + dacount);\n System.out.println(\"pa:::: \" + pacount);\n System.out.println(\"Backlinks :: \" + countBackLinks);\n\n objSeokeyworddetails.setKeywordID(objKeywords);\n objSeokeyworddetails.setUrl(domainName);\n objSeokeyworddetails.setKeyword(objKeywords.getKeyword());\n objSeokeyworddetails.setCampaignID(objKeywords.getCampaignID());\n objSeokeyworddetails.setCountBackLinks(countBackLinks);\n objSeokeyworddetails.setGooglePA(pacount);\n objSeokeyworddetails.setGoogleDA(dacount);\n\n listUpdatedKeywords.add(objSeokeyworddetails);\n\n// objKeywordDao.saveBackLinksResult1(keywordId, domainName, objKeywords.getKeyword(), objKeywords.getCampaignID(), countBackLinks, startTrackId, endtrackId, objKeywords.getUrl());\n// objKeywordDao.savePaDaResult1(keywordId, domainName, objKeywords.getKeyword(), objKeywords.getCampaignID(), pacount, dacount, objKeywords.getUrl());\n }\n\n } catch (Exception ex) {\n l.debug(ex + \" \" + ex.getMessage());\n }\n\n try {\n\n for (Seokeyworddetails objUniqueURL : listUpdatedKeywords) {\n\n for (Serpkeywords objKeywords : lstKeywords) {\n if (objUniqueURL.getUrl().equals(objKeywords.getUrl())) {\n keywordId = objUniqueURL.getKeywordID().getKeywordID();\n objKeywordDao.saveBackLinksResult(objKeywords.getKeywordID(), objKeywords.getUrl(), objKeywords.getKeyword(), objKeywords.getCampaignID(), objUniqueURL.getCountBackLinks(), startTrackId, endtrackId);\n objKeywordDao.savePaDaResult(objKeywords.getKeywordID(), objKeywords.getUrl(), objKeywords.getKeyword(), objKeywords.getCampaignID(),objUniqueURL.getGooglePA() , objUniqueURL.getGoogleDA());\n\n }\n\n }\n }\n\n } catch (Exception ex) {\n l.debug(ex + \" \" + ex.getMessage());\n }\n\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic static void main(String[] args) {\n\t\ttry {\n\t\t\tCrawler crawler = new Crawler();\n\t\t\tSystem.setProperty(\"https.proxyHost\", \"192.168.2.101\");\n\t\t\tSystem.setProperty(\"https.proxyPort\", \"1080\");\n\n\t\t\tfillUrls(crawler.url, crawler.urlsToBeCrawled, crawler.depthMap);\n\t\t\tcrawler.addUrl(crawler.url, 1);\n\t\t\tlong start = System.currentTimeMillis();\n\t\t\tSystem.out.println(\"Crawling started\");\n\t\t\tcrawler.begin();\n\t\t\t\n\t\t\twhile (true) {\n\t\t\t\tif (crawler.urlsToBeCrawled.isEmpty() && Thread.activeCount() == 1 || crawler.count == crawler.threadCount) {\n\t\t\t\t\tCollections.sort(crawler.brs, new SortByRating());\n\t\t\t\t\twriteExcel(\"C://test1.xls\", crawler.brs);\n\n\t\t\t\t\tlong end = System.currentTimeMillis();\n\t\t\t\t\tSystem.out.println(\"Total crawl time\" + (end - start) / 1000 + \" seconds\");\n\t\t\t\t\tSystem.exit(1);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static void main(String[] args) throws IOException {\n\t\tCrawlMethods cm = new CrawlMethods();\n\t\tString url = cm.getURL();\n\t\tint pageNumber;\n\t\tint eachPageNumber = 2;\n\t\tBoolean isOver = false;\n\t\t\n\t\ttry {\n\t\t\tcm.loopPost(url);\n\t\t\twhile (true) {\n\t\t\t\tisOver = cm.enterPost();\n\t\t\t\tif (isOver) {\n\t\t\t\t\tSystem.out.println(\"끝\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tpageNumber = cm.getPageNumber();\n\t\t\t\tif (pageNumber % 10 == 0) {\n\t\t\t\t\tif (pageNumber == 10) {\n\t\t\t\t\t\tcm.TenNext();\n\t\t\t\t\t\teachPageNumber = 2;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcm.afterTenNext();\n\t\t\t\t\t\teachPageNumber = 2;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// 만약 10페이지 미만이면\n\t\t\t\tif (pageNumber < 10) {\n\t\t\t\t\tcm.beforeTenClickNext(eachPageNumber);\n\t\t\t\t\teachPageNumber++;\n\t\t\t\t\tThread.sleep(2500);\n\t\t\t\t} else {\n\t\t\t\t\tcm.afterTenClickNext(eachPageNumber);\n\t\t\t\t\teachPageNumber++;\n\t\t\t\t\tThread.sleep(2500);\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tparsePDF pp = new parsePDF();\n\t\t\tpp.parseData(pp.readFilesFromDirectory());\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "@Override\r\n\tpublic void crawl_data() {\n\t\t\r\n\t}", "private static void go2(){\n\t\tString concreateURL = \"http://www.yixinhealth.com/%E5%8C%96%E9%AA%8C%E5%92%8C%E6%A3%80%E6%9F%A5/%E5%BF%83%E7%94%B5%E5%9B%BE/\"; \n\t\tConnection c = Jsoup.connect(concreateURL); \n\t\tc.timeout(10000);\n\t\ttry {\n\t\t\tDocument doc = c.get();\n\t\t\t//System.out.println(doc.html()); \n\t\t\t//System.out.println(doc.getElementById(\"content_area\").html());\n\t\t\t//Element eles = doc.getElementById(\"content_area\");\n\t\t\t//System.out.println(eles.html());\n\t\t\t\n\t\t\t//Below code is for the multiple link page\n\t\t\t//Elements eles2 = eles.getElementsByAttributeValue(\"style\", \"text-align: center;\");\n\t\t\t//System.out.println(eles2.html());\n\t\t\t/*for(Element ele: eles2){\n\t\t\t\tElements link = ele.getElementsByTag(\"a\");\n\t\t\t\t//System.out.println(link.html());\n\t\t\t\tfor (int i=0;i<link.size();i++) {\n\t\t\t\t\tSystem.out.println(link.get(i).attr(\"href\"));\n\t\t\t\t}\n\t\t\t}*/\n\t\t\t\n\t\t\t\n\t\t\t//System.out.println(eles2.html());\n\t\t\tElement eles = doc.getElementById(\"content_area\");\n\t\t\tElements eles2 = eles.getElementsByTag(\"img\");\n\t\t\tfor(int i=0;i<eles2.size();i++){\n\t\t\t\teles2.get(i).parent().attr(\"style\", \"text-align:center\");\n\t\t\t\teles2.get(i).parent().parent().nextElementSibling().attr(\"style\", \"text-align:center\");\n\t\t\t\teles2.get(i).attr(\"style\", \"width:50%\");\n\t\t\t}\n\t\t\t\n\t\t\tElements eles3 = eles.getElementsByClass(\"j-header\");\n\t\t\tfor (Element ele : eles3) {\n\t\t\t\tElements eleHeader = ele.getElementsByTag(\"h2\");\n\t\t\t\teleHeader.attr(\"style\", \"text-align:center\");\n\t\t\t}\n\t\t\tSystem.out.println(eles.html());\n\t\t\t\n\t\t\t//Below code is help to clear out the share icon to like Sina weibo\n\t\t\tElements eles4 = eles.getElementsByClass(\"bshare-custom\");\n\t\t\t//eles4.remove();\n\t\t\t\n\t\t\t//Elements eles3 = eles.getElementsByClass(\"n*j-imageSubtitle\");\n\t\t\t//System.out.println(eles3.size());\n\t\t\t/*for(int i=0;i<eles3.size();i++){\n\t\t\t\teles3.get(i).attr(\"style\", \"text-align:center;width:50%\");\n\t\t\t}\n\t\t\tSystem.out.println(eles.html());*/\n\t\t\t//System.out.println(eles2.get(0).attr(\"src\"));\n\t\t\t/*Element eles = doc.getElementById(\"content_area\");\n\t\t\tElements eles2 = eles.getElementsByClass(\"j-header\");\n\t\t\tfor (Element ele : eles2) {\n\t\t\t\tElements eleHeader = ele.getElementsByTag(\"h2\");\n\t\t\t\tSystem.out.println(\"Title---->\"+eleHeader.html()); \n\t\t\t}\n\t\t\tElements elesBody = eles.getElementsByClass(\"j-text\");\n\t\t\tSystem.out.println(\"Body---->\"+elesBody.html()); */\n\t\t\t//System.out.println(eles2.html()); \n /*List<String> nameList = new ArrayList<String>(); \n for (Element ele : eles) {\n \tString text = ele.select(\"h*\").text();\n \tSystem.out.println(text); \n String text = ele.select(\"span\").first().text(); \n if (text.length() > 1 && text.startsWith(\"▲\")) { \n \n if (Integer.parseInt(text.substring(1)) > 30) { \n // 在这里.html()和.text()方法获得的内容是一样的 \n System.out.println(ele.select(\"a\").first().html()); \n nameList.add(ele.select(\"a\").first().text()); \n } \n } \n } */\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static void invertedIndex(String URL){\n //if the url set already contains this url, it means this url has already been processed, so return\n if(urlSet.contains(URL)){\n return;\n }\n else{\n //first add this unprocessed url to url list\n urlSet.add(URL);\n try{\n //connect this url and get its content\n URL url = new URL(URL);\n URLConnection urlCon = url.openConnection();\n BufferedReader in = new BufferedReader(new InputStreamReader(urlCon.getInputStream()));\n String urlString = \"\";\n String current;\n while((current = in.readLine()) != null)\n {\n urlString += current;\n }\n\n //by filtering the link label to get all the links in this page\n String[] urlList = urlString.split(\"<a href=\\\"\");\n\n //define regex expression to filter script label\n String scriptFilter=\"<script[^>]*?>[\\\\s\\\\S]*?<\\\\/script>\";\n\n //define regex expression to filter style label\n String styleFilter=\"<style[^>]*?>[\\\\s\\\\S]*?<\\\\/style>\";\n\n //define regex expression to filter html label\n String htmlFilter=\"<[^>]+>\";\n\n //filter all the useless labels\n Pattern scriptP=Pattern.compile(scriptFilter,Pattern.CASE_INSENSITIVE);\n Matcher scriptM=scriptP.matcher(urlString);\n urlString=scriptM.replaceAll(\"\");\n\n Pattern styleP=Pattern.compile(styleFilter,Pattern.CASE_INSENSITIVE);\n Matcher styleM=styleP.matcher(urlString);\n urlString=styleM.replaceAll(\"\");\n\n Pattern htmlP=Pattern.compile(htmlFilter,Pattern.CASE_INSENSITIVE);\n Matcher htmlM=htmlP.matcher(urlString);\n urlString=htmlM.replaceAll(\"\");\n\n //transfer content to a word array\n String[] words = urlString.split(\" \");\n for(int i = 0; i < words.length; i++){\n //System.out.println(words[i]);\n //if the hashmap doesn't contain this word, so put this word and its url pair into the hashmap\n if(!index.containsKey(words[i])){\n HashSet<String> str = new HashSet<String>();\n str.add(URL);\n index.put(words[i],str);\n }\n //if the hashmap already contains this word, update its record\n else{\n HashSet<String> str = index.get(words[i]);\n str.add(URL);\n index.put(words[i],str);\n }\n }\n //System.out.println(urlString);\n\n for(int i = 1; i < urlList.length;i++){\n //get each url in this page and transfer it to valid url, after that process each url\n int endpos = urlList[i].indexOf(\"\\\"\");\n String Url = getValidUrl(urlList[i].substring(0, endpos));\n //System.out.println(Url);\n if(Url != null){\n invertedIndex(Url);\n }\n }\n }catch(Exception e){\n System.out.println(\"can't process url : \" + URL);\n }\n }\n }", "public static void leechBBC(Hdict dict)\r\n {\r\n WebDriver driver = new ChromeDriver();\r\n \r\n String baseUrl = \"https://www.bbc.com/\";\r\n driver.get(baseUrl);\r\n \r\n List<WebElement> links = driver.findElements(By.tagName(\"a\"));\r\n \r\n System.out.println(\"There is a total of \" + links.size() + \" frong page news detected on BBC\");\r\n \r\n Hdict titleDicts = new Hdict();\r\n \r\n for(int i = 0; i < links.size(); i++)\r\n {\r\n //get href links\r\n String url = links.get(i).getAttribute(\"href\");\r\n \r\n Words hUrl = new Words(url, 0);\r\n if(titleDicts.hdict_lookup(hUrl) != null) // if this page is already parsed\r\n {\r\n continue;\r\n }\r\n \r\n //if the page is not parsed\r\n titleDicts.hdict_insert(hUrl);\r\n \r\n String urlname = \"https://www.bbc.com/news/\";\r\n \r\n String[] news = url.split(urlname);\r\n if(news.length > 1 && news[1].length() > 10) // if it is .html and has some other shish, shit solution but works\r\n {\r\n //WebDriver driver1 = new ChromeDriver();\r\n //driver1.get(url);\r\n \r\n String[] temp1 = news[1].split(\"-\");\r\n \r\n try{ // if the serial is not attached\r\n Integer.parseInt(temp1[temp1.length-1]);\r\n }\r\n catch(Exception e){ continue; };\r\n \r\n if(temp1.length < 2) // if it is not even a topic\r\n continue;\r\n \r\n //nytimes doesn't have viewers count, so default 2500 effectiveness on all posts\r\n \r\n int reactions = NYTIME_AVG;\r\n \r\n String directory = news[1];\r\n \r\n directory = directory.split(\".html\")[0]; // removes file name and directory\r\n String[] temp = directory.split(\"/\");\r\n String title = temp[temp.length-2]; // get file name, more concise, skip last for CNN, last is index\r\n String[] keys = title.split(\"-\");\r\n \r\n for(String key : keys)\r\n {\r\n if(key.contains(\".html\")) continue; // useless stuff\r\n \r\n boolean integercheck = true;\r\n try{\r\n Integer.parseInt(key);\r\n } catch(Exception e) \r\n {\r\n integercheck = false;\r\n };\r\n if(integercheck) continue; // useless numbers\r\n \r\n if(Arrays.binarySearch(JUNK_WORDS, key) >= 0) continue; // useless words\r\n \r\n Words wkey = new Words(key, reactions * BBC_WORTH);\r\n Words wkey_old = dict.hdict_lookup(wkey);\r\n if(wkey_old == null) dict.hdict_insert(wkey);\r\n else\r\n {\r\n wkey.setPopularity(wkey.getPopularity() + wkey_old.getPopularity());\r\n dict.hdict_insert(wkey);\r\n }\r\n }\r\n }\r\n }\r\n //close Chrome\r\n driver.close();\r\n }", "public static void main(String[] args) {\n\t\t\n\t\tif (args.length != 1) {\n\t\t\tthrow new IllegalArgumentException(\"Usage: java WordCount <URL>\");\n\t\t}\n\t\tString site = args[0];\n\t\t\n\t\t// If efficiency becomes important, a BufferedInputStream could be used in place of Jsoup.\n\t\t// This would prevent multiple passes over the text, but would introduce the challenge of\n\t\t// reading between HTML tags.\n\t\tString text;\n\t\ttry {\n\t\t\ttext = Jsoup.connect(site).get().text();\n\t\t} catch (IllegalArgumentException e) {\n\t\t\t// Attempt to connect with https:// protocol prepended\n\t\t\ttry {\n\t\t\t\tsite = \"https://\" + site;\n\t\t\t\ttext = Jsoup.connect(site).get().text();\n\t\t\t} catch (IllegalArgumentException a) {\n\t\t\t\tthrow new IllegalArgumentException(\"Page cannot be loaded. \"\n\t\t\t\t\t\t+ \"Usage: java WordCount <URL>\");\n\t\t\t} catch (IOException m) {\n\t\t\t\tthrow new IllegalArgumentException(\"Page cannot be loaded. \"\n\t\t\t\t\t\t+ \"Usage: java WordCount <URL>\"); \n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tthrow new IllegalArgumentException(\"Page cannot be loaded.\"\n\t\t\t\t\t+ \" Usage: java WordCount <URL>\");\n\t\t} \n\t\t\n\t\t// Split text into array using alphabetical (multiple languages) and \n\t\t// apostrophe characters\n\t\tString[] textArr = text.split(\"[^\\\\p{L}'’]+\");\n\t\tTree dictionary = new Tree();\n\t\tfor (int i = 0; i < textArr.length; i++) {\n\t\t\tdictionary.insert(textArr[i].toLowerCase());\n\t\t}\n\t\t\n\t\t// Build array using the dictionary. A more efficient solution would involve using a \n\t\t// sorted LinkedList of size 25, and only adding Nodes to the list if they are greater\n\t\t// than the current least Node, adding the new lowest value to the tail with \n\t\t// each insertion.\n\t\tNode[] arr = dictionary.toArray();\n\t\tArrays.sort(arr);\n\t\tfor (int i = 0; i < NUMBER_OF_WORDS; i++) {\n\t\t\tif (i < arr.length) {\n\t\t\t\tSystem.out.printf(\"%-12s%10d\\n\", arr[i].getWord(), arr[i].getCount());\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public int scrape(String[] urls, String outputFolderName, String outputFileName, Long contextCounter, @Nullable Boolean dynamic)\n\t\t\tthrows FourZeroFourException, JsonLDInspectionException, CannotWriteException, MissingMarkupException {\n\n\n\t\tint index = 0;\n\n\t\tfor (String url : urls) {\n\n\t\t\turl = fixURL(url);\n\n\t\t\tString html = \"\";\n\t\t\t// The dynamic boolean determines if the scraper should start using selenium or JSOUP to scrape the information (dynamic and static respectively)\n\n\t\t\tif (dynamic) {\n\t\t\t\tlogger.info(\"dynamic scraping setting\");\n\t\t\t\thtml = wrapHTMLExtraction(url);\n\t\t\t} else {\n\t\t\t\tlogger.info(\"static scraping setting\");\n\t\t\t\thtml = wrapHTMLExtractionStatic(url);\n\t\t\t}\n\n\n\t\t\tif (html == null || html.contentEquals(\"\")){\n\t\t\t\t//return false;\n\t\t\t\treturn index;\n\t\t\t}\n\n\t\t\tif (logger.isTraceEnabled()) {\n\t\t\t\tlogger.trace(\"Read following html ==============================================================\");\n\t\t\t\tlogger.trace(html);\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\thtml = injectId(html, url);\n\t\t\t\tif (logger.isTraceEnabled()) {\n\t\t\t\t\tlogger.trace(\"Same HTML after injecting ID ==============================================================\");\n\t\t\t\t\tlogger.trace(html);\n\t\t\t\t}\n\t\t\t} catch (MissingHTMLException e) {\n\t\t\t\tlogger.error(e.toString());\n\t\t\t\t//return false;\n\t\t\t\treturn index;\n\t\t\t}\n\n\t\t\tDocumentSource source = new StringDocumentSource(html, url);\n\t\t\tIRI sourceIRI = SimpleValueFactory.getInstance().createIRI(source.getDocumentIRI());\n\n\t\t\tString n3 = getTriplesInNTriples(source);\n\t\t\tif (n3 == null)\n\t\t\t\tthrow new MissingMarkupException(url);\n\n\t\t\tModel updatedModel = null;\n\t\t\ttry {\n\t\t\t\tupdatedModel = processTriples(n3, sourceIRI, contextCounter);\n\t\t\t} catch (NTriplesParsingException e1) {\n\t\t\t\tlogger.error(\"Failed to process triples into model; the NTriples generated from the URL (\" + url\n\t\t\t\t\t\t+ \") could not be parsed into a model.\");\n\t\t\t\t//return false;\n\t\t\t\treturn index;\n\t\t\t}\n\t\t\tif (updatedModel == null){\n\t\t\t\t//return false;\n\t\t\t\treturn index;\n\t\t\t}\n\n\t\t\t//FIXME here you have to do the writing in the same folder if it is a sitemap, pass parameter boolean flag and loop until all url are parsed and at the end write to folder\n\t\t\tif(index == 0){\n\t\t\t\tFile directory = new File(outputFolderName);\n\t\t\t\tif (!directory.exists())\n\t\t\t\t\tdirectory.mkdir();\n\n\t\t\t\tif (outputFileName == null) {\n\t\t\t\t\toutputFileName = outputFolderName + \"/\" + contextCounter + \".nq\";\n\t\t\t\t} else {\n\t\t\t\t\toutputFileName = outputFolderName + \"/\" + outputFileName + \".nq\";\n\t\t\t\t}\n\n\t\t\t\ttry (PrintWriter out = new PrintWriter(new File(outputFileName))) {\n\n\t\t\t\t\tRio.write(updatedModel, out, RDFFormat.NQUADS);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tlogger.error(\"Problem writing file for \" + url, e);\n\t\t\t\t\tthrow new CannotWriteException(url);\n\t\t\t\t}\n\n\t\t\t\tif (!new File(outputFileName).exists())\n\t\t\t\t\tSystem.exit(0);\n\n\t\t\t} else {\n\t\t\t\ttry (FileWriter out = new FileWriter(new File(outputFileName), true)) {\n\t\t\t\t\t//try (PrintWriter out = new PrintWriter(new File(outputFileName))) {\n\t\t\t\t\tRio.write(updatedModel, out, RDFFormat.NQUADS, new WriterConfig().set(BasicWriterSettings.PRETTY_PRINT, true));\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tlogger.error(\"Problem writing file for \" + url, e);\n\t\t\t\t\tthrow new CannotWriteException(url);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tindex++;\n\t\t}\n\n\n\n\t\t//return true;\n\t\treturn -1;\n\t}", "private void pageContent( String url) {\n\t\t\n\t\tif ( !url.matches(URL)) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tList<String> outlinks = null; // out link urls\n\t\tUrlBean bean = null; // basic info of the url\n\t\t\n\t\tbean = new UrlBean();\n\t\ttry {\n\t\t\t\n\t\t\tconn = Jsoup.connect(url).timeout(5000);\n\t\t\tif ( conn == null) {\n\t\t\t\treturn ;\n\t\t\t}\n\t\t\t\n\t\t\tdocument = conn.get(); // 得到网页源代码,超时时间是5秒\n\t\t\t\n\t\t\t/*\n\t\t\t * 文章基本信息\n\t\t\t */\n\t\t\telements = document.getElementsByTag(\"title\");\n\t\t\tif ( elements!= null && elements.size() != 0) {\n\t\t\t\telement = elements.get(0);\n\t\t\t}\n\t\t\tString title = element.text();\n\t\t\tbean.setTitle(title);\n\t\t\tbean.setKeywords(title);\n\t\t\t\n\t\t\telements = document.getElementsByTag(\"a\");\n\t\t\tif ( elements != null) {\n\t\t\t\tString linkUrl = null;\n\t\t\t\toutlinks = new ArrayList<String>();\n\t\t\t\tfor ( int i = 0; i < elements.size(); i++) {\n\t\t\t\t\tlinkUrl = elements.get(i).attr(\"href\");\n\t\t\t\t\tif ( linkUrl.matches(URL)) {\n\t\t\t\t\t\toutlinks.add(linkUrl);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn;\n\t\t} \n\t\t\n\t\tbean.setUrl(url);\n\t\tbean.setId(urlId++);\n\t\tbean.setRank(1);\n\t\tif ( outlinks != null) {\n\t\t\tint count = outlinks.size();\n\t\t\tbean.setOutlinks(count);\n\t\t\tfor ( int i = 0; i < count; i++) {\n\t\t\t\turlsSet.add(outlinks.get(i));\n\t\t\t}\n\t\t\tif ( new AllInterface().addOneUrlInfo(bean, outlinks)) {\n\t\t\t\tSystem.out.println(\"Add to database successfully, url is '\" + url + \"'.\");\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"Fail to add to database, maybe url exists. Url is '\" + url + \"'.\");\n\t\t\t}\n\t\t\tSystem.out.println(\"[\" + count + \" urls remain...]\");\n\t\t\tSystem.out.println();\n\t\t} else {\n\t\t\tSystem.out.println(\"Error occurs in crawl, url is '\" + url + \"'.\");\n\t\t\tSystem.out.println(\"[[FINISHED]]\");\n\t\t\tSystem.out.println();\n\t\t}\n\t\t\n\t}", "@Override\n public Map<String,Object> run(Map<String,Object> args) throws Exception {\n Path tmpFolder = new Path(getConf().get(\"mapred.temp.dir\", \".\")\n + \"stat_tmp\" + System.currentTimeMillis());\n\n numJobs = 1;\n currentJob = new NutchJob(getConf(), \"db_stats\");\n\n currentJob.getConfiguration().setBoolean(\"mapreduce.fileoutputcommitter.marksuccessfuljobs\", false);\n \n Boolean sort = (Boolean)args.get(Nutch.ARG_SORT);\n if (sort == null) sort = Boolean.FALSE;\n currentJob.getConfiguration().setBoolean(\"db.reader.stats.sort\", sort);\n\n DataStore<String, WebPage> store = StorageUtils.createStore(currentJob\n .getConfiguration(), String.class, WebPage.class);\n Query<String, WebPage> query = store.newQuery();\n\n //remove the __g__dirty field since it is not stored\n String[] fields = Arrays.copyOfRange(WebPage._ALL_FIELDS, 1,\n WebPage._ALL_FIELDS.length);\n query.setFields(fields);\n\n GoraMapper.initMapperJob(currentJob, query, store, Text.class, LongWritable.class,\n WebTableStatMapper.class, null, true);\n\n currentJob.setCombinerClass(WebTableStatCombiner.class);\n currentJob.setReducerClass(WebTableStatReducer.class);\n\n FileOutputFormat.setOutputPath(currentJob, tmpFolder);\n\n currentJob.setOutputFormatClass(SequenceFileOutputFormat.class);\n\n currentJob.setOutputKeyClass(Text.class);\n currentJob.setOutputValueClass(LongWritable.class);\n FileSystem fileSystem = FileSystem.get(getConf());\n\n try {\n currentJob.waitForCompletion(true);\n } finally {\n ToolUtil.recordJobStatus(null, currentJob, results);\n if (!currentJob.isSuccessful()) {\n fileSystem.delete(tmpFolder, true);\n return results;\n }\n }\n\n Text key = new Text();\n LongWritable value = new LongWritable();\n\n SequenceFile.Reader[] readers = org.apache.hadoop.mapred.SequenceFileOutputFormat\n .getReaders(getConf(), tmpFolder);\n\n TreeMap<String, LongWritable> stats = new TreeMap<String, LongWritable>();\n for (int i = 0; i < readers.length; i++) {\n SequenceFile.Reader reader = readers[i];\n while (reader.next(key, value)) {\n String k = key.toString();\n LongWritable val = stats.get(k);\n if (val == null) {\n val = new LongWritable();\n if (k.equals(\"scx\"))\n val.set(Long.MIN_VALUE);\n if (k.equals(\"scn\"))\n val.set(Long.MAX_VALUE);\n stats.put(k, val);\n }\n if (k.equals(\"scx\")) {\n if (val.get() < value.get())\n val.set(value.get());\n } else if (k.equals(\"scn\")) {\n if (val.get() > value.get())\n val.set(value.get());\n } else {\n val.set(val.get() + value.get());\n }\n }\n reader.close();\n }\n\n LongWritable totalCnt = stats.get(\"T\");\n if (totalCnt==null)totalCnt=new LongWritable(0);\n stats.remove(\"T\");\n results.put(\"total pages\", totalCnt.get());\n for (Map.Entry<String, LongWritable> entry : stats.entrySet()) {\n String k = entry.getKey();\n LongWritable val = entry.getValue();\n if (k.equals(\"scn\")) {\n results.put(\"min score\", (val.get() / 1000.0f));\n } else if (k.equals(\"scx\")) {\n results.put(\"max score\", (val.get() / 1000.0f));\n } else if (k.equals(\"sct\")) {\n results.put(\"avg score\",\n (float) ((((double) val.get()) / totalCnt.get()) / 1000.0));\n } else if (k.startsWith(\"status\")) {\n String[] st = k.split(\" \");\n int code = Integer.parseInt(st[1]);\n if (st.length > 2)\n results.put(st[2], val.get());\n else\n results.put(st[0] + \" \" + code + \" (\"\n + CrawlStatus.getName((byte) code) + \")\", val.get());\n } else\n results.put(k, val.get());\n }\n // removing the tmp folder\n fileSystem.delete(tmpFolder, true);\n \n return results;\n }", "public void countWord() {\n\t\tiniStorage();\n\t\tWordTokenizer token = new WordTokenizer(\"models/jvnsensegmenter\",\n\t\t\t\t\"data\", true);\n\t\t// String example =\n\t\t// \"Nếu bạn đang tìm kiếm một chiếc điện thoại Android? Đây là, những smartphone đáng để bạn cân nhắc nhất. Thử linh tinh!\";\n\t\t// token.setString(example);\n\t\t// System.out.println(token.getString());\n\n\t\tSet<Map.Entry<String, String>> crawlData = getCrawlData().entrySet();\n\t\tIterator<Map.Entry<String, String>> i = crawlData.iterator();\n\t\twhile (i.hasNext()) {\n\t\t\tMap.Entry<String, String> pageContent = i.next();\n\t\t\tSystem.out.println(pageContent.getKey());\n\t\t\tPageData pageData = gson.fromJson(pageContent.getValue(),\n\t\t\t\t\tPageData.class);\n\t\t\ttoken.setString(pageData.getContent().toUpperCase());\n\t\t\tString wordSegment = token.getString();\n\t\t\tString[] listWord = wordSegment.split(\" \");\n\t\t\tfor (String word : listWord) {\n\t\t\t\taddToDictionary(word, 1);\n\t\t\t\tDate date;\n\t\t\t\ttry {\n\t\t\t\t\tdate = simpleDateFormat.parse(pageData.getTime().substring(\n\t\t\t\t\t\t\t0, 10));\n\t\t\t\t} catch (ParseException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\taddToStatByDay(date, word, 1);\n\t\t\t}\n\t\t}\n\t}", "void runC() {\n\t\tArrayList<Link> links_s2 = new ArrayList<Link>(links_s);\n\t\tArrayList<Link> links_p2 = new ArrayList<Link>(links_p);\n\t\talgorithmC = new HashSet<Link>(algorithmC(links_p2, links_s2));\n\t}", "public void Crawl(String startUrl) {\n HashSet crawledList = new HashSet();\n LinkedHashSet toCrawlList = new LinkedHashSet();\n // Add start URL to the To Crawl list.\n toCrawlList.add(startUrl);\n\n // Get URL at bottom of the list.\n String url = (String) toCrawlList.iterator().next();\n // Remove URL from the To Crawl list.\n toCrawlList.remove(url);\n // Convert string url to URL object.\n URL verifiedUrl = verifyUrl(url);\n\n // Add page to the crawled list.\n crawledList.add(url);\n // Download the page at the given URL.\n String pageContents = downloadPage(verifiedUrl);\n\n if (pageContents != null && pageContents.length() > 0) {\n // Retrieve list of valid links from page.\n ArrayList links = retrieveLinks(verifiedUrl, pageContents, crawledList);\n // Add links to the To Crawl list.\n toCrawlList.addAll(links);\n\n }\n\n System.out.println(pageContents);\n\n }", "@Override\n protected Void doInBackground() {\n PropertyPage.resetCachedFilesCount();\n scanListSize = scanList.size();\n /*\n * Timer to update cache progress\n */\n final int TIMER_VALUE = 10 * scanListSize;\n\n fileIterator = new FileIterator[scanList.size()];\n for (int i = 0; i < scanListSize; i++) {\n fileIterator[i] = new FileIterator(cachePage.getIncludedCachePath(scanList.get(i).toString()), cachePage, this);\n fileIterator[i].runScanner();\n sendProgress(); //update progress to user\n }\n while (!isCancelled() && PropertyPage.getIteratorThreadAliveCount() >= 1) {\n sendProgress(); //update progress to user\n try {\n if (!PropertyPage.getFileIteratorStopper()) {\n Thread.sleep(TIMER_VALUE);\n }\n } catch (InterruptedException interruptedEx) {\n LOGGER.log(Level.SEVERE, \"Current Thread interrupted\", interruptedEx);\n Thread.currentThread().interrupt();\n }\n }\n cachePage.saveCacheConfigToFile();\n return null;\n }", "public static void main(String args[]) {\n if (args.length < 3 || args.length > 5) {\n System.out.println(\"Usage: Crawler {start URL} {database environment path} {max doc size in MB} {number of files to index}\");\n System.exit(1);\n }\n\n System.out.println(\"Crawler starting\");\n String startUrl = args[0];\n String envPath = args[1];\n Integer size = Integer.valueOf(args[2]);\n Integer count = args.length == 4 ? Integer.valueOf(args[3]) : 100;\n\n StorageInterface db = StorageFactory.getDatabaseInstance(envPath);\n\n Crawler crawler = new Crawler(startUrl, db, size, count);\n\n System.out.println(\"Starting crawl of \" + count + \" documents, starting at \" + startUrl);\n crawler.start();\n\n while (!crawler.isDone())\n try {\n Thread.sleep(10);\n } catch (InterruptedException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n\n // TODO: final shutdown\n\n System.out.println(\"Done crawling!\");\n }", "@Override\n\tprotected synchronized void getArticles() throws Exception {\n\t\tif(thread == null || thread.isAlive() == false) {\n\t\t\tWebRunner runner = new WebRunner(mHandler);\n\t\t\tthread = new Thread(runner);\n\t\t\tthread.start();\n\t\t}\n }", "public void run(){\n\t\tif(searchHow==0){\n\t\t\tint isbnCount = 0;\n\t\t\tfor(int i=0; i<db.size(); i++){\n\t\t\t\t\tSearchRequest requestIsbn = new SearchRequest(db, searchForThis, isbnCount, db.size());\n\t\t\t\t\tdb.searchByISBN(requestIsbn);\n\t\t\t\t\tisbnCount = requestIsbn.foundPos;\n\t\t\t\t\tif (requestIsbn.foundPos >= 0) {\n\t\t\t\t\t\tisbnCount++;\n\t\t\t\t\t\tString formatThis = \"Matched ISBN at position: \" + requestIsbn.foundPos;\n\t\t\t\t\t\tSystem.out.printf(\"%-35s || Title: \"+db.getBook(requestIsbn.foundPos)+\"\\n\",formatThis);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\ti=db.size();\n\t\t\t}\n\t\t}\n\t\tif(searchHow==1){\n\t\t\tint titleCount = 0;\n\t\t\tfor(int i=0; i<db.size(); i++){\n\t\t\t\t\tSearchRequest requestTitle = new SearchRequest(db, searchForThis, titleCount, db.size());\n\t\t\t\t\tdb.searchByTitle(requestTitle);\n\t\t\t\t\ttitleCount = requestTitle.foundPos;\n\t\t\t\t\tif (requestTitle.foundPos >= 0) {\n\t\t\t\t\t\ttitleCount++;\n\t\t\t\t\t\tString formatThis = \"Matched title at position: \" + requestTitle.foundPos;\n\t\t\t\t\t\tSystem.out.printf(\"%-35s || Title: \"+db.getBook(requestTitle.foundPos)+\"\\n\",formatThis);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\ti=db.size();\n\t\t\t}\n\t\t}\n\t\tif(searchHow==2){\n\t\t\tint authorCount = 0;\n\t\t\tfor(int i=0; i<db.size(); i++){\n\t\t\t\t\tSearchRequest requestAuthor = new SearchRequest(db, searchForThis, authorCount, db.size());\n\t\t\t\t\tdb.searchByAuthor(requestAuthor);\n\t\t\t\t\tauthorCount = requestAuthor.foundPos;\n\t\t\t\t\tif (requestAuthor.foundPos >= 0) {\n\t\t\t\t\t\tauthorCount++;\n\t\t\t\t\t\tString formatThis = \"Matched author at position: \" + requestAuthor.foundPos;\n\t\t\t\t\t\tSystem.out.printf(\"%-35s || Title: \"+db.getBook(requestAuthor.foundPos)+\"\\n\",formatThis);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\ti=db.size();\n\t\t\t}\n\t\t}\n\t\tif(searchHow==3){\n\t\t\tint pageCount = 0;\n\t\t\tfor(int i=0; i<db.size(); i++){\n\t\t\t\t\tSearchRequest requestPage = new SearchRequest(db, searchForThis, pageCount, db.size());\n\t\t\t\t\tdb.searchByNumPages(requestPage);\n\t\t\t\t\tpageCount = requestPage.foundPos;\n\t\t\t\t\tif (requestPage.foundPos >= 0) {\n\t\t\t\t\t\tpageCount++;\n\t\t\t\t\t\tString formatThis = \"Matched pages at position: \" + requestPage.foundPos;\n\t\t\t\t\t\tSystem.out.printf(\"%-35s || Title: \"+db.getBook(requestPage.foundPos)+\"\\n\",formatThis);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\ti=db.size();\n\t\t\t}\n\t\t}\n\t\tif(searchHow==4){\n\t\t\tint yearCount = 0;\n\t\t\tfor(int i=0; i<db.size(); i++){\n\t\t\t\t\tSearchRequest requestYear = new SearchRequest(db, searchForThis, yearCount, db.size());\n\t\t\t\t\tdb.searchByYear(requestYear);\n\t\t\t\t\tyearCount = requestYear.foundPos;\n\t\t\t\t\tif (requestYear.foundPos >= 0) {\n\t\t\t\t\t\tyearCount++;\n\t\t\t\t\t\tString formatThis = \"Matched year at position: \" + requestYear.foundPos;\n\t\t\t\t\t\tSystem.out.printf(\"%-35s || Title: \"+db.getBook(requestYear.foundPos)+\"\\n\",formatThis);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\ti=db.size();\n\t\t\t}\n\t\t}\n\t}", "public static void init() {\n\n\t\tcontentDirectory = new Document();\n\n\t\t//For ass\n\t\t//////////////////////////////////////////////////////////////////////////////////////////\n\t\t//list of links to places (on reddit for example) to scrape from\n\t\tArrayList<String> redditAssLinks = new ArrayList<>();\n\t\tredditAssLinks.add(\"http://www.reddit.com/r/fffffffuuuuuuuuuuuu\"); //add sites here\n\n\t\tredditAssLinks.add(\"http://www.reddit.com/r/memes\");\n\t\tredditAssLinks.add(\"https://www.reddit.com/r/funnymeme/\");\n\t\tredditAssLinks.add(\"https://www.reddit.com/r/adviceanimals\");\n\t\tredditAssLinks.add(\"https://www.reddit.com/r/vertical\");\n\t\tredditAssLinks.add(\"https://www.reddit.com/r/firstworldproblems\");\n\t\tDocument redditAssDoc = new Document();\n\t\tredditAssDoc.append(\"reddit\", redditAssLinks);\n\n\t\t//could also append this when imgur implementation is ready:\n\t\t//contentDirectory.append(\"ass\", imgurAssDoc);\n\t\tcontentDirectory.append(\"ass\", redditAssDoc);\n\t\t//////////////////////////////////////////////////////////////////////////////////////////\n\n\t\t//for workout\n\t\t//////////////////////////////////////////////////////////////////////////////////////////\n\t\tArrayList<String> redditWorkoutLinks = new ArrayList<>();\n\t\tredditWorkoutLinks.add(\"http://www.reddit.com/r/gymfails\");\n\t\tredditWorkoutLinks.add(\"http://www.reddit.com/r/gymmemes\");\n\t\tredditWorkoutLinks.add(\"https://www.reddit.com/r/bodybuilding/\");\n\t\tredditWorkoutLinks.add(\"https://www.reddit.com/r/weightlifting\");\n\t\tDocument redditWorkoutDoc = new Document();\n\t\tredditWorkoutDoc.append(\"reddit\", redditWorkoutLinks);\n\n\t\tcontentDirectory.append(\"workout\", redditWorkoutDoc);\n\t\t//////////////////////////////////////////////////////////////////////////////////////////\n\n\t\t//for minecraft\n\t\t//////////////////////////////////////////////////////////////////////////////////////////\n\t\tArrayList<String> redditMinecraftLinks = new ArrayList<>();\n\t\tredditMinecraftLinks.add(\"http://www.reddit.com/r/Minecraft/\");\n\t\tredditMinecraftLinks.add(\"http://www.reddit.com/r/MinecraftSuggestions\");\n\t\tDocument redditMinecraftDoc = new Document();\n\t\tredditMinecraftDoc.append(\"reddit\", redditMinecraftLinks);\n\n\t\tcontentDirectory.append(\"minecraft\", redditMinecraftDoc);\n\t\t//////////////////////////////////////////////////////////////////////////////////////////\n\n\n\t\t//for minecraft\n\t\t//////////////////////////////////////////////////////////////////////////////////////////\n\t\tArrayList<String> redditKSPLinks = new ArrayList<>();\n\t\tredditKSPLinks.add(\"https://www.reddit.com/r/KerbalSpaceProgram/\");\n\t\tredditKSPLinks.add(\"https://www.reddit.com/r/KSPMemes\");\n\t\tredditKSPLinks.add(\"http://www.reddit.com/r/KerbalAcademy\");\n\t\tredditKSPLinks.add(\"https://www.reddit.com/r/RealSolarSystem/\");\n\t\tDocument redditKSPDoc = new Document();\n\t\tredditKSPDoc.append(\"reddit\", redditKSPLinks);\n\n\t\tcontentDirectory.append(\"KSP\", redditKSPDoc);\n\t\t//////////////////////////////////////////////////////////////////////////////////////////\n\n\t\t//for weed\n\t\t//////////////////////////////////////////////////////////////////////////////////////////\n\t\tArrayList<String> redditWeedLinks = new ArrayList<>();\n\t\tredditWeedLinks.add(\"https://www.reddit.com/r/weed/\");\n\t\tredditWeedLinks.add(\"https://www.reddit.com/r/trees/\");\n\t\tredditWeedLinks.add(\"https://www.reddit.com/r/Picturesoftrees/\");\n\t\tredditWeedLinks.add(\"https://www.reddit.com/r/bakedart/\");\n\t\tredditWeedLinks.add(\"https://www.reddit.com/r/treecomics/\");\n\t\tredditWeedLinks.add(\"https://www.reddit.com/r/nugs/\");\n\t\tredditWeedLinks.add(\"https://www.reddit.com/r/nugporn/\");\n\t\tredditWeedLinks.add(\"https://www.reddit.com/r/TokeSpot/\");\n\n\t\tDocument redditWeedDoc = new Document();\n\t\tredditWeedDoc.append(\"reddit\", redditWeedLinks);\n\n\t\tcontentDirectory.append(\"weed\", redditWeedDoc);\n\t\t//////////////////////////////////////////////////////////////////////////////////////////\n\n\t\t//for drug\n\t\t//////////////////////////////////////////////////////////////////////////////////////////\n\t\tArrayList<String> redditDrugLinks = new ArrayList<>();\n\t\tredditDrugLinks.add(\"https://www.reddit.com/r/DrugArt/\");\n\t\tredditDrugLinks.add(\"https://www.reddit.com/r/trippy/\");\n\t\tredditDrugLinks.add(\"https://www.reddit.com/r/drugmemes/\");\n\t\tDocument redditDrugDoc = new Document();\n\t\tredditDrugDoc.append(\"reddit\", redditDrugLinks);\n\n\t\tcontentDirectory.append(\"drug\", redditDrugDoc);\n\t\t//////////////////////////////////////////////////////////////////////////////////////////\n\n\t\t//for cute animals\n\t\t//////////////////////////////////////////////////////////////////////////////////////////\n\t\tArrayList<String> redditCanimalLinks = new ArrayList<>();\n\t\tredditCanimalLinks.add(\"https://www.reddit.com/r/aww/\");\n\t\tredditCanimalLinks.add(\"http://www.reddit.com/r/cats/\");\n\t\tredditCanimalLinks.add(\"https://www.reddit.com/r/babyanimals/\");\n\t\tredditCanimalLinks.add(\"https://www.reddit.com/r/AnimalsBeingBros\");\n\t\tredditCanimalLinks.add(\"https://www.reddit.com/r/woof_irl/\");\n\t\tDocument reddiCanimalDoc = new Document();\n\t\treddiCanimalDoc.append(\"reddit\", redditCanimalLinks);\n\n\t\tcontentDirectory.append(\"canimal\", reddiCanimalDoc);\n\t\t//////////////////////////////////////////////////////////////////////////////////////////\n\n\n\t}", "private void innerCrawl(URL url, int limit) {\n\t\t\tsynchronized(urls) {\n\t\t\t\tif(urls.size() <= limit) {\n\t\t\t\t\tqueue.execute(new CrawlWorker(url.toString()));\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public static void testWordCount(Configuration conf, DataStore<String,WebPage> inStore, DataStore<String,\n TokenDatum> outStore) throws Exception {\n ((DataStoreBase<String,WebPage>)inStore).setConf(conf);\n ((DataStoreBase<String,TokenDatum>)outStore).setConf(conf);\n \n //create input\n WebPageDataCreator.createWebPageData(inStore);\n \n //run the job\n WordCount wordCount = new WordCount(conf);\n wordCount.wordCount(inStore, outStore);\n \n //assert results\n HashMap<String, Integer> actualCounts = new HashMap<>();\n for(String content : WebPageDataCreator.CONTENTS) {\n if (content != null) {\n for(String token:content.split(\" \")) {\n Integer count = actualCounts.get(token);\n if(count == null) \n count = 0;\n actualCounts.put(token, ++count);\n }\n }\n }\n for(Map.Entry<String, Integer> entry:actualCounts.entrySet()) {\n assertTokenCount(outStore, entry.getKey(), entry.getValue()); \n }\n }", "public static void main(String[] args) throws IOException {\n\t\t// word -> number of times that it appears over all files\n \n Map< Character, Set<String> > globalWordSetsPerCharacter = new ConcurrentHashMap<>();\n \n // NOTE(jakob): The CountDownLatch no longer keeps track of the\n // amount of threads left, it instead is a blocking barrier\n // that the main thread will wait for to open, which happens\n // once our AtomicInteger (which is our actual\n // thread counter) reaches zero.\n\t\tCountDownLatch latch = new CountDownLatch( 1 ); // Wait and see (^:\n AtomicInteger activeThreadCount = new AtomicInteger(0);\n \n\t\tFiles.walk(Path.of(\"data/\"))\n .filter(Files::isRegularFile)\n\t\t\t.map( path -> new Thread( () -> {\n activeThreadCount.incrementAndGet();\n\t\t\t\tcomputeOccurrences( path, globalWordSetsPerCharacter );\n\t\t\t\t\n // Now this is a bit tricky.\n // It is in essence a check-then-act race condition.\n // The thread safety of this relies on the fact that only the\n // last thread to finish will get a return value of 0 from the\n // decrementAndGet method on the AtomicInt (Since it is atomic).\n // POST CLASS: We actually discussed that this would not work in\n // all cases, if for instance the first thread finishes before\n // any other thread has been started yet. Look at the solution\n // we developed together to see a solution that does not have\n // this problem. (^:\n if (activeThreadCount.decrementAndGet() == 0) {\n latch.countDown();\n }\n\t\t\t} ) )\n\t\t\t.forEach( Thread::start );\n\n\t\ttry {\n\t\t\tlatch.await();\n\t\t} catch( InterruptedException e ) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tglobalWordSetsPerCharacter.forEach(\n (character, words) -> System.out.println( character + \": \" + words ) );\n\t}", "@Override\r\n public void execute() throws BuildException \r\n {\r\n try {\r\n //Use Xerces as the parser. Does not support Saxon6.5.5 parser \r\n System.setProperty(\"org.xml.sax.driver\", \"org.apache.xerces.parsers.SAXParser\");\r\n System.setProperty(\"javax.xml.parsers.SAXParserFactory\", \"org.apache.xerces.jaxp.SAXParserFactoryImpl\");\r\n // System.setProperty(\"org.xml.sax.driver\", \"com.icl.saxon.aelfred.SAXDriver\");\r\n // System.setProperty(\"javax.xml.parsers.SAXParserFactory\", \"com.icl.saxon.aelfred.SAXParserFactoryImpl\");\r\n } catch (SecurityException se){\r\n System.out.println(\"[WARNING] Default parser is not set to Xerces. Make sure Saxon6.5.5 \" +\r\n \"is not in your CLASSPATH.\");\r\n } catch (Exception e){\r\n System.out.println(\"[WARNING] Default parser is not set to Xerces. Make sure Saxon6.5.5 \" +\r\n \"is not in your CLASSPATH\");\r\n }\r\n\r\n ArrayList<DocFileInfo> filesDescription = null; // list of information about the topic files\r\n ArrayList<File> htmlFiles = null; // topic files listed in the given directory\r\n ArrayList<String> htmlFilesPathRel = null;\r\n Map<String, String> tempDico = new HashMap<String, String>(); \r\n Iterator it;\r\n\r\n //File name initialization\r\n String htmlList = \"htmlFileList.js\";\r\n String htmlInfoList = \"htmlFileInfoList.js\";\r\n String indexName = \".js\";\r\n\r\n //timing\r\n Date dateStart = new Date();\r\n\t\t\r\n if (htmldir == null) {\r\n System.out.println(txt_no_args + \".\");\r\n return;\r\n }\r\n // Init input directory\r\n inputDir = new File(htmldir);\r\n\r\n // Begin of init\r\n\r\n // check if inputdir exists\t\t\r\n if ((inputDir == null) || !inputDir.exists()) {\r\n System.out.println(txt_no_inputdir + \" \"+ inputDir + \".\");\r\n return;\r\n }\r\n\r\n // check if outputdir defined\r\n if (outputDir == null) {\r\n //set the output directory: path= {inputDir}/search \r\n outputDir = inputDir.getPath().concat(File.separator).concat(searchdir);\r\n }\r\n\r\n // check if outputdir exists\r\n File tempfile = new File(outputDir); \r\n if (!tempfile.exists()) {\r\n boolean b = (new File(outputDir)).mkdir();\r\n if (!b) {\r\n System.out.println(txt_cannot_create_outputdir + \" \"+ outputDir + \".\");\r\n return;\r\n }\r\n }\r\n\t\t\r\n String inputPath = inputDir.getPath();\r\n \r\n //end of init\r\n\r\n\r\n // Get the list of all html files but the tocs, covers and indexes\r\n DirList nsiDoc = new DirList(inputDir, \"^.*\\\\.\" + htmlExtension + \"?$\", 1);\r\n htmlFiles = nsiDoc.getListFiles();\r\n // Check if found html files\r\n if ((htmlFiles == null) || htmlFiles.isEmpty()) {\r\n System.out.println(txt_no_html_files + \" \"+ inputDir + \".\");\r\n return;\r\n }\r\n // Get the list of all html files with relative paths \r\n htmlFilesPathRel = nsiDoc.getListFilesRelTo(inputPath);\r\n if (htmlFilesPathRel == null) {\r\n System.out.println(txt_no_relative_files_found);\r\n return;\t\t\t\r\n }\r\n\t\t\r\n // Create the list of the existing html files (index starts at 0)\r\n String htmlListPath = outputDir.concat(File.separator).concat(htmlList);\r\n WriteJSFiles.WriteHTMLList(htmlListPath, htmlFilesPathRel);\r\n\r\n // Parse each html file to retrieve the words:\r\n // ------------------------------------------\r\n\r\n // Retrieve the clean-up properties for indexing\r\n RetrieveCleanUpProps();\r\n RetrieveEncodingProps();\r\n // System.out.print(\"clean\"+\" \" +cleanUpStrings);\r\n\r\n //create a default handler\r\n //SaxHTMLIndex spe = new SaxHTMLIndex (); // do not use clean-up props files\r\n //SaxHTMLIndex spe = new SaxHTMLIndex (cleanUpStrings); // use clean-up props files\r\n FilesIndexer spe = new FilesIndexer(cleanUpStrings, cleanUpChars, encodingProps); // use clean-up props files\r\n\r\n if ( spe.init(tempDico) == 0 ) {\r\n\r\n //create a html file description list\r\n filesDescription = new ArrayList <DocFileInfo> ();\r\n\r\n it = htmlFiles.iterator ( ) ;\r\n\r\n // parse each html files\r\n while ( it.hasNext ( ) ) {\r\n File ftemp = (File) it.next();\r\n //tempMap.put(key, value);\r\n //The HTML file information are added in the list of FileInfoObject\r\n DocFileInfo docFileInfoTemp = new DocFileInfo(spe.runExtractData(ftemp, IndexerTask.indexerLanguage));\r\n\r\n // Set path relative to inputPath\r\n ftemp = docFileInfoTemp.getFullpath();\r\n String stemp = ftemp.toString(); \r\n int i = stemp.indexOf(inputPath);\r\n if ( i != 0 ) {\r\n System.out.println(\"The file path does not match with the input path: \" + stemp);\r\n continue;\r\n }\r\n int ad = stemp.equals(inputPath) ? 0 : 1;\r\n stemp = stemp.substring(inputPath.length() + ad);\r\n ftemp = new File (stemp);\r\n docFileInfoTemp.setFullpath(ftemp);\r\n\r\n filesDescription.add(docFileInfoTemp);\r\n }\r\n \r\n /*remove empty strings from the map*/\r\n if (tempDico.containsKey(\"\")) {\r\n tempDico.remove(\"\");\r\n }\r\n \r\n // write the index files\r\n if (tempDico.isEmpty()) {\r\n System.out.println(txt_no_words_gathered + \" \"+ inputDir + \".\");\r\n return;\r\n }\r\n\r\n WriteJSFiles.WriteIndex(outputDir.concat(File.separator).concat(indexName), tempDico);\r\n\r\n // write the html list file with title and shortdesc\r\n // create the list of the existing html files (index starts at 0)\r\n WriteJSFiles.WriteHTMLInfoList(outputDir.concat(File.separator).concat(htmlInfoList), filesDescription);\r\n\r\n // perf measurement\r\n Date dateEnd = new Date();\r\n long diff = dateEnd.getTime() - dateStart.getTime();\r\n if(diff < 1000) {\r\n System.out.println(\"Delay = \" + diff + \" milliseconds\");\r\n } else {\r\n System.out.println(\"Delay = \" + diff/1000 + \" seconds\");\r\n }\r\n } else {\r\n System.out.println(txt_wrong_dita_basedir);\r\n }\r\n }", "private void collect() {\n\n System.out.println(\"Getting IndexReader...\");\n final IndexReader reader = index.reader();\n\n System.out.println(\"Calling forEachDocument()...\");\n index.forEachDocument(new DocTask() {\n\n int docsDone = 0;\n\n final int totalDocs = reader.maxDoc() - reader.numDeletedDocs();\n\n @Override\n public void perform(BlackLabIndex index, int docId) {\n Map<String, String> metadata = new HashMap<>();\n Document luceneDoc = index.luceneDoc(docId);\n for (IndexableField f: luceneDoc.getFields()) {\n // If this is a regular metadata field, not a control field\n if (!f.name().contains(\"#\")) {\n fieldNames.add(f.name());\n if (f.stringValue() != null)\n metadata.put(f.name(), f.stringValue());\n else if (f.numericValue() != null)\n metadata.put(f.name(), f.numericValue().toString());\n }\n }\n values.add(metadata);\n docsDone++;\n if (docsDone % 100 == 0) {\n int perc = docsDone * 100 / totalDocs;\n System.out.println(docsDone + \" docs exported (\" + perc + \"%)...\");\n }\n }\n });\n }", "public static void pageRankmain() {\n\t\t\t\n\t\t\tstopWordStore();\n\t\t\t//File[] file_read= dir.listFiles();\n\t\t\t//textProcessor(file_read);// Will be called from LinkCrawler\n\t\t\t//queryProcess();\n\t\t\t//System.out.println(\"docsave \"+ docsave);\n\t\t\t/*for ( Map.Entry<String, ArrayList<String>> entry : docsave.entrySet()) {\n\t\t\t String key = entry.getKey();\n\t\t\t List<String> values = entry.getValue();\n\t\t\t System.out.print(\"Key = \" + key);\n\t\t\t System.out.println(\" , Values = \"+ values);\n\t\t\t}*/\n\t\t\t//########## RESPOINSIBLE FOR CREATING INVERTED INDEX OF TERMS ##########\n\t\t\tfor(int i=0;i<vocabulary.size();i++) {\n\t\t\t\tint count=1;\n\t\t\t\tMap<String, Integer> nestMap = new HashMap<String, Integer>();\n\t\t\t\tfor ( Map.Entry<String, ArrayList<String>> entry : docsave.entrySet()) {\n\t\t\t\t String keyMain = entry.getKey();\n\t\t\t\t List<String> values = entry.getValue();\n\t\t\t\t if(values.contains(vocabulary.get(i)))\n\t\t\t\t \t{\n\t\t\t\t \tentryDf.put(vocabulary.get(i), count);//entryDf stores documents frequency of vocabulary word \\\\it increase the count value for specific key\n\t\t\t\t \tcount++;\n\t\t\t\t \t}\n\t\t\t\t \n\t\t\t\t nestMap.put(keyMain, Collections.frequency(values,vocabulary.get(i)));\n\t\t\t \t\n\t\t\t \t//System.out.println(\"VOC \"+ vocabulary.get(i)+ \" KeyMain \" +keyMain+ \" \"+ Collections.frequency(values,vocabulary.get(i)));\n\t\t\t\t\t}\n\t\t\t\t\ttfList.put(vocabulary.get(i), nestMap);\n\t\t\t}\n\t\t\t//########## RESPOINSIBLE FOR CREATING A MAP \"storeIdf\" TO STORE IDF VALUES OF TERMS ##########\n\t\t\tfor ( Map.Entry<String, Integer> endf : entryDf.entrySet()) {\n\t\t\t\tString keydf = endf.getKey();\n\t\t\t\tint valdf = endf.getValue();\n\t\t\t\t//System.out.print(\"Key = \" + \"'\"+keydf+ \"'\");\n\t\t\t //System.out.print(\" , Values = \"+ valdf);\n\t\t\t double Hudai = (double) (docsave.size())/valdf;\n\t\t\t //System.out.println(\"docsave size \"+docsave.size()+ \" valdf \"+ valdf + \" Hudai \"+ Hudai+ \" log Value1 \"+ Math.log(Hudai)+ \" log Value2 \"+ Math.log(2));\n\t\t\t double idf= Math.log(Hudai)/Math.log(2);\n\t\t\t storeIdf.put(keydf, idf);\n\t\t\t //System.out.print(\" idf-> \"+ idf);\n\t\t\t //System.out.println();\n\t\t\t} \n\t\t\t\n\t\t\t//############ Just for Printing ##########NO WORK HERE########\n\t\t\tfor (Map.Entry<String, Map<String, Integer>> tokTf : tfList.entrySet()) {\n\t\t\t\tString keyTf = tokTf.getKey();\n\t\t\t\tMap<String, Integer> valTF = tokTf.getValue();\n\t\t\t\tSystem.out.println(\"Inverted Indexing by Key Word = \" + \"'\"+keyTf+ \"'\");\n\t\t\t\tfor (Map.Entry<String, Integer> nesTf : valTF.entrySet()) {\n\t\t\t\t\tString keyTF = nesTf.getKey();\n\t\t\t\t\tInteger valTf = nesTf.getValue();\n\t\t\t\t\tSystem.out.print(\" Document Consists This Key Word = \" + \"'\"+ keyTF+ \"'\");\n\t\t\t\t\tSystem.out.println(\" , Term Frequencies in This Doc = \"+ valTf);\n\t\t\t\t} \n\t\t\t}\n\t\t\t//########### FOR CALCULATING DOCUMENT LENTH #############//\n\t\t\tfor ( Map.Entry<String, ArrayList<String>> entry_new : docsave.entrySet()) // Iterating Number of Documents\n\t\t\t{\n\t\t\t\tString keyMain_new = entry_new.getKey();\n\t\t\t\t//int countStop=0;\n\t\t\t\tdouble sum=0;\n\t\t\t\t for(Map.Entry<String, Map<String, Integer>> tokTf_new : tfList.entrySet()) // Iterating through the vocabulary\n\t\t\t\t { \n\t\t\t\t\t Map<String, Integer> valTF_new = tokTf_new.getValue();\n\t\t\t\t\t for (Map.Entry<String, Integer> nesTf_new : valTF_new.entrySet()) // Iterating Through the Documents\n\t\t\t\t\t {\n\t\t\t\t\t\t if(keyMain_new.equals(nesTf_new.getKey())) // Only doc name EQUAL with docsave name can enter here\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t double val = nesTf_new.getValue()* (Double) storeIdf.get(tokTf_new.getKey());\n\t\t\t\t\t\t\t sum = sum+ Math.pow(val, 2);\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t\t \n\t\t\t\t\t //countStop++;\n\t\t\t\t }\n\t\t\t\t docLength.put(keyMain_new, Math.sqrt(sum));\n\t\t\t\t sum=0;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tSystem.out.println(\"Document Length \"+ docLength);\n\t\t\t//System.out.println(\"tfList \"+tfList);\n\t\t\t\n\t\t\t //########### FOR CALCULATING QUERY LENTH #############///\n\t\t\t\tdouble qrySum=0;\n\t\t\t\t for(String qryTerm: queryList) // Iterating through the vocabulary\n\t\t\t\t {\n\t\t\t\t\t//entryQf.put(qryTerm, Collections.frequency(queryList,qryTerm));// VUl ase\n\t\t\t\t\t \n\t\t\t\t\t\t if(storeIdf.get(qryTerm) != null) \n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t entryQf.put(qryTerm, Collections.frequency(queryList,qryTerm));\n\t\t\t\t\t\t\t double val = entryQf.get(qryTerm)* (Double) storeIdf.get(qryTerm);\n\t\t\t\t\t\t\t qrySum = qrySum+ Math.pow(val, 2);\n\t\t\t\t\t\t }\n\t\t\t\t\t System.out.println(qryTerm+\" \"+entryQf.get(qryTerm)+ \" \"+ (Double) storeIdf.get(qryTerm));\n\t\t\t\t }\n\t\t\t\t qrySum=Math.sqrt(qrySum);\n\t\t\t\t System.out.println(\"qrySum \" + qrySum);\n\t\t\t\t \n\t\t\t\t//########### FOR CALCULATING COSINE SIMILARITY #############///\n\t\t\t\t for ( Map.Entry<String, ArrayList<String>> entry_dotP : docsave.entrySet()) // Iterating Number of Documents\n\t\t\t\t\t{\n\t\t\t\t\t\tdouble sumProduct=0;\n\t\t\t\t\t\tdouble productTfIdf=0;\n\t\t\t\t\t\tString keyMain_new = entry_dotP.getKey(); //Geting Doc Name\n\t\t\t\t\t\t for(Map.Entry<String, Integer> qryTermItr : entryQf.entrySet()) // Iterating through the vocabulary\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t Map<String, Integer> matchTerm = tfList.get(qryTermItr.getKey()); // Getting a map of doc Names by a Query Term as value of tfList\n\n\t\t\t\t\t\t\t\t if(matchTerm.containsKey(keyMain_new)) // Only doc name EQUAL with docsave name can enter here\n\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t //System.out.println(\"Test \"+ matchTerm.get(keyMain_new) +\" keyMain_new \" + keyMain_new);\n\t\t\t\t\t\t\t\t\t double docTfIdf= matchTerm.get(keyMain_new) * storeIdf.get(qryTermItr.getKey());\n\t\t\t\t\t\t\t\t\t double qryTfIdf= qryTermItr.getValue() * storeIdf.get(qryTermItr.getKey());\n\t\t\t\t\t\t\t\t\t productTfIdf = docTfIdf * qryTfIdf;\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t sumProduct= sumProduct+productTfIdf;\n\t\t\t\t\t\t\t //System.out.println(\"productTfIdf \"+productTfIdf+\" sumProduct \"+ sumProduct);\n\t\t\t\t\t\t\t productTfIdf=0;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t cosineProd.put(entry_dotP.getKey(), sumProduct/(docLength.get(entry_dotP.getKey())*qrySum));\n\t\t\t\t\t\t sumProduct=0;\n\t\t\t\t\t\t //System.out.println(entry_dotP.getKey()+ \" \" + docLength.get(entry_dotP.getKey()));\n\t\t\t\t\t}\n\t\t\t\t System.out.println(\"cosineProd \"+ cosineProd);\n\t\t\t\t \n\t\t\t\t System.out.println(\"Number of Top Pages you want to see\");\n\t\t\t\t int topRank = Integer.parseInt(scan.nextLine());\n\t\t\t\t Map<String, Double> result = cosineProd.entrySet().stream()\n\t\t\t .sorted(Map.Entry.comparingByValue(Comparator.reverseOrder())).limit(topRank)\n\t\t\t .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue,\n\t\t\t (oldValue, newValue) -> oldValue, LinkedHashMap::new));\n\n\t\t\t\t scan.close();\n\t\t\t //Alternative way\n\t\t\t //Map<String, Double> result2 = new LinkedHashMap<>();\n\t\t\t //cosineProd.entrySet().stream().sorted(Map.Entry.<String, Double>comparingByValue().reversed()).limit(2).forEachOrdered(x -> result2.put(x.getKey(), x.getValue()));\n\n\t\t\t System.out.println(\"Sorted...\");\n\t\t\t System.out.println(result);\n\t\t\t //System.out.println(result2);\n\t}", "@Override\r\n\tpublic void run() {\n\t\t\t\r\n\t\tString [] kod = {\"STIA\",\"STQM\",\"STID\",\"STIJ\",\"STIX\",\"STIN\",\"STIK\",\"STIW\",\"STQS\"};\r\n\t\tint num=0;\r\n\t\tsuper.run();\r\n\t\t\r\n\t\tfor(int i=0;i<text.length;i++) {\r\n\t\t\tfor(int s=1000;s<=5000;s++) {\r\n\t\t\t\tfor(int k=0;k<kod.length;k++) {\r\n\t\t\t\t\tif(text[i].contains(kod[k]+s)) {\r\n\t\t\t\t\t\tnum++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t}\r\n\t\tSystem.out.println(\"Thread-4: The number of courses from SOC: \"+num);\r\n\t\tSystem.out.println(\"\");\r\n\t\t}" ]
[ "0.6695044", "0.66769916", "0.66539764", "0.65268785", "0.6364769", "0.6341213", "0.6329482", "0.63080895", "0.62145907", "0.6212696", "0.6141706", "0.61300457", "0.6108328", "0.6099897", "0.6059411", "0.6030578", "0.6026931", "0.59873277", "0.5982648", "0.5955393", "0.5945125", "0.59398115", "0.5939678", "0.5928871", "0.5896991", "0.5896652", "0.58915293", "0.5877862", "0.57891566", "0.5775443", "0.5764618", "0.5758779", "0.5724308", "0.57193327", "0.57008696", "0.56960624", "0.56947684", "0.5660615", "0.5654711", "0.5636867", "0.56219596", "0.561883", "0.561883", "0.56161714", "0.56069833", "0.5582413", "0.5582258", "0.55676943", "0.5563596", "0.5563314", "0.55632824", "0.5557355", "0.55434954", "0.55235505", "0.551485", "0.5501923", "0.54669756", "0.5463052", "0.54426897", "0.5435803", "0.5433494", "0.54316014", "0.5429229", "0.5405293", "0.53927", "0.53612715", "0.535465", "0.5352836", "0.5351596", "0.5346829", "0.53415734", "0.5341108", "0.5340808", "0.5340688", "0.5334098", "0.53292763", "0.53288275", "0.53287876", "0.5326194", "0.5322966", "0.5308582", "0.5291293", "0.52796316", "0.52733797", "0.52705246", "0.52634573", "0.5260805", "0.52436256", "0.5217349", "0.5217103", "0.5214368", "0.52132136", "0.5211141", "0.52085334", "0.52033466", "0.5200065", "0.51930135", "0.5180932", "0.5180472", "0.5161844" ]
0.78905016
0
Select the time periods that need to be counted
private void customTime(boolean shouldStart) { if (customCalendar == null) { customCalendar = Calendar.getInstance(); customYear = customCalendar.get(Calendar.YEAR); customMonth = customCalendar.get(Calendar.MONTH); customDay = customCalendar.get(Calendar.DAY_OF_MONTH); } timeDialog = new DatePickerDialog(this, this, customYear, customMonth, customDay); timeDialog.show(); if (shouldStart) { Toasty.info(StatActivity.this, "Selection start time").show(); } else { Toasty.info(StatActivity.this, "Select end time").show(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected int getNumberOfPeriods()\n {\n return 2;\n }", "public int getHowManyInPeriod();", "private Set calculateTimeSet() {\n List choices = getDataChoices();\n if (choices.isEmpty()) {\n return null;\n }\n Set newSet = null;\n for (int i = 0; i < choices.size(); i++) {\n try {\n VerticalProfileInfo info = getVPInfo(i);\n GridDataInstance dataInstance = info.getDataInstance();\n Set set = GridUtil.getTimeSet(dataInstance.getGrid());\n //System.out.println(\"di.timeset[\"+i+\"] = \" + set);\n if (set != null) {\n if (newSet == null) {\n newSet = set;\n } else {\n newSet = newSet.merge1DSets(set);\n }\n }\n } catch (Exception e) {\n logger.error(\"Problem calculating TimeSet\", e);\n }\n }\n //System.out.println(\"merged time set = \" + newSet);\n return newSet;\n }", "public void testGetSubIntervalCount() {\n TaskSeriesCollection tsc = createCollection3();\n }", "@Override\n\tpublic int periodAllcount() throws Exception {\n\t\treturn dao.periodAllcount();\n\t}", "int getPeriod();", "public Map<String, List<TimePeriodModel>> getAllTimePeriods();", "public java.util.Collection getTimeLimit();", "@Override\n\tprotected int getActiveCount(long units) {\n\t\treturn units % period == 0 ? 1 : 0;\n\t}", "double getPeriod();", "public Aggregation getPeriodicCountAggregation(Date startDate, Date endDate) {\n\t\tAggregationOperation match = Aggregation.match(Criteria.where(\"in_time\").lt(endDate).gt(startDate));\n\t\tAggregation parkingAgg = Aggregation.newAggregation(match,\n\t\t\t\tAggregation.project().andExpression(\"vehicle_type\").as(\"type\"),\n\t\t\t\tAggregation.group(Aggregation.fields().and(\"type\")).count().as(\"count\"));\n\n\t\treturn parkingAgg;\n\t}", "PeriodCountCalculator<E> getPeriodCountCalculator();", "long getSamplePeriod();", "int countByExample(ScheduleCriteria example);", "public void test800324() {\n TaskSeries s1 = new TaskSeries(\"S1\");\n s1.add(new Task(\"Task 1\", new SimpleTimePeriod(new Date(), new Date())));\n s1.add(new Task(\"Task 2\", new SimpleTimePeriod(new Date(), new Date())));\n s1.add(new Task(\"Task 3\", new SimpleTimePeriod(new Date(), new Date())));\n TaskSeriesCollection tsc = new TaskSeriesCollection();\n tsc.add(s1);\n try {\n tsc.getStartValue(0, 3);\n assertTrue(false);\n } catch (IndexOutOfBoundsException e) {\n }\n try {\n tsc.getEndValue(0, 3);\n assertTrue(false);\n } catch (IndexOutOfBoundsException e) {\n }\n try {\n tsc.getSubIntervalCount(0, 3);\n assertTrue(false);\n } catch (IndexOutOfBoundsException e) {\n }\n }", "public DataElementChartResult generateChartDataPeriodWise( List<Date> selStartPeriodList,\n List<Date> selEndPeriodList, List<String> periodNames, List<DataElement> dataElementList,\n List<DataElementCategoryOptionCombo> decocList, OrganisationUnit orgUnit )\n throws Exception\n {\n DataElementChartResult dataElementChartResult;\n\n String[] series = new String[dataElementList.size()];\n String[] categories = new String[selStartPeriodList.size()];\n Double[][] data = new Double[dataElementList.size()][selStartPeriodList.size()];\n String chartTitle = \"OrganisationUnit : \" + orgUnit.getShortName();\n String xAxis_Title = \"Time Line\";\n String yAxis_Title = \"Value\";\n\n int serviceCount = 0;\n\n for ( DataElement dataElement : dataElementList )\n {\n DataElementCategoryOptionCombo decoc;\n\n DataElementCategoryCombo dataElementCategoryCombo = dataElement.getCategoryCombo();\n\n List<DataElementCategoryOptionCombo> optionCombos = new ArrayList<DataElementCategoryOptionCombo>(\n dataElementCategoryCombo.getOptionCombos() );\n\n if ( deSelection.equalsIgnoreCase( OPTIONCOMBO ) )\n {\n decoc = decocList.get( serviceCount );\n\n series[serviceCount] = dataElement.getName() + \" : \" + decoc.getName();\n \n CaseAggregationCondition caseAggregationCondition = caseAggregationConditionService\n .getCaseAggregationCondition( dataElement, decoc );\n\n if ( caseAggregationCondition == null )\n {\n selectedStatus.add( \"no\" );\n }\n else\n {\n selectedStatus.add( \"yes\" );\n }\n\n yseriesList.add( dataElement.getName() + \" : \" + decoc.getName() );\n }\n else\n {\n decoc = dataElementCategoryService.getDefaultDataElementCategoryOptionCombo();\n series[serviceCount] = dataElement.getName();\n\n CaseAggregationCondition caseAggregationCondition = caseAggregationConditionService\n .getCaseAggregationCondition( dataElement, decoc );\n\n if ( caseAggregationCondition == null )\n {\n selectedStatus.add( \"no\" );\n }\n else\n {\n selectedStatus.add( \"yes\" );\n }\n\n yseriesList.add( dataElement.getName() );\n }\n\n int periodCount = 0;\n for ( Date startDate : selStartPeriodList )\n {\n Date endDate = selEndPeriodList.get( periodCount );\n String drillDownPeriodName = periodNames.get( periodCount );\n String tempStartDate = format.formatDate( startDate );\n String tempEndDate = format.formatDate( endDate );\n\n categories[periodCount] = periodNames.get( periodCount );\n //PeriodType periodType = periodService.getPeriodTypeByName( periodTypeLB );\n\n String values = orgUnit.getId() + \":\" + dataElement.getId() + \":\" + decoc.getId() + \":\" + periodTypeLB\n + \":\" + tempStartDate + \":\" + tempEndDate;\n selectedValues.add( values );\n\n String drillDownData = orgUnit.getId() + \":\" + \"0\" + \":\" + dataElement.getId() + \":\" + decoc.getId()\n + \":\" + periodTypeLB + \":\" + tempStartDate + \":\" + tempEndDate + \":\" + drillDownPeriodName + \":\"\n + deSelection + \":\" + aggChecked;\n selectedDrillDownData.add( drillDownData );\n\n Double aggDataValue = 0.0;\n \n if ( deSelection.equalsIgnoreCase( OPTIONCOMBO ) )\n {\n //System.out.println( \" Inside deSelection.equalsIgnoreCase( OPTIONCOMBO ) \" );\n if ( aggDataCB != null )\n {\n Double temp = aggregationService.getAggregatedDataValue( dataElement, decoc, startDate,\n endDate, orgUnit );\n if ( temp != null )\n aggDataValue += temp;\n //aggDataValue = temp;\n }\n else\n {\n Collection<Period> periods = periodService.getPeriodsBetweenDates( startDate, endDate );\n for ( Period period : periods )\n {\n DataValue dataValue = dataValueService.getDataValue( orgUnit, dataElement, period, decoc );\n try\n {\n aggDataValue += Double.parseDouble( dataValue.getValue() );\n }\n catch ( Exception e )\n {\n }\n }\n }\n }\n else\n {\n //System.out.println( \" Inside not deSelection.equalsIgnoreCase( OPTIONCOMBO ) \" );\n Iterator<DataElementCategoryOptionCombo> optionComboIterator = optionCombos.iterator();\n while ( optionComboIterator.hasNext() )\n {\n DataElementCategoryOptionCombo decoc1 = (DataElementCategoryOptionCombo) optionComboIterator.next();\n\n if ( aggDataCB != null )\n {\n Double temp = aggregationService.getAggregatedDataValue( dataElement, decoc1, startDate,\n endDate, orgUnit );\n if ( temp != null )\n aggDataValue += temp;\n //aggDataValue = temp;\n }\n else\n {\n Collection<Period> periods = periodService.getPeriodsBetweenDates( startDate, endDate );\n for ( Period period : periods )\n {\n DataValue dataValue = dataValueService.getDataValue( orgUnit, dataElement, period, decoc1 );\n try\n {\n aggDataValue += Double.parseDouble( dataValue.getValue() );\n }\n catch ( Exception e )\n {\n }\n }\n }\n }\n }\n //System.out.println( \" Data is : \" + aggDataValue );\n data[serviceCount][periodCount] = aggDataValue;\n\n if ( dataElement.getType().equalsIgnoreCase( DataElement.VALUE_TYPE_INT ) )\n {\n if ( dataElement.getNumberType().equalsIgnoreCase( DataElement.VALUE_TYPE_INT ) )\n {\n data[serviceCount][periodCount] = Math.round( data[serviceCount][periodCount]\n * Math.pow( 10, 0 ) )\n / Math.pow( 10, 0 );\n }\n else\n {\n data[serviceCount][periodCount] = Math.round( data[serviceCount][periodCount]\n * Math.pow( 10, 1 ) )\n / Math.pow( 10, 1 );\n }\n }\n periodCount++;\n }\n\n serviceCount++;\n }\n dataElementChartResult = new DataElementChartResult( series, categories, data, chartTitle, xAxis_Title,\n yAxis_Title );\n\n return dataElementChartResult;\n }", "public ArrayList<String> getCountStatics() {\n\t\tint countsPerMinute = 0;\n\t\tint countsPerHour = 0;\n\t\tint countsPerDay = 0;\n\t\tint countsPerWeek = 0;\n\t\tint countsPerMonth = 0;\n\n\t\t// get a comparison time and start comparing the times against it\n\t\tArrayList<String> myArrayString = new ArrayList<String>();\n\t\tCalendar currDate = Calendar.getInstance();\n\t\tfor (int i = 0; i < clickerCountObject.getClickerTimestamps().size(); i++) {\n\t\t\tSystem.out.println(clickerCountObject.getClickerTimestamps().get(i)\n\t\t\t\t\t.get(Calendar.MINUTE) <= currDate.get(Calendar.MINUTE));\n\t\t\tif (currDate.get(Calendar.MINUTE) - 1 <= clickerCountObject\n\t\t\t\t\t.getClickerTimestamps().get(i).get(Calendar.MINUTE)\n\t\t\t\t\t&& currDate.get(Calendar.MINUTE) >= clickerCountObject\n\t\t\t\t\t\t\t.getClickerTimestamps().get(i).get(Calendar.MINUTE)) {\n\t\t\t\tcountsPerMinute += 1;\n\t\t\t}\n\t\t\tif (currDate.get(Calendar.HOUR_OF_DAY) - 1 <= clickerCountObject\n\t\t\t\t\t.getClickerTimestamps().get(i).get(Calendar.HOUR_OF_DAY)\n\t\t\t\t\t&& currDate.get(Calendar.HOUR_OF_DAY) >= clickerCountObject\n\t\t\t\t\t\t\t.getClickerTimestamps().get(i)\n\t\t\t\t\t\t\t.get(Calendar.HOUR_OF_DAY)) {\n\t\t\t\tcountsPerHour += 1;\n\t\t\t}\n\t\t\tif ((currDate.get(Calendar.DAY_OF_MONTH) - 1 <= clickerCountObject\n\t\t\t\t\t.getClickerTimestamps().get(i).get(Calendar.DAY_OF_MONTH))\n\t\t\t\t\t&& (currDate.get(Calendar.DAY_OF_MONTH) >= clickerCountObject\n\t\t\t\t\t\t\t.getClickerTimestamps().get(i)\n\t\t\t\t\t\t\t.get(Calendar.DAY_OF_MONTH))) {\n\t\t\t\tcountsPerDay += 1;\n\t\t\t}\n\t\t\tif ((currDate.get(Calendar.WEEK_OF_MONTH) - 1 <= clickerCountObject\n\t\t\t\t\t.getClickerTimestamps().get(i).get(Calendar.WEEK_OF_MONTH))\n\t\t\t\t\t&& (currDate.get(Calendar.WEEK_OF_MONTH) >= clickerCountObject\n\t\t\t\t\t\t\t.getClickerTimestamps().get(i)\n\t\t\t\t\t\t\t.get(Calendar.WEEK_OF_MONTH))) {\n\t\t\t\tcountsPerWeek += 1;\n\t\t\t}\n\t\t\tif ((currDate.get(Calendar.MONTH) - 1 <= clickerCountObject\n\t\t\t\t\t.getClickerTimestamps().get(i).get(Calendar.MONTH))\n\t\t\t\t\t&& (currDate.get(Calendar.MONTH) >= clickerCountObject\n\t\t\t\t\t\t\t.getClickerTimestamps().get(i).get(Calendar.MONTH))) {\n\t\t\t\tcountsPerMonth += 1;\n\t\t\t}\n\t\t}\n\t\tmyArrayString.add(\"Counts per Minute \"\n\t\t\t\t+ Integer.toString(countsPerMinute));\n\t\tmyArrayString.add(\"Counts per Hour \" + Integer.toString(countsPerHour));\n\t\tmyArrayString.add(\"Counts per Day \" + Integer.toString(countsPerDay));\n\t\tmyArrayString.add(\"Counts per Week \" + Integer.toString(countsPerWeek));\n\t\tmyArrayString.add(\"Counts per Month \"\n\t\t\t\t+ Integer.toString(countsPerMonth));\n\n\t\tSystem.out.println(myArrayString);\n\t\treturn myArrayString;\n\t}", "default int countExecutions(ZonedDateTime startDate, ZonedDateTime endDate) {\n return getExecutionDates(startDate, endDate).size();\n }", "public List<Period> getPeriods() throws PeriodNotFoundException;", "public void test697153() {\n TaskSeries s1 = new TaskSeries(\"S1\");\n s1.add(new Task(\"Task 1\", new SimpleTimePeriod(new Date(), new Date())));\n s1.add(new Task(\"Task 2\", new SimpleTimePeriod(new Date(), new Date())));\n s1.add(new Task(\"Task 3\", new SimpleTimePeriod(new Date(), new Date())));\n TaskSeries s2 = new TaskSeries(\"S2\");\n s2.add(new Task(\"Task 2\", new SimpleTimePeriod(new Date(), new Date())));\n s2.add(new Task(\"Task 3\", new SimpleTimePeriod(new Date(), new Date())));\n s2.add(new Task(\"Task 4\", new SimpleTimePeriod(new Date(), new Date())));\n TaskSeriesCollection tsc = new TaskSeriesCollection();\n tsc.add(s1);\n tsc.add(s2);\n s1.removeAll();\n int taskCount = tsc.getColumnCount();\n }", "private DateRange setDefaultTemporalSubset(DimensionDescriptor timeDimension, SimpleFeature f) {\n final String start = timeDimension.getStartAttribute();\n final String end = timeDimension.getEndAttribute();\n Date startTime = (Date) f.getAttribute(start);\n Date endTime = startTime;\n if (end != null) {\n endTime = (Date) f.getAttribute(end);\n }\n return new DateRange(startTime, endTime);\n }", "public static void main(String[] args) {\n\t\tDateTimeFormatter dateTimeFormatter = DateTimeFormat.forPattern(\"yyyy-MM-dd HH:mm:ss\");\n\t\tList<Interval> existingIntervals;\n\t\texistingIntervals = new ArrayList<Interval>();\n\t\t\n\t\texistingIntervals.add(new Interval(DateTime.parse(\"2016-06-13 08:00:00\", dateTimeFormatter), DateTime.parse(\"2016-06-13 10:00:00\", dateTimeFormatter)));\n\t\texistingIntervals.add(new Interval(DateTime.parse(\"2016-06-13 10:35:00\", dateTimeFormatter), DateTime.parse(\"2016-06-13 11:35:00\", dateTimeFormatter)));\n\t\texistingIntervals.add(new Interval(DateTime.parse(\"2016-06-13 12:00:00\", dateTimeFormatter), DateTime.parse(\"2016-06-13 14:00:00\", dateTimeFormatter)));\n\t\texistingIntervals.add(new Interval(DateTime.parse(\"2016-06-13 15:00:00\", dateTimeFormatter), DateTime.parse(\"2016-06-13 19:05:00\", dateTimeFormatter)));\n\t\t\n\t\tDateTimeGapFinder dateTimeGapFinder = new DateTimeGapFinder();\n\t\t// the search interval overshadows the extremities of existing intervals\n\t\tInterval bigSearch = new Interval(DateTime.parse(\"2016-06-13 10:00:00\", dateTimeFormatter), DateTime.parse(\"2016-06-13 12:00:00\", dateTimeFormatter));\n\t\t\n\t\tList<Interval> bigSearchResults = dateTimeGapFinder.findGaps(existingIntervals, bigSearch);\n\t\t\n\t\tSystem.out.println(bigSearchResults);\n\t\t\n\t}", "@Override\r\n\tpublic int[] getDayPeople() {\n\t\tint[] result = new int[7];\r\n\t\tDate date = DateUtil.getCurrentDate();\r\n\t\tresult[0] = cinemaConditionDao.getDayCount(date);\r\n\t\tfor(int i=0;i<6;i++){\r\n\t\t\tdate = DateUtil.getDayBefore(date);\r\n\t\t\tresult[i+1] = cinemaConditionDao.getDayCount(date);\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "public void initPeriodsSearch() {\n\n\t\t//init fundamentalFreq\n\t\tcalculatefundamentalFreq();\n\n\t\t//set the first search area\n\t\tfinal double confidenceLevel = 5 / 100.;\n\t\tnextPeriodSearchingAreaEnd = (int) Math.floor( hzToPeriod( fundamentalFreq ) * ( 1 + confidenceLevel ) );\n\t}", "public Collection<TimePeriod> getTimeSlots() {\n\t\treturn null;\n\t}", "private void appointmentReport() {\n Set<String> types = new HashSet<>();\n Set<Month> months = new HashSet<>();\n HashMap<String, Integer> numberByType = new HashMap<>();\n HashMap<Month, Integer> numberByMonth = new HashMap<>();\n\n for (Appointment appointment: Data.getAppointments()) {\n months.add(appointment.getStart().toLocalDateTime().getMonth());\n types.add(appointment.getType());\n }\n\n for (String type: types) {\n int count = 0;\n for (Appointment appointment: Data.getAppointments()) {\n\n if (type.equals(appointment.getType())) {\n count++;\n }\n numberByType.put(type, count);\n }\n }\n for (Month month: months) {\n int count = 0;\n for (Appointment appointment: Data.getAppointments()) {\n if (month.equals(appointment.getStart().toLocalDateTime().getMonth())) {\n count++;\n }\n numberByMonth.put(month, count);\n }\n }\n\n reportText.appendText(\"Report of the number of appointments by type:\\n\\n\");\n reportText.appendText(\"Count \\t\\tType\\n\");\n numberByType.forEach((k,v) -> reportText.appendText(v + \"\\t\\t\" + k + \"\\n\"));\n reportText.appendText(\"\\n\\n\\nReport of the number of appointments by Month:\\n\\n\");\n reportText.appendText(\"Count \\t\\tMonth\\n\");\n numberByMonth.forEach((k,v) -> reportText.appendText(v + \"\\t\\t\" + k + \"\\n\"));\n\n }", "private void getTimeConditions(List<RuleInstance> rules,Set<Condition> conds)\n{\n for (RuleInstance ri : rules) {\n getTimeConditions(ri,rules,conds);\n }\n}", "public double selPeriodo(int periodo, int estrato) {\n double perTasa = 0;\n if (periodo == 201611) {\n if (estrato == 1) {\n perTasa = tasaNov16_1;\n }\n if (estrato == 2) {\n perTasa = tasaNov16_2;\n }\n if (estrato == 3) {\n perTasa = tasaNov16_3;\n }\n if (estrato == 4) {\n perTasa = tasaNov16_4;\n }\n if (estrato == 5) {\n perTasa = tasaNov16_5;\n }\n if (estrato == 6) {\n perTasa = tasaNov16_6;\n }\n }\n if (periodo == 201610) {\n if (estrato == 1) {\n perTasa = tasaOct16_1;\n }\n if (estrato == 2) {\n perTasa = tasaOct16_2;\n }\n if (estrato == 3) {\n perTasa = tasaOct16_3;\n }\n if (estrato == 4) {\n perTasa = tasaOct16_4;\n }\n if (estrato == 5) {\n perTasa = tasaOct16_5;\n }\n if (estrato == 6) {\n perTasa = tasaOct16_6;\n }\n }\n if (periodo == 201609) {\n if (estrato == 1) {\n perTasa = tasaSep16_1;\n }\n if (estrato == 2) {\n perTasa = tasaSep16_2;\n }\n if (estrato == 3) {\n perTasa = tasaSep16_3;\n }\n if (estrato == 4) {\n perTasa = tasaSep16_4;\n }\n if (estrato == 5) {\n perTasa = tasaSep16_5;\n }\n if (estrato == 6) {\n perTasa = tasaSep16_6;\n }\n }\n if (periodo == 201608) {\n if (estrato == 1) {\n perTasa = tasaAgo16_1;\n }\n if (estrato == 2) {\n perTasa = tasaAgo16_2;\n }\n if (estrato == 3) {\n perTasa = tasaAgo16_3;\n }\n if (estrato == 4) {\n perTasa = tasaAgo16_4;\n }\n if (estrato == 5) {\n perTasa = tasaAgo16_5;\n }\n if (estrato == 6) {\n perTasa = tasaAgo16_6;\n }\n }\n if (periodo == 201607) {\n if (estrato == 1) {\n perTasa = tasaJul16_1;\n }\n if (estrato == 2) {\n perTasa = tasaJul16_2;\n }\n if (estrato == 3) {\n perTasa = tasaJul16_3;\n }\n if (estrato == 4) {\n perTasa = tasaJul16_4;\n }\n if (estrato == 5) {\n perTasa = tasaJul16_5;\n }\n if (estrato == 6) {\n perTasa = tasaJul16_6;\n }\n }\n if (periodo == 201606) {\n if (estrato == 1) {\n perTasa = tasaJun16_1;\n }\n if (estrato == 2) {\n perTasa = tasaJun16_2;\n }\n if (estrato == 3) {\n perTasa = tasaJun16_3;\n }\n if (estrato == 4) {\n perTasa = tasaJun16_4;\n }\n if (estrato == 5) {\n perTasa = tasaJun16_5;\n }\n if (estrato == 6) {\n perTasa = tasaJun16_6;\n }\n }\n if (periodo == 201605) {\n if (estrato == 1) {\n perTasa = tasaMay16_1;\n }\n if (estrato == 2) {\n perTasa = tasaMay16_2;\n }\n if (estrato == 3) {\n perTasa = tasaMay16_3;\n }\n if (estrato == 4) {\n perTasa = tasaMay16_4;\n }\n if (estrato == 5) {\n perTasa = tasaMay16_5;\n }\n if (estrato == 6) {\n perTasa = tasaMay16_6;\n }\n }\n if (periodo == 201604) {\n if (estrato == 1) {\n perTasa = tasaAbr16_1;\n }\n if (estrato == 2) {\n perTasa = tasaAbr16_2;\n }\n if (estrato == 3) {\n perTasa = tasaAbr16_3;\n }\n if (estrato == 4) {\n perTasa = tasaAbr16_4;\n }\n if (estrato == 5) {\n perTasa = tasaAbr16_5;\n }\n if (estrato == 6) {\n perTasa = tasaAbr16_6;\n }\n }\n if (periodo == 201603) {\n if (estrato == 1) {\n perTasa = tasaMar16_1;\n }\n if (estrato == 2) {\n perTasa = tasaMar16_2;\n }\n if (estrato == 3) {\n perTasa = tasaMar16_3;\n }\n if (estrato == 4) {\n perTasa = tasaMar16_4;\n }\n if (estrato == 5) {\n perTasa = tasaMar16_5;\n }\n if (estrato == 6) {\n perTasa = tasaMar16_6;\n }\n }\n if (periodo == 201602) {\n if (estrato == 1) {\n perTasa = tasaFeb16_1;\n }\n if (estrato == 2) {\n perTasa = tasaFeb16_2;\n }\n if (estrato == 3) {\n perTasa = tasaFeb16_3;\n }\n if (estrato == 4) {\n perTasa = tasaFeb16_4;\n }\n if (estrato == 5) {\n perTasa = tasaFeb16_5;\n }\n if (estrato == 6) {\n perTasa = tasaFeb16_6;\n }\n }\n if (periodo == 201601) {\n if (estrato == 1) {\n perTasa = tasaEne16_1;\n }\n if (estrato == 2) {\n perTasa = tasaEne16_2;\n }\n if (estrato == 3) {\n perTasa = tasaEne16_3;\n }\n if (estrato == 4) {\n perTasa = tasaEne16_4;\n }\n if (estrato == 5) {\n perTasa = tasaEne16_5;\n }\n if (estrato == 6) {\n perTasa = tasaEne16_6;\n }\n }\n if (periodo == 201512) {\n if (estrato == 1) {\n perTasa = tasaDic_1;\n }\n if (estrato == 2) {\n perTasa = tasaDic_2;\n }\n if (estrato == 3) {\n perTasa = tasaDic_3;\n }\n if (estrato == 4) {\n perTasa = tasaDic_4;\n }\n if (estrato == 5) {\n perTasa = tasaDic_5;\n }\n if (estrato == 6) {\n perTasa = tasaDic_6;\n }\n }\n if (periodo == 201511) {\n if (estrato == 1) {\n perTasa = tasaNov_1;\n }\n if (estrato == 2) {\n perTasa = tasaNov_2;\n }\n if (estrato == 3) {\n perTasa = tasaNov_3;\n }\n if (estrato == 4) {\n perTasa = tasaNov_4;\n }\n if (estrato == 5) {\n perTasa = tasaNov_5;\n }\n if (estrato == 6) {\n perTasa = tasaNov_6;\n }\n }\n if (periodo == 201510) {\n if (estrato == 1) {\n perTasa = tasaOct_1;\n }\n if (estrato == 2) {\n perTasa = tasaOct_2;\n }\n if (estrato == 3) {\n perTasa = tasaOct_3;\n }\n if (estrato == 4) {\n perTasa = tasaOct_4;\n }\n if (estrato == 5) {\n perTasa = tasaOct_5;\n }\n if (estrato == 6) {\n perTasa = tasaOct_6;\n }\n }\n if (periodo == 201509) {\n if (estrato == 1) {\n perTasa = tasaSep_1;\n }\n if (estrato == 2) {\n perTasa = tasaSep_2;\n }\n if (estrato == 3) {\n perTasa = tasaSep_3;\n }\n if (estrato == 4) {\n perTasa = tasaSep_4;\n }\n if (estrato == 5) {\n perTasa = tasaSep_5;\n }\n if (estrato == 6) {\n perTasa = tasaSep_6;\n }\n }\n if (periodo == 201508) {\n if (estrato == 1) {\n perTasa = tasaAgo_1;\n }\n if (estrato == 2) {\n perTasa = tasaAgo_2;\n }\n if (estrato == 3) {\n perTasa = tasaAgo_3;\n }\n if (estrato == 4) {\n perTasa = tasaAgo_4;\n }\n if (estrato == 5) {\n perTasa = tasaAgo_5;\n }\n if (estrato == 6) {\n perTasa = tasaAgo_6;\n }\n }\n if (periodo == 201507) {\n if (estrato == 1) {\n perTasa = tasaJul_1;\n }\n if (estrato == 2) {\n perTasa = tasaJul_2;\n }\n if (estrato == 3) {\n perTasa = tasaJul_3;\n }\n if (estrato == 4) {\n perTasa = tasaJul_4;\n }\n if (estrato == 5) {\n perTasa = tasaJul_5;\n }\n if (estrato == 6) {\n perTasa = tasaJul_6;\n }\n }\n if (periodo == 201506) {\n if (estrato == 1) {\n perTasa = tasaJun_1;\n }\n if (estrato == 2) {\n perTasa = tasaJun_2;\n }\n if (estrato == 3) {\n perTasa = tasaJun_3;\n }\n if (estrato == 4) {\n perTasa = tasaJun_4;\n }\n if (estrato == 5) {\n perTasa = tasaJun_5;\n }\n if (estrato == 6) {\n perTasa = tasaJun_6;\n }\n }\n if (periodo == 201505) {\n if (estrato == 1) {\n perTasa = tasaMay_1;\n }\n if (estrato == 2) {\n perTasa = tasaMay_2;\n }\n if (estrato == 3) {\n perTasa = tasaMay_3;\n }\n if (estrato == 4) {\n perTasa = tasaMay_4;\n }\n if (estrato == 5) {\n perTasa = tasaMay_5;\n }\n if (estrato == 6) {\n perTasa = tasaMay_6;\n }\n }\n if (periodo == 201504) {\n if (estrato == 1) {\n perTasa = tasaAbr_1;\n }\n if (estrato == 2) {\n perTasa = tasaAbr_2;\n }\n if (estrato == 3) {\n perTasa = tasaAbr_3;\n }\n if (estrato == 4) {\n perTasa = tasaAbr_4;\n }\n if (estrato == 5) {\n perTasa = tasaAbr_5;\n }\n if (estrato == 6) {\n perTasa = tasaAbr_6;\n }\n }\n return perTasa;\n }", "public TimePeriod getPeriod();", "int getAndConditionGroupsCount();", "public int getTravelGroupListCount(Map conditions);", "@SuppressWarnings(\"unchecked\")\n\t@Override\n\tpublic List<GuideStatisticDTO> getGuidesStatisticByPeriod(LocalDateTime start, LocalDateTime end) {\n\t\tStringBuilder query = new StringBuilder(\n\t\t\t\t\"SELECT XS.guide.firstName AS firstName, XS.guide.lastName AS lastName, COUNT(id) AS totalExcursions, \"\n\t\t\t\t\t\t+ \"SUM(XS.details.durationSec) AS excursionsTotalDuration \" + \"FROM Excursion AS XS \"\n\t\t\t\t\t\t+ \"WHERE (XS.start >= :startDate AND XS.end <= :endDate) GROUP BY XS.guide\");\n\t\tSystem.out.println(query.toString());\n\t\tQuery result = sessionFactory.getCurrentSession().createQuery(query.toString());\n\t\tresult.setTimestamp(\"startDate\", Timestamp.valueOf(start));\n\t\tresult.setTimestamp(\"endDate\", Timestamp.valueOf(end));\n\t\tList<GuideStatisticDTO> returnResult = new ArrayList<GuideStatisticDTO>();\n\t\tfor (Object[] obj : (List<Object[]>) result.list()) {\n\t\t\tGuideStatisticDTO listElement = new GuideStatisticDTO();\n\t\t\tlistElement.setFirstName(String.valueOf(obj[0]));\n\t\t\tlistElement.setLastName(String.valueOf(obj[1]));\n\t\t\tlistElement.setTotalExcursions((long) obj[2]);\n\t\t\tlistElement.setExcursionsTotalDuration(LocalTime.MIN.plusSeconds((long) obj[3]));\n\t\t\treturnResult.add(listElement);\n\n\t\t}\n\n\t\treturn returnResult;\n\t\t// return result.list();\n\t}", "public static Map<String, Long> countActivitiesWholePeriod(List<MonitoredData> data){\n ArrayList<String> activities = new ArrayList<>();\n for(int i=0; i<data.size(); i++){\n activities.add(data.get(i).getActivity());\n }\n Map<String, Long> counts =\n activities.stream().collect(Collectors.groupingBy(e -> e, Collectors.counting()));\n return counts;\n }", "public int getHits(int timestamp) {\n while(q.size() > 0 && timestamp - q.peek() >= PERIOD){\n q.poll();\n }\n\n return q.size();\n }", "private void setUp() {\r\n Calendar calendar1 = Calendar.getInstance();\r\n calendar1.set((endDate.get(Calendar.YEAR)), \r\n (endDate.get(Calendar.MONTH)), (endDate.get(Calendar.DAY_OF_MONTH)));\r\n calendar1.roll(Calendar.DAY_OF_YEAR, -6);\r\n \r\n Calendar calendar2 = Calendar.getInstance();\r\n calendar2.set((endDate.get(Calendar.YEAR)), \r\n (endDate.get(Calendar.MONTH)), (endDate.get(Calendar.DAY_OF_MONTH)));\r\n \r\n acceptedDatesRange[0] = calendar1.get(Calendar.DAY_OF_YEAR);\r\n acceptedDatesRange[1] = calendar2.get(Calendar.DAY_OF_YEAR); \r\n \r\n if(acceptedDatesRange[1] < 7) {\r\n acceptedDatesRange[0] = 1; \r\n }\r\n \r\n //MiscStuff.writeToLog(\"Ranges set \" + calendar1.get\r\n // (Calendar.DAY_OF_YEAR) + \" \" + calendar2.get(Calendar.DAY_OF_YEAR));\r\n }", "public int getPeriod() {\n return period;\n }", "public List<Object[]> getNumFailuresAndDurationByDate(Date startDate, Date endDate) {\n\t\tQuery query = em.createQuery(\"select imsi, count(c), sum(duration) from BaseData c where c.date_time >= :sDate AND c.date_time <= :eDate group by imsi\");\n\t\tquery.setParameter(\"sDate\",startDate);\n\t\tquery.setParameter(\"eDate\", endDate);\n\t\treturn (List<Object[]>)query.getResultList();\n\t}", "public int getPeriod()\r\n\t{\r\n\t\treturn period;\r\n\t}", "@Override\n\tpublic List<String> countDate() {\n\t\treturn controlA.countDate();\n\t}", "@Test\r\n public void testReflexivityOverlappingTimePeriods(){\n DateTime startAvailability1 = new DateTime(2021, 7, 9, 10, 30);\r\n DateTime endAvailability1 = new DateTime(2021, 7, 9, 11, 30);\r\n DateTime startAvailability2 = new DateTime(2021, 7, 9, 11, 0);\r\n DateTime endAvailability2 = new DateTime(2021, 7, 9, 12, 0);\r\n Availability availability1 = new Availability(new HashSet<>(Arrays.asList(\"online\", \"in-person\")), startAvailability1, endAvailability1);\r\n Availability availability2 = new Availability(new HashSet<>(Arrays.asList(\"online\", \"in-person\")), startAvailability2, endAvailability2);\r\n assertTrue(availability1.overlapsWithTimePeriod(availability2));\r\n assertTrue(availability2.overlapsWithTimePeriod(availability1));\r\n }", "public static void main(String[] args) {\n DataFactory df = new DataFactory();\n Date minDate = df.getDate(2000, 1, 1);\n Date maxDate = new Date();\n \n for (int i = 0; i <=1400; i++) {\n Date start = df.getDateBetween(minDate, maxDate);\n Date end = df.getDateBetween(start, maxDate);\n System.out.println(\"Date range = \" + dateToString(start) + \" to \" + dateToString(end));\n }\n\n}", "@Test\n void calculatePeriodRangeBelow350() throws ParseException {\n LocalDate testDateStart = LocalDate.parse(\"2016-08-03\");\n LocalDate testDateEnd = LocalDate.parse(\"2017-02-16\");\n Map<String, String> periodMap = datesHelper.calculatePeriodRange(testDateStart, testDateEnd, false);\n assertEquals(\"6 months\", periodMap.get(PERIOD_START));\n assertEquals(\"16 February 2017\", periodMap.get(PERIOD_END));\n }", "public TimePeriod notWorking(TimePeriod period);", "@Test\n public void lab6() {\n StudentService ss = new StudentService();\n Utils.fillStudents(ss);\n\n List<Student> students = ss.getAllStudents();\n\n long count = students.stream()\n .filter(s -> s.getDob().until(LocalDate.now(), ChronoUnit.YEARS) > 20)\n .collect(counting());\n\n }", "public long getSamplingPeriod();", "public void setPeriod(int period) {\n this.period = period;\n }", "public Collection<TimeRange> query(Collection<Event> events, MeetingRequest request) {\n if(request.getAttendees().isEmpty()){\n return Arrays.asList(TimeRange.WHOLE_DAY);\n }\n // nobody has time to meet for more than a day\n if(request.getDuration() > TimeRange.WHOLE_DAY.duration()){\n return Arrays.asList();\n }\n // if there're no already existing events, whole day is available, \n if(events.isEmpty()){\n return Arrays.asList(TimeRange.WHOLE_DAY);\n }\n\n Collection<String> listOfAttendees = request.getAttendees();\n List<TimeRange> unavailableTimes = getUnavailableTimesForAttendees(events, listOfAttendees);\n\n return getAvailableTimes(unavailableTimes, request.getDuration());\n }", "public void GetAvailableDates()\n\t{\n\t\topenDates = new ArrayList<TimePeriod>(); \n\t\t\n\t\ttry\n\t\t{\n\t\t\tConnector con = new Connector();\n\t\t\t\n\t\t\tString query = \"SELECT startDate, endDate FROM Available WHERE available_hid = '\"+hid+\"'\"; \n\t\t\tResultSet rs = con.stmt.executeQuery(query);\n\t\t\t\n\t\t\twhile(rs.next())\n\t\t\t{\n\t\t\t\tTimePeriod tp = new TimePeriod(); \n\t\t\t\ttp.stringStart = rs.getString(\"startDate\"); \n\t\t\t\ttp.stringEnd = rs.getString(\"endDate\"); \n\t\t\t\ttp.StringToDate();\n\t\t\t\t\n\t\t\t\topenDates.add(tp); \n\t\t\t}\n\t\t\tcon.closeConnection(); \n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t}", "@Query(\"SELECT id, measured_at FROM measurements WHERE measured_at >= :startDate AND measured_at < :endDate\")\n @TypeConverters({DateConverter.class})\n List<MeasurementEvent> findForPeriodTest(Date startDate, Date endDate);", "@Override\n\tpublic long getTimePeriod() {\n\t\treturn 0;\n\t}", "org.hl7.fhir.Period getAppliesPeriod();", "private int count_events(List<Integer> events, int start_ts) {\n int l = 0, r = events.size() - 1;\n if (r == -1)\n return 0;\n if (events.get(r) < start_ts)\n return 0;\n int b = 0;\n while (l + 1 < r) {\n int mid = (l+r) / 2;\n if (events.get(mid) >= start_ts) {\n r = mid;\n } else {\n l = mid;\n }\n }\n if (events.get(r) >= start_ts) {\n b = r;\n }\n if (events.get(l) >= start_ts) {\n b = l;\n }\n int cnt = events.size() - 1 - b + 1;\n // System.out.println(cnt);\n return cnt;\n\t\t}", "public long period() throws TimeWindowException {\n return div();\n }", "private Set<Integer> filterSelectionUnit() {\n singlefilter = false;\n Map<Integer, Integer> dsCounter = new HashMap<>();\n int counter = 0;\n for (DatasetPieChartFilter filter : filtersSet.values()) {\n if (filter.isActiveFilter()) {\n counter++;\n }\n\n filter.getSelectedDsIds().stream().map((id) -> {\n if (!dsCounter.containsKey(id)) {\n dsCounter.put(id, 0);\n }\n return id;\n }).forEach((id) -> {\n dsCounter.put(id, dsCounter.get(id) + 1);\n });\n\n }\n Set<Integer> finalSelectionIds = new HashSet<>();\n dsCounter.keySet().stream().filter((dsId) -> (dsCounter.get(dsId) == 6)).forEach((dsId) -> {\n finalSelectionIds.add(dsId);\n });\n if (counter == 1) {\n singlefilter = true;\n }\n\n return finalSelectionIds;\n\n }", "public void period() {\n\t\tPeriod annually = Period.ofYears(1);\n\t\tPeriod quarterly = Period.ofMonths(3);\n\t\tPeriod everyThreeWeeks = Period.ofWeeks(3);\n\t\tPeriod everyOtherDay = Period.ofDays(2);\n\t\tPeriod everyYearAndAWeek = Period.of(1, 0, 7);\n\t\tLocalDate date = LocalDate.of(2014, Month.JANUARY, 20);\n\t\tdate = date.plus(annually);\n\t\tSystem.out.println(date);\n\t\tSystem.out.println(Period.of(0, 20, 47)); // P20M47D\n\t\tSystem.out.println(Period.of(2, 20, 47)); // P2Y20M47D\n\t}", "public static void main(String arg[]) throws InterruptedException, ParseException {\n\t\tInstant now = Instant.now();\r\n\t\tThread.sleep(1000);\r\n\t\tInstant end = Instant.now();\r\n\t\t\r\n\t\tDuration timeElapse = Duration.between(now,end);\r\n\t\t\r\n\t\tSystem.out.println(now);\r\n\t\t\r\n\t\tSystem.out.println(\"Nanos \"+timeElapse.toNanos());\r\n\t\t\r\n\t\tLocalDate startDate = LocalDate.of(2018,8,15);\r\n\t\tLocalDate endDate = LocalDate.now();\r\n\t\t\r\n\t\tSystem.out.println(endDate);\r\n\t\t\r\n\t\tPeriod period = startDate.until(endDate);\r\n\t\t\r\n\t\tSystem.out.println(\"Days \"+period.getDays());\r\n\t\t\r\n\t\tLocalTime lt = LocalTime.now();\r\n\t\t\r\n\t\tSystem.out.println(lt);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}", "@Test\n void calculatePeriodRangeOver2Years() throws ParseException {\n LocalDate testDateStart = LocalDate.parse(\"2013-03-07\");\n LocalDate testDateEnd = LocalDate.parse(\"2017-12-17\");\n Map<String, String> periodMap = datesHelper.calculatePeriodRange(testDateStart, testDateEnd, false);\n assertEquals(\"57 months\", periodMap.get(PERIOD_START));\n assertEquals(\"17 December 2017\", periodMap.get(PERIOD_END));\n }", "public ArrayList<ApplianceTimedEvent> generateRepeatedUsagePeriod(int startTime, int day, int addDays, int span, Time interval){\n\n ArrayList<ApplianceTimedEvent> hours = new ArrayList<ApplianceTimedEvent>();\n \n Time start = new Time(startTime, day);\n Time currentTime = universe.getUniverseTime();\n /*BUG FIX by Darius... The generated time was in the past so we need to make sure\n the new TimedEvent is in the future. I have added this code to adjust it therefore.*/\n if(start.compare(currentTime) < 0){\n\n start = new Time(start.getCurrentHour(), start.getCurrentDay());\n if(start.compare(currentTime) < 0) start = start.advanceTime(new Time(0,0,1,0,0));\n }\n\n //determine end time\n Time end = start.clone();\n\n end = end.advanceTime(new Time(span,0,0,0,0));\n \n //Create timed event to represent usage period\n ApplianceTimedEvent ate = new ApplianceTimedEvent(this,\n start,\n end,\n new ApplianceUseCommand(this),\n interval);\n //add event to list\n hours.add(ate); \n \n // Adds an identical timed event to the Arraylist\n //for every additional day specified.\n //Adds for a maximum of 6 additional days --> 7 days in a week.\n for(int i = 0; i<addDays && i<6; i++){\n //advance start and end times by one day\n start = start.advanceTime(new Time(0,1,0,0,0));\n end = end.advanceTime(new Time(0,1,0,0,0));\n //create identical timed event with start/end times advanced by one day.\n ate = new ApplianceTimedEvent(this,\n start,\n end,\n new ApplianceUseCommand(this),\n interval);\n //add to list\n hours.add(ate); \n }\n\n return hours;\n }", "public int getTimePeriod() {\n return timePeriod;\n }", "public java.util.List<org.drip.analytics.cashflow.CompositePeriod> periods()\n\t{\n\t\treturn _lsPeriod;\n\t}", "public static int countDays(List<MonitoredData> data){\n System.out.println(\"3) How many times has appeared each activity for each day: \");\n long result = 0;\n ArrayList<String> days = new ArrayList<>();\n ArrayList<MonitoredData> dataTrunc = new ArrayList<>();\n for (int i=0; i<data.size(); i++){\n String day = \"\";\n day += data.get(i).getStartTime().charAt(8);\n day += data.get(i).getStartTime().charAt(9);\n days.add(day);\n }\n for (int i=0; i<data.size(); i++){\n dataTrunc.add(data.get(i));\n if (i<days.size()-1){\n if (!days.get(i+1).equals(days.get(i))){\n System.out.println(\" Day \" + days.get(i) + \" ::: \" + countActivitiesWholePeriod(dataTrunc));\n dataTrunc.clear();\n }\n }else{\n System.out.println(\" Day \" + days.get(i) + \" ::: \" + countActivitiesWholePeriod(dataTrunc));\n }\n }\n Stream<String> daysStream = days.stream();\n result = daysStream\n .distinct()\n .count();\n return (int)result;\n }", "public void setPeriod(int periodInYears) {\nnumberOfPayments = periodInYears * MONTHS;\n}", "private int getNumberOfEventsByMinuteOrHour(boolean isByMinute) {\n int counter = 0;\n long currentTimeSeconds = getCurrentTimeInSeconds();\n long currentTimeIndex = (currentTimeSeconds - startTime) % SECONDS_IN_DAY;\n int timePeriod = isByMinute ? SECONDS_IN_MINUTE : SECONDS_IN_HOUR;\n\n if (currentTimeIndex + 1 - timePeriod >= 0) {\n for (int i = (int) currentTimeIndex; i > currentTimeIndex - timePeriod; i--) {\n synchronized (records[i]) {\n if (currentTimeSeconds - records[i].getLastTimeReset() < SECONDS_IN_DAY) {\n counter += records[i].getCount();\n }\n }\n }\n } else {\n for (int i = (int) currentTimeIndex; i >= 0; i--) {\n synchronized (records[i]) {\n if (currentTimeSeconds - records[i].getLastTimeReset() < SECONDS_IN_DAY) {\n counter += records[i].getCount();\n }\n }\n }\n\n for (int i = records.length - 1; i > records.length + currentTimeIndex - timePeriod; i--) {\n synchronized (records[i]) {\n if (currentTimeSeconds - records[i].getLastTimeReset() < SECONDS_IN_DAY) {\n counter += records[i].getCount();\n }\n }\n }\n }\n\n return counter;\n }", "public int periodCount() {\n\t\treturn message.getPeriodCount();\n\t}", "public void menuprecoperiodo(String username) {\n Scanner s=new Scanner(System.in);\n LogTransportadora t=b_dados.getTrasnportadoras().get(username);\n double count=0;\n try {\n ArrayList<Historico> hist = b_dados.buscaHistoricoTransportadora(t.getCodEmpresa());\n System.out.println(\"Indique o ano:\");\n int ano=s.nextInt();\n System.out.println(\"Indique o mês\");\n int mes=s.nextInt();\n System.out.println(\"Indique o dia\");\n int dia=s.nextInt();\n for(Historico h: hist){\n LocalDateTime date=h.getDate();\n if(date.getYear()==ano && date.getMonthValue()==mes && date.getDayOfMonth()==dia){\n count+=h.getKmspercorridos()*t.getPrecokm();\n }\n }\n System.out.println(\"O total fatorado nesse dia foi de \" + count +\"€\");\n }\n catch (TransportadoraNaoExisteException e){\n System.out.println(e.getMessage());\n }\n }", "@Override\r\n\tpublic int[] getMonthPeople() {\n\t\tint[] result = new int[12];\r\n\t\tDate date = DateUtil.getCurrentDate();\r\n\t\tDate dateStart = DateUtil.getFirstDay(date);\r\n\t\tDate dateEnd = DateUtil.getLastDay(date);\r\n\t\tresult[0] = cinemaConditionDao.getCount(dateStart, dateEnd);\r\n\t\tfor(int i=0;i<11;i++){\r\n\t\t\tdate = DateUtil.getMonthBefroe(dateStart);\r\n\t\t\tdateStart = DateUtil.getFirstDay(date);\r\n\t\t\tdateEnd = DateUtil.getLastDay(date);\r\n\t\t\tresult[i+1] = cinemaConditionDao.getCount(dateStart, dateEnd);\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "List<Book> getBooksFromPeriod(LocalDate from,LocalDate to);", "public static Reservation[] getFromPeriod(Period period) {\r\n \t\t// Set the condition\r\n\t\tString condition = \"period.startTime >= \" + period.start.getTime() + \r\n \t\t\t\t\t \t\t\" AND period.endTime <= \" + period.end.getTime();\r\n \t\t\r\n \t\t// Execute the query\r\n \t\tResultSet result = model.get(\"reservation\", condition, \"period\", \"reservation.period\", \"period.id\");\r\n \r\n \t\t// Examine if the result has any content\r\n \t\tif (getFirstRowInResultSet(result)) {\r\n \t\t\t// Retrieve the results\r\n \t\t\ttry {\r\n \t\t\t\tresult.last();\r\n \t\t\t\tReservation[] arr = new Reservation[result.getRow()];\r\n \t\t\t\tresult.beforeFirst();\r\n \t\t\t\twhile (result.next()) {\r\n \t\t\t\t\tint id \t\t\t = result.getInt(1);\r\n \t\t\t\t\tSystem.out.println(result.getString(\"startTime\"));\r\n \t\t\t\t\t//arr[result.getRow() - 1] = new Reservation(id, customer, period, vehicle);\r\n \t\t\t\t}\r\n \t\t\t\t\r\n \t\t\t\t// Return\r\n \t\t\t\treturn arr;\r\n \t\t\t} catch (SQLException e) {\r\n \t\t\t\tLog.error(\"Unable to retrieve data from result: \" + e);\r\n \t\t\t}\r\n \t\t} else {\r\n \t\t\tLog.info(\"Query for Reservation with condition returned empty.\");\r\n \t\t}\r\n \t\t\r\n \t\t// Return failure.\r\n \t\treturn null;\r\n \t}", "private List<TweetPoll> getTotalTweetPollUsageByHashTagAndDateRange(\n \t\t\tfinal String tagName, final Integer period) {\n \t\tList<TweetPoll> tweetPollsByHashTag = new ArrayList<TweetPoll>();\n \t\t// Gets the tweetpolls by hashtag\n \t\ttweetPollsByHashTag = getTweetPollDao()\n \t\t\t\t.getTweetPollsbyHashTagNameAndDateRange(tagName, period);\n \t\t// Gets the stats detail of hashtags by tweetpoll.\n \t\treturn tweetPollsByHashTag;\n \t}", "void getCurrentPeriodo();", "public Collection<TimePeriod> getEmptyTimeSlots() {\n\t\treturn null;\n\t}", "int getAndSequenceGroupsCount();", "public int getHits(int timestamp) {\n while(q.size() > 0 && timestamp - q.peek() >= PERIOD){\n int key = q.poll();\n hits = hits - map.get(key);\n map.remove(key);\n }\n\n return hits;\n }", "private TaskSeriesCollection createCollection3() {\n Task sub1 = new Task(\"Sub1\", new Date(11), new Date(111));\n Task sub2 = new Task(\"Sub2\", new Date(22), new Date(222));\n Task sub3 = new Task(\"Sub3\", new Date(33), new Date(333));\n Task sub4 = new Task(\"Sub4\", new Date(44), new Date(444));\n Task sub5 = new Task(\"Sub5\", new Date(55), new Date(555));\n Task sub6 = new Task(\"Sub6\", new Date(66), new Date(666));\n sub1.setPercentComplete(0.111);\n sub2.setPercentComplete(0.222);\n sub3.setPercentComplete(0.333);\n sub4.setPercentComplete(0.444);\n sub5.setPercentComplete(0.555);\n sub6.setPercentComplete(0.666);\n TaskSeries seriesA = new TaskSeries(\"Series A\");\n Task taskA1 = new Task(\"Task 1\", new SimpleTimePeriod(new Date(100), new Date(200)));\n taskA1.setPercentComplete(0.1);\n taskA1.addSubtask(sub1);\n Task taskA2 = new Task(\"Task 2\", new SimpleTimePeriod(new Date(220), new Date(350)));\n taskA2.setPercentComplete(0.2);\n taskA2.addSubtask(sub2);\n taskA2.addSubtask(sub3);\n seriesA.add(taskA1);\n seriesA.add(taskA2);\n TaskSeries seriesB = new TaskSeries(\"Series B\");\n Task taskB2 = new Task(\"Task 2\", new SimpleTimePeriod(new Date(2220), new Date(3350)));\n taskB2.setPercentComplete(0.3);\n taskB2.addSubtask(sub4);\n taskB2.addSubtask(sub5);\n taskB2.addSubtask(sub6);\n seriesB.add(taskB2);\n TaskSeriesCollection tsc = new TaskSeriesCollection();\n tsc.add(seriesA);\n tsc.add(seriesB);\n return tsc;\n }", "int getStagesCount();", "BigInteger getPeriod();", "public static void main(String[] args) throws ParseException {\n String beginWorkDate = \"8:00:00\";//上班时间\n String endWorkDate = \"12:00:00\";//下班时间\n SimpleDateFormat sdf = new SimpleDateFormat(TimeUtil.DF_ZH_HMS);\n long a = TimeUtil.countMinutes(sdf.parse(beginWorkDate),sdf.parse(endWorkDate));\n System.out.println(a/30);\n\n String beginRestDate = \"8:30:00\";//休息时间\n String endRestDate = \"9:00:00\";\n long e = TimeUtil.countMinutes(sdf.parse(beginWorkDate),sdf.parse(beginRestDate));\n long f = TimeUtil.countMinutes(sdf.parse(beginWorkDate),sdf.parse(endRestDate));\n\n String beginVactionDate = \"10:00:00\";//请假时间\n String endVactionDate = \"11:00:00\";\n long b= TimeUtil.countMinutes(sdf.parse(beginWorkDate),sdf.parse(beginVactionDate));\n long c= TimeUtil.countMinutes(sdf.parse(beginWorkDate),sdf.parse(endVactionDate));\n\n String time = \"9:00:00\";//被别人预约的\n long d = TimeUtil.countMinutes(sdf.parse(beginWorkDate),sdf.parse(time));\n List<Integer> num = new ArrayList<>();\n num.add((int) (d/30));\n\n String myTime = \"11:30:00\";//我约的\n long g = TimeUtil.countMinutes(sdf.parse(beginWorkDate),sdf.parse(myTime));\n List<Integer> mynum = new ArrayList<>();\n mynum.add((int) (g/30));\n\n\n List<Date> yes = new ArrayList<>();//能约\n List<Date> no = new ArrayList<>();//不能约\n List<Date> my = new ArrayList<>();//我约的\n for (int i = 0; i < a/30; i ++) {\n Date times = TimeUtil.movDateForMinute(sdf.parse(beginWorkDate), i * 30);\n System.out.println(sdf.format(times));\n yes.add(times);\n if ((i >= e / 30 && i < f / 30) || (i >= b / 30 && i < c / 30)) {\n //休息时间,请假时间\n no.add(times);\n yes.remove(times);\n continue;\n }\n for (Integer n : num) {\n if (i == n) {\n //被预约时间\n no.add(times);\n yes.remove(times);\n }\n }\n for (Integer n : mynum) {\n if (i == n) {\n //被预约时间\n my.add(times);\n }\n }\n }\n }", "int getTimeInstants();", "@Test\n public void ratingAtSameTimeAsStartIsReturned() {\n LocalDateTime firstTime = LocalDateTime.of(2017, Month.JANUARY, 1, 0, 0);\n\n TimePeriod tp = new TimePeriod(firstTime, firstTime.plusHours(4));\n ScoreTime r1 = new ScoreTime(firstTime, 3);\n ScoreTime r2 = new ScoreTime(firstTime.plusHours(3), 3);\n\n List<ScoreTime> returnedList = getRatingsBetweenAndSometimesOneBefore(tp, Arrays.asList(r1, r2));\n assertEquals(2, returnedList.size());\n assertEquals(r1.getTime(), returnedList.get(0).getTime());\n assertEquals(r2.getTime(), returnedList.get(1).getTime());\n }", "int countPowertypeRanges();", "public void testGetSeriesCount() {\n TaskSeriesCollection c = createCollection1();\n }", "public DataElementChartResult generateChartDataOrgGroupPeriodWise( List<Date> selStartPeriodList,\n List<Date> selEndPeriodList, List<String> periodNames, List<DataElement> dataElementList,\n List<DataElementCategoryOptionCombo> decocList, List<OrganisationUnit> selOUGroupMemberList )\n throws Exception\n {\n DataElementChartResult dataElementChartResult;\n\n String[] series = new String[dataElementList.size()];\n String[] categories = new String[selStartPeriodList.size()];\n Double[][] data = new Double[dataElementList.size()][selStartPeriodList.size()];\n String chartTitle = \"OrganisationUnit : \" + selectedOrgUnit.getShortName() + \"( Group- \"\n + selOrgUnitGroup.getName() + \" )\";\n String xAxis_Title = \"Time Line\";\n String yAxis_Title = \"Value\";\n\n int serviceCount = 0;\n\n for ( DataElement dataElement : dataElementList )\n {\n DataElementCategoryOptionCombo decoc;\n DataElementCategoryCombo dataElementCategoryCombo = dataElement.getCategoryCombo();\n List<DataElementCategoryOptionCombo> optionCombos = new ArrayList<DataElementCategoryOptionCombo>(\n dataElementCategoryCombo.getOptionCombos() );\n\n if ( deSelection.equalsIgnoreCase( OPTIONCOMBO ) )\n {\n decoc = decocList.get( serviceCount );\n series[serviceCount] = dataElement.getName() + \" : \" + decoc.getName();\n yseriesList.add( dataElement.getName() + \" : \" + decoc.getName() );\n }\n else\n {\n decoc = dataElementCategoryService.getDefaultDataElementCategoryOptionCombo();\n series[serviceCount] = dataElement.getName();\n yseriesList.add( dataElement.getName() );\n }\n\n int periodCount = 0;\n for ( Date startDate : selStartPeriodList )\n {\n Date endDate = selEndPeriodList.get( periodCount );\n categories[periodCount] = periodNames.get( periodCount );\n Double aggDataValue = 0.0;\n\n String tempStartDate = format.formatDate( startDate );\n String tempEndDate = format.formatDate( endDate );\n String drillDownPeriodName = periodNames.get( periodCount );\n\n Collection<Period> periods = periodService.getPeriodsBetweenDates( startDate, endDate );\n String drillDownData = selectedOrgUnit.getId() + \":\" + selOrgUnitGroup.getId() + \":\"\n + dataElement.getId() + \":\" + decoc.getId() + \":\" + periodTypeLB + \":\" + tempStartDate + \":\"\n + tempEndDate + \":\" + drillDownPeriodName + \":\" + deSelection + \":\" + aggChecked;\n selectedDrillDownData.add( drillDownData );\n\n int orgGroupCount = 0;\n for ( OrganisationUnit orgUnit : selOUGroupMemberList )\n {\n \n if ( deSelection.equalsIgnoreCase( OPTIONCOMBO ) )\n {\n if ( aggDataCB != null )\n {\n Double tempAggDataValue = aggregationService.getAggregatedDataValue( dataElement, decoc,\n startDate, endDate, orgUnit );\n if ( tempAggDataValue != null )\n aggDataValue += tempAggDataValue;\n }\n else\n {\n for ( Period period : periods )\n {\n DataValue dataValue = dataValueService.getDataValue( orgUnit, dataElement, period,\n decoc );\n try\n {\n aggDataValue += Double.parseDouble( dataValue.getValue() );\n }\n catch ( Exception e )\n {\n }\n }\n }\n }\n else\n {\n Iterator<DataElementCategoryOptionCombo> optionComboIterator = optionCombos.iterator();\n while ( optionComboIterator.hasNext() )\n {\n DataElementCategoryOptionCombo decoc1 = (DataElementCategoryOptionCombo) optionComboIterator\n .next();\n\n if ( aggDataCB != null )\n {\n Double tempAggDataValue = aggregationService.getAggregatedDataValue( dataElement, decoc1,\n startDate, endDate, orgUnit );\n if ( tempAggDataValue != null )\n aggDataValue += tempAggDataValue;\n }\n else\n {\n for ( Period period : periods )\n {\n DataValue dataValue = dataValueService.getDataValue( orgUnit, dataElement, period,\n decoc1 );\n try\n {\n aggDataValue += Double.parseDouble( dataValue.getValue() );\n }\n catch ( Exception e )\n {\n }\n }\n }\n }\n }\n orgGroupCount++;\n }\n\n data[serviceCount][periodCount] = aggDataValue;\n\n if ( dataElement.getType().equalsIgnoreCase( DataElement.VALUE_TYPE_INT ) )\n {\n if ( dataElement.getNumberType().equalsIgnoreCase( DataElement.VALUE_TYPE_INT ) )\n {\n data[serviceCount][periodCount] = Math.round( data[serviceCount][periodCount]\n * Math.pow( 10, 0 ) )\n / Math.pow( 10, 0 );\n }\n else\n {\n data[serviceCount][periodCount] = Math.round( data[serviceCount][periodCount]\n * Math.pow( 10, 1 ) )\n / Math.pow( 10, 1 );\n }\n }\n periodCount++;\n }\n\n serviceCount++;\n }\n\n dataElementChartResult = new DataElementChartResult( series, categories, data, chartTitle, xAxis_Title,\n yAxis_Title );\n\n return dataElementChartResult;\n\n }", "public static void main(String[] args) {\n\n\t\tInterval i1 = new Interval(5, 24);\n\t\tInterval i2 = new Interval(15, 25);\n\t\tInterval i3 = new Interval(27, 40);\n\t\tInterval i4 = new Interval(50, 60);\n\n\t\tInterval[] intervals = { i1, i2, i3, i4 };\n\n\t\t// Problem 2 : Given an array of meetings time intervals consisting of start and\n\t\t// end times. Determine number of conference rooms required.\n\t\tint numMeetings = minMeetingRooms(intervals);\n\t\tSystem.out.println(numMeetings);\n\n\t}", "long getUnjoinedEventsCount();", "Map<StateT, Map<ConditionT, Long>> getNumExecutions();", "ManageableHistoricalTimeSeriesInfo select(Collection<ManageableHistoricalTimeSeriesInfo> candidates, String selectionKey);", "public Indicator[] getIndicatorForPeriod(int start, int end)\n {\n int index = 0;\n int validStart = indicators[0].getYear();\n int validEnd = indicators[indicators.length - 1].getYear();\n int oldStart = start, oldEnd = end;\n int startIndex = start - validStart;\n int counter = 0;\n\n if (start > end || (start < validStart && end < validStart) || (start > validEnd && end > validEnd))\n {\n throw new IllegalArgumentException(\"Invalid request of start and end year \" + start + \", \" + end +\n \". Valid period for \" + name + \" is \" + validStart + \" to \" + validEnd);\n }\n\n boolean changed = false;\n if (start < indicators[0].getYear())\n {\n changed = true;\n start = indicators[0].getYear();\n }\n\n if (end > indicators[indicators.length - 1].getYear())\n {\n changed = true;\n end = indicators[indicators.length - 1].getYear();\n }\n\n if (changed)\n {\n System.out.println(\"Invalid request of start and end year \" + oldStart + \",\" + oldEnd +\n \". Using valid subperiod for \" + name + \" is \" + start + \" to \" + end);\n }\n\n int numberOfYears = (end - start)+1;\n Indicator[] outputArray = new Indicator[numberOfYears];\n\n for (int i = startIndex; i < numberOfYears; i++)\n {\n outputArray[counter] = indicators[i];\n counter++;\n }\n return outputArray;\n }", "public void pollTest(int count, String region) {\r\n Date d = new Date();\r\n System.out.println(d.toString() + \" // \" + count + \" second interval // \" + region);\r\n }", "public int getTimePeriod()\n\t{\n\t\treturn timePeriod;\n\t}", "List<VarRatio> selectAll();", "@Override\n public void addPeriodicInterest()\n {\n elapsedPeriods++; \n super.addPeriodicInterest();\n System.out.println(elapsedPeriods);\n }", "public int[] computeAvailabilities(Building selected, Calendar selectedDate, Calendar now) {\n if (selected == null) {\n return null;\n }\n int day = selectedDate.get(Calendar.DAY_OF_WEEK);\n //some modulo shenanigans because weekDays[0] is monday but Calendar doesn't have the same\n day = day + 5;\n day = day % 7;\n Weekdays openingHoursWeek = new Weekdays(selected.getOpeningHours());\n String openingHoursDay = openingHoursWeek.getWeekdays().get(day);\n //if closed\n if (openingHoursDay.equals(Weekdays.CLOSED)) {\n return null;\n }\n int nowDay = now.get(Calendar.DAY_OF_WEEK);\n int nowMonth = now.get(Calendar.DAY_OF_MONTH);\n int dayClean = selectedDate.get(Calendar.DAY_OF_WEEK);\n int month = selectedDate.get(Calendar.DAY_OF_MONTH);\n int hours = now.get(Calendar.HOUR_OF_DAY);\n int minutes = now.get(Calendar.MINUTE);\n if (minutes != 0) {\n hours++;\n }\n String begin = openingHoursDay.split(\"-\")[0];\n String end = openingHoursDay.split(\"-\")[1];\n int beginTime = Integer.parseInt(begin.split(\":\")[0]);\n int endTime = Integer.parseInt(end.split(\":\")[0]);\n int[] res = new int[2];\n if (nowDay == dayClean\n && nowMonth == month && hours > beginTime) {\n beginTime = hours;\n }\n res[0] = beginTime;\n res[1] = endTime;\n return res;\n }", "private TimeSpanList activeTimeAnswer()\r\n {\r\n return TimeSpanList.singleton(TimeSpan.get(myQueryTime));\r\n }", "@Test\n void calculatePeriodRangeOver380() throws ParseException {\n LocalDate testDateStart = LocalDate.parse(\"2015-03-07\");\n LocalDate testDateEnd = LocalDate.parse(\"2017-12-17\");\n Map<String, String> periodMap = datesHelper.calculatePeriodRange(testDateStart, testDateEnd, false);\n assertEquals(\"33 months\", periodMap.get(PERIOD_START));\n assertEquals(\"17 December 2017\", periodMap.get(PERIOD_END));\n }", "public List<SalesOrderAggregatedCreated> selectAll();", "public List<Integer> getSePeriodYears() {\n\t\treturn Arrays.asList(5, 7, 10);\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tLocalDate initialDate = LocalDate.now();\n\t\t\n\t\n\t\tLocalDate finalDate = initialDate .plus(Period.ofWeeks(4) );\t// number* 7 % 30 \n\t\t int days = Period.between(initialDate, finalDate).getDays();\n\t\t System.out.println(days);\n\t\t \n\t\t long between = ChronoUnit.DAYS.between(initialDate, finalDate);\n\t\t System.out.println(\"duration between the two time :\" + between);\n\t\t \n\t\t \n\t\t LocalTime initialTime = LocalTime.now();\n\t\t \n\t\t LocalTime finalTime = initialTime.plus(Duration.ofSeconds(36));\n\t\t \n\t\t long second = Duration.between(initialTime, finalTime).getSeconds();\n\t\t \n\t\t System.out.println(\"duration between the two time :\" + second);\n\t\t \n\t\t long between2 = ChronoUnit.SECONDS.between(initialTime, finalTime);\n\t\t \n\t\t System.out.println(\"duration between the two time :\" + between2);\n\t\t \n\t\t \n\t\t \n\t}", "@Test\n void deve_retornar_o_periodo_first_period_out() {\n List<LocalTime> localTimes = Arrays.asList(LocalTime.parse(\"10:30:00\"));\n TimeCourseEnum response = timeService.addPeriod(localTimes);\n Assert.assertEquals(TimeCourseEnum.FIRST_PERIOD_OUT, response);\n }", "public List<AllTimeSeasonBean> getAllTimeRecord(){\n String q = \"select new com.main.pcblroyals.bean.AllTimeSeasonBean( \" +\n \"sum(case when g.teamScore > g.opponentScore then 1 else 0 end), \" +\n \"sum(case when g.teamScore = g.opponentScore then 1 else 0 end), \" +\n \"sum(case when g.teamScore < g.opponentScore then 1 else 0 end) \" +\n \") \" +\n \"from seasons s \" +\n \"join games g on s.id = g.season.id \";\n Query query = entityManager.createQuery(q);\n return (List<AllTimeSeasonBean>) query.getResultList();\n }", "private int getPeriodindexFromTime(long time, long period, int periodsPerSpan) {\n int index = (int) (time / period);\n return index;\n }", "@Test\n public void testHeterogeneousSegmentFilterConditionLimit() throws SqlParseException {\n\n val project = \"heterogeneous_segment\";\n // val dfId = \"747f864b-9721-4b97-acde-0aa8e8656cba\"\n // val seg1Id = \"8892fa3f-f607-4eec-8159-7c5ae2f16942\"\n // val seg2Id = \"d75a822c-788a-4592-a500-cf20186dded1\"\n // val seg3Id = \"54eaf96d-6146-45d2-b94e-d5d187f89919\"\n // val seg4Id = \"411f40b9-a80a-4453-90a9-409aac6f7632\"\n // val seg5Id = \"a8318597-cb75-416f-8eb8-96ea285dd2b4\"\n // \n val sql = \"with T1 as (select cal_dt, trans_id \\n\" + \"from test_kylin_fact inner join test_account \\n\"\n + \"on test_kylin_fact.seller_id = test_account.account_id \\n\"\n + \"where cal_dt between date'2012-01-01' and date'2012-01-03'\\n\" + \"group by cal_dt, trans_id)\\n\";\n\n {\n val sqlWithTooManyOrs = sql + \" select * from T1 where \" + \"(cal_dt='2012-01-01' and trans_id = 1) or \\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 2) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 3) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 4) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 5) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 6) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 7) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 8) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 9) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 10) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 12) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 13) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 14) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 15) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 16) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 17) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 18) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 19) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 20)\";\n val contexts = OlapContextTestUtil.getOlapContexts(project, sqlWithTooManyOrs);\n Assert.assertEquals(\n \">=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-01),<=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-03)\",\n contexts.get(0).getExpandedFilterConditions().stream().map(RexNode::toString)\n .collect(Collectors.joining(\",\")));\n }\n\n {\n val sqlWithFilter = sql + \" select * from T1 where \" + \"(cal_dt='2012-01-01' and trans_id = 1) or \\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 2) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 3) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 4) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 5) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 6) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 7) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 8) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 9) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 10)\";\n val contexts = OlapContextTestUtil.getOlapContexts(project, sqlWithFilter);\n Assert.assertNotEquals(\n \">=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-01),<=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-03)\",\n contexts.get(0).getExpandedFilterConditions().stream().map(RexNode::toString)\n .collect(Collectors.joining(\",\")));\n }\n\n }" ]
[ "0.6113238", "0.6015232", "0.57642305", "0.5664806", "0.5604996", "0.55881935", "0.55539525", "0.5488081", "0.5405958", "0.5290383", "0.52899015", "0.5252298", "0.5239317", "0.5231002", "0.52013326", "0.5181522", "0.51619726", "0.51381487", "0.51264876", "0.51220685", "0.51149553", "0.508662", "0.50288945", "0.5024061", "0.50011826", "0.49955082", "0.49721426", "0.4958625", "0.4954405", "0.49306843", "0.4928757", "0.49283442", "0.49003208", "0.48900875", "0.48816586", "0.4872682", "0.48663726", "0.48626205", "0.48555064", "0.48332962", "0.48306236", "0.48174807", "0.48034552", "0.4781774", "0.47807974", "0.47732234", "0.47730592", "0.4772513", "0.4747099", "0.4745477", "0.47377965", "0.4737769", "0.47370657", "0.4732516", "0.47298092", "0.47125", "0.4709389", "0.4708571", "0.46942005", "0.46896884", "0.46894005", "0.4688105", "0.46823052", "0.46781322", "0.4677948", "0.4662146", "0.46597603", "0.465938", "0.46484536", "0.46386003", "0.4634191", "0.4633354", "0.4629942", "0.46274674", "0.46266094", "0.46251294", "0.46234062", "0.4620759", "0.46136433", "0.4608366", "0.46071723", "0.46039486", "0.46009088", "0.45864633", "0.45839164", "0.4581691", "0.4580188", "0.4570838", "0.4570759", "0.45649993", "0.4563665", "0.45553514", "0.4552377", "0.45495954", "0.4547864", "0.45471805", "0.45439613", "0.45420694", "0.4532116", "0.45275176", "0.4523348" ]
0.0
-1
Log.d("AppDebug", "translateFields FirstFragment called");
@Override protected void translateFields(View view, String languageString) { Context context = view.getContext(); ((TextView) view.findViewById(R.id.first_page_text_title)) .setText(LanguageManager.Intro.getTextTitle(context, languageString)); ((TextView) view.findViewById(R.id.first_page_text)) .setText(LanguageManager.Intro.getText(context, languageString)); ((Button) view.findViewById(R.id.first_page_test_button)) .setText(LanguageManager.Intro.getButtonText(context, languageString)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void onFragmentStart() {\n\t}", "@Override\r\n\tpublic void onFragmentCreate(Bundle savedInstanceState) {\n\t}", "@Override\r\n\tpublic void onFragmentResume() {\n\t}", "public LocalizationFragment() {\n }", "@Override\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tLog.d(\"Fragment02\",\"onCreate\");\n\t}", "@Trace\n//\t@LogMethod\n\tprivate void loadNext() {\n\t\tToast.makeText(MainActivity.this, \"Test\", Toast.LENGTH_SHORT).show();\n\t}", "@Override\n public void onClick(View v) {\n\n String msg = fragmentCallback.getMsgFromActivity(\"null\");\n Toast.makeText(BlankFragment1.this.getContext(), msg, Toast.LENGTH_SHORT).show();\n }", "@Override\n public void onActivityCreated(Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n Log.i(sFragmentName, \"onActivityCreated()\");\n }", "public void MapFragment() {}", "@Override\r\n\tpublic void onFragmentStop() {\n\t}", "@Override\r\n\tpublic void onFragmentPaused() {\n\t}", "@Override\n public void onFragmentAttached() {\n }", "public CarModifyFragment() {\n }", "@Override\n public void onViewCreated(View view, Bundle savedInstanceState) {\n fragmentView = view;\n boolean hasProfile = false;\n //check si on avait des erreur ou un phone et name a ajouter\n if(args != null && !args.isEmpty()){\n try {\n if(args.containsKey(\"msg\")){\n displayErrMsg(args.getInt(\"msg\"));\n }\n if(args.containsKey(\"name\")){\n String name = args.getString(\"name\");\n if(name!= null && !name.isEmpty()){\n ((EditText)fragmentView.findViewById(R.id.userName)).setText(name);\n hasProfile = true;\n }\n }\n if(args.containsKey(\"phone\")){\n String phone = args.getString(\"phone\");\n if(phone != null && !phone.isEmpty()){\n ((EditText)fragmentView.findViewById(R.id.userPhone)).setText(phone);\n hasProfile = true;\n }\n }\n //on set le focus sur le message\n if(hasProfile){\n ((EditText)fragmentView.findViewById(R.id.userMessage)).requestFocus();\n }\n\n }catch(Exception e){\n Tracer.log(TAG, \"onViewCreated.ARGS.exception: \", e);\n }\n\n }\n\n //\n Button buttNext = fragmentView.findViewById(R.id.buttNext);\n //butt create\n buttNext.setOnClickListener(\n new View.OnClickListener() {\n public void onClick(View v) {\n checkMandatoryFieldsAndCreate();\n }\n });\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n Toast.makeText(getActivity(), getResources().getString(R.string.onCreateViewTop), Toast.LENGTH_SHORT).show();\n return inflater.inflate(R.layout.fragment_first, container, false);\n }", "public void sendMessage() {\n\n String msg = queryEditText.getText().toString();\n //String response = translateToEnglish(msg);\n TranslateFragment translateFragment = this;\n if (msg.trim().isEmpty()) {\n Toast.makeText(getActivity(), \"Please enter your query!\", Toast.LENGTH_LONG).show();\n } else {\n //introCardView.setVisibility(View.INVISIBLE);\n fadeOutAndHideView(introCardView);\n languageIdentifier.identifyLanguage(msg).addOnSuccessListener(new OnSuccessListener<String>() {\n @Override\n public void onSuccess(String languageCode) {\n\n if (languageCode != \"und\" && languageCode.equals(\"zh\")) {\n\n\n chineseEnglishTranslator.downloadModelIfNeeded(chineseToEnglishConditions).addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void aVoid) {\n\n chineseEnglishTranslator.translate(msg).addOnSuccessListener(new OnSuccessListener<String>() {\n @Override\n public void onSuccess(String s) {\n translatedText=s;\n showTextView(msg, USER);\n queryEditText.setText(\"\");\n // Android client\n translateReply = msg;\n aiRequest.setQuery(translatedText);\n\n RequestTask requestTask = new RequestTask(translateFragment,getActivity(), aiDataService, customAIServiceContext);\n requestTask.execute(aiRequest);\n }\n });\n\n }\n });\n\n //translate the text to english and then display\n //Log.i(TAG, \"Language: \" + languageCode);\n //Log.i(TAG, \"Language: translated\" + translatedText);\n\n } else {\n translatedText = msg;\n translateReply = msg;\n\n showTextView(msg, USER);\n queryEditText.setText(\"\");\n // Android client\n aiRequest.setQuery(translatedText);\n RequestTask requestTask = new RequestTask(translateFragment,getActivity(), aiDataService, customAIServiceContext);\n\n getActivity().runOnUiThread(new Runnable() {\n public void run() {\n requestTask.execute(aiRequest);\n }\n });\n\n\n\n }\n }\n });\n\n\n/* showTextView(msg, USER);\n queryEditText.setText(\"\");\n // Android client\n aiRequest.setQuery(msg);\n ChatFragment chFragment;\n RequestTask requestTask = new RequestTask(this,getActivity(), aiDataService, customAIServiceContext);\n requestTask.execute(aiRequest);*/\n }\n }", "public RegisterFragment() {\n }", "@Override\n public void onClick(View view) {\n Toast.makeText( getActivity(), \"Fragment Second's\", Toast.LENGTH_SHORT ).show();\n\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(\n R.layout.fragment_first, container, false);\n\n txt = v.findViewById(R.id.txt);\n txt.setText(\"First Fragment\");\n return v;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_fragment_test, container, false);\n\n ButterKnife.inject(FragmentTest.this, view);\n\n /*btToastMessage = (Button) view.findViewById(R.id.btToastMessage);\n btToastMessage.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n Toast.makeText(getActivity(), \"Toast printado\", Toast.LENGTH_SHORT).show();\n }\n });\n\n etName = (EditText) view.findViewById(R.id.etName);\n etEmail = (EditText) view.findViewById(R.id.etEmail);*/\n\n for(int i = 0, tam = listEt.size(); i < tam; i++){\n Log.i(\"LOG\", \"Hint: \"+listEt.get(i).getHint().toString());\n }\n\n\n return(view);\n }", "@Override\r\n\tpublic void handleFragmentMessage(String arg0, int arg1, Object arg2) {\n\t\t\r\n\t}", "@Override\n public void onPause() {\n super.onPause();\n Log.i(sFragmentName, \"onPause()\");\n }", "@Override\r\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n Bundle savedInstanceState) {\n\r\n View v = inflater.inflate(R.layout.fragment_halaman, container, false);\r\n\r\n TextView tv = (TextView) v.findViewById(R.id.tv_halaman);\r\n String halaman = getArguments().getString(EXTRAS);\r\n tv.setText(halaman);\r\n\r\n Log.e(TAG, \"onCreateView : Halaman Fragment\" + halaman);\r\n\r\n return v;\r\n\r\n }", "public static void Fragment_en_Framelayout(Activity act ,int framelayoutid,Fragment frag){\n }", "public CreatePatientFragment() {\n\n }", "public Fragment_Tutorial() {}", "@Override\r\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tSystem.out.println(\"MyCollectShopFragment--create\");\r\n\t\tsuper.onCreate(savedInstanceState);\r\n\t}", "public AddToCardFragment() {\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_messages_, container, false);\n\n TextView textView = view.findViewById(R.id.textView2);\n name_to_send_massage = view.findViewById(R.id.name_to_send_massage);\n text_to_send = view.findViewById(R.id.et_send_messages);\n send_button = view.findViewById(R.id.button_send_messages);\n\n\n textView.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n singleton.setGo_massage_from_find(null);\n // todo hide the key board\n Navigation.findNavController(view).navigate(R.id.action_messages_Fragment_to_host_Tabs_Fragment);\n }\n });\n\n\n\n return view;\n }", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\t// TODO Auto-generated method stub\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t\t\n\t\tILog.v(\"MyFragment onActivityCreated\");\n\t}", "@Override\n\tpublic void onAttach(Activity activity) {\n\t\tsuper.onAttach(activity);\n\t\tLog.d(\"Fragment02\",\"onAttach\");\n\t}", "@Override\n public void onAdLoaded() {\n Log.i(\"Ads\", \"onAdLoaded\");\n }", "public NewShopFragment() {\n }", "@Override\n public void onAdLoaded() {\n Log.i(\"Ads\", \"onAdLoaded\");\n }", "@Override\n public void onAdLoaded() {\n Log.i(\"Ads\", \"onAdLoaded\");\n }", "public MyGoodsFragment() {\n }", "public void onFragment( Framedata fragment ) {\n\t\tlog.info( \"received fragment: \" + new String( fragment.getPayloadData().array() ) );\n\t}", "public void resolve()\n{\n getFragment().resolveFragment();\n}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n rootview = inflater.inflate(R.layout.fragment_translate, container, false);\n setHasOptionsMenu(true);\n introCardView = (MaterialCardView) rootview.findViewById(R.id.introCard);\n tv_chatIntro = (TextView) rootview.findViewById(R.id.tv_chatIntro);\n tv_chatQuestions =(TextView) rootview.findViewById(R.id.tv_chatQuestions);\n //changeLabelToEnglish();\n bottomNavigationView = getActivity().findViewById(R.id.bottom_navigationid);\n\n SharedPreferences pref = getActivity().getSharedPreferences(\"myPrefs\",MODE_PRIVATE);\n defaultLanguage =pref.getString(\"isChinese\",\"au\");\n\n // language detection initializer\n languageIdentifier = FirebaseNaturalLanguage.getInstance().getLanguageIdentification();\n\n // Create an English-China translator:\n FirebaseTranslatorOptions englishToChineseOptions =\n new FirebaseTranslatorOptions.Builder()\n .setSourceLanguage(FirebaseTranslateLanguage.EN)\n .setTargetLanguage(FirebaseTranslateLanguage.ZH)\n .build();\n englishChineseTranslator =\n FirebaseNaturalLanguage.getInstance().getTranslator(englishToChineseOptions);\n\n englishToChineseConditions = new FirebaseModelDownloadConditions.Builder()\n .build();\n\n //-------------------------------------------------------------------------------------//\n\n FirebaseTranslatorOptions chineseToEnglishOptions =\n new FirebaseTranslatorOptions.Builder()\n .setSourceLanguage(FirebaseTranslateLanguage.ZH)\n .setTargetLanguage(FirebaseTranslateLanguage.EN)\n .build();\n chineseEnglishTranslator = FirebaseNaturalLanguage.getInstance().getTranslator(chineseToEnglishOptions);\n chineseToEnglishConditions = new FirebaseModelDownloadConditions.Builder()\n .build();\n chineseEnglishTranslator.downloadModelIfNeeded(chineseToEnglishConditions).addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void aVoid) {\n\n isCnAudownloaded = true;\n\n // Toast.makeText(getContext(), \"Chinese-English translator downloaded\", Toast.LENGTH_LONG).show();\n }\n });\n\n dialogFlowKey = getActivity().getResources().getString(R.string.dialogflow_key);\n\n englishChineseTranslator.downloadModelIfNeeded(englishToChineseConditions).addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void aVoid) {\n isAuCndownloaded = true;\n // Toast.makeText(getContext(), \"English-Chinese translator downloaded\", Toast.LENGTH_LONG).show();\n }\n });\n\n //---------------------back navigation-------------------\n ((AppCompatActivity)getActivity()).getSupportActionBar().setHomeAsUpIndicator(null);\n if(defaultLanguage.equals(\"cn\")){\n changeLabelToChinese();\n ((AppCompatActivity) getActivity()).getSupportActionBar().setTitle(\"译者\");\n\n }\n else{\n changeLabelToEnglish();\n ((AppCompatActivity) getActivity()).getSupportActionBar().setTitle(\"Translator\");\n\n }\n\n\n return rootview;\n }", "public RegisterFragment() {\n // Required empty public constructor\n }", "@Override\n public void onAdLoaded() {\n Log.i(\"Ads\", \"xxx WelcomeAd onAdLoaded\");\n }", "void onFragmentInteraction(ArrayList naleznosci, String KLUCZ);", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n myDb = new DatabaseHelper(getContext());\n\n view=inflater.inflate(R.layout.fragment_gpslocation, container, false);\n mFusedLocationClient = LocationServices.getFusedLocationProviderClient(getContext());\n getActivity().setTitle(\"Calling\");\n\n\n fetchLocation(inflater,container);\n\n return view;\n }", "public LogFragment() {\n }", "public FragmentMy() {\n }", "public WalletFragment(){}", "void onFragmentInteractionMain();", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View viewSecondFragment =inflater.inflate(R.layout.fragment_second, container, false);\n textViewSmsBody = viewSecondFragment.findViewById(R.id.textViewSmsBody);\n //Получаем данные\n Bundle args = getArguments();\n if (args != null) {\n String smsBody = args.getString(SMA_BODY);\n Toast.makeText(getContext(), smsBody, Toast.LENGTH_SHORT).show();\n setTextSmsBody(smsBody);\n }\n\n\n\n\n return viewSecondFragment;\n }", "public StepsFragment() {\n }", "public void onAttach() {\n super.onAttach(getActivity());\n Log.i(sFragmentName, \"onAttach()\");\n }", "void onMainMapFragmentNextBtn();", "public void createFragment() {\n\n }", "public void onClick(View arg0) {\n getActivity().getSupportFragmentManager().beginTransaction()\r\n .replace(R.id.container, new Maps_Principal_Trans_Fragemnt()).commit();\r\n\r\n }", "public MyLocationsFragment() {\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view=inflater.inflate (R.layout.fragment_phone_verification, container, false);\n //initviews is used to initialize the views\n initViews (view);\n actionProfileVerificationInstance=Navigation.findNavController (getActivity (), R.id.mainNavHostFragment);\n //get bundles data get the data sent from previous fragment\n getBundlesData ();\n return view;\n }", "@Override\n public void onAdLoaded() {\n Log.d(\"TAG\",\"Ad loaded\");\n }", "@Override\n public void onPause() {\n super.onPause();\n\n Toast.makeText(getContext(),\"on pause\",Toast.LENGTH_SHORT).show();\n Log.e(\"fragmentlifecycle\",\"on pause\");\n }", "public MainActivityFragment(){\n\n }", "@Override\n public void onCreate() {\n Log.d(TAG, TAG + \" onCreate\");\n }", "void onFragmentInteraction(String string);", "void onFragmentInteraction(String string);", "private void initFragments() {\n\t\tZhiBoFragment zhiBoFragment = ZhiBoFragment.newInstance(null);\n\t\tzhiBoFragment.setSquareFragmentListener(this);\n\t\tLiaotianFragment liaotianFragment = LiaotianFragment.newInstance(null);\n\t\tliaotianFragment.setSquareFragmentListener(this);\n\t\tfragments.add(zhiBoFragment);\n\t\tfragments.add(liaotianFragment);\n\t\t\n\t\t\n\t}", "@Override\n\tprotected void initParamsForFragment() {\n\n\t}", "public void initFragments() {\n Log.d(\"initFragments\", \"initFragments: start\");\n if (!focus) {\n Log.d(\"initFragments\", \"initFragments: not focused\");\n return;\n }\n\n if (calendarFragment != null)\n getSupportFragmentManager().beginTransaction().remove(calendarFragment).commit();\n if (scheduleFragment != null)\n getSupportFragmentManager().beginTransaction().remove(scheduleFragment).commit();\n if (userHomeFragment != null)\n getSupportFragmentManager().beginTransaction().remove(userHomeFragment).commit();\n if (medicineFragment != null)\n getSupportFragmentManager().beginTransaction().remove(medicineFragment).commit();\n\n Log.d(\"initFragments\", \"initFragments: new\");\n calendarFragment = new CalendarFragment();\n scheduleFragment = new CheckupFragment();\n userHomeFragment = new UserHomeFragment();\n medicineFragment = new MedicationFragment();\n\n fragmentTransaction = getSupportFragmentManager().beginTransaction();\n Log.d(\"initFragments\", \"initFragments: begin transaction\");\n fragmentTransaction.add(R.id.navigationFrame, calendarFragment);\n fragmentTransaction.hide(calendarFragment);\n fragmentTransaction.add(R.id.navigationFrame, scheduleFragment);\n fragmentTransaction.hide(scheduleFragment);\n fragmentTransaction.add(R.id.navigationFrame, userHomeFragment);\n fragmentTransaction.hide(userHomeFragment);\n fragmentTransaction.add(R.id.navigationFrame, medicineFragment);\n fragmentTransaction.hide(medicineFragment);\n fragmentTransaction.commit();\n\n if (lastFragment == null) {\n Log.d(\"initFragments\", \"initFragments: null last fragment\");\n lastFragment = \"calendarFragment\";\n setFragment(calendarFragment);\n }\n else {\n Log.d(\"initFragments\", \"initFragments: set last fragment\");\n setLastFragment();\n }\n }", "public MainActivityFragment() {\n }", "public MainActivityFragment() {\n }", "private final void m136464d() {\n BaseFragment baseFragment;\n if (this.f98816d && this.f98817e && getView() != null && (baseFragment = this.f98814b) != null) {\n if (baseFragment.isDetached() || baseFragment.getContext() == null) {\n VideoXOnlineLog.m139074c(VideoXOnlineLog.f101073b, C6969H.m41409d(\"G458AC31F8D3FA424C5019E5CF3ECCDD27BA5C71BB83DAE27F2549946FBF1E0D86797D413B135B973A60B825AFDF79985\"), null, 2, null);\n return;\n }\n if (baseFragment.getActivity() != null) {\n FragmentActivity activity = baseFragment.getActivity();\n if ((activity != null ? activity.getApplication() : null) != null) {\n m136459a(baseFragment);\n return;\n }\n }\n VideoXOnlineLog.m139074c(VideoXOnlineLog.f101073b, C6969H.m41409d(\"G458AC31F8D3FA424C5019E5CF3ECCDD27BA5C71BB83DAE27F2549946FBF1E0D86797D413B135B973A60B825AFDF79986\"), null, 2, null);\n }\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_first, container, false);\n\n Bundle bundle = getArguments();\n\n if(bundle != null){\n if( bundle.containsKey(\"name\")){\n name = bundle.getString(\"name\") ;\n }\n\n if( bundle.containsKey(\"age\")){\n age = bundle.getString(\"age\") ;\n }\n }\n nextFagTv = v.findViewById(R.id.nextFagTv);\n\n nextFagTv.setText(\"name is \"+name+\" and age is \"+age);\n\n nextFagTv.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.container,new SecondFragment())\n .addToBackStack(\"SecondFragment\").commit();\n }\n });\n\n return v;\n }", "@Override\n public void onContactSelected(Contact contact) {\n\n// Toast.makeText(this, \"Affichage des messages du contact id = \" + contactId, Toast.LENGTH_LONG).show();\n // Call to showMessagesFragment\n\n // Create a new fragment\n Fragment fragment = new ShowSlaveContactMessagesFragment();\n\n // Insert the fragment by replacing any existing fragment\n FragmentManager fragmentManager = getFragmentManager();\n\n Bundle args = new Bundle();\n args.putInt(\"phone_id\", targetPhone.getId());\n args.putString(\"phone_login\", targetPhone.getLogin());\n\n args.putInt(\"user_id\", currentUser.getId());\n args.putString(\"user_mail\", currentUser.getMail());\n args.putString(\"user_password\", currentUser.getPassword());\n\n args.putInt(\"contact_id\", contact.getId());\n args.putString(\"contact_name\", contact.getNom());\n args.putString(\"contact_phone_number\", contact.getNumero());\n\n // Remplace le contenu de content_frame par la layout associée au fragment\n fragment.setArguments(args);\n fragmentManager.beginTransaction()\n .replace(R.id.slave_main_content_frame, fragment)\n .commit();\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_survey_q1fragment, container, false);\n nextB = v.findViewById(R.id.Q1surveyB);\n Q1A = v.findViewById(R.id.Q1A);\n Q1E = v.findViewById(R.id.Q1E);\n\n nextB.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n q1FragmentListener.onInputQ1Next();\n }\n });\n\n Q1A.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n q1FragmentListener.calledQ1A(\"Q1A\");\n Toast.makeText(getActivity(), \"Words of Affirmation\", Toast.LENGTH_LONG).show();\n }\n });\n\n Q1E.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n q1FragmentListener.calledQ1E(\"Q1E\");\n Toast.makeText(getActivity(), \"Physical Touch\", Toast.LENGTH_LONG).show();\n }\n });\n\n return v;\n }", "void onFragmentInteractionmaps();", "public TransactionsFragment() {\n }", "public FindItemFragment() {\n }", "@Override\n\tpublic void onNaviViewLoaded() {\n\t\t\n\t}", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n Log.i(sFragmentName, \"onCreate()\");\n\n Bundle extras = getActivity().getIntent().getExtras();\n\n String fname = extras.getString(\"fname\");\n String iname = extras.getString(\"iname\");\n String indi_id = extras.getString(\"indi\");\n String indvtype = extras.getString(\"indvtype\");\n\n Log.i(sFragmentName, \"onCreate() - fname: \" + fname);\n Log.i(sFragmentName, \"onCreate() - iname: \" + iname);\n Log.i(sFragmentName, \"onCreate() - indi: \" + indi_id);\n Log.i(sFragmentName, \"onCreate() - indvtype: \" + indvtype);\n sFullName = iname;\n int poscomma = iname.indexOf(\",\");\n String formattediname = iname.substring(poscomma + 2, iname.length());\t\t\t// given names\n formattediname = formattediname + \" /\" + iname.substring(0, poscomma) + \"/\";\n\n Log.i(sFragmentName, \"onCreate() - formattediname: \" + formattediname);\n Log.i(sFragmentName, \"onCreate() - sFullName: \" + sFullName);\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n\t\t\tBundle savedInstanceState) {\n\t\t\r\n\t\tView view=inflater.inflate(R.layout.fragment_two, container, false);\r\n\t\t\r\n\t\tButton btnFragment2=(Button) view.findViewById(R.id.btnFragment2);\r\n\t btnFragment2.setOnClickListener(new View.OnClickListener() {\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void onClick(View v) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\t\r\n\t\t\t\tfbcl.changActivity(\"Ñþºþ\");\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn view;\r\n\t}", "public MainFragment2() {\r\n super();\r\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v= inflater.inflate(R.layout.fragment_company_details_company_intro, container, false);\n Toast.makeText(getContext(), company_id+company_name, Toast.LENGTH_SHORT).show();\n companyDetailsCompanyIntroText=v.findViewById(R.id.companyDetailsCompanyIntroText);\n setValues();\n return v;\n }", "@Override\n public void loginClickedSignUp() {\n startSignInFragment();\n }", "@Override\n public void onStop() {\n super.onStop();\n Log.i(sFragmentName, \"onStop()\");\n }", "public void run() {\n assert getFragmentManager() != null;\n Fragment currentFragment = getActivity().getSupportFragmentManager().findFragmentById(R.id.content_main);\n FragmentTransaction ft = getFragmentManager().beginTransaction();\n if (Build.VERSION.SDK_INT >= 26) {\n ft.setReorderingAllowed(false);\n }\n ft.detach(currentFragment).attach(currentFragment).commit();\n }", "@Override\r\n\tpublic void onStartNavi(int arg0) {\n\r\n\t}", "@Override\r\n\tpublic void onResume() {\n\t\tsuper.onResume();\r\n\r\n\t\tthreeDBaseActivityticket.curFragmentTag = getString(R.string.three_direct_sum_name);\r\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n ViewGroup root = (ViewGroup) inflater.inflate(R.layout.fragment_logintab, container,false);\n\n edit_email = root.findViewById(R.id.edit_email);\n edit_pwd = root.findViewById(R.id.edit_pwd);\n btn_pwd_find = root.findViewById(R.id.btn_pwd_find);\n btn_login = root.findViewById(R.id.btn_login);\n\n edit_email.setTranslationX(800); //email\n edit_pwd.setTranslationX(800);\n btn_pwd_find.setTranslationX(800);\n btn_login.setTranslationX(800);\n\n edit_email.setAlpha(v);\n edit_pwd.setAlpha(v);\n btn_pwd_find.setAlpha(v);\n btn_login.setAlpha(v);\n\n edit_email.animate().translationX(0).alpha(1).setDuration(800).setStartDelay(300).start();\n edit_pwd.animate().translationX(0).alpha(1).setDuration(800).setStartDelay(500).start();\n btn_pwd_find.animate().translationX(0).alpha(1).setDuration(800).setStartDelay(500).start();\n btn_login.animate().translationX(0).alpha(1).setDuration(800).setStartDelay(700).start();\n\n\n\n //로그인을 위한 이벤트 감지자\n btn_login.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n\n Intent intent = new Intent(getActivity(), MyPageActivity.class);\n\n String email = edit_email.getText().toString();\n String pwd = edit_pwd.getText().toString();\n\n String result = \"email=\"+email+\"&pwd=\"+pwd;\n\n new LoginTask().execute(result);\n\n }\n });\n return root;\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle state) {\n view = inflater.inflate(R.layout.fragment_scan, null);\n\n view.findViewById(R.id.txtTest)\n .setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n Toast.makeText(getActivity(), \"Contents = \", Toast.LENGTH_SHORT).show();\n loadFragment(new PoleIdFragment());\n }\n }\n );\n\n return view;\n }", "public VehicleFragment() {\r\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_edit_profile, container, false);\n\n textInputLayout = rootView.findViewById(R.id.textInputLayout);\n updateProfileEt = rootView.findViewById(R.id.updateProfileEt);\n editButton = rootView.findViewById(R.id.editButton);\n\n\n updateProfileLayout = rootView.findViewById(R.id.updateProfileLayout);\n\n progressBar3 = rootView.findViewById(R.id.progressBar3);\n\n String[] registrationOneData = getArguments().getStringArray(\"messageForEditing\");\n\n configureEditFragmentBasedOnData(registrationOneData);\n\n\n\n editButton.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n String data = updateProfileEt.getText().toString();\n if(EditValidation.simpleEditDataValidation(registrationOneData[1],data)){\n showViews();\n editData(data,registrationOneData[0]);\n }\n }\n });\n\n\n\n progressBar3.setVisibility(View.GONE);\n\n return rootView;\n }", "public CommonLogFragment() {\n\t\tsuper();\n\t}", "@Override\n public void onAdLeftApplication() {\n Log.i(\"Ads\", \"xxx Banner onAdLeftApplication\");\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_create_hint, container, false);\n EditText hintDescription = view.findViewById(R.id.hintDetailEditText);\n hintDescription.setText(hint.getHint());\n cancelButton = view.findViewById(R.id.cancelButton);\n cancelButton.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n viewChanger.changeViewAndBack(CreateHuntFragment.newInstance(uid,hunt));\n }\n });\n\n deleteButton = view.findViewById(R.id.deleteButton);\n deleteButton.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n hunt.removeHint(hint);\n viewChanger.changeViewAndBack(CreateHuntFragment.newInstance(uid,hunt));\n }\n });\n\n finishButton = view.findViewById(R.id.finishButton);\n finishButton.setOnClickListener(new View.OnClickListener(){\n @Override\n public void onClick(View v) {\n finalizeHint();\n }\n });\n this.hintText = view.findViewById(R.id.hintDetailEditText);\n this.hintText.setText(hint.getHint());\n\n\n mapView = view.findViewById(R.id.mapView);\n mapView.onCreate(savedInstanceState);\n mapView.getMapAsync(this);\n\n this.finishText = view.findViewById(R.id.hintFinishMessageEditText);\n this.finishText.setText(hint.getFinishMessage());\n return view;\n }", "void onMainFragmentSelectListner(View view);", "@Override\n public void onStartNavi(int arg0) {\n\n }", "@Override\n\t\tpublic void onUnityAdsStart(String arg0) {\n\n\t\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n Bundle params = getArguments();\n view = inflater.inflate(R.layout.fragment_info,\n parent, false);\n\n\n numero = view.findViewById(R.id.num_id);\n prenom = view.findViewById(R.id.prenom_id);\n nom = view.findViewById(R.id.nom_id);\n formation = view.findViewById(R.id.formation_id);\n\n numero.setText(params.getString(\"i\"));\n prenom.setText(params.getString(\"prenom\"));\n nom.setText(params.getString(\"nom\"));\n formation.setText(params.getString(\"formation\"));\n\n InfoFragmentEventListener infoFragmentEventListener = (InfoFragmentEventListener)getActivity();\n\n\n //return inflater.inflate(R.layout.fragment_info, parent, false);\n Button btnprec = view.findViewById(R.id.prec_btn);\n Button btnsuiv = view.findViewById(R.id.suiv_btn);\n\n btnprec.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n infoFragmentEventListener.precedantClicked();\n }\n });\n btnsuiv.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n infoFragmentEventListener.suivantClicked();\n }\n });\n\n\n\n return view;\n }", "@Override\n public void onViewCreated(View view, Bundle savedInstanceState) {\n }", "public progFragment() {\n }", "void onFragmentAddNewUser();", "@Override\n public void getStartedClicked() {\n startSignUpFragment();\n\n }", "@Override\n protected void onForward(View backwardView) {\n super.onBackward(backwardView);\n Log.d(\"info\", \"submit\");\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_register, container, false);\n emailEditText= rootView.findViewById(R.id.registerEmail);\n nameEditText = rootView.findViewById(R.id.registerName);\n registerButton = rootView.findViewById(R.id.registerAuthBtn);\n\n registerButton.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n\n String emailString = emailEditText.getText().toString().trim();\n String nameString = nameEditText.getText().toString().trim();\n if(emailString.isEmpty() && nameString.isEmpty()){\n ((MainActivity)getActivity()).toast(getString(R.string.field_empty));\n return;\n }\n\n onRegisterButtonPressed(emailString, nameString);\n\n }\n });\n\n return rootView;\n }" ]
[ "0.6683333", "0.6468576", "0.591292", "0.5895404", "0.58688974", "0.58636445", "0.58428437", "0.5836174", "0.57373613", "0.5695405", "0.56745183", "0.5670737", "0.56504714", "0.5639706", "0.5631334", "0.5618271", "0.56095934", "0.56053007", "0.559739", "0.5577665", "0.5529948", "0.54900783", "0.5484953", "0.5484722", "0.5482745", "0.54778457", "0.54711646", "0.5453064", "0.5452782", "0.54502946", "0.54311734", "0.543041", "0.54291445", "0.54041636", "0.54041636", "0.54039276", "0.53920984", "0.5389975", "0.53848124", "0.5378136", "0.5376197", "0.5374033", "0.53580964", "0.53578854", "0.5350906", "0.5347628", "0.53365016", "0.5319203", "0.531533", "0.53023744", "0.5297028", "0.52936625", "0.52764887", "0.5276037", "0.52670074", "0.5237833", "0.5237817", "0.52369577", "0.5226827", "0.5216295", "0.5216295", "0.521472", "0.5213251", "0.520671", "0.5203334", "0.5203334", "0.5190591", "0.5187544", "0.5186497", "0.51842046", "0.51766926", "0.5172875", "0.5166855", "0.51643914", "0.51626277", "0.5162298", "0.5162111", "0.51610595", "0.5160708", "0.5138792", "0.5135366", "0.5134295", "0.51290905", "0.51283014", "0.51265085", "0.51210946", "0.5118485", "0.51168424", "0.51150614", "0.51131004", "0.51123905", "0.5110677", "0.5106997", "0.51061743", "0.51000565", "0.50996745", "0.5096698", "0.50954413", "0.50949025", "0.5094855" ]
0.5998612
2
return String.format(FOUND_ACCOUNT, account.getAccountID(), account.getAccountName(), account.getUserID(), account.getUserName(), password);
public static String logFoundAccount(Account account, String password) { return String.format(FOUND_ACCOUNT, "xxx", account.getAccountName(), "xxx", "xxx", "xxx"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getAccount();", "java.lang.String getLoginAccount();", "java.lang.String getLoginAccount();", "public String getAccount() {\n\t\treturn getUsername() + \":\" + getPassword() + \"@\" + getUsername();\n\t}", "public String getCurrentUserAccount();", "public static String getUserAccount(String account){\n return \"select ui_account from user_information where ui_account = '\"+account+\"'\";\n }", "String getAccountID();", "String getAccountID();", "public String displayAccount() {\r\n\t return id+\",\"+name+\",\"+balance+\",\"+email+\",\"+dateOfOpening;\r\n }", "public String getAccountEntry() {\n return this.username + Utility.createLine(' ', MAX_USERNAME_LENGTH -\n this.username.length()) + \" \" + this.type + \" \"\n + String.format(\"%09.2f\", this.balance);\n }", "public String getAccountInfo(){\n NumberFormat currencyFormat = NumberFormat.getCurrencyInstance();\n return \"Account No : \" + accountNo +\n \"\\nName : \" + name +\n \"\\nBalance : \" + currencyFormat.format(balance);\n }", "public String getAccountNo();", "public String toString(){\r\n //your code here\r\n return(\"Withdrawal of: $\" + amount + \"Date: \" + date + \"from account: \" + account);\r\n }", "private String getPasswordFor(String name) {\n return new StringBuilder().append(PASSWORD_FOR).append(\" '\").append(name).append(\"': \").toString();\n }", "public static String accountValid(String account){\n return \"select u_accountnum from users having u_accountnum = '\" + account + \"'\";\n }", "public String getAccount(){\n\t\treturn account;\n\t}", "java.lang.String getAccountNumber();", "static String getAccountStatement(int accountNum) {\n int accountCompare; // for comparison\n try {\n // Select all the SQL columns needed to output a statement\n rs = st.executeQuery(\"SELECT AccountNum, LastName, FirstName, UserBalanceC, UserBalanceS FROM CashiiDB2\");\n\n // Keep comparing till the if statement finds what it needs, then output\n while (rs.next()) {\n accountCompare = rs.getInt(\"AccountNum\");\n if (accountCompare == accountNum)\n return \"<h1>\" + rs.getString(\"FirstName\") + \" \" + rs.getString(\"LastName\") + \"</h1>\" + \"Account Number: \" + rs.getInt(\"AccountNum\") + \"<br> <p>Savings: $\" + rs.getInt(\"UserBalanceS\") + \"<br>Chequing: $\" + rs.getInt(\"UserBalanceC\") + \"<p>\";\n // accountCompare + \", \" + rs.getInt(\"UserPIN\") + \", \\n\" + rs.getString(\"LastName\") + \", \" + rs.getString(\"FirstName\") + \", \" + rs.getDouble(\"UserBalanceC\") + \", \" +rs.getDouble(\"UserBalanceS\");\n }\n } catch (java.sql.SQLException e) {\n e.printStackTrace();\n }\n return \"NOTFOUND\"; // This should not happen in any circumstance\n }", "String getAccountDescription();", "String getAccountDescription();", "public String toString()\r\n\t{\r\n\t\tString out;\r\n\t\t\r\n\t\tif (locked)\r\n\t\t{\r\n\t\t\tout = \"***LOCKED ACCOUNT***\";\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tout = \"***UNLOCKED ACCOUNT***\";\r\n\t\t}\r\n\t\tout += String.format(\"\\nUser Name: %s\\nAccount Number: %s\\nEmail Address: %s\\n%s\",\r\n\t\t\t\tuserName, getAccountNumberString(), getEmailAddress(), getNotification());\r\n\t\t\r\n\t\tif (!locked)\r\n\t\t{\r\n\t\t\tnotification = null;\r\n\t\t}\r\n\t\t\r\n\t\treturn out;\r\n\t}", "public String getAccount() {\r\n return account;\r\n }", "String getTradingAccount();", "java.lang.String getAccountId();", "java.lang.String getAccountId();", "java.lang.String getAccountId();", "public String getAccount() {\n return account;\n }", "public String getAccount() {\n return account;\n }", "public String getAccount() {\n return account;\n }", "public String getAccount() {\n return account;\n }", "public String getAccount() {\n return account;\n }", "public String getAccount() {\n return account;\n }", "public String getAccount() {\n return account;\n }", "public String getAccount() {\n return account;\n }", "public String getAccount() {\n return account;\n }", "public String getAccount() {\n return account;\n }", "@Override\r\n public String toString(){\r\n String out = \"Login - \";\r\n out += login;\r\n out += \" Password - \";\r\n out += Encryptor.decrypt(password,login);\r\n return out;\r\n }", "private String statementForAccount(Account account) {\n\tStringBuilder statement = new StringBuilder(\"\");\n\n //Translate to pretty account type\n switch(account.getAccountType()){\n case CHECKING:\n statement.append(\"Checking Account\\n\");\n break;\n case SAVINGS:\n statement.append(\"Savings Account\\n\");\n break;\n case MAXI_SAVINGS:\n statement.append(\"Maxi Savings Account\\n\");\n break;\n }\n\n //Now total up all the transactions\n double total = 0.0;\n for (Transaction transaction : account.getTransactions()) {\n statement.append(\" \" + (transaction.getAmount() < 0 ? \"withdrawal\" : \"deposit\") + \" \" + toDollars(transaction.getAmount()) + \"\\n\");\n total += transaction.getAmount();\n }\n statement.append(\"Total \" + toDollars(total));\n return statement.toString();\n }", "public java.lang.String getAccount() {\n java.lang.Object ref = account_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n account_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "private static void displayAccount(Account account) {\n\t\tSystem.out.println(account.toString());\n\t\tSystem.out.println();\n\t}", "String getUserPassword();", "public java.lang.String getAccount() {\n java.lang.Object ref = account_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n account_ = s;\n return s;\n }\n }", "@Override\n public String toString() {\n return \"\\nname: \" + name +\n \"\\npassword: \" + password +\n \"\\ndateOfBirth: \" + dateOfBirth +\n \"\\nmarriageStatus: \" + marriageStatus +\n \"\\naccountNumber: \" + accountNumber +\n \"\\namount in account 1 : \" + amountAccount1 +\n \"\\naccountNumber2: \" + accountNumber2 +\n \"\\namount in account 2 : \" + amountAccount2 +\n \"\\nrelativeName: \" + relativeName +\n \"\\nrelativeAge: \" + relativeAge;\n }", "public java.lang.String getAccount() {\n java.lang.Object ref = account_;\n if (!(ref instanceof java.lang.String)) {\n java.lang.String s = ((com.google.protobuf.ByteString) ref)\n .toStringUtf8();\n account_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getAccountNumberString()\r\n\t{\r\n\t\t\r\n\t}", "@Override\n\tpublic String toString(){\n\t\treturn \"Account{\"+\n\t\t\t\t\"id=\"+id+\n\t\t\t\t\", email='\"+email+'\\''+\n\t\t\t\t\", user=\"+user+\n\t\t\t\t\", accessLevel=\"+accessLevel+\n\t\t\t\t\", prefs=\"+prefs+\n\t\t\t\t\", createdAt=\"+createdAt+\n\t\t\t\t\", lastActive=\"+lastActive+\n\t\t\t\t\", banInfo=\"+banInfo+\n\t\t\t\t\", activationInfo=\"+activationInfo+\n\t\t\t\t\", invitedBy=\"+invitedBy+\n\t\t\t\t'}';\n\t}", "public java.lang.String getAccount() {\n java.lang.Object ref = account_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n account_ = s;\n }\n return s;\n }\n }", "public static String getAccountPassword() {\n\t\tif ((xml == null) || (accountPassword == null)) return \"password\";\n\t\tif (accountPassword.equals(\"\")) return \"password\";\n\t\treturn accountPassword;\n\t}", "public String toString()\r\n\t{\r\n\t return \"Accnt nbr \"+getAcctNbr()+\" has balance of $\"+twoDigits.format(getBalance());\r\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn accountID;\n\t}", "static void printAccountBalance(String address){\n }", "public static String format(String account) {\n return Accounts.get(account).getHoldings().toString();\n }", "public String toString() {\n return \"Account \" + name + \" has $\" + balance + \"and is \" + getState()\n + \"\\n\";\n }", "@Override\n\tpublic String createAccount() {\n\t\treturn \"Created Saving Account Sucessfully\";\n\t}", "public void printAccountInfo(){\n System.out.printf(\"%5d %-20s %8.2f\\n\",accountNum,customerName,balance);\n }", "public String getAccount() {\r\n\t\treturn account;\r\n\t}", "public StringBuilder printAccountInformation(){\n StringBuilder accountInformation = new StringBuilder();\n accountInformation.append(\"Account information:\\n\")\n .append(\"\\tAccount id: \").append(this.getId()).append(\"\\n\")\n .append(\"\\tAccount balance: \").append(this.getBalance()).append(\"\\n\")\n .append(\"\\tAccount annual interest rate: \").append(this.getAnnualInterestRate()).append(\"\\n\")\n .append(\"\\tAccount create date: \").append(this.getDateCreated()).append(\"\\n\");\n\n return accountInformation;\n }", "String password();", "@Override\n public String toString() {\n return \"--------------------------------------------\\n\"+\n \"username: \" + username + \"\\n\" + \n \"fullName: \" + lastName + \" \" + firstName + \"\\n\" + \n \"password: \" + password + \"\\n\" +\n \"phone: \" + phone + \"\\n\" + \n \"email: \" + email + \"\\n\";\n }", "String getNewPassword();", "private static void lookupAccount(String email) {\n\t\t\n\t}", "public java.lang.String getLoginAccount() {\n java.lang.Object ref = loginAccount_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n loginAccount_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getLoginAccount() {\n java.lang.Object ref = loginAccount_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n loginAccount_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "@Override\n public String toString()\n {\n return getClass().getSimpleName() + \"(\" + getAccountID() + \")\";\n }", "Account getAccount();", "public String generateAccountNumber() {\n // Set First part of AccountNumber\n String accountNumberFirst = \"1398\";\n\n // To Make Second, Third part Get each date and time\n String currentTime = getCurrentTime();\n\n // Get year, month, day\n String date = currentTime.split(\" \")[0];\n int year, month, day;\n year = Integer.parseInt(date.split(\"-\")[0]);\n month = Integer.parseInt(date.split(\"-\")[1]);\n day = Integer.parseInt(date.split(\"-\")[2]);\n\n // Get hour, minute, second\n String time = currentTime.split(\" \")[1];\n int hour, minute, second;\n hour = Integer.parseInt(time.split(\":\")[0]);\n minute = Integer.parseInt(time.split(\":\")[1]);\n second = Integer.parseInt(time.split(\":\")[2]);\n\n // Set Second part of AccountNumber\n String accountNumberSecond;\n accountNumberSecond = Integer.toString((year % 10)) + Integer.toString((month * second) % 10) + Integer.toString((day * minute + hour) % 10);\n\n // Set Third part of AccountNumber\n String accountNumberThird;\n accountNumberThird = Integer.toString((second * hour + minute) % 10) + Integer.toString((second * day + hour) % 10) + Integer.toString((day * month + second) % 10) + Integer.toString((second * minute + day) % 10);\n\n // Set Forth part of AccountNumber\n String accountNumberForth;\n int count = (int)accountDataRepository.count();\n if(count % 100 < 10) {\n accountNumberForth = \"0\" + Integer.toString(count % 100);\n }\n else {\n accountNumberForth = Integer.toString(count % 100);\n }\n\n // Generate AccountNumber\n String accountNumber = accountNumberFirst + \"-\" + accountNumberSecond + \"-\" + accountNumberThird + \"-\" + accountNumberForth;\n\n return accountNumber;\n }", "public String toString(){\n return String.format(\"Vigenere Cipher (password='%s')\", password);\n }", "String getPassword();", "String getPassword();", "String getPassword();", "String getPassword();", "String getPassword();", "String getPassword();", "String getPassword();", "String getPassword();", "String getPassword();", "public String readAccountInfo(String accId, String pass) {\n if (accountId.equals(accId) && password.equals(pass)) {\n return customerEmail;\n }\n //return if unable to retrieve email address\n return \"Nope\";\n }", "@Override\n public String toString() {\n return \"accountNumber=\" + accountNumber +\n \", name='\" + name + '\\'' +\n \", balance=\" + balance +\n \", pendingBalance=\" + pendingBalance;\n }", "public String toString(){\r\n\t\treturn this.username+\"(\"+this.firstname+\" \"+this.lastname+\")\";\r\n\t}", "public String toString() {\n if (group == null) {\n return \"Account[user=\" + user + \"]\";\n }\n return \"Account[user=\" + user + \", group=\" + group + \"]\";\n }", "String getPass();", "int createAccount(Account account);", "private String lookupPassword(String user) {\n\treturn \"happy8\";\r\n\t}", "public String printAccounts() {\n StringBuilder result;\n result = new StringBuilder((\"--Listing accounts in the database--\\n\"));\n for (int i = 0; i < size; i++) {\n result.append(accounts[i].toString()).append(\"\\n\");\n }\n result.append(\"--end of listing--\");\n return result.toString();\n }", "AccountDetail getAccount(String number) throws Exception;", "@Override\n\tpublic String toString() {\n\t\treturn \"Hello, my name is: \" + getName() + \" and I have pass: \" + getPassword() + \" and balance: \" + getBalance() + \"$\" + \"\\n\";\n\t}", "String getUserUsername();", "public java.lang.String getLoginAccount() {\n java.lang.Object ref = loginAccount_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n loginAccount_ = s;\n return s;\n }\n }", "public java.lang.String getLoginAccount() {\n java.lang.Object ref = loginAccount_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n loginAccount_ = s;\n return s;\n }\n }", "private String isValid(Account account) {\n String result = \"\";\n if (!AccountUtil.isValidMail(account.getEmail())) {\n result = ErrorConstants.ERROR_VALIDMAIL;\n } else if (!AccountUtil.isValidPassword(account.getPassword())) {\n result = ErrorConstants.ERROR_PASS;\n } else if (authenticationRepo.checkAccountExistByEmail(account.getEmail())) {\n result = ErrorConstants.ERROR_EMAILUSED;\n }\n return result;\n }", "public String toString() {\n\t\tStringBuffer sb;\n\t\tsb = new StringBuffer(\"\\nlogin : \" + login);\n\t\tsb.append(\"\\npass : \" + passwd);\n\t\tif (admin) sb.append(\"admin\");\n\t\tif (pcreator) sb.append(\"pcreator\");\n\t\treturn sb.toString();\n\t}", "public String printAllAccountInformation(Account account) {\n\t\tString stringOne = \"|| \" + account.getBusinessName() + \" || \" + account.getAssets() + \n\t\t\t\t \" || \" + account.getLiabilities() + \" || \" + account.getRevenue() +\n\t\t\t\t \" || \" + account.getExpenses() + \" || \" + account.getBeginningInventory() +\n\t\t\t\t \" || \" + account.getPurchases() + \" || \" + account.getCostOfSales();\n\t\tString stringTwo = \" || \" + cal.calculateEquity(account) \n\t\t+ \" || \" + cal.calculateIncome(account) \n\t\t+ \" || \" + cal.calculateInvertory(account) + \" ||\";\n\t\treturn stringOne + stringTwo;\n\t}", "public String getUserEmail(String nick) throws DAOException;", "public String printFormattedAccounts() {\n\t\t\n\t\tStringBuilder output = new StringBuilder(\"\");\n\t\t\n\t\tif(size > 0) {\n\t\t\t\n\t\t\tfor(int i = 0; i < size; i++) {\n\t\t\t\t\n\t\t\t\toutput.append(accounts[i].toStringExport());\n\t\t\t\toutput.append(\"\\n\");\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\telse {\n\t\t\t\n\t\t\toutput.append(\"Empty database.\");\n\t\t\t\n\t\t}\n\t\t\n\t\treturn output.toString();\n\t\t\n\t}", "net.nyhm.protonet.example.proto.AccountProto.Account getAccount();", "net.nyhm.protonet.example.proto.AccountProto.Account getAccount();", "public String checkUsername() {\n String username = \"\"; // Create username\n boolean isOK = true; // Condition loop\n\n while (isOK) {\n username = checkEmpty(\"Account\"); // Call method to check input of username\n boolean isExist = false; // Check exist username\n for (Account acc : accounts) {\n // If username is exist, print out error\n if (username.equals(acc.getUsername())) {\n System.out.println(\"This account has already existed\");\n System.out.print(\"Try another account: \");\n isExist = true;\n }\n }\n // If username not exist then return username\n if (!isExist) {\n return username;\n }\n }\n return username; // Return username\n }", "@Override\n public String toString()//to show data\n {\n return \"the balance = \" + balance + \"\\n the account_number = \" + account_number + \"\\n\";\n }", "@Override\n public void onSuccess(final Account account) {\n String accountKitId = account.getId();\n\n // Get phone number\n PhoneNumber phoneNumber = account.getPhoneNumber();\n if (phoneNumber != null) {\n String phoneNumberString = phoneNumber.toString();\n }\n }", "String getPassportNumber();" ]
[ "0.68839806", "0.6686703", "0.6686703", "0.6332631", "0.63122314", "0.62528116", "0.62058157", "0.62058157", "0.61978424", "0.6074901", "0.60470897", "0.5963107", "0.5952566", "0.59347886", "0.58938164", "0.5866781", "0.58583677", "0.58571005", "0.5814944", "0.5814944", "0.58149415", "0.5813478", "0.58130145", "0.5790104", "0.5790104", "0.5790104", "0.57895195", "0.57895195", "0.57895195", "0.57895195", "0.57895195", "0.57895195", "0.57895195", "0.57895195", "0.57895195", "0.57895195", "0.5779525", "0.5749849", "0.57439727", "0.57363564", "0.5730025", "0.57101566", "0.5708566", "0.5704845", "0.57047457", "0.5701866", "0.5692245", "0.5691541", "0.56806844", "0.56551975", "0.5636969", "0.5613432", "0.5609717", "0.56044894", "0.560397", "0.55678326", "0.5562708", "0.5562411", "0.55563956", "0.5554099", "0.5540954", "0.55361027", "0.55361027", "0.5530767", "0.55227065", "0.5515714", "0.55107266", "0.5469682", "0.5469682", "0.5469682", "0.5469682", "0.5469682", "0.5469682", "0.5469682", "0.5469682", "0.5469682", "0.54672235", "0.54396063", "0.5418697", "0.54118353", "0.5410333", "0.54082763", "0.54060346", "0.54042876", "0.54007614", "0.5395235", "0.5391137", "0.53834146", "0.53834146", "0.5378753", "0.5363576", "0.5360044", "0.53544706", "0.5351274", "0.53494257", "0.53494257", "0.5346315", "0.5331893", "0.5318285", "0.53156215" ]
0.7135054
0
return String.format(NO_ACCOUNTS, userName, password);
public static String logNoAccounts(String userName, String password) { return String.format(NO_ACCOUNTS, "xxx", "xxx"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String getUserPassword();", "java.lang.String getLoginAccount();", "java.lang.String getLoginAccount();", "String password();", "java.lang.String getAccount();", "private String getPasswordFor(String name) {\n return new StringBuilder().append(PASSWORD_FOR).append(\" '\").append(name).append(\"': \").toString();\n }", "@Override\r\n public String toString(){\r\n String out = \"Login - \";\r\n out += login;\r\n out += \" Password - \";\r\n out += Encryptor.decrypt(password,login);\r\n return out;\r\n }", "public static String invalidAuthentication() {\n return holder.format(\"invalidAuthentication\");\n }", "String getNewPassword();", "String getPassword();", "String getPassword();", "String getPassword();", "String getPassword();", "String getPassword();", "String getPassword();", "String getPassword();", "String getPassword();", "String getPassword();", "String getUserUsername();", "public String getCurrentUserAccount();", "public String toString(){\r\n //your code here\r\n return(\"Withdrawal of: $\" + amount + \"Date: \" + date + \"from account: \" + account);\r\n }", "public String toString()\r\n\t{\r\n\t\tString out;\r\n\t\t\r\n\t\tif (locked)\r\n\t\t{\r\n\t\t\tout = \"***LOCKED ACCOUNT***\";\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tout = \"***UNLOCKED ACCOUNT***\";\r\n\t\t}\r\n\t\tout += String.format(\"\\nUser Name: %s\\nAccount Number: %s\\nEmail Address: %s\\n%s\",\r\n\t\t\t\tuserName, getAccountNumberString(), getEmailAddress(), getNotification());\r\n\t\t\r\n\t\tif (!locked)\r\n\t\t{\r\n\t\t\tnotification = null;\r\n\t\t}\r\n\t\t\r\n\t\treturn out;\r\n\t}", "public String getAccount() {\n\t\treturn getUsername() + \":\" + getPassword() + \"@\" + getUsername();\n\t}", "public String toString(){\n return String.format(\"Vigenere Cipher (password='%s')\", password);\n }", "java.lang.String getPassword();", "java.lang.String getPassword();", "java.lang.String getPassword();", "java.lang.String getPassword();", "java.lang.String getPassword();", "java.lang.String getPassword();", "java.lang.String getPassword();", "String getPass();", "public AccountReturnStrings() {\n\t\t\n\t}", "String getPassportNumber();", "public String toString() {\n\t\tStringBuffer sb;\n\t\tsb = new StringBuffer(\"\\nlogin : \" + login);\n\t\tsb.append(\"\\npass : \" + passwd);\n\t\tif (admin) sb.append(\"admin\");\n\t\tif (pcreator) sb.append(\"pcreator\");\n\t\treturn sb.toString();\n\t}", "@Override\n public String toString() {\n return \"--------------------------------------------\\n\"+\n \"username: \" + username + \"\\n\" + \n \"fullName: \" + lastName + \" \" + firstName + \"\\n\" + \n \"password: \" + password + \"\\n\" +\n \"phone: \" + phone + \"\\n\" + \n \"email: \" + email + \"\\n\";\n }", "public String displayAccount() {\r\n\t return id+\",\"+name+\",\"+balance+\",\"+email+\",\"+dateOfOpening;\r\n }", "public static String logFoundAccount(Account account, String password) {\n return String.format(FOUND_ACCOUNT, \"xxx\", account.getAccountName(), \"xxx\", \"xxx\", \"xxx\");\n }", "String getTemporaryPassword();", "public String getAccountEntry() {\n return this.username + Utility.createLine(' ', MAX_USERNAME_LENGTH -\n this.username.length()) + \" \" + this.type + \" \"\n + String.format(\"%09.2f\", this.balance);\n }", "private static String genString(){\n final String ALPHA_NUMERIC_STRING =\n \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n int pwLength = 14; //The longer the password, the more likely the user is to change it.\n StringBuilder pw = new StringBuilder();\n while (pwLength-- != 0) {\n int character = (int)(Math.random()*ALPHA_NUMERIC_STRING.length());\n pw.append(ALPHA_NUMERIC_STRING.charAt(character));\n }\n return pw.toString(); //\n }", "public String toString(){\r\n\t\treturn this.username+\"(\"+this.firstname+\" \"+this.lastname+\")\";\r\n\t}", "public String returnUsername(){\n return username;\n }", "public String getAccountNo();", "public static String getUserAccount(String account){\n return \"select ui_account from user_information where ui_account = '\"+account+\"'\";\n }", "GenerateUserAccount () {\r\n }", "public String printFormattedAccounts() {\n\t\t\n\t\tStringBuilder output = new StringBuilder(\"\");\n\t\t\n\t\tif(size > 0) {\n\t\t\t\n\t\t\tfor(int i = 0; i < size; i++) {\n\t\t\t\t\n\t\t\t\toutput.append(accounts[i].toStringExport());\n\t\t\t\toutput.append(\"\\n\");\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\telse {\n\t\t\t\n\t\t\toutput.append(\"Empty database.\");\n\t\t\t\n\t\t}\n\t\t\n\t\treturn output.toString();\n\t\t\n\t}", "public static String getAccountPassword() {\n\t\tif ((xml == null) || (accountPassword == null)) return \"password\";\n\t\tif (accountPassword.equals(\"\")) return \"password\";\n\t\treturn accountPassword;\n\t}", "private Object String(char[] password) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }", "public java.lang.String getPassword();", "public String toString(){\n return username;\n\n }", "String getUserName();", "String getUserName();", "public String getPassword();", "public String getPassword();", "String getUsername();", "String getUsername();", "String getUsername();", "String getUsername();", "String getUsername();", "String getUsername();", "String usernameLabel();", "private String newPassword() {\n\t\tchar[] vet = new char[10];\n\t\tfor(int i=0; i<10; i++) {\n\t\t\tvet[i] = randomChar();\n\t\t}\n\t\treturn new String(vet);\n\t}", "public String generatePassword(){\n\t\treturn \"a\" + super.generatePassword() + \"1\";\n\t}", "public String generateAccountNumber() {\n // Set First part of AccountNumber\n String accountNumberFirst = \"1398\";\n\n // To Make Second, Third part Get each date and time\n String currentTime = getCurrentTime();\n\n // Get year, month, day\n String date = currentTime.split(\" \")[0];\n int year, month, day;\n year = Integer.parseInt(date.split(\"-\")[0]);\n month = Integer.parseInt(date.split(\"-\")[1]);\n day = Integer.parseInt(date.split(\"-\")[2]);\n\n // Get hour, minute, second\n String time = currentTime.split(\" \")[1];\n int hour, minute, second;\n hour = Integer.parseInt(time.split(\":\")[0]);\n minute = Integer.parseInt(time.split(\":\")[1]);\n second = Integer.parseInt(time.split(\":\")[2]);\n\n // Set Second part of AccountNumber\n String accountNumberSecond;\n accountNumberSecond = Integer.toString((year % 10)) + Integer.toString((month * second) % 10) + Integer.toString((day * minute + hour) % 10);\n\n // Set Third part of AccountNumber\n String accountNumberThird;\n accountNumberThird = Integer.toString((second * hour + minute) % 10) + Integer.toString((second * day + hour) % 10) + Integer.toString((day * month + second) % 10) + Integer.toString((second * minute + day) % 10);\n\n // Set Forth part of AccountNumber\n String accountNumberForth;\n int count = (int)accountDataRepository.count();\n if(count % 100 < 10) {\n accountNumberForth = \"0\" + Integer.toString(count % 100);\n }\n else {\n accountNumberForth = Integer.toString(count % 100);\n }\n\n // Generate AccountNumber\n String accountNumber = accountNumberFirst + \"-\" + accountNumberSecond + \"-\" + accountNumberThird + \"-\" + accountNumberForth;\n\n return accountNumber;\n }", "public String printEnterPassword() {\n return \"Please enter your current password: \";\n }", "public static String accountExpired(String username) {\n return holder.format(\"accountExpired\", username);\n }", "@Override\n\tpublic String createAccount() {\n\t\treturn \"Created Saving Account Sucessfully\";\n\t}", "public java.lang.String getSpPassword(){\r\n return localSpPassword;\r\n }", "static void printAccountBalance(String address){\n }", "public java.lang.String getAccountNumberString()\r\n\t{\r\n\t\t\r\n\t}", "public static String logIn() {\n\t\tboolean flag;\n\t\tdo {\n\t\t\tflag = false;\n\t\t\ttry {\n\t\t\t\tResultSet rs = Messages.connect().executeQuery(\"SELECT B_Username, B_Password FROM BloodDonor\");\n\t\t\t\tusername_login = JOptionPane.showInputDialog(null,\"Welcome! Please type your username\", \"LOG IN\", JOptionPane.INFORMATION_MESSAGE);\n\t\t\t\tpassword_login = JOptionPane.showInputDialog(null,\"Enter your password\", \"LOG IN\", JOptionPane.INFORMATION_MESSAGE);\n\t\t\t\twhile (rs.next()){\n\t\t\t\t\tif (rs.getString(\"B_Username\").equals(username_login) && rs.getString(\"B_password\").equals(password_login)){\n\t\t\t\t\t\tflag = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t\tif (flag == false){\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Invalid username or password. Please try again.\", \"ALERT MESSAGE\", JOptionPane.WARNING_MESSAGE);\n\t\t\t\t}\n\t\t\t\tMessages.connect().close();\n\t\t\t } catch (InputMismatchException | SQLException e) {\n JOptionPane.showMessageDialog(null, \"Please enter a valid username or password.\", \"ALERT MESSAGE\", JOptionPane.WARNING_MESSAGE);\n flag = false;\n }\n\t\n\t\t}while (flag == false);\n\t\treturn username_login;\n\t}", "private String lookupPassword(String user) {\n\treturn \"happy8\";\r\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn \"Hello, my name is: \" + getName() + \" and I have pass: \" + getPassword() + \" and balance: \" + getBalance() + \"$\" + \"\\n\";\n\t}", "java.lang.String getPass();", "java.lang.String getPass();", "@Override\n public String toString() {\n return \"\\nname: \" + name +\n \"\\npassword: \" + password +\n \"\\ndateOfBirth: \" + dateOfBirth +\n \"\\nmarriageStatus: \" + marriageStatus +\n \"\\naccountNumber: \" + accountNumber +\n \"\\namount in account 1 : \" + amountAccount1 +\n \"\\naccountNumber2: \" + accountNumber2 +\n \"\\namount in account 2 : \" + amountAccount2 +\n \"\\nrelativeName: \" + relativeName +\n \"\\nrelativeAge: \" + relativeAge;\n }", "private String statementForAccount(Account account) {\n\tStringBuilder statement = new StringBuilder(\"\");\n\n //Translate to pretty account type\n switch(account.getAccountType()){\n case CHECKING:\n statement.append(\"Checking Account\\n\");\n break;\n case SAVINGS:\n statement.append(\"Savings Account\\n\");\n break;\n case MAXI_SAVINGS:\n statement.append(\"Maxi Savings Account\\n\");\n break;\n }\n\n //Now total up all the transactions\n double total = 0.0;\n for (Transaction transaction : account.getTransactions()) {\n statement.append(\" \" + (transaction.getAmount() < 0 ? \"withdrawal\" : \"deposit\") + \" \" + toDollars(transaction.getAmount()) + \"\\n\");\n total += transaction.getAmount();\n }\n statement.append(\"Total \" + toDollars(total));\n return statement.toString();\n }", "String getAccountID();", "String getAccountID();", "java.lang.String getAccountNumber();", "@Override\r\n\tpublic String toString() {\r\n\t\t//new toString method for using possible fail checks (validation) later\r\n\t\t//it will not print PASSWORD\r\n\t\treturn String.format(\"UserID: \"+ userID +\"\\nUsername: \"+ username +\"\\nWeight: \"+ weight);\r\n\t}", "public static String expiredCredentials(String username) {\n return holder.format(\"expiredCredentials\", username);\n }", "static String getAccountStatement(int accountNum) {\n int accountCompare; // for comparison\n try {\n // Select all the SQL columns needed to output a statement\n rs = st.executeQuery(\"SELECT AccountNum, LastName, FirstName, UserBalanceC, UserBalanceS FROM CashiiDB2\");\n\n // Keep comparing till the if statement finds what it needs, then output\n while (rs.next()) {\n accountCompare = rs.getInt(\"AccountNum\");\n if (accountCompare == accountNum)\n return \"<h1>\" + rs.getString(\"FirstName\") + \" \" + rs.getString(\"LastName\") + \"</h1>\" + \"Account Number: \" + rs.getInt(\"AccountNum\") + \"<br> <p>Savings: $\" + rs.getInt(\"UserBalanceS\") + \"<br>Chequing: $\" + rs.getInt(\"UserBalanceC\") + \"<p>\";\n // accountCompare + \", \" + rs.getInt(\"UserPIN\") + \", \\n\" + rs.getString(\"LastName\") + \", \" + rs.getString(\"FirstName\") + \", \" + rs.getDouble(\"UserBalanceC\") + \", \" +rs.getDouble(\"UserBalanceS\");\n }\n } catch (java.sql.SQLException e) {\n e.printStackTrace();\n }\n return \"NOTFOUND\"; // This should not happen in any circumstance\n }", "String getLoginapiavgrtt();", "String getTradingAccount();", "String getUser();", "String getUser();", "@Override\n\tpublic String toString () {\n\t\tString pUser = \"User: \" + getID();\n\t\tString pPass = \"Pass: \" + getPass();\n\t\treturn pUser + \" \" + pPass;\n\t}", "public static String userNotFound(String username) {\n return holder.format(\"userNotFound\", username);\n }", "public String toString()\r\n/* 61: */ {\r\n/* 62:75 */ return \"User [username=\" + this.username + \", password=\" + this.password + \", email=\" + this.email + \", phone=\" + this.phone + \"]\";\r\n/* 63: */ }", "java.lang.String getCred();", "public String toString() {\r\n\t\tif (!error)\r\n\t\t\treturn \"Username: \" + userName + \"\\nID: \" + id + \"\\nAuthToken: \" + authToken;\r\n\t\telse\r\n\t\t\treturn \"Error: \" + message; \r\n\t}", "private static String accountNumberGenerator() {\n char[] chars = new char[10];\n for (int i = 0; i < 10; i++) {\n chars[i] = Character.forDigit(rnd.nextInt(10), 10);\n }\n return new String(chars);\n }", "public String getAccountInfo(){\n NumberFormat currencyFormat = NumberFormat.getCurrencyInstance();\n return \"Account No : \" + accountNo +\n \"\\nName : \" + name +\n \"\\nBalance : \" + currencyFormat.format(balance);\n }", "String getAccountDescription();", "String getAccountDescription();", "String errorMessage();", "java.lang.String getUsername();", "java.lang.String getUsername();" ]
[ "0.64035577", "0.62975115", "0.62975115", "0.6283365", "0.6151478", "0.6096482", "0.6080094", "0.6059563", "0.6051549", "0.6043711", "0.6043711", "0.6043711", "0.6043711", "0.6043711", "0.6043711", "0.6043711", "0.6043711", "0.6043711", "0.59891015", "0.59797436", "0.594254", "0.59330654", "0.5874295", "0.58433044", "0.5790801", "0.5790801", "0.5790801", "0.5790801", "0.5790801", "0.5790801", "0.5790801", "0.5770598", "0.5747781", "0.5725622", "0.5721079", "0.5711588", "0.5704921", "0.5692069", "0.5691841", "0.56445074", "0.5631583", "0.56213564", "0.5618027", "0.55979115", "0.5589312", "0.5582156", "0.5579003", "0.5567922", "0.55670696", "0.5564842", "0.5560597", "0.5548411", "0.5548411", "0.55227715", "0.55227715", "0.5516063", "0.5516063", "0.5516063", "0.5516063", "0.5516063", "0.5516063", "0.55073416", "0.5500212", "0.54977864", "0.5482859", "0.54754966", "0.54734915", "0.54544026", "0.5444407", "0.5443059", "0.54373246", "0.54325926", "0.54300284", "0.5427336", "0.54263467", "0.54263467", "0.54067594", "0.5403503", "0.5397098", "0.5397098", "0.5387717", "0.5373529", "0.5371793", "0.53688496", "0.53675437", "0.5359064", "0.5357395", "0.5357395", "0.5351774", "0.5351042", "0.53483427", "0.5342651", "0.5341015", "0.53358126", "0.5330024", "0.53158474", "0.53158474", "0.5307254", "0.5303981", "0.5303981" ]
0.675748
0
return String.format(REQUEST_SENDER_TOKEN_REQUEST, accountId, envelopeId, callbackUrl);
public static String logRequestSenderTokenRequest(String accountId, String envelopeId, String callbackUrl) { return String.format(REQUEST_SENDER_TOKEN_REQUEST, "xxx", envelopeId, callbackUrl); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String buildResponseString(String code) {\r\n StringBuilder responseString = new StringBuilder();\r\n\r\n responseString.append(ACCESS_TOKEN);\r\n responseString.append(\"?client_id=\" + CLIENT_ID);\r\n responseString.append(\"&redirect_uri=\" + REDIRECT_URI);\r\n responseString.append(\"&code=\" + code);\r\n responseString.append(\"&client_secret=\" + APP_SECRET);\r\n return responseString.toString();\r\n }", "@WebMethod\n public String getRequestToken() {\n String result = TokenService.getRequestToken();\n return result;\n }", "String getTokenString();", "GetToken.Req getGetTokenReq();", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "public static String getRequestToken(Context context){\n\t\t\tSharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);\n\t\t\treturn prefs.getString(TWITTER_REQUEST_TOKEN, null);\n\t\t}", "public static String streamingEnabledToken() {\n return \"{\" +\n \" \\\"pushEnabled\\\": true,\" +\n \" \\\"token\\\": \\\"eyJhbGciOiJIUzI1NiIsImtpZCI6IjVZOU05US45QnJtR0EiLCJ0eXAiOiJKV1QifQ.eyJ4LWFibHktY2FwYWJpbGl0eSI6IntcIk16TTVOamMwT0RjeU5nPT1fTVRFeE16Z3dOamd4X01UY3dOVEkyTVRNME1nPT1fbXlTZWdtZW50c1wiOltcInN1YnNjcmliZVwiXSxcIk16TTVOamMwT0RjeU5nPT1fTVRFeE16Z3dOamd4X3NwbGl0c1wiOltcInN1YnNjcmliZVwiXSxcImNvbnRyb2xfcHJpXCI6W1wic3Vic2NyaWJlXCIsXCJjaGFubmVsLW1ldGFkYXRhOnB1Ymxpc2hlcnNcIl0sXCJjb250cm9sX3NlY1wiOltcInN1YnNjcmliZVwiLFwiY2hhbm5lbC1tZXRhZGF0YTpwdWJsaXNoZXJzXCJdfSIsIngtYWJseS1jbGllbnRJZCI6ImNsaWVudElkIiwiZXhwIjoyMjA4OTg4ODAwLCJpYXQiOjE1ODc0MDQzODh9.LcKAXnkr-CiYVxZ7l38w9i98Y-BMAv9JlGP2i92nVQY\\\"\" +\n \"}\";\n\n }", "public String getToken();", "public String getRequestMessage()\r\n/* 34: */ {\r\n/* 35:26 */ return this.requestMessage;\r\n/* 36: */ }", "String getToken();", "String getToken();", "String getToken();", "String getToken();", "String getToken();", "private String pollForServerInitiatedToken(String returnedMessage, String notificationUrl) throws Exception {\n\n UriComponents urlComponent = null;\n try {\n urlComponent = UriComponentsBuilder.newInstance()\n .fromHttpUrl(notificationUrl + '/' + returnedMessage)\n .build().encode();\n log.info(\"===> si_callback URL: {}\", urlComponent.toString());\n } catch (Exception ex) {\n String message = String.format(\"Error building si_callback URL that attempts to obtain access token: %s\", ex.getMessage());\n log.error(message, ex);\n throw new Exception(message);\n }\n\n try {\n ResponseEntity<String> response = restTemplate.getForEntity(urlComponent.toString(), String.class);\n\n log.info(\"si_callback/{auth_req_id} endpoint: {}\", urlComponent.toString());\n log.info(\"si_callback Response {}\", response);\n returnedMessage = response.getBody();\n log.info(\"si_callback Response Body: {}\", returnedMessage);\n } catch (RestClientResponseException ex) {\n if (ex.getResponseBodyAsByteArray().length > 0) {\n returnedMessage = new String(ex.getResponseBodyAsByteArray());\n log.error(\"si_callback Response Message Byte Array: code: {} message: {}\", ex.getRawStatusCode() , returnedMessage);\n throw new Exception(returnedMessage);\n } else {\n log.error(\"si_callback Response Error Message: {}\", ex.getMessage());\n returnedMessage = ex.getMessage();\n throw new Exception(returnedMessage);\n }\n } catch (Exception e) {\n returnedMessage = \"Error in calling Token end point\" + e.getMessage();\n log.error(returnedMessage);\n throw new Exception(returnedMessage);\n }\n\n return returnedMessage;\n\n }", "@FormUrlEncoded\n @POST(\"oauth/request_token\")\n Flowable<ResponseBody> requestToken(@Field(\"oauth_callback\") String oauthCallback);", "String getRequest();", "public java.lang.String getOauth_token(){\r\n return localOauth_token;\r\n }", "public String getAccessTokenEndpoint(final TrueNTHOAuthConfig config) {\n\n\treturn config.getAccessTokenEndpoint();\n }", "String getAccessToken();", "String getAccessToken();", "public String generateToken(HttpServletRequest request)\r\n\t{\r\n\t\treturn tokensManager.generateToken((HttpServletRequest) request);\r\n\t}", "public static String sendLiveRequest(){\n\n // The following line initializes the HttpGet Object with the URL in order to send a request\n HttpGet get = new HttpGet(BASE_URL + ENDPOINT + \"?access_key=\" + ACCESS_KEY);\n\n try {\n CloseableHttpResponse response = httpClient.execute(get);\n HttpEntity entity = response.getEntity();\n\n // the following line converts the JSON Response to an equivalent Java Object\n JSONObject exchangeRates = new JSONObject(EntityUtils.toString(entity));\n \n Date timeStampDate = new Date((long)(exchangeRates.getLong(\"timestamp\")*1000)); \n DateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n String formattedDate = dateFormat.format(timeStampDate);\n \n String USDUAH = \"1 \" + exchangeRates.getString(\"source\") + \" in UAH : \" + exchangeRates.getJSONObject(\"quotes\").getDouble(\"USDUAH\") + \" (Date: \" + formattedDate + \")\";\n String USDEUR = \"1 \" + exchangeRates.getString(\"source\") + \" in EUR : \" + exchangeRates.getJSONObject(\"quotes\").getDouble(\"USDEUR\") + \" (Date: \" + formattedDate + \")\"; \n String USDGBP = \"1 \" + exchangeRates.getString(\"source\") + \" in GBP : \" + exchangeRates.getJSONObject(\"quotes\").getDouble(\"USDGBP\") + \" (Date: \" + formattedDate + \")\";\n String USDJPY = \"1 \" + exchangeRates.getString(\"source\") + \" in JPY : \" + exchangeRates.getJSONObject(\"quotes\").getDouble(\"USDJPY\") + \" (Date: \" + formattedDate + \")\";\n return USDUAH+\"\\n\"+USDEUR+\"\\n\"+USDGBP+\"\\n\"+USDJPY;\n } catch (ClientProtocolException e) { \n e.printStackTrace();\n Main.logger.log(Level.SEVERE, \"Exception: \", e);\n } catch (IOException e) {\n e.printStackTrace();\n Main.logger.log(Level.SEVERE, \"Exception: \", e);\n } catch (ParseException e) {\n e.printStackTrace();\n } catch (JSONException e) {\n e.printStackTrace();\n Main.logger.log(Level.SEVERE, \"Exception: \", e);\n }\n\t\treturn null;\n }", "public String getAccessTokenStatusEndpoint(final TrueNTHOAuthConfig config) {\n\n\treturn config.getAccessTokenStatusEndpoint();\n }", "RequestToken getOAuthRequestToken(String callbackURL) throws MoefouException;", "private String signature() {\n\t\t++this.nonce;\n\t\tString message = new String(this.nonce + this.username + this.apiKey);\n\t\tMac hmac = null;\n\n\t\ttry {\n\t\t\thmac = Mac.getInstance(\"HmacSHA256\");\n\t\t\tSecretKeySpec secret_key = new SecretKeySpec(\n\t\t\t\t\t((String) this.apiSecret).getBytes(\"UTF-8\"), \"HmacSHA256\");\n\t\t\thmac.init(secret_key);\n\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (InvalidKeyException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (UnsupportedEncodingException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn String.format(\"%X\",\n\t\t\t\tnew BigInteger(1, hmac.doFinal(message.getBytes())));\n\t}", "@Override\n public String getBotToken() {\n return \"412386556:AAHawYQpPaNLFdnpckQsYr7c3YdBQZEXy0I\";\n }", "private String toLoggableString() {\n\t\tString string = canceled ? \"canceled call\" : \"call\";\n\t\tHttpUrl redactedUrl = originalRequest.url().resolve(\"/...\");\n\t\treturn string + \" to \" + redactedUrl;\n\t}", "private String getSignString(HttpServletRequest request) throws IOException {\n\t\tString date = ((HttpServletRequest) request).getHeader(HttpHeaders.DATE);\n\t\tString body = ((RequestWrapper) request).getPayload();\n\t\tString base64Body = Base64.encodeBase64String(body.getBytes());\n\n\t\tStringBuilder sb = new StringBuilder(request.getScheme());\n\t\tsb.append(\"://\");\n\t\tsb.append(request.getServerName());\n\t\tsb.append((\"http\".equals(request.getScheme()) && request.getServerPort() == 80) || (\"https\".equals(request.getScheme()) && request.getServerPort() == 443) ? \"\" : \":\" + request.getServerPort() );\n\t\tsb.append(request.getRequestURI());\n\t\tsb.append(request.getQueryString() != null ? \"?\" + request.getQueryString() : \"\");\n\t\tsb.append(\" \");\n\t\tsb.append(date);\n\t\tsb.append(\" \");\n\t\tsb.append(base64Body);\n\n\t\treturn sb.toString();\n\t}", "public String getPushToken() {\n }", "java.lang.String getRemoteToken();", "private String getSignedAssertion(String clientId, String tokenEndpoint, String mccmnc, String code, String clientKeyPairs, String keyPair) throws Exception {\n log.info(\"Entering getSignedAssertion: tokenEndpoint: {}\", tokenEndpoint);\n\n AssertionBody assertionBody = new AssertionBody();\n\n assertionBody.setAud(tokenEndpoint);\n assertionBody.setIss(clientId);\n assertionBody.setSub(clientId);\n // Create a version 4 UUID\n assertionBody.setJti(UUID.randomUUID().toString());\n // Casting to int truncates fractional portion of long if it exists\n int iat = (int)(new Date().getTime() / 1000);\n assertionBody.setIat(iat);\n int exp = iat + 30 * 60;\n assertionBody.setExp(exp);\n\n ObjectMapper mapper = new ObjectMapper();\n\n JSONObject parseKeyPairs = null;\n try {\n parseKeyPairs = JSONObjectUtils.parse(clientKeyPairs);\n } catch (ParseException ex) {\n String returnedMessage = String.format(\"JSONProcessingException: Error converting AssertionBody to JSON string: %s\", ex.getMessage());\n log.error(returnedMessage);\n throw new Exception(returnedMessage);\n }\n Object signingKey = parseKeyPairs.get(clientId);\n log.info(\"===> signingKey: \" + signingKey);\n\n String jwtKeyId = signingKey == null ? \"\" : signingKey.toString();\n\n JwtHeaderAssertion jwtHeaderAssertion = createJwtHeaderAssertion(jwtKeyId);\n\n String jwtHeaderAssertionJsonStrng = null;\n String assertionBodyJsonString = null;\n // Convert Java POJO JwtHeaderAssertion object to JSON string\n // Convert Java POJO AssertionBody object to JSON string\n try {\n jwtHeaderAssertionJsonStrng = mapper.writeValueAsString(jwtHeaderAssertion);\n assertionBodyJsonString = mapper.writeValueAsString(assertionBody);\n } catch (JsonProcessingException ex) {\n String returnedMessage = String.format(\"JSONProcessingException: Error converting AssertionBody to JSON string: %s\", ex.getMessage());\n log.error(returnedMessage);\n throw new Exception(returnedMessage);\n }\n log.info(\"JwtHeaderAssertion JSON string: {}\", jwtHeaderAssertionJsonStrng);\n log.info(\"AssertionBody JSON string: {}\", assertionBodyJsonString);\n\n String unsignedAssertion = createUnsignedJwt(jwtHeaderAssertionJsonStrng, assertionBodyJsonString);\n log.info(\"unsignedAssertion: {}\", unsignedAssertion);\n\n String signedAssertion = \"\";\n\n try {\n signedAssertion = createSignedRSAToken(unsignedAssertion, clientId, clientKeyPairs, keyPair);\n } catch (ParseException ex) {\n String returnedMessage = String.format(\"ParseException: Error signing unsigned assertion: %s\", ex.getMessage());\n log.error(returnedMessage);\n throw new Exception(returnedMessage);\n } catch (JOSEException ex) {\n String returnedMessage = String.format(\"JOSEException: Error signing unsigned assertion: %s\", ex.getMessage());\n log.error(returnedMessage);\n throw new Exception(returnedMessage);\n }\n log.info(\"Leaving getSignedAssertion\");\n\n return signedAssertion;\n }", "Future<String> getAccessToken(OkapiConnectionParams params);", "String getRequestURL();", "@Override\n protected String doInBackground(Void... voids) {\n RequestHandler requestHandler = new RequestHandler(AppController.getAppContext());\n\n\n\n try {\n JSONObject response = requestHandler.sendPostRequest(URLs.URL_UPDATE_TOKEN_DAILY, null, Request.Method.POST);\n return response.toString();\n\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n\n return null;\n }", "public String generateAccessToken() {\n return accessTokenGenerator.generate().toString();\n }", "private static String getQuery() {\n String scope = \"\";\n generateState();\n\n for (String s : SCOPES) {\n scope += \"+\" + s;\n }\n\n return \"?response_type=code&redirect_uri=\" + REDIRECT_URL +\n \"&client_id=\" + CLIENT_KEY +\n \"&scope=\" + scope +\n \"&STATE=\" + STATE;\n }", "public String getRequestString()\n\t{\n\t\tStringBuilder sb = new StringBuilder();\n\t\t\n\t\tIdentType type2 = getIdent2Type();\n\t\t\n\t\tif( type2 == IdentType.USER )\n\t\t{\n\t\t\tIdentType type1 = getIdent1Type();\n\t\t\t\n\t\t\tSlots slots = getSlots();\n\n\t\t\tswitch( type1 )\n\t\t\t{\n\t\t\t\tcase DIVERTI:\n\t\t\t\t\tsb.append( \"SEND BLOCKED ADDRESS FOR THIRD-PARTY CALL DIVERSION USING \" );\n\t\t\t\t\tsb.append( slots.getLabel() );\n\t\t\t\t\tbreak;\n\t\t\t\tcase IPFIXI:\n\t\t\t\t\tsb.append( \"SEND INTER-PREFIX CALL EXTENDED ADDRESSING INFORMATION USING \" );\n\t\t\t\t\tsb.append( slots.getLabel() );\n\t\t\t\t\tbreak;\n\t\t\t\tcase PABXI:\n\t\t\t\t\tsb.append( \"SEND PABX EXTENSION USING\" );\n\t\t\t\t\tsb.append( slots.getLabel() );\n\t\t\t\t\tbreak;\n\t\t\t\tcase PSTNGI:\n\t\t\t\t\tif( slots == Slots.SLOTS_1 )\n\t\t\t\t\t{\n\t\t\t\t\t\tsb.append( \"SEND UP TO 9 PSTN DIALED DIGITS\" );\n\t\t\t\t\t}\n\t\t\t\t\telse if( slots == Slots.SLOTS_2 )\n\t\t\t\t\t{\n\t\t\t\t\t\tsb.append( \"SEND 10 TO 31 PSTN DIALED DIGITS\" );\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tsb.append( \"SEND PSTN DIALED DIGITS USING \" );\n\t\t\t\t\t\tsb.append( slots.getLabel() );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase SDMI:\n\t\t\t\t\tsb.append( \"SEND SHORT DATA MESSAGE USING \" );\n\t\t\t\t\tsb.append( slots.getLabel() );\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t/* MODE 2 */\n\t\t\tsb.append( \"SEND \" );\n\t\t\tsb.append( getDescriptor().getMode2Label() );\n\t\t}\n\t\t\n\t\treturn sb.toString();\n\t}", "@Override\n protected String buildPaySign(Map<String, String> api_response_params, String api_key) throws PayException {\n Map<String,String > params = new LinkedHashMap<>();\n params.put(amount ,api_response_params.get(amount));\n params.put(order_no ,api_response_params.get(order_no));\n params.put(plat_num ,api_response_params.get(plat_num));\n params.put(app_id ,api_response_params.get(app_id));\n params.put(sign_type ,api_response_params.get(sign_type));\n params.put(pay_type ,api_response_params.get(pay_type));\n params.put(status ,api_response_params.get(status));\n params.put(back_status ,api_response_params.get(back_status));\n params.put(complete_time ,api_response_params.get(complete_time));\n String signMd5 = JSON.toJSONString(params);\n\n log.debug(\"[酷狗支付]-[响应支付]-2.生成加密URL签名完成:{}\", JSON.toJSONString(signMd5) );\n return signMd5;\n }", "Pokemon.RequestEnvelop.AuthInfo.JWT getToken();", "public java.lang.String getToken(){\r\n return localToken;\r\n }", "java.lang.String getRequestID();", "@Override\n protected String getAccessTokenUrl(final JsonNode inputOAuthConfiguration) {\n return TOKEN_URL;\n }", "private String getKey(final PushToken token) throws UnsupportedEncodingException {\n final String sKey = new StringBuilder().append(\"/\").append(token.getTenantKey()).append(\"/\")\n .append(token.getUserId()).toString();\n\n return sKey;\n }", "String generateUserRequestToken(String username, Collection<String> authorities);", "String getTransactionId();", "String getTransactionId();", "long requestId();", "long requestId();", "public String getResponseMessage();", "String getTokenEndpoint(FederationElement fedElem);", "protected static String generateToken()\n\t{\n\t\treturn UUID.randomUUID().toString();\n\t}", "String requestToString(MovilizerRequest request);", "java.lang.String getResponse();", "public String buildLoginUrl() {\n\t\tfinal GoogleAuthorizationCodeRequestUrl url = flow\n\t\t\t\t.newAuthorizationUrl();\n\t\treturn url.setRedirectUri(CALLBACK_URI).setState(stateToken).build();\n\t}", "public String getToken()\n {\n return ssProxy.getToken();\n }", "private String getTokenV2(TokenRequestBody tokenRequestBody, String tokenEndPoint) throws Exception {\n log.info(\"Entering getTokenV2\");\n String message = null;\n HttpStatus status = null;\n try {\n\n MultiValueMap<String, String> map = new LinkedMultiValueMap<>();\n map.add(GRANT_TYPE, tokenRequestBody.getGrantType());\n map.add(CODE, tokenRequestBody.getCode());\n map.add(CLIENT_ID, tokenRequestBody.getClientId());\n map.add(REDIRECT_URI, tokenRequestBody.getRedirectUri());\n map.add(CLIENT_ASSERTION_TYPE, tokenRequestBody.getClientAssertionType());\n map.add(CLIENT_ASSERTION, tokenRequestBody.getClientAssertion());\n log.info(\"Just created token request map\");\n\n HttpHeaders headers = new HttpHeaders();\n headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);\n Object loggedHeader = headers.remove(HttpHeaders.AUTHORIZATION);\n\n HttpEntity<MultiValueMap<String, String>> request = new HttpEntity<>(map, headers);\n log.info(\"User Token v2>>Carrier endpoint: {}\", tokenEndPoint);\n log.info(\"User Token v2>>Carrier Request: {}\", loggedHeader);\n log.info(\"User Token v2>>Carrier Body: {}\", map);\n log.info(\"User Token v2>>Request: {}\", request);\n log.info(\"tokenEndPoint: {}\", tokenEndPoint);\n\n ResponseEntity<String> response = restTemplate.exchange(tokenEndPoint, HttpMethod.POST, request,\n String.class);\n log.info(\"Just made carrier token endpoint REST call\");\n if (!response.getStatusCode().equals(HttpStatus.OK)) {\n throw new OauthException(\"Carrier thrown Exception: \" + response.getStatusCodeValue());\n }\n message = response.getBody();\n log.info(\"User Token2 Response: {}\", message);\n } catch (RestClientResponseException ex) {\n String returnedMessage = \"\";\n if (ex.getRawStatusCode() == 401) {\n returnedMessage = String.format(\"Error getTokenV2: HTTP 401: Unauthorized token: %s\", ex.getMessage());\n log.error(returnedMessage);\n throw new Exception(returnedMessage);\n }\n if (ex.getResponseBodyAsByteArray().length > 0)\n returnedMessage = new String(ex.getResponseBodyAsByteArray());\n else\n returnedMessage = ex.getMessage();\n status = HttpStatus.BAD_REQUEST;\n log.error(\"HTTP 400: \" + returnedMessage);\n throw new OauthException(returnedMessage, status);\n } catch (Exception ex) {\n String returnedMessage = String.format(\"Error getTokenV2: Error in calling Token end point: %s\", ex.getMessage());\n log.error(returnedMessage);\n throw new Exception(returnedMessage);\n }\n log.info(\"Leaving getTokenV2\");\n return message;\n }", "public String getAccessToken();", "private static final String m2193f() {\n StringBuilder stringBuilder = new StringBuilder();\n stringBuilder.append(\"fb\");\n stringBuilder.append(C0560t.m1253e());\n stringBuilder.append(\"://authorize\");\n return stringBuilder.toString();\n }", "private String m25428h() {\n if (this.a == null) {\n return null;\n }\n Uri parse;\n Builder builder;\n String a = AdSettings.m6374a();\n if (a != null) {\n if (!a.isEmpty()) {\n a = String.format(\"https://www.%s.facebook.com/audience_network/server_side_reward\", new Object[]{a});\n parse = Uri.parse(a);\n builder = new Builder();\n builder.scheme(parse.getScheme());\n builder.authority(parse.getAuthority());\n builder.path(parse.getPath());\n builder.query(parse.getQuery());\n builder.fragment(parse.getFragment());\n builder.appendQueryParameter(\"puid\", this.a.m7645a());\n builder.appendQueryParameter(\"pc\", this.a.m7646b());\n builder.appendQueryParameter(\"ptid\", this.f19103e);\n builder.appendQueryParameter(\"appid\", this.f19107i);\n return builder.build().toString();\n }\n }\n a = \"https://www.facebook.com/audience_network/server_side_reward\";\n parse = Uri.parse(a);\n builder = new Builder();\n builder.scheme(parse.getScheme());\n builder.authority(parse.getAuthority());\n builder.path(parse.getPath());\n builder.query(parse.getQuery());\n builder.fragment(parse.getFragment());\n builder.appendQueryParameter(\"puid\", this.a.m7645a());\n builder.appendQueryParameter(\"pc\", this.a.m7646b());\n builder.appendQueryParameter(\"ptid\", this.f19103e);\n builder.appendQueryParameter(\"appid\", this.f19107i);\n return builder.build().toString();\n }", "@Override\n\tpublic String buildRequest(String timestamp) {\n\t\tMap<String, String> sParaTemp = new LinkedHashMap<String, String>();\n\t\tsParaTemp.put(\"userid\",userid);\n\t\tsParaTemp.put(\"serverid\",serverid+\"\");\n\t\tsParaTemp.put(\"ptime\",timestamp);\n\t\tsParaTemp.put(\"isadult\",isAdult+\"\");\n\t\tString prestr = MapToParam.createRequestParams(sParaTemp,\"&\"+KEY);\n\t\treturn LOGIN_PATH+\"&\"+prestr;\n\t}", "private String getPaymentToken() {\r\n\t\tString paymentToken = \"\";\r\n\t\tUserItem currentUserItem = getSimpleWorksUserSessionConfiguration().getCurrentUser();\r\n\t\tOrderItem orderItem = getSimpleWorksUserSessionConfiguration().getOrderItem();\r\n\t\tif (orderItem != null) {\r\n\t\t\tpaymentToken = \"\" + orderItem.getOrderId();\r\n\t\t\t if (currentUserItem != null){\r\n\t\t\t\t paymentToken += \"#\" + currentUserItem.getUserId();\r\n\t\t\t }\r\n\t\t}\r\n\t\treturn paymentToken;\r\n\t}", "public java.lang.String getToken(){\n return localToken;\n }", "@Test\n public void destiny2AwaGetActionTokenTest() {\n String correlationId = null;\n InlineResponse20059 response = api.destiny2AwaGetActionToken(correlationId);\n\n // TODO: test validations\n }", "private String prepareSecurityToken() {\r\n\t\tint time = ((int) System.currentTimeMillis() % SECURITY_TOKEN_TIMESTAMP_RANGE);\r\n\t\treturn String.valueOf(time + (new Random().nextLong() - SECURITY_TOKEN_TIMESTAMP_RANGE));\r\n\t}", "public String getClientRequestToken() {\n return this.clientRequestToken;\n }", "public String getClientRequestToken() {\n return this.clientRequestToken;\n }", "public String getClientRequestToken() {\n return this.clientRequestToken;\n }", "GetToken.Res getGetTokenRes();", "private String issueToken(String username) {\n \n String token =TokenManagement.getTokenHS256(username,tokenSec,tokenduration);\n return token;\n }", "String getResponse();", "public static String getAccessToken() {\n return \"\";\n }", "void requestSendSMSCode(Context context,String phone);", "private String generateSignatureBaseString(String httpMethod, String url, Map<String, String> requestParams, String nonce, String timestamp) {\n Map<String, String> params = new HashMap<>();\n requestParams.entrySet().forEach(entry -> {\n put(params, entry.getKey(), entry.getValue());\n });\n put(params, oauth_consumer_key, consumerKey);\n put(params, oauth_nonce, nonce);\n put(params, oauth_signature_method, signatureMethod);\n put(params, oauth_timestamp, timestamp);\n put(params, oauth_token, token);\n put(params, oauth_version, version);\n Map<String, String> sortedParams = params.entrySet().stream().sorted(Map.Entry.comparingByKey())\n .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, LinkedHashMap::new));\n StringBuilder base = new StringBuilder();\n sortedParams.entrySet().forEach(entry -> {\n base.append(entry.getKey()).append(\"=\").append(entry.getValue()).append(\"&\");\n });\n base.deleteCharAt(base.length() - 1);\n String baseString = httpMethod.toUpperCase() + \"&\" + encode(url) + \"&\" + encode(base.toString());\n return baseString;\n }", "private String getMessage() {\n\t\tSharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);\r\n\t\t\r\n\t\tboolean addSign = prefs.getBoolean(\"addsign\", true);\r\n\t\t\r\n\t\ttry {\r\n\t\t\r\n\t\tdefMessage = \"I am busy right now and will call you latter.\";\r\n\t\t\r\n\t\tfinalMessage = prefs.getString(\"message\", defMessage);\r\n\t\tif(finalMessage.equals(\"\"))\r\n\t\t\tfinalMessage = defMessage;\r\n\t\t} catch (RuntimeException e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t\tfinalMessage = defMessage;\r\n\t\t}\r\n\t\t\r\n\t\tif(addSign)\r\n\t\t\tfinalMessage += \"\\nSent using Calls and SMS Blocker for android.\\nDownload from: https://play.google.com/store/apps/details?id=com.atiffarrukh.callandsmsblocker\";\r\n\t\treturn finalMessage;\r\n\t}", "private String getRequestUrl(String query) {\n\n StringBuilder builder = new StringBuilder();\n float lat, lng;\n\n // check for location, if not found, check for locally saved location\n if (location != null) {\n lat = location.lat;\n lng = location.lng;\n } else {\n lat = SharedPrefs.get(C.sp_last_lat);\n lng = SharedPrefs.get(C.sp_last_long);\n }\n String locationStr;\n // if even that is not found, search near Bangalore\n if (lat == -1 || lng == -1) {\n locationStr = \"near=Bengaluru\";\n } else {\n locationStr = \"ll=\" + lat + \",\" + lng;\n }\n\n builder.append(C.API_SEARCH)\n .append(\"client_id=\").append(C.FS_CLIENT_ID).append(\"&\")\n .append(\"client_secret=\").append(C.FS_CLIENT_SECRET).append(\"&\")\n .append(\"v=20191231&\")\n .append(\"limit=20&\")\n .append(\"intent=checkin&\")\n .append(locationStr);\n\n if (query != null) {\n builder.append(\"&query=\").append(query);\n }\n\n return builder.toString();\n\n }", "OAuth2Token getToken();", "@RequestMapping(value = \"/getSocialEmailId\", method = RequestMethod.GET, produces = \"application/javascript\")\n @ResponseBody\n public String getSocialEmailId(@RequestParam String accessToken) {\n String emailId = null;\n try {\n emailId = this.econnectService.getSocialEmailId(accessToken);\n } catch (Exception e) {\n e.printStackTrace();\n }\n return emailId;\n }", "private void requestToken(){\n APIAuth auth = new APIAuth(this.prefs.getString(\"email\", \"\"), this.prefs.getString(\"password\", \"\"), this.prefs.getString(\"fname\", \"\") + \" \" +this.prefs.getString(\"lname\", \"\"), this.prefs, null);\n auth.authenticate();\n }", "java.lang.String getChannelToken();", "java.lang.String getChannelToken();", "public static String generateSignatureBaseString(String requestMethod, String requestUrl, OAuth1Parameters oauthParameters, Map<String, String[]> requestParameters) throws URISyntaxException {\n\t\tMap<String, String[]> parameters = new LinkedHashMap<String, String[]>();\n\t\t\n\t\tint parameterPos = requestUrl.indexOf('?');\n\t\tint fragmentPos = requestUrl.indexOf('#', parameterPos + 1);\n\t\tif (parameterPos > -1) {\n\t\t\tString queryString = fragmentPos > -1 ? requestUrl.substring(parameterPos + 1, fragmentPos) : requestUrl.substring(parameterPos + 1);\n\t\t\tMap<String, String[]> httpParameters= HttpUtil.parseQueryString(queryString);\n\t\t\tif (httpParameters != null && !httpParameters.isEmpty()) {\n\t\t\t\tparameters.putAll(httpParameters);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Adding oauth parameters\n\t\tfor (Entry<String, String> entry : oauthParameters.getOAuthParameters().entrySet()) {\n\t\t\tif (!OAuth1Parameters.OAUTH_SIGNATURE.equals(entry.getKey())) {\n\t\t\t\tparameters.put(entry.getKey(), new String[] {entry.getValue()});\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (requestParameters != null && !requestParameters.isEmpty()) {\n\t\t\tparameters.putAll(requestParameters);\n\t\t}\n\t\t\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(OAuth1Util.encode(requestMethod.toUpperCase())).append(\"&\")\n\t\t .append(OAuth1Util.encode(normalizeUrl(requestUrl))).append(\"&\")\n\t\t .append(OAuth1Util.encode(normalizeParameters(parameters)));\n\t\t\n\t\treturn sb.toString();\n\t}", "public static void sendToken(SendTokenRequest tokenRequest) {\n APICalls invocations = getRetrofitEngine().create(APICalls.class);\n\n Call<SendTokenDAO> call = invocations.sendFCMToken(tokenRequest);\n call.enqueue(new retrofit2.Callback<SendTokenDAO>() {\n @Override\n public void onResponse(Call<SendTokenDAO> call, Response<SendTokenDAO> response) {\n BankCraftApplication.getInstance().getEventBus().post(new SendTokenResponseEvent(response.body()));\n }\n\n @Override\n public void onFailure(Call<SendTokenDAO> call, Throwable t) {\n BankCraftApplication.getInstance().getEventBus().post(new SendTokenResponseEvent(t.getMessage()));\n }\n });\n }", "private String createSignedRSAToken(String jwtToken, String clientId, String clientKeyPairs, String keyPair) throws ParseException, JOSEException {\n log.info(\"Entering createSignedRSAToken\");\n log.info(\"clientKeyPairs: {}\", clientKeyPairs);\n\n Object signingKey;\n\n // To not affect current functionality, if no clientId parameter is passed,\n // sign with the default playground's \"testing_key\"\n JSONObject parseKeyPairs = JSONObjectUtils.parse(clientKeyPairs);\n log.info(\"Parsed clientKeyPairs\");\n\n if (clientId.equals(\"none\")) {\n signingKey = parseKeyPairs.get(\"default\");\n } else {\n signingKey = parseKeyPairs.get(clientId);\n if (signingKey == null) {\n throw new OauthException(\"Client ID to private key mapping not found\", HttpStatus.BAD_REQUEST);\n }\n }\n log.info(\"signingKey: {}\", signingKey);\n\n String[] splitString = jwtToken.split(\"\\\\.\");\n\n log.info(\"Size of splitString: {}\", splitString.length);\n\n log.info(\"~~~~~~~~~ JWT Header ~~~~~~~\");\n String base64EncodedHeader = splitString[0];\n JWSHeader head = JWSHeader.parse(new Base64URL(base64EncodedHeader));\n\n\n log.info(\"~~~~~~~~~ JWT Body ~~~~~~~\");\n String base64EncodedBody = splitString[1];\n Payload payload = new Payload(new Base64URL(base64EncodedBody));\n\n // RSA signatures require a public and private RSA key pair,\n // the public key must be made known to the JWS recipient to\n // allow the signatures to be verified\n\n log.info(\"keyPair: {}\", keyPair);\n\n net.minidev.json.JSONObject parsedRsa = JSONObjectUtils.parse(keyPair);\n\n Object getSigningKey = parsedRsa.get(signingKey);\n String signingKeyToString = String.valueOf(getSigningKey);\n\n RSAKey rsaJWK = RSAKey.parse(signingKeyToString);\n RSAPrivateKey prK = (RSAPrivateKey) rsaJWK.toPrivateKey();\n RSAPublicKey puK = (RSAPublicKey) rsaJWK.toPublicKey();\n\n byte[] privateKeyEnc = prK.getEncoded();\n byte[] privateKeyPem = java.util.Base64.getEncoder().encode(privateKeyEnc);\n String privateKeyPemStr = new String(privateKeyPem);\n\n // Create RSA-signer with the private key\n JWSSigner signer = new RSASSASigner(rsaJWK);\n\n // Prepare JWS object with simple string as payload\n JWSObject jwsObject = new JWSObject(head, payload);\n\n // Compute the RSA signature\n jwsObject.sign(signer);\n\n // To serialize to compact form, produces something like\n String s = jwsObject.serialize();\n log.info(\"Signed RSA Token:\");\n log.info(s);\n\n // To parse the JWS and verify it, e.g. on client-side\n jwsObject = JWSObject.parse(s);\n\n JWSVerifier verifier = new RSASSAVerifier(puK);\n\n log.info(\"Verify: {}\", jwsObject.verify(verifier));\n\n log.info(\"In RSA we trust! --> {}\", jwsObject.getPayload().toString());\n return s;\n }", "private String getTokenTooOldMessage(long currentTimeInMillis, long timeStampSkewMillis, long issuedAtTimeMillis, long rejectBeforeMillis) {\n StringBuilder tmp = new StringBuilder();\n tmp.append(\"JSON Web Token is issued before the allowed time.\");\n tmp.append(\" Issued At Time(ms) : \");\n tmp.append(issuedAtTimeMillis);\n tmp.append(\", Reject before limit(ms) : \");\n tmp.append(rejectBeforeMillis);\n tmp.append(\", TimeStamp Skew : \");\n tmp.append(timeStampSkewMillis);\n tmp.append(\", Current Time : \");\n tmp.append(currentTimeInMillis);\n tmp.append(\". JWT Rejected and validation terminated\");\n return tmp.toString();\n }", "RequestToken getOAuthRequestToken() throws MoefouException;", "JsonObject fetchRecipient(String recipientToken);", "@GET\n\tString get(@QueryParam(\"tempToken\") String tempToken) {\n\n\t\tif(tempToken==null)\n\t\t\treturn \"Invalid token provided\";\n\t\t\n\t\tString responseString = \"\";\n\t\tClientConfig config = new ClientConfig();\n\t\tClient client = ClientBuilder.newClient(config);\n\t\tWebTarget target = client.target(getBaseURI(tempToken));\n\t\tresponseString = target.request().accept(MediaType.APPLICATION_JSON)\n\t\t\t\t.get(String.class);\n\t\tSystem.out.println(\"Obtained response is \" + responseString);\n\n\t\tif (responseString.contains(\"access_token=\")) {\n\t\t\tresponseString = responseString.replace(\"access_token=\", \"\");\n\t\t\treturn responseString;\n\t\t}else\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\t\n\n\t}", "public String getToken()\n {\n return token;\n }", "String getSender();", "public static String encodeUrl(String base, String parentCode, String code, String targetCode, String token) {\n\t\t/**\n\t\t * A Function for Base64 encoding urls\n\t\t **/\n\n\t\t// Encode Parent and Code\n\t\tString encodedParentCode = new String(Base64.getEncoder().encode(parentCode.getBytes()));\n\t\tString encodedCode = new String(Base64.getEncoder().encode(code.getBytes()));\n\t\tString url = base + \"/\" + encodedParentCode + \"/\" + encodedCode;\n\n\t\t// Add encoded targetCode if not null\n\t\tif (targetCode != null) {\n\t\t\tString encodedTargetCode = new String(Base64.getEncoder().encode(targetCode.getBytes()));\n\t\t\turl = url + \"/\" + encodedTargetCode;\n\t\t}\n\n\t\t// Add access token if not null\n\t\tif (token != null) {\n\t\t\turl = url +\"?token=\" + token;\n\t\t}\n\t\treturn url;\n\t}", "public String getRequestInXML() throws Exception;", "void onGetTokenSuccess(AccessTokenData token);", "abstract public String buildAuthRequest(String userId, String authCallback) throws IOException;", "@Override\n\tpublic String RequestToString() throws APIException \n\t{\n\t\tfor (Listener listen : listeners1)\n\t\t\tlisten.beforeRequestToString();\n\t\tString requesttoString=\"\";\n\t\ttry\n\t\t{\n\t\t\tapi.RequestToString();\n\t\t}\n\t\tcatch(APIException e)\n\t\t{\n\t\t\tfor (Listener listen : listeners1)\n\t\t\t\tlisten.onError(e);\n\t\t\tthrow new APIException(e);\n\t\t}\n\t\tfor (Listener listen : listeners1)\n\t\t\tlisten.afterRequestToString();\n\t\treturn requesttoString;\n\t}" ]
[ "0.6104177", "0.5714891", "0.5663434", "0.56453395", "0.56085527", "0.56085527", "0.56085527", "0.56085527", "0.56085527", "0.56085527", "0.56061035", "0.554535", "0.53887707", "0.53783816", "0.53600585", "0.53600585", "0.53600585", "0.53600585", "0.53600585", "0.53449607", "0.53444207", "0.53433216", "0.5322096", "0.52818215", "0.52512246", "0.52512246", "0.52440715", "0.52385104", "0.5205608", "0.5171494", "0.51568687", "0.5145745", "0.5133471", "0.51271254", "0.5124368", "0.51206243", "0.5103093", "0.5091547", "0.50635046", "0.5036249", "0.5029747", "0.5015543", "0.5000905", "0.4995448", "0.49909028", "0.49897814", "0.4982972", "0.4982449", "0.49796924", "0.49684468", "0.49600086", "0.49600086", "0.49562943", "0.49562943", "0.49455467", "0.494531", "0.49416834", "0.49369913", "0.4925398", "0.49237764", "0.49216834", "0.4918679", "0.49104834", "0.48973042", "0.48724142", "0.48640233", "0.48566532", "0.4854088", "0.48530394", "0.48472464", "0.48461163", "0.48461163", "0.48461163", "0.48385194", "0.48292333", "0.4826823", "0.4821727", "0.48068407", "0.48060066", "0.48051003", "0.48034638", "0.48015222", "0.4790028", "0.47893515", "0.47822067", "0.47822067", "0.47684124", "0.47654122", "0.47624585", "0.47589868", "0.4757193", "0.47506136", "0.47504392", "0.4741742", "0.4731727", "0.47287664", "0.47254503", "0.4718954", "0.4712308", "0.47102106" ]
0.7500807
0
return String.format(RECIPIENT, recipient.getType(), recipient.getID(), recipient.getUserName(), recipient.getEmail());
public static String logRecipient(Recipient recipient) { return String.format(RECIPIENT, recipient.getType(), recipient.getID(), recipient.getUserName(), "xxx"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public String toString() {\n return \"Recipient: \" + recipients[0] + \"; Type: \" + type;\n }", "public String messageToString(){\n String stringMessage = \"Message:\\n\" + text + \"\\nFrom User: \" + fromUser.toNameAndEmailString();\n if(toGroup != null && !emergency) {\n stringMessage = \"Message:\\n\" + text + \"\\nFrom User: \" + fromUser.toNameAndEmailString() + \"\\nTo Group:\\n\" + toGroup.groupToListString();\n\n }\n else if(emergency){\n stringMessage =\"EMERGENCY!!!\\n\" + \"Message:\\n\" + text + \"\\nFrom User: \" + fromUser.toNameAndEmailString() + \"\\n\";\n }\n\n\n return stringMessage;\n }", "public String toString ()\r\n\t{\r\n\t\tString format = \r\n\t\t\t\t\"*****************************************************************\" + \"\\n\" +\r\n\t\t\t\t\t\t\"\\t\" + \"The name of the contact is \"+ firstName + \" \" + surname + \". \" + \"\\n\" +\r\n\t\t\t\t\t\t\"\\t\" + \"The ID number of the contact is \" + uniqueID + \". \" + \"\\n\" +\r\n\t\t\t\t\t\t\"\\t\" + \"The phone number of the contact is \" + phoneNumber + \".\" + \"\\n\" +\r\n\t\t\t\t\t\t\"*****************************************************************\" + \"\\n\";\r\n\r\n\t\treturn format;\r\n\t}", "@Override\n protected String createEntityAsString(Message entity) {\n String stringToIds = \"\";\n List<User> listUsers = entity.getTo();\n for (User friend : listUsers) {\n stringToIds += friend.getId() + \",\";\n }\n if (stringToIds.length() >= 1)\n stringToIds = stringToIds.substring(0, stringToIds.length() - 1);\n String messageAttributes = \"\";\n messageAttributes += entity.getId() + \";\" +\n entity.getFrom().getId() + \";\" +\n stringToIds + \";\" +\n entity.getMessage() + \";\" +\n entity.getDate().format(Constants.DATE_TIME_FORMATTER);\n return messageAttributes;\n }", "public static String build_GOT_Email (String first, String last){\n // String email = first.charAt(0) + last + \"@NightWatch.com\";\n // return email ;\n // another way to print i can say this is the simplest way\n return first.charAt(0) + last + \"@NightWatch.com\";\n\n }", "String getEmail(int type);", "protected abstract String format();", "public String getRecipient()\n {\n return recipient;\n }", "protected String formatField() {\n \tif(!updated) return \"No record set.\";\n \t\n \tif(firstFieldP.getText() != null && lastFieldP.getText() != null) {\n\t \tfirstNameString = firstFieldP.getText();\n\t \tlastNameString = lastFieldP.getText();\n \t} else\t{\n \tfirstNameString = firstFieldC.getText();\n \tlastNameString = lastFieldC.getText();\n \ttribeString = tribeField.getText();\t\n \t}\n\n \tStringBuffer sb = new StringBuffer();\n \tsb.append(\"<html><p align=center>\");\n \tsb.append(firstNameString);\n \tsb.append(\" \");\n \tsb.append(lastNameString);\n \tsb.append(\"<br>\");\n \tsb.append(tribeString);\n \tsb.append(\"</p></html>\");\n \t\n \treturn sb.toString(); \t\n }", "public String toString()\r\n\t\t{\r\n\t\t\treturn firstName + \"#\" + familyName + \"#\" + ID + \"#\";\r\n\t\t}", "@Override //indicates that this method overrides a superclass method\n public String toString(){\n\n return String.format(\"%s: %s %s%n%s : %s%n%s: %.2f%n%s: %.2f\",\"commission employee\",firstName,lastName,\n \"pan number\",panCardNumber,\"gross sales\",grossSales,\"commission rate\",commissionRate);\n }", "@Override\n\tpublic String toString() {\n\t\t\n\t\treturn String.format(\"%s/%s, %s, %s, status: %s\",getNome(),getIdentificacao(),getEmail(),getCelular(),status);\n\t}", "@VTID(8)\r\n java.lang.String format();", "@Override \n\tpublic String toString()\n\t{\n\t\treturn \"When I talk to \" + contactName.getName() + \", remind me \" + reminderMessage;\n\t}", "private String format(final String format, final Object arg1, final Object arg2)\n\t{\n\t\treturn MessageFormatter.format(format, arg1, arg2).getMessage();\n\t}", "public static String format(Endereco endereco)\n\t{\n\t\tif(endereco != null)\n\t\t{\n\t\t\treturn endereco.getLogradouro() + (endereco.getComplemento() != null ? \" - \" + endereco.getComplemento() : \"\") + \", \" + endereco.getNumero() + \" - \" + endereco.getBairro() + \" (\" + endereco.getCidade().getNome() + \"/\" + endereco.getCidade().getEstado().getNome() + \")\";\n\t\t}\n\t\t\n\t\treturn Constants.TEXT_EMPTY;\n\t}", "public String toString(){ \r\n return \"Nome: \" + this.nome + \"\\nEmail: \" + this.email +\r\n \"\\nEndereço: \" + this.endereco + \"\\nId: \" + this.id + \"\\n\"; \r\n }", "@Override\n public String toString(){\n \n return String.format(\"%-8d%-10s%-10s%-10s %.2f\\t%-6b\", getCustNumber(), getFirstName(), getSurname(),\n getPhoneNum(), getCredit(), canRent);\n }", "@Override\n public String toString() {\n return \"\\r\\nUser: \" + user + \" Message: \" + message +\" \\r\\n\" ;\n }", "@Override\n public String toString() {\n var str = \"[\" + _id + \"] \" + _firstName + \" \" + _lastName + \", \" + _emailAddress.getEmail() + \", \" + _address.getWholeAdress(); //added adress in ToString\n if (_orders.size() > 0) {\n str += \", Orders: (\";\n for (var i = 0; i < _orders.size(); i++) {\n str += \"#\" + _orders.get(i).getId();\n if (i < _orders.size() - 1) str += \", \";\n }\n str += \")\";\n }\n return str;\n }", "public String toString(){\n\t\tStringBuilder sb = new StringBuilder();\n\t\tString results = new String();\n\t\tsb.append(\"\\nUser information: \"+user.toString()+\"Guests Coming: \"+guests+\"\\nAttending Result: \"+result);\n\t\tsb.append(\"\\nInformation Meeting :\"+meeting.toString());\n\t\treturn sb.toString();\n\t}", "public String toFIPAString() {\n String str = \"(\" + type.toUpperCase() + \"\\n\";\n if ( sender != null )\n str += \" :sender ( \" + getSender_As_FIPA_String() + \" )\\n\";\n if ( receivers != null && !receivers.isEmpty() ) {\n str += \" :receiver (set \";\n Enumeration allRec = getFIPAReceivers();\n while (allRec.hasMoreElements()) {\n FIPA_AID_Address addr = (FIPA_AID_Address) allRec.nextElement();\n String current =\"(\" + addr.toFIPAString() +\")\";\n str += current; }\n str += \" )\\n\";\n }\n if ( replyWith != null )\n str += \" :reply-with \" + replyWith + \"\\n\";\n if ( inReplyTo != null )\n str += \" :in-reply-to \" + inReplyTo + \"\\n\";\n if ( replyBy != null )\n str += \" :reply-by \" + replyBy + \"\\n\";\n if ( ontology != null )\n str += \" :ontology \" + ontology + \"\\n\";\n if ( language != null )\n str += \" :language \" + language + \"\\n\";\n if ( content != null )\n // try no \"'s // brackets may be SL specific\n str += \" :content \\\"\" + content + \"\\\"\\n\";//\" :content \\\"( \" +Misc.escape(content) + \")\\\"\\n\";\n if ( protocol != null )\n str += \" :protocol \" + protocol + \"\\n\";\n if ( conversationId != null )\n str += \" :conversation-id \" + conversationId + \"\\n\";\n if ( replyTo != null )\n str += \" :reply-to \" + replyTo + \"\\n\";\n /*\n if ( envelope != null && !envelope.isEmpty() ) {\n str += \" :envelope (\";\n Enumeration enum = envelope.keys();\n String key;\n Object value;\n while( enum.hasMoreElements() ) {\n key = (String)enum.nextElement();\n value = envelope.get(key);\n str += \"(\" + key + \" \\\"\" + Misc.escape(value.toString()) + \"\\\")\";\n }*/\n // str += \")\";\n //}\n \n str += \")\\n\";\n return str;\n }", "@Override\n public String toString() {\n return String.format(\"[id = %d, PIN: %s, LastName = %s, gender=%s, FirstName: %s]\", id, pin,LastName, gender, FirstName);\n }", "public String toString(){\n return \"Format: \" + format +\", \" + super.toString(); \n }", "public String toString() {\r\n\t\tString output = personNum + \"; \" + personType + \"; \" + personName + \"; \" + personTelNo + \"; \" + personEmail + \"; \" \r\n\t\t\t\t+ personAddress + \"\\n\"; \r\n\t return output;\r\n\t}", "public abstract String format(T t);", "@Override\n public void recipient(String recipient) {\n }", "String getTo();", "public String toString(){\n\t\treturn String.format(\"Address: %s\\nType: %s\\nPrice: %.2f\\nOwner: %s\",getAddress(),getType(),getPrice(),getOwner());\n\t}", "public String toString(){\n return ( \"\\nName: \" + name \n + \"\\nPhone Number: \" + phoneNumber\n + \"\\nAge: \" + age \n + \"\\nWeight: \" + weight );\n }", "public String getStringRepresentation() {\n StringJoiner joiner = new StringJoiner(STRING_FORMAT_DELIMITER);\n\n joiner.add(this.getCaller())\n .add(this.getCallee())\n .add(SIMPLE_DATE_FORMAT.format(startTime))\n .add(SIMPLE_DATE_FORMAT.format(endTime));\n\n return joiner.toString();\n }", "@Override\n\tpublic String toString() {\n\t//\tString str = String.format(\"Patient ID#%s Name: %d %s Birthdate: %s Gender: %s\",\n\t//\t\tpatientID, firstName, lastName, birthdate.toString(), gender);\n\n String str = \"Patient ID: \" + patientID + \", Name: \" + firstName + \" \" + lastName +\n \", Birthdate: \" + birthdate + \", Gender: \" + gender;\n\t\treturn str;\n\t}", "public String toString() {\r\n//\t\treturn String.format(\"| %-18s | %-3d | %-12s | %-6s | \",\r\n//\t\t\t\tname, age, organ, bloodtype.getBloodType());\r\n\t\treturn String.format(\"%5d | %-18s | %-3d | %-12s | %-6s | \",\r\n\t\t\t\tpatientID, name, age, organ, bloodtype.getBloodType());\r\n\t}", "@Override \npublic String toString() { \n return String.format(\"%s: %s%n%s: $%,.2f; %s: %.2f\", \n \"commission nurse\", super.toString(), \n \"gross sales\", getGrossSales(), \n \"commission rate\", getCommissionRate()); \n}", "public String getFormattedMessage(String level,String message, String target){\n StringBuilder builder = new StringBuilder();\n for (String next : priority) {\n if(next.equals(\"date\")){\n if(date == null) {\n builder.append(dateFormat.format(new Date()));\n }else builder.append(dateFormat.format(date));\n builder.append(\" \");\n }else if(next.equals(\"level\")){\n builder.append(level);\n builder.append(\" \");\n }else if(next.equals(\"target\")){\n builder.append(target);\n builder.append(\" \");\n }else if(next.equals(\"message\")){\n builder.append(message);\n builder.append(\" \");\n }else if(next.equals(\"separate\")){\n builder.append(separate);\n builder.append(\" \");\n }\n }\n\n return builder.toString();\n }", "public String toString() {\r\n\t\treturn \"Name: \" + getName() + \" Phone: \" + phoneNumber + \" Email: \" + email;\r\n\t\t\r\n\t}", "public String toString() {\n\t // added the Address here\n return String.format(\"%s, %s Hired: %s Birthday: %s \\n Address: %s\", \n lastName, firstName, hireDate, birthDate, Address);\n }", "public String Formatting(){\n\t\t\t return String.format(\"%03d-%02d-%04d\", getFirstSSN(),getSecondSSN(),getThirdSSN());\n\t\t }", "@Override\r\n\tpublic String toStringFormat() {\n\t\treturn transactionId + \" \" + merhcantId\r\n\t\t\t\t+ \" \" + transactionVolume + \" \" + transactionAmount\r\n\t\t\t\t+ \" \" + transactionDate+\"\\n\";\r\n\t}", "private String _getAddressString(Address[] replyToAddresses)\n {\n\n StringBuffer to = new StringBuffer(100);\n\n for (int i = 0; i < replyToAddresses.length; i++)\n {\n if (i > 0)\n to.append(\",\");\n to.append(((InternetAddress)replyToAddresses[i]).getAddress());\n }\n\n return to.toString();\n\n }", "public String toString() {\n \t\tStringBuffer retval = new StringBuffer();\r\n \t\tretval.append(address.toString());\r\n \t\tif ( parameters.size() != 0 ) retval.append(\";\").append(parameters.toString());\r\n \t\treturn retval.toString();\r\n \t}", "public String toString()\r\n/* 398: */ {\r\n/* 399:351 */ return \"<\" + this.t + \", \" + this.from + \", \" + this.to + \">\";\r\n/* 400: */ }", "public String toString(){\r\n return getNumber() + \":\" + getLastName() + \",\" + getFirstName() + \",\" + \"Sales Employee\";\r\n }", "public String toString(){\r\n //your code here\r\n return(\"Withdrawal of: $\" + amount + \"Date: \" + date + \"from account: \" + account);\r\n }", "@Override\n public String getPayTo() {\n return getFirstName() + \" \" + getLastName();\n }", "@Override\n\tpublic String toString() {\n\t\treturn getSenderPk()+\":\"+getAmount()+\":\"+getReceiverPk();\n\t}", "private static String formatFamilyMember (FamilyMemberGuest fmg, Date arrivo, int permanenza) {\n\t\tString res = \"\";\n\n\t\tres += FamilyMemberGuest.CODICE;\n\t\tres += DateUtils.format(arrivo);\n\t\tres += String.format(\"%02d\", permanenza);\n\t\tres += padRight(fmg.getSurname().trim().toUpperCase(),50);\n\t\tres += padRight(fmg.getName().trim().toUpperCase(),30);\n\t\tres += fmg.getSex().equals(\"M\") ? 1 : 2;\n\t\tres += DateUtils.format(fmg.getBirthDate());\n\n\t\t//Setting luogo et other balles is a bit more 'na rottura\n\t\tres += formatPlaceOfBirth(fmg.getPlaceOfBirth());\n\n\t\tPlace cita = fmg.getCittadinanza(); //banana, box\n\t\tres += cita.getId();\n\t\t//Assert.assertEquals(168,res.length()); //if string lenght is 168 we are ok\n\t\tres += padRight(\"\", 34);\n\t\tres += \"\\r\\n\";\n\n\t\treturn res;\n\t}", "public String toString() {\n\t\tString string = sender.getAdresse().getOrt() + \">\" + empfaenger.getAdresse().getOrt() + \"(Start:\"\n\t\t\t\t+ startZeitpunkt + \" Dauer:\" + transportDauer + \")\";\n\t\tif (istAusgeliefert() == true) {\n\t\t\tstring += \" ist ausgeliefert\";\n\t\t} else {\n\t\t\tstring += \"bei \" + (100 * (momentanZeitpunkt - startZeitpunkt) / transportDauer) + \"%\";\n\t\t}\n\t\treturn string;\n\t}", "String format(Object obj, Object... args);", "@Override\n\tpublic String toString(){\n\t\treturn this.from+\"----\"+this.to; \n\t}", "public String toString()\n\t{\n\t\treturn String.format(\"%-25s%-15s\\n%-25s%-15s\\n%-25s%-15s\\n%-25s%-15d\\n%-25s%-15s\\n%-25s$%,-13.2f\", \n\t\t\t\t \t\t \t \"Name\", this.getName(), \"Address:\", this.getAddress(), \"Telephone number:\", this.getTelephone(), \n\t\t\t\t \t\t \t \"Customer Number:\", this.getCustNum(), \"Email notifications:\", this.getSignedUp() == true ? \"Yes\" : \"No\",\n\t\t\t\t \t\t \t \"Purchase amount:\", this.getCustomerPurchase());\n\t}", "public String toString()\r\n {\r\n return \"[\"+contactID+\",\"+firstName+\",\"+lastName+\",\"+phone+\",\"+address+\"]\";\r\n }", "@Override\n public String toString(){\n return (\"firstName:\"+getFirstName()+\" lastName:\"+getLastName()+\" Social Insurance Number:\"+getSocialInsuranceNumber());\n }", "public String toString(){\r\n\t\treturn this.username+\"(\"+this.firstname+\" \"+this.lastname+\")\";\r\n\t}", "@Override public String toString(){\n\t\treturn String.format(\"%s %s %s\", firstName, middleName, lastName);\n\t}", "public static String build_GOT_Email(String fName, String lName){\n\n //String email = fName.substring(0,1)+lName+\"@NightWatch.com\";\n //String email = fName.charAt(0)+lName+\"@NightWatch.com\";\n //return email;\n return fName.charAt(0)+lName+\"@NightWatch.com\";\n\n\n }", "public java.lang.String getRecipient() {\n return recipient;\n }", "@Override\n public String toString() {\n return \"Apartment(To rent){\" + \"id = \" + id + \n \"description=\" + description + \"price=\" + price + \"rooms=\" + rooms + \"mail= \" + mail + \", name = \" + name + \", phoneNr = \" + phoneNr \n + \"'}'\";\n }", "public String toString(){\n return name + \" \" + phone;\n }", "public String toString(){\n\n\tString msg =\"\";\n\n\tmsg += super.toString()+\"\\n\";\n\tmsg +=\"El tipo de servicio es: \"+typeOfService+\"\\n\";\n\tmsg +=\"La cantidad de kiloWatts registrada es: \"+kiloWatts+\"\\n\";\n\tmsg +=\"Cantidad de arboles que deben plantar: \"+calculatedConsuption()+\"\\n\";\n\tmsg += \"---------------------------------------------------------\";\n\n\n return msg;\n}", "public String format(Object... args) {\n\t\treturn format(new StringBuilder(), args).toString();\n\t}", "public String toString(){\n\t\tString msg = \"\";\n\t\tmsg += messageInfo[0] + \" \" + messageInfo[1] + \" \" + messageInfo[2] + \"\\n\";\n\t\tif (!headerLines.isEmpty()){\n\t\t\tfor (int i = 0; i < headerLines.size(); i++){\n\t\t\t\tmsg += headerLines.get(i).get(0) + \" \" + headerLines.get(i).get(1) + \"\\n\";\n\t\t\t}\n\t\t}\n\t\tmsg += \"\\n\";\n\t\tif (entity.length > 0){\n\t\t\t\tmsg += entity;\n\t\t}\n\t\treturn msg;\n\t}", "protected String getToStringFormat()\n {\n return getClass().getSimpleName() + \"@\"\n + Integer.toHexString(hashCode()) + \": { \"\n + \"offset = 0x\" + Integer.toHexString(offset) + \"; \"\n + \"size = \" + size + \"; \"\n + \"%s\"\n + \"value = \" + getValue() + \"; \"\n + \"isAccessible = \" + isAccessible() + \"; \"\n + \"checksum = 0x\" + Integer.toHexString(checksum()) + \"; \"\n + \"}\";\n }", "@Override\n public String toString() {\n return getUserName() + \" on \" + getDate() + \"\\n\" + message + \"\\nType: \" + getType();\n }", "String getUserMail();", "public String getRecipient() {\n\t\treturn recipient;\n\t}", "public String format(Object value);", "public String toString()\r\n {\r\n return getCandidate().getName() + \"'s phone fundraiser takes place in: \" + getLocation() + \" and has \" + getDonors() + \" donors attending.\\n\";\r\n }", "String getResponsible();", "public String getParticipantInfo() {\n\t\treturn String.format(\"%s (%s) from %s\", getParticipantName(), this.emailAddress,\n\t\t\tthis.company);\n\t}", "@Override\r\n public String toString() {\r\n \r\n String returnStr = messageKind.getMessage();\r\n \r\n // We display the name of the associated entity, if there is one\r\n if (associatedEntity != null) {\r\n Identifier.Category category = associatedEntity.getCategory();\r\n \r\n final String messageTemplateName;\r\n if (category == Identifier.Category.TOP_LEVEL_FUNCTION) {\r\n messageTemplateName = \"AssociatedWithFunction\";\r\n } else if (category == Identifier.Category.TYPE_CONSTRUCTOR) {\r\n messageTemplateName = \"AssociatedWithTypeCons\";\r\n } else if (category == Identifier.Category.DATA_CONSTRUCTOR) {\r\n messageTemplateName = \"AssociatedWithDataCons\";\r\n } else if (category == Identifier.Category.TYPE_CLASS) {\r\n messageTemplateName = \"AssociatedWithTypeClass\";\r\n } else if (category == Identifier.Category.CLASS_METHOD) {\r\n messageTemplateName = \"AssociatedWithClassMethod\";\r\n } else {\r\n messageTemplateName = \"AssociatedWithGeneral\";\r\n }\r\n \r\n final QualifiedName name = associatedEntity.getName();\r\n final String displayName;\r\n \r\n // we optimize the display of the associated entity: if it's defined in the same module\r\n // as reported by the source position, then we display only the unqualified name of the entity\r\n if (sourceRange != null && sourceRange.getSourceName().equals(name.getModuleName().toSourceText())) {\r\n displayName = name.getUnqualifiedName();\r\n } else {\r\n displayName = name.getQualifiedName();\r\n }\r\n \r\n returnStr = CALMessages.getString(messageTemplateName, displayName, returnStr);\r\n }\r\n\r\n if(sourceRange != null) {\r\n String sourceName = sourceRange.getSourceName();\r\n String sourcePositionStr = null;\r\n int line = sourceRange.getStartLine();\r\n int column = sourceRange.getStartColumn();\r\n \r\n if (line > 0 && column > 0) {\r\n sourcePositionStr = CALMessages.getString(\"SourcePositionFormat\", Integer.valueOf(line), Integer.valueOf(column));\r\n } else if (line > 0) {\r\n sourcePositionStr = CALMessages.getString(\"SourcePositionFormatNoColumn\", Integer.valueOf(line));\r\n } \r\n \r\n if(sourceName != null && sourcePositionStr != null) {\r\n sourcePositionStr = CALMessages.getString(\"MessageFormat\", sourceName, sourcePositionStr);\r\n returnStr = CALMessages.getString(\"MessageFormat\", sourcePositionStr, returnStr);\r\n } else if (sourceName == null && sourcePositionStr != null) {\r\n returnStr = CALMessages.getString(\"MessageFormat\", sourcePositionStr, returnStr);\r\n } else if (sourceName != null && sourcePositionStr == null) {\r\n returnStr = CALMessages.getString(\"MessageFormat\", sourceName, returnStr); \r\n }\r\n }\r\n \r\n returnStr = CALMessages.getString(\"MessageFormat\", getSeverity().toString(), returnStr);\r\n \r\n // Add information about the exception if present\r\n if (exception != null) { \r\n // Caused by \r\n if (exception instanceof TypeException) {\r\n //todoBI our own internal exception classes to do not need to display their names since the resulting\r\n //error message is intended to be a \"user readable\" string. There are others except TypeException...\r\n returnStr = CALMessages.getString(\"MessageWithTypeException\", returnStr, exception.getLocalizedMessage());\r\n } else {\r\n returnStr = CALMessages.getString(\"MessageWithOtherException\", new Object[] {returnStr, exception.getClass().getName(), exception.getLocalizedMessage()});\r\n }\r\n }\r\n \r\n return returnStr;\r\n }", "@AutoEscape\n public String getMailShareholder();", "public String toString() {\n\t\tString s1,s2,s3,s4;\r\n\t\ts1 = \"{FIR ID: \"+id + \"\\nname= \" + name + \", phone number=\" + phone_no \r\n\t\t\t\t+\"\\nDate: \"+filing_date+\", Address: \" +address\r\n\t\t\t\t+\"\\nFIR Category: \"+category;\r\n\t\t\r\n\t\tif(statement_uploaded) {\r\n\t\t\ts2 = \", Statement Uploaded\";\r\n\t\t}\r\n\t\telse {\r\n\t\t\ts2 = \", Statement Not Uploaded\";\r\n\t\t}\r\n\t\tif(id_proof_uploaded) {\r\n\t\t\ts3 = \", ID Proof Uploaded\";\r\n\t\t}\r\n\t\telse {\r\n\t\t\ts3 = \", ID Proof Not Uploaded\";\r\n\t\t}\r\n\t\ts4 = \"\\nStatus : \"+status+\"}\";\r\n\t\treturn s1+s2+s3+s4;\r\n\t}", "public String formatmsg(int i){\n String a = \"Here is the messages:\\n\";\n a += \"\\n-------------------------\\n\";\n a += \"The id of this message is \" + +getmessage(i).getmessageid()+\n \"\\nThis message is from \" + getmessage(i).getSendername() + \" whose id is \" +\n getmessage(i).getSenderid() + \":\\n\" + getmessage(i).getTxt();\n return a;\n }", "public String contactToString() {\r\n\t\tString toReturn = new String();\r\n\t\tif (contacts.size() > 0) {\r\n\t\t\tfor (int i = 0; i < contacts.size(); i++) {\r\n\t\t\t\ttoReturn += \",\" + contacts.get(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn toReturn;\r\n\t}", "private static String formatEntry(Object entry){\n return QUOTE + entry.toString() + QUOTE + DELIM;\n }", "@Override\n public String toString() {\n return this.getTimestamp().atZone(ZoneId.of(\"Europe/Vienna\")).format(DateTimeFormatter.ofPattern(\"dd.MM.yyyy HH:mm\"))\n + \" \" + this.getFirstName()\n + \" \" + this.getLastName().substring(0,1) + \".\"\n //+ \", \" + this.getTelephoneNo()\n //+ \" (\" + this.getEmail() + \")\"\n ;\n }", "public String toString() {\r\n\t\treturn String.format(\"This is a junior employee. ID is %d, hired since %d, and commission is $%,.2f.\\r\\n\", \r\n\t\t\tgetID(), getYearHired(), getCommission());\r\n\t}", "public String toString() {\r\n \t\treturn \"\\\"\" + _name + \"\\\" by \" + _creator;\r\n \t}", "String getEmail();", "String getEmail();", "String getEmail();", "String getEmail();", "String getEmail();", "@AutoEscape\n public String getEmail();", "@Override\n public final String getAsString(FacesContext context, UIComponent component, Object value) {\n if (value == null || value.equals(\"\")) {\n return null;\n } else {\n //Get ID from the Person Object (primitive operation in the subclass)\n Integer id = getIdFromObjectPerson(value);\n //Create an Array for persisting personal Info (FirstName, LastName, E-mail - 3 fields)\n String [] personalInfo = getPersonalInfo(value);\n //Create String from the Person object\n String toString = getNewStringFromPerson(id, personalInfo[0], personalInfo[1], personalInfo[2]);\n \n return toString;\n }\n }", "java.lang.String getTelefon();", "public String stringreturner() \r\n\r\n{ \r\n\r\nString st = \"\\n\"; \r\n\r\nreturn st +\"\\nName of the book: \" +NameOfTheBook+ \"\\nName of the writer: \" + NameofWriter+ \"\\nISBN Number: \" + isbnNumber + \"\\nCost of The Book: $\" + booksCost; \r\n\r\n}", "public String toString() {\n return getFirstName() + \" \" + getLastName() + \" \" + getEmail() + \" \" + getPhone() + \" \" + getAffiliate();\n }", "public String toString() {\n return \"(\" + From + \",\" + To + \")\";\n }", "java.lang.String getEmail();", "java.lang.String getEmail();", "java.lang.String getEmail();", "java.lang.String getEmail();", "java.lang.String getEmail();", "java.lang.String getEmail();", "public String myToString() {\n\t\treturn \t\"User: \" + ((User)value1).toString() +\r\n\t\t\t\t\" | Job: \" + ((Job)key).name +\r\n\t\t\t\t\" | Recruiter: \" + ((Recruiter)value2).toString() +\r\n\t\t\t\t\" | Score: \" + df2.format(score);\r\n\t}", "String getFormattedString(IRenamable f);", "String getEndereco2();", "public String toString() {\n\t\treturn String.format( \"%s: %s\\n%s: $%,.2f; %s:%.2f\",\r\n\t\t\t\t \"commission employee\", super.toString(),\r\n\t\t\t\t \"gross sales\", getGrossSales(),\r\n\t\t\t\t \"commission rate\", getCommissionRate() );\r\n\t}" ]
[ "0.6541604", "0.65115285", "0.6428505", "0.63814104", "0.635966", "0.6145698", "0.61128", "0.6104408", "0.60996217", "0.59930235", "0.5977716", "0.59593457", "0.5910685", "0.591025", "0.5876688", "0.5863841", "0.5863666", "0.58590007", "0.58360684", "0.58261526", "0.5801992", "0.57917607", "0.5780543", "0.5778101", "0.57750374", "0.57679844", "0.5730262", "0.57234687", "0.57113236", "0.5707209", "0.5705591", "0.57041156", "0.5698281", "0.5685602", "0.56829304", "0.5679723", "0.56621313", "0.5659679", "0.5659376", "0.56584173", "0.5658035", "0.56541866", "0.5650929", "0.5646717", "0.5641341", "0.5641181", "0.5633493", "0.5630795", "0.5627202", "0.5623011", "0.5620127", "0.56180227", "0.5615235", "0.5610541", "0.5608949", "0.5607343", "0.56063604", "0.56059337", "0.55990654", "0.55941504", "0.5593029", "0.55920357", "0.5587104", "0.55836016", "0.55737734", "0.5569717", "0.55664486", "0.556308", "0.55545866", "0.55439055", "0.55420595", "0.55416286", "0.55292726", "0.55213404", "0.5514473", "0.5512847", "0.551051", "0.5503589", "0.55034345", "0.54922026", "0.54922026", "0.54922026", "0.54922026", "0.54922026", "0.54905254", "0.5489703", "0.5487858", "0.5486201", "0.54837954", "0.5483447", "0.54834414", "0.54834414", "0.54834414", "0.54834414", "0.54834414", "0.54834414", "0.54771626", "0.54764915", "0.54764736", "0.5474061" ]
0.7121247
0
opens socket for input and output communication
public SocketIO(Socket nsocket) { socket = nsocket; try { input = new DataInputStream(socket.getInputStream()); out = new DataOutputStream(socket.getOutputStream()); } catch(UnknownHostException u) { return; } catch(IOException i) { return; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int openSocket(SocketRpcController socketController) {\r\n if (socket != null && in != null && out != null) {\r\n return 0;\r\n }\r\n // Open socket\r\n try {\r\n socket = socketFactory.createSocket(host, port);\r\n out = socket.getOutputStream(); //new BufferedOutputStream(socket.getOutputStream());\r\n in = socket.getInputStream(); //new BufferedInputStream(socket.getInputStream());\r\n } catch (UnknownHostException e) {\r\n handleError(socketController, ErrorReason.UnknownHost,\r\n \"Could not find host: \" + host, e);\r\n return -1;\r\n } catch (IOException e) {\r\n handleError(socketController, ErrorReason.IOError, String.format(\r\n \"Could not open I/O for %s:%s\", host, port), e);\r\n close();\r\n return -1;\r\n }\r\n return 1;\r\n }", "private void openSocket(String host, int port) throws IOException {\n \t\t// Debug - attempting connection\n \n \t\tclientSocket = new Socket(InetAddress.getByName(host), port);\n \n \t\toutput = new BufferedWriter(new OutputStreamWriter(\n \t\t\t\tclientSocket.getOutputStream()));\n \t\toutput.flush();\n \n \t\tfileOutput = new BufferedOutputStream(clientSocket.getOutputStream());\n \n \t\tinput = new BufferedReader(new InputStreamReader(\n \t\t\t\tclientSocket.getInputStream()));\n \n \t\t// Debug - done\n \t}", "public synchronized void open(){\n if(connected){ //Already connected but needs to get streams\n try{\n streamIn = new DataInputStream(socket.getInputStream());\n streamOut = new DataOutputStream(socket.getOutputStream());\n System.out.println(clientID+\": open: socket\");\n }catch(IOException e){\n System.out.println(clientID+\": open: socket: failed: IOException: \"+e);\n }\n }else if(!isHost) { //ConnectingClient\n try{\n socket = new Socket(ip, port);\n streamIn = new DataInputStream(socket.getInputStream());\n streamOut = new DataOutputStream(socket.getOutputStream());\n connected = true;\n System.out.println(clientID+\": open: socket: IP:\"+ip+\" Port:\"+port);\n }catch(IOException ex){\n connected = false;\n System.out.println(clientID+\": open: socket: failed: IOException: \"+ex);\n }\n }else if(isHost){ //HostClient\n try{\n hostSocket = new ServerSocket(0);\n port = hostSocket.getLocalPort();\n ip = InetAddress.getLocalHost().getHostAddress();\n System.out.println(clientID+\": open: hostSocket: IP:\"+ip+\" Port:\"+port);\n }catch(IOException e){\n System.out.println(clientID+\": open: hostSocket: failed: IOException: \"+e);\n }\n }\n }", "private void openInputStream() throws IOException {\n InputStreamReader isReader = new InputStreamReader(this.sock.getInputStream());\n reader = new BufferedReader(isReader);\n }", "public int createSocket()\n\t{\n\t\t\n\t}", "private void openOutputStream() throws IOException {\n writer=new PrintWriter(this.sock.getOutputStream());\n }", "private void openSocket(int port, String request) throws Exception {\n Socket socket = new Socket(InetAddress.getByName(\"localhost\"), port);\n ObjectOutputStream oos = new ObjectOutputStream(socket.getOutputStream());\n oos.writeObject(request);\n ObjectInputStream ois = new ObjectInputStream(socket.getInputStream()); \n String response = (String) ois.readObject(); \n System.out.println(\"Response from DataNode: \" + response);\n socket.close();\n }", "public ConsumerClientInputThread(Socket socket, ConsumerClientListenThread consumerClientListenThread)\r\n {\r\n // Initialize variables\r\n this.socket = socket;\r\n this.consumerClientListenThread = consumerClientListenThread;\r\n \r\n try\r\n {\r\n networkOutput =\r\n new PrintWriter(\r\n socket.getOutputStream(),true);\r\n }\r\n catch(IOException ioEx)\r\n {\r\n ioEx.printStackTrace();\r\n }\r\n }", "public SingleService(Socket socket) throws IOException {\n this.socket = socket;\n output = new PrintWriter(\n new BufferedWriter(\n new OutputStreamWriter(\n socket.getOutputStream())), true);\n input = new BufferedReader(\n new InputStreamReader(\n socket.getInputStream()));\n }", "final public void openConnection() throws IOException {\n // Do not do anything if the connection is already open\n if (isConnected())\n return;\n\n // Create the sockets and the data streams\n try {\n clientSocket = new Socket(host, port);\n output = new DataOutputStream(clientSocket.getOutputStream());\n // input =\n // new BufferedReader(new InputStreamReader(clientSocket.getInputStream(), \"Big5_HKSCS\"));\n input = new DataInputStream(clientSocket.getInputStream());\n } catch (IOException ex)\n // All three of the above must be closed when there is a failure\n // to create any of them\n {\n try {\n closeAll();\n } catch (Exception exc) {\n }\n\n throw ex; // Rethrow the exception.\n }\n\n clientReader = new Thread(this); // Create the data reader thread\n readyToStop = false;\n clientReader.start(); // Start the thread\n }", "private void startConnection() throws IOException {\n bos = new BufferedOutputStream(socket.getOutputStream(), 65536);\n\n byte[] key = new byte[16];\n Random random = new Random();\n random.nextBytes(key);\n String base64Key = Base64.encodeBase64String(key);\n\n byte[] handshake = createHandshake(base64Key);\n bos.write(handshake);\n bos.flush();\n\n InputStream inputStream = socket.getInputStream();\n verifyServerHandshake(inputStream, base64Key);\n\n writerThread.start();\n\n notifyOnOpen();\n\n bis = new BufferedInputStream(socket.getInputStream(), 65536);\n read();\n }", "public Client() throws IOException\n {\n socket = new Socket(\"127.0.0.1\", 1234);\n\n socket2 = new Socket(\"127.0.0.1\", 1235);\n \n out = new ObjectOutputStream(socket.getOutputStream());\n in = new ObjectInputStream(socket.getInputStream());\n \n in2 = new ObjectInputStream(socket2.getInputStream());\n }", "public void start() throws IOException {\n super.start();\n\n try {\n socket = new Socket(getIP(), getPort());\n input = new DataInputStream(socket.getInputStream());\n output = new DataOutputStream(socket.getOutputStream());\n }\n catch(Exception e) {\n System.out.println(\"The port \" + getPort() + \" is currently already in use.\");\n }\n }", "public void communicate() {\n\t\tconnect();\n\t\ttry {\n\t\t\tin = new BufferedReader(new InputStreamReader(socket.getInputStream()));\n\t\t\tout = new PrintWriter((socket.getOutputStream()), true);\n\t\t\tobjOut = new ObjectOutputStream(socket.getOutputStream());\n\t\t\tobjIn = new ObjectInputStream(socket.getInputStream());\n\t\t\twhile (!socket.isClosed()) {}\t// Doesn't need to do anything besides stay awake, GUI handles all in/outputs\n\t\t\tin.close();\n\t\t\tout.close();\n\t\t\tobjIn.close();\n\t\t\tobjOut.close();\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Sending error: \" + e.getMessage());\n\t\t}\t\t\n\t}", "public void bind() {\n\t\ttry {\n\t\t\tthis.out = new DataOutputStream(this.s.getOutputStream());\n\t\t\tthis.in = new DataInputStream(new DataInputStream(this.s.getInputStream()));\n\t\t} catch (IOException e) {\n\t\t\tthis.finishedOK = false;\n\t\t}\n\t}", "private void connect() {\n\t\ttry {\n\t\t\tsocket = new Socket(Server.ADDRESS, Server.PORT_NUMBER);\n\t\t\tthis.oos = new ObjectOutputStream(socket.getOutputStream());\n\t\t\tthis.ois = new ObjectInputStream(socket.getInputStream());\n\t\t\tServerListener serverlistener = new ServerListener();\n\t\t\tserverlistener.start();\n\t\t\tRequest request = new Request(RequestCode.START_DOCUMENT_STREAM);\n\t\t\trequest.setUsername(user.getUsername());\n\t\t\toos.writeObject(request);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "SocketNode(NodeInterface node, Socket socketIn) {\n this.connectionIn = true;\n try {\n this.socketInput = new ObjectInputStream(socketIn.getInputStream());\n this.socketOutput = new ObjectOutputStream(socketIn.getOutputStream());\n } catch (IOException e) {\n this.close();\n }\n this.connected = true;\n Executors.newCachedThreadPool().execute(() ->\n node.getSocketManager().createConnection(this, socketIn.getInetAddress().getHostAddress()));\n }", "private void start_Connexion()throws UnknownHostException, IOException{\n \tsocket = new Socket(IP,num_Socket);\n \tout = new ObjectOutputStream(socket.getOutputStream());\n \tin = new ObjectInputStream(socket.getInputStream());\n \t\n }", "public SocketWrapper(final Socket socket) throws IOException {\n this.host = socket.getInetAddress().getHostName();\n this.port = socket.getPort();\n this.socket = socket;\n initStreams();\n opened = true;\n }", "public void initiateContact(){\n try{\n clientSocket = new Socket(hostName, portNumber); \n inFromUser = new BufferedReader(new InputStreamReader(System.in)); \n outToServer = new DataOutputStream(clientSocket.getOutputStream()); \n inFromServer = new BufferedReader(new InputStreamReader(clientSocket.getInputStream())); \n }catch(IOException e){\n System.err.println(\"Caught IOException in initiateContact: \" + e.getMessage());\n }\n }", "public PlayerSocket(String name, PrintWriter output, BufferedReader input) throws IOException {\n\t\tsuper(name);\n\t\tthis.input= input;\n\t\tthis.output= output;\n\t\tvalidResponse = false;\n\t\tponged = false;\n\t\tThread t = new Thread(this::listen);\n\t\tt.start();\n\t}", "protected Socket getSocket() {\n\t\treturn input;\n\t}", "public ClientThread(Socket socket) throws IOException\r\n {\r\n this.socket = socket;\r\n this.netIn = new Scanner(new InputStreamReader(socket.getInputStream()));\r\n this.netOut = new PrintStream(socket.getOutputStream());\r\n\r\n }", "public cliente(Socket socket) throws IOException {\r\n this.socket = socket;\r\n is = socket.getInputStream();\r\n os = socket.getOutputStream();\r\n\r\n }", "private void open() throws ConnectException, IOException {\n if (!opened) {\n if ((host == null) || \"\".equals(host.trim())) throw new ConnectException(\"You must specify the host name\");\n else if (port <= 0) throw new ConnectException(\"You must specify the port number\");\n socket = new Socket();\n InetSocketAddress addr = new InetSocketAddress(host, port);\n socket.setReceiveBufferSize(Utils.SOCKET_BUFFER_SIZE);\n socket.setSendBufferSize(Utils.SOCKET_BUFFER_SIZE);\n socket.setTcpNoDelay(Utils.SOCKET_TCP_NODELAY);\n socket.setKeepAlive(Utils.SOCKET_KEEPALIVE);\n socket.connect(addr);\n initStreams();\n opened = true;\n if (log.isDebugEnabled()) log.debug(\"getReceiveBufferSize() = \" + socket.getReceiveBufferSize());\n }\n }", "private void initSocket(String host, String port) throws IOException {\n\t\t// check the validity of the host name\n\t\tif (host == null || host.isEmpty()) throw new IllegalArgumentException(\"host == null || host.isEmpty()\");\n\t\t// check the validity of the port number\n\t\tint p = 0;\n\t\ttry {\n\t\t\tp = Integer.parseInt(port);\n\t\t} catch (NumberFormatException e) {\n\t\t\tthrow new IllegalArgumentException(\"Illegal port argument\");\n\t\t}\n\t\tif (p <= 0) {\n\t\t\tthrow new IllegalArgumentException(\"Illegal port argument\");\n\t\t}\n\t\t// establish the network connection\n\t\ttry {\n\t\t\tthis.socket = new Socket(host, p);\n\t\t} catch (IOException e) {\n\t\t\tgetErrorManager().error(\"Failed to establish the network connection\", e,\n\t\t\t\tErrorManager.OPEN_FAILURE);\n\t\t\tthrow e;\n\t\t}\n\t\tsuper.internalSetOutputStream(new BufferedOutputStream(this.socket.getOutputStream()));\n\t}", "@Override\n public void start() throws IOException\n {\n try\n {\n InetSocketAddress address = new InetSocketAddress(config.getHost(), config.getPort());\n sock = new Socket();\n sock.setSoTimeout(config.getReadTimeout());\n sock.connect(address, config.getReadTimeout());\n out = new ObjectOutputStream(new BufferedOutputStream(sock.getOutputStream()));\n out.flush();\n in = new ObjectInputStream(new BufferedInputStream(sock.getInputStream()));\n }\n catch (ConnectException ce)\n {\n log.info(\"Unable to connect to TCP socket on interface \" + config.getHost() + \" and port \" + config.getPort());\n throw ce;\n }\n }", "public NetworkClient(Socket socket) throws IOException {\n\t\tthis.socket = socket;\n\t\tthis.host = socket.getInetAddress().getHostAddress();\n\t\tthis.port = socket.getPort();\n\t\tin = new BufferedReader(new InputStreamReader(socket.getInputStream()));\n\t\tout = new PrintWriter(new OutputStreamWriter(socket.getOutputStream()));\n\t}", "@Override\r\n\tpublic void start(Socket socket){}", "StreamConnectionIO(Mux mux, OutputStream out, InputStream in) {\n\tsuper(mux);\n\tthis.out = out;\n//\tthis.out = new BufferedOutputStream(out);\n\tthis.in = in;\n\n\toutChannel = newChannel(out);\n\tinChannel = newChannel(in);\n sendQueue = new LinkedList<Buffer>();\n }", "private Socket newSocket() throws IOException {\n try {\n InetAddress hostAddress = InetAddress.getByName(publicAddress);\n return new Socket(hostAddress, AgentRemoteService.PORT);\n } catch (IOException e) {\n throw new IOException(\"Couldn't connect to publicAddress: \" + publicAddress + \":\" + AgentRemoteService.PORT, e);\n }\n }", "public void initTransport() {\n JDE.signal(procID, MESSAGE, \"Debugger connected to standard I/O socket.\", QUOTE);\n\n final Process process = m_debugger.getVM().process();\n standardInputProcessor = new StandardInputProcessor(process.getOutputStream());\n standardInputProcessor.start();\n\n standardOutputWriter = new StandardOutputWriter(m_sioSocket);\n standardOutputWriter.println(\"*** Process Standard I/O ***\");\n\n standardOutputProcessor = new StandardOutputProcessor(process.getInputStream());\n standardOutputProcessor.start();\n\n standardErrorProcessor = new StandardErrorProcessor(process.getErrorStream());\n standardErrorProcessor.start();\n\n }", "private static void server() throws IOException {\n\t\tServerSocket serverSocket = new ServerSocket(10999);\n\t\t//listener, waiting connection\n\t\tSocket socket = serverSocket.accept();//block\n\t\t//input --> receive / output --> send\n\t\tInputStream inputStream = socket.getInputStream();\n\t\tOutputStream outputStream = socket.getOutputStream();\n\t\t//byte array (stream)\n\t\tbyte[] b = new byte[1024];\n\t\t//read/receive\n\t\tinputStream.read(b);\n\t\t//\n\t\tString resp = client(b);\n\t\t//\n\t\toutputStream.write(resp.getBytes());\n\t\t//closing\n\t\tsocket.close();\n\t\t//close server\n\t\tserverSocket.close();\n\t}", "SocketNode(ObjectInputStream socketInput, ObjectOutputStream socketOutput, MessageHandler messageHandler) {\n this.messageHandler = messageHandler;\n this.socketInput = socketInput;\n this.socketOutput = socketOutput;\n this.connected = true;\n this.connectionIn = false;\n }", "InputPort createInputPort();", "public void createUpdatSocket(String ip, int port) throws IOException\n {\n socket = new Socket(ip,port);\n outAgent =\n new PrintWriter(socket.getOutputStream(), true);\n inAgent =\n new BufferedReader(\n new InputStreamReader(socket.getInputStream()));\n }", "void open(String nameNport) {\n\tString[] token=nameNport.split(\":\");\n\tString host=token[0];\n\tint port=Integer.parseInt(token[1]);\n\tint proceedFlag=1;\n\tIterator<Socket> iterator=Connection.connections.iterator();\n\tif(host.equalsIgnoreCase(\"localhost\") || host.equals(\"127.0.0.1\"))\n\t\thost=simpella.infoSocket.getLocalAddress().getHostAddress();\n\tif((host.equalsIgnoreCase(simpella.infoSocket.getLocalAddress().getHostAddress())||host.equalsIgnoreCase(simpella.infoSocket.getLocalAddress().getCanonicalHostName()))&&(simpella.serverPortNo==port || simpella.downloadPortNo==port)){\n\t\tproceedFlag=0;\n\t\tSystem.out.println(\"Client: Self Connect not allowed\");\n\t\t}\n\twhile(iterator.hasNext() && proceedFlag==1)\n\t{\n\t\tSocket sock=(Socket)iterator.next();\n\t\t\n\t\tif((host.equalsIgnoreCase(sock.getInetAddress().getHostAddress()) || host.equalsIgnoreCase(sock.getInetAddress().getCanonicalHostName())) && port==sock.getPort()){\n\t\t\tproceedFlag=0; \n\t\t\tSystem.out.println(\"Client: Duplicate connection to same IP/port not allowed\");\n\t\t\tbreak;\n\t\t}\n\t\t\n\t}\n\tif(proceedFlag==1)\n\t\t{\n\t\n\t\n\tbyte type=04;\n\tMessage msg=new Message(type);\n\ttry {\n\t\tConnection.outgoingConnPackRecv[noOfConn]=0;\n\t\tConnection.outgoingConnPackSent[noOfConn]=0;\n\t\tConnection.outgoingConnPackSentSize[noOfConn]=0;\n\t\tConnection.outgoingConnPackRecvSize[noOfConn]=0;\n\t\t\n\t\tclientSideSocket[noOfConn]=new Socket(host,port);\n\t\tSystem.out.println(\"Client:TCP Connection established...Begin handshake\");\n\t\toutToServer[noOfConn]=new ObjectOutputStream(clientSideSocket[noOfConn].getOutputStream());\n\t\tinFromServer[noOfConn]=new ObjectInputStream(clientSideSocket[noOfConn].getInputStream());\n\t\tString strToServer=\"SIMPELLA CONNECT/0.6\\r\\n\";\n\t\tbyte[] byteArray= strToServer.getBytes(\"UTF-16LE\");\n\t\tmsg.setPayload(byteArray);\n \t\n\t\tSystem.out.println(\"Client:\"+new String(byteArray));\n\t\t//outToServer.writeUTF(\"SIMPELLA CONNECT/0.6\\r\\n\");\n\t\tConnection.outgoingConnPackSent[noOfConn]++;\n\t\tConnection.outgoingConnPackSentSize[noOfConn]+=byteArray.length+23;\n\t\toutToServer[noOfConn].writeObject((Object)msg);\n\t\tConnection.outgoingConnPackRecv[noOfConn]++;\n\t\t\n\t\tMessage msg1=(Message) inFromServer[noOfConn].readObject();\n\t\tbyte[] fromServer=msg1.getPayload();\n\t\tConnection.outgoingConnPackRecvSize[noOfConn]+=fromServer.length+23;\n\t\tString strFromServer=new String(fromServer);\n\t\tSystem.out.println(\"Server:\"+strFromServer);\n\t\tif(msg1.getMessage_type()==05)\n\t\t\t{\n\t\t\tstrToServer=\"SIMPELLA/0.6 200 thank you for accepting me\\r\\n\";\n\t\t\tbyte[] byteArray1= strToServer.getBytes(\"UTF-16LE\");\n\t\t\tMessage m=new Message((byte)05);\n\t\t\tm.setPayload(byteArray1);\n\t\t\tConnection.outgoingConnPackSent[noOfConn]++;\n\t\t\tConnection.outgoingConnPackSentSize[noOfConn]+=byteArray1.length+23;\n\t\t\toutToServer[noOfConn].writeObject((Object)m);\n\t\t\t\n\t\t\tConnection.connections.add(clientSideSocket[client.noOfConn]);\n\t\t\tConnection.outgoingConnection[client.noOfConn]=clientSideSocket[client.noOfConn];\n\t\t\tConnection.clientOutStream[client.noOfConn]=outToServer[client.noOfConn];\n\t\t\tnew clientSocketListen(clientSideSocket[noOfConn],outToServer[noOfConn],inFromServer[noOfConn]);\n\t\t\tupdate();\n\t\t\tnoOfConn++;\n\t\t\t//System.out.println(\"Client:num of conn=\"+noOfConn);\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\t\tSystem.out.println(\"<open>:Cannot open connection to \"+host+\" at this time\");\n\t\t\t\tclientSideSocket[noOfConn].close();\n\t\t\t\tinFromServer[noOfConn].close();\n\t\t\t\toutToServer[noOfConn].close();\n//\t\t\t\tSystem.out.println(\"Client:num of conn=\"+noOfConn);\n\t\t\t}\n\t\t\n\t\t\n\t} catch (UnknownHostException e) {\n\t\tSystem.out.println(\"Unknown Host: Destination host unreachable\");\n\t\t//e.printStackTrace();\n\t} catch (Exception e) {\n\t\tSystem.out.println(\"Connection Refused/Destination host unreachable\");\n\t}\n\t\t}\n\t}", "public void InitSocket(String server, int port) throws IOException {\r\n socket = new Socket(server, port);\r\n outputStream = socket.getOutputStream();\r\n\r\n Thread receivingThread = new Thread() {\r\n @Override\r\n public void run() {\r\n try {\r\n BufferedReader reader = new BufferedReader(\r\n new InputStreamReader(socket.getInputStream()));\r\n String line;\r\n while ((line = reader.readLine()) != null) {\r\n notifyObservers(line);\r\n }\r\n } catch (IOException ex) {\r\n notifyObservers(ex);\r\n }\r\n }\r\n };\r\n receivingThread.start();\r\n }", "private void connectToServer() {\n\t\ttry {\n\t\t\tsocket = new Socket(InetAddress.getLocalHost(), Server.SERVER_PORT);\n\t\t\tin = new BufferedReader(new InputStreamReader(\n\t\t\tsocket.getInputStream()));\n\t\t\tout = new PrintWriter(socket.getOutputStream());\n\t\t}\n\t\tcatch(IOException e) {\n\t\t\tSystem.out.println(\"CLIENT: Cannot connect to server\");\n\t\t\tSystem.exit(-1);\n\t\t}\n\t}", "private void establishConnection() throws IOException {\n\t\tthis.inReader = new BufferedReader(new InputStreamReader(this.conn.getInputStream()));\n\t\tthis.outWriter = new BufferedWriter(new OutputStreamWriter(this.conn.getOutputStream()));\n\t}", "public void InitSocket(String server, int port) throws IOException {\n socket = new Socket(server, port);\n outputStream = socket.getOutputStream();\n\n Thread receivingThread = new Thread() {\n @Override\n public void run() {\n try {\n \n BufferedReader reader = new BufferedReader(\n new InputStreamReader(socket.getInputStream()));\n String line;\n while ((line = reader.readLine()) != null)\n notifyObservers(line);\n } catch (IOException ex) {\n notifyObservers(ex);\n }\n }\n };\n receivingThread.start();\n }", "public static int openSocket() throws IOException {\n serverSocket = new ServerSocket(0, 10, InetAddress.getLocalHost());\n return serverSocket.getLocalPort();\n }", "private void initStreams() throws IOException {\n OutputStream os = socket.getOutputStream();\n InputStream is = socket.getInputStream();\n dos = new DataOutputStream(new BufferedOutputStream(os));\n dis = new DataInputStream(new BufferedInputStream(is));\n }", "public void init() {\n\t\ttry {\n\t\t\tthis.is = new ObjectInputStream(clientSocket.getInputStream());\n\t\t\tthis.os = new ObjectOutputStream(clientSocket.getOutputStream());\n\t\t\twhile (this.readCommand()) {}\n\t\t} \n\t\tcatch (IOException e) \n\t\t{\n\t\t\tSystem.out.println(\"XX. There was a problem with the Input/Output Communication:\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public MonitoringSocket() throws IOException {\r\n\r\n\t\tincrementNumberOfOpenSockets();\r\n\t\tprintMonitoringSocketStatus();\r\n\t}", "public OrganizerSingleService(Socket socket) throws IOException {\n this.socket = socket;\n output = new PrintWriter(\n new BufferedWriter(\n new OutputStreamWriter(\n socket.getOutputStream())), true);\n input = new BufferedReader(\n new InputStreamReader(\n socket.getInputStream()));\n }", "@Override\n public void run() {\n try {\n //create a socket using sever name or IP and port\n socket = new Socket(serverName, serverPort);\n // set up stream\n start();\n //if everything is good, enable controls on GUI\n send.setEnabled(true); // setup buttons\n tf.setEnabled(true);\n connect.setEnabled(false);\n //catch execeptions if any\n } catch (UnknownHostException uhe) {\n display(\"Host unknown: \" + uhe.getMessage()); // Alert not the right host/ IP\n } catch (IOException ioe) {\n display(\"Unexpected exception: \" + ioe.getMessage());\n }\n //keep listening to incoming messages\n while (true) { // the infinite loop\n try {\n while (!bufferInput.ready()) { // when steam ready to read\n }\n String output = bufferInput.readLine(); // Received the data from socket\n while (output != null) \n {append(output + \"\\n\");\n output = bufferInput.readLine();} } \n catch (IOException ioe) {ioe.getMessage();}\t\n \t\t\t}\t\t }", "public TCPServer(Socket s) throws IOException\n\t{\n\t\tthis.rover = s;\n\t\tthis.rover.setTcpNoDelay(false);\n\t\tthis.in = this.rover.getInputStream();\n\t\tthis.out = this.rover.getOutputStream();\n\t}", "@Override\n public Socket createSocket(final InetAddress host, final int port, \n final InetAddress localHost, final int localPort) \n throws IOException {\n return createSocket(host, port);\n }", "@Override\r\n\tpublic Socket createSocket(InetAddress host, int port) throws IOException {\n\t\treturn null;\r\n\t}", "public void openConnection() {\n System.out.println(\"Opening connection...\");\n\n try {\n String HOST = \"192.168.4.1\";\n int PORT = 2323;\n connectionSocket = new Socket(HOST, PORT);\n connectionSocket.setTcpNoDelay(true);\n\n writer = new BufferedWriter(new OutputStreamWriter(new BufferedOutputStream(connectionSocket.getOutputStream())));\n reader = new BufferedReader(new InputStreamReader(connectionSocket.getInputStream()));\n\n System.out.println(\"openConnection(): Success\");\n return;\n } catch (UnknownHostException e) {\n System.out.println(\"UnknownHostException at openConnection()\");\n } catch (IOException e) {\n System.out.println(\"IOException at openConnection()\");\n } catch (Exception e) {\n System.out.println(\"Exception at openConnection()\");\n System.out.println(e.toString());\n }\n\n System.out.println(\"Failed to connect\");\n }", "private ISocket acceptISocket() throws IOException {\n // Manage client depending the connection\n if (serverSocket instanceof AdHocServerSocketBluetooth) {\n return new AdHocSocketBluetooth((BluetoothSocket) serverSocket.accept());\n } else {\n return new AdHocSocketWifi((Socket) serverSocket.accept());\n }\n }", "private void openStreams() {\n try {\n outputStream = new DataOutputStream(clientSocket.getOutputStream());\n inputStream = new DataInputStream(clientSocket.getInputStream());\n } catch (IOException e) {\n System.err.println(\"Could not open IO streams for the client.\");\n System.err.println(e.getMessage());\n }\n }", "private synchronized void openConnection() {\n\t\tsendData = new Thread(){\n\t\t\tpublic void run(){\n\t\t\t\tsynchronized(msgs){\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tmsgs.wait(1000);\n\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\twhile(true){\n\t\t\t\t\tsynchronized(msgs){\n\t\t\t\t\t\ttry{\n\t\t\t\t\t\t\tif(msgs.size() > 0){\n\t\t\t\t\t\t\t\tout = new PrintWriter(new PrintWriter(s.getOutputStream()));\n\t\t\t\t\t\t\t\tString temp = msgs.get(0);\n\t\t\t\t\t\t\t\tout.println(temp);\n\t\t\t\t\t\t\t\tout.flush();\n\t\t\t\t\t\t\t\tSystem.out.println(temp);\n\t\t\t\t\t\t\t\tmsgs.remove(0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}catch(IOException e){\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\treceiveData = new Thread(){\n\t\t\tpublic void run(){\n\t\t\t\tString received;\n\t\t\t\tdo{\n\t\t\t\t\ttry {\n\t\t\t\t\t\tin = new BufferedReader(new InputStreamReader(s.getInputStream()));\n\t\t\t\t\t\treceived = in.readLine();\n\t\t\t\t\t\tparseMessageReceived(received);\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}while(true);\n\t\t\t}\n\t\t};\n\t\tsendData.setDaemon(true);\n\t\treceiveData.setDaemon(true);\n\t\tsendData.start();\n\t\treceiveData.start();\n\t\tnew Thread()\n\t\t{\n\t\t\tpublic void run(){\n\t\t\t\twhile(true){\n\t\t\t\t\ttry {\n\t\t\t\t\t\tsendData.join();\n\t\t\t\t\t\treceiveData.join();\n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}.start();\n\t}", "public interface _Socket {\n boolean isConnected();\n ByteBuffer getData() throws IOException;\n void sendData(ByteBuffer byteBuffer) throws IOException;\n void close() throws IOException;\n\n}", "public void connectToServer() throws IOException {\n\t\t\tString serverAddress = \"localhost\";\r\n\r\n\t\t\t// Make connection and initialize streams\r\n\t\t\tsocket = new Socket(serverAddress, 9898);\r\n\t\t\tin = new BufferedReader(\r\n\t\t\t\t\tnew InputStreamReader(socket.getInputStream()));\r\n\t\t\tout = new PrintWriter(socket.getOutputStream(), true);\r\n\t\t}", "public abstract void handle(Socket socket);", "SocketReader newSocketReader(SocketConnection connection);", "public WriteToClient(Socket c) throws IOException { //initialize printwirte and scanner\r\n\t\ttoClient = new PrintWriter(c.getOutputStream());\r\n\t\tstdin = new Scanner(System.in);\r\n\t}", "public TCPCanSocket(Socket s) throws IOException\n \t{ \n \t System.out.println(s.getInetAddress() + \" \" + s.getPort());\n \t\tthis.s = s;\n \t\tSystem.out.println( \"constructor: open socket data streams\" );\n \t\tdin = new BufferedInputStream(s.getInputStream());\n \t\tdout = new BufferedOutputStream(s.getOutputStream());\n \t\t// dout.flush();\n \t}", "@Override\n public void run(){\n System.out.println(clientID+\" run\");\n open();\n if(isHost){ //HostClient listening\n try{\n controller.sendHostAddress(ip, port);\n socket = hostSocket.accept();\n System.out.println(clientID+\": run: accept\");\n close(); //closes hostSocket\n connected = true;\n open(); //gets streams\n controller.sendConnect(); \n }catch(IOException e){\n System.out.println(clientID+\": run: accept: failed: IOException: \"+e);\n }\n }\n while(connected){ //interprets requests from other client\n try{\n String request = streamIn.readUTF();\n System.out.println(clientID+\": receive: \"+request);\n String response[] = request.split(\"<&>\");\n controller.interpretRequest(response);\n }catch(IOException ioe){\n System.out.println(clientID+\": receive: failed: IOException:\"+ioe);\n connected = false; \n }\n }\n }", "public ClientSocket(Socket socket0, Socket socket1) throws IOException {\n super();\n this.socket0 = socket0;\n this.socket1 = socket1;\n inReader = new BufferedReader(new InputStreamReader(socket0.getInputStream()));\n outWriter = new PrintWriter(new OutputStreamWriter(socket0.getOutputStream(),StandardCharsets.UTF_8), true);\n objectOutputStream = new ObjectOutputStream(socket1.getOutputStream());\n }", "public ClientConnectionHandler(Socket socket, int number) {\r\n clientSocket = socket;\r\n clientNumber = number;\r\n isOpen = true;\r\n\r\n try {\r\n in = new DataInputStream(socket.getInputStream());\r\n out = new DataOutputStream(socket.getOutputStream());\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n }", "public void creatSocket() {\n\n try {\n\n server = new ServerSocket(PORT);\n\n mExecutorService = Executors.newCachedThreadPool();\n\n while (true) {\n\n Socket client = server.accept();\n\n mExecutorService.execute(new SockectService(client));\n\n Log.d(TAG, \"Creating Socket\" );\n\n }\n\n } catch (Exception e) {\n\n e.printStackTrace();\n\n }\n\n }", "public void establishSocketConnection() {\n\t\ttry {\n\t\t\tsocket = new Socket(serverIP, serverPort);\n\t\t\tlogger.info(\"Connection with JSON-RPC server opened at local endpoint \" + socket.getLocalAddress().getHostAddress() + \":\" + socket.getLocalPort());\n\t\t\t// create a writer to send JSON-RPC requests to the JSON-RPC server\n\t\t\twriter = new OutputStreamWriter(socket.getOutputStream(), \"utf-8\");\n\t\t\t// create a JsonReader object to receive JSON-RPC response\n\t\t\tjsonReader = new JsonReader(new InputStreamReader(socket.getInputStream(), \"utf-8\"));\n\t\t} catch (UnknownHostException e) {\n\t\t\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public interface SocketClientInterface {\n boolean openConnection();\n void handleSession();\n void closeSession();\n}", "ClientProcess(Socket socket)\r\n {\r\n\r\n id = IDCounter++;\r\n this.socket = socket;\r\n\r\n System.out.println(\"Thread trying to create Object Input/Output Streams\");\r\n try\r\n {\r\n //set up i/o\r\n out = new ObjectOutputStream(socket.getOutputStream());\r\n in = new ObjectInputStream(socket.getInputStream());\r\n\r\n username = (String) in.readObject();\r\n displayMessage(\"***username + \" + \"JUST CONNECTED***\");\r\n userNames.add(username);\r\n }\r\n catch (IOException e) {\r\n displayMessage(\"Exception creating new Input/output Streams: \" + e);\r\n return;\r\n }\r\n\r\n\r\n catch (ClassNotFoundException e) {\r\n }\r\n\r\n System.out.println(\"complete\");\r\n }", "private void init() throws IOException {\n m_sock = new Socket(InetAddress.getByAddress(m_address), VIDEO_TO_PC_PORT);\n m_sock.setSoTimeout(READ_TIMEOUT_MS);\n m_sockistream = m_sock.getInputStream();\n m_daistream = new DataInputStream(m_sockistream);\n m_initialized = true;\n }", "public Socket createSocket()\n/* */ {\n/* 82 */ return new Socket();\n/* */ }", "public void ChatNetworking(String _host, boolean pickTCP, boolean pickUDP){\r\n \r\n host = _host; \r\n //I'm not sure if I understand Chat Networking method's requirement on our document because it isn't that clear as I thought\r\n try{\r\n \r\n cs = new Socket(\"hostname\", 16789); \r\n input = new BufferedReader(new InputStreamReader(cs.getInputStream())); \r\n output = new PrintWriter(new OutputStreamWriter(cs.getOutputStream())); \r\n //I'm not sure how to use TCP DataOutputSTream to create a socket. That means DataOutputStream replace PrintWriter?\r\n DataOutputStream out = new DataOutputStream(cs.getOutputStream()); \r\n \r\n System.out.println(\"getLocalHost: \"+InetAddress.getLocalHost() );\r\n \r\n \r\n }\r\n catch (UnknownHostException uhe){\r\n jtaMsgReceived.setText(\"Unable to connect the host\"); \r\n return;\r\n }\r\n catch (IOException ioe){\r\n jtaMsgReceived.setText(\"Communication lost\"); \r\n return; \r\n }\r\n \r\n }", "public void listen() {\n\t\tthread(\"NetworkClientInput\", () -> {\n\t\t\twhile (true) {\n\t\t\t\ttry {\n\t\t\t\t\tString str = in.readLine();\n\t\t\t\t\t\n\t\t\t\t\tif (str == null)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"[CLIENT] Received: \" + str);\n\t\t\t\t\ttry {\n\t\t\t\t\t\thandle(str);\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\tSystem.err.println(\"[Client] Error handling input\");\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tSystem.out.println(\"[Client] Disconnected.\");\n\t\t\t\t\tconnected = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tconnected = false;\n\t\t\texecutor.shutdown();\n\t\t\tsocket.close();\n\t\t});\n\t}", "public int start() throws IOException{\n\t\tClientThread listenerThread = new ClientThread(this);\n\t\tlistenerSock = listenerThread.initSocket();\n\t\tint newPort = listenerSock.getLocalPort();\n\t\tclientPort = newPort;\n\t\tt = new Thread(listenerThread);\n\t\tt.start();\n\t\tsock = new Socket(serverIP, port);\n\t\treturn newPort;\n\t}", "public EnvironmentSocket createNewSocket(String host, int port) throws IOException {\n Socket socket = new Socket(host, port);\n return wrapperSocket(socket);\n }", "public Sender(Socket socket)\n {\n try\n {\n _out = new ObjectOutputStream(socket.getOutputStream());\n }\n catch (IOException e1)\n {\n e1.printStackTrace();\n }\n }", "public Socket connect() {\r\n\t\ts = null;\r\n\t\ttry {\r\n\t\t\ts = new Socket(hostName, port);\r\n\t\t\tdos = Utils.deflatedDataOut(s.getOutputStream(), 8);\r\n\t\t} catch (UnknownHostException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn s;\r\n\t\t// TODO Auto-generated method stub\r\n\r\n\t}", "public abstract void stream(int port);", "private void sendSocket()\n {\n InputStreamReader reader = null;\n BufferedReader bufferreader = null;\n Socket socket = null;\n try{\n socket = new Socket(address, port);\n OutputStream outputstream = socket.getOutputStream();\n DataOutputStream dataOutputStream = new DataOutputStream(outputstream);\n OutputStreamWriter outputStreamWriter = new OutputStreamWriter(dataOutputStream);\n String tem_msg = \"\";\n if(SEND_FILE==0)\n {\n tem_msg = original_name;\n }\n tem_msg = tem_msg+msg;\n// outputstream.write(msg.getBytes());\n// outputstream.flush();\n //dataOutputStream.writeUTF(msg);\n //dataOutputStream.flush();\n outputStreamWriter.write(tem_msg);\n outputStreamWriter.flush();\n //DataInputStream dataInputStream = new DataInputStream(socket.getInputStream());\n //InputStreamReader inputStreamReader = new InputStreamReader(dataInputStream);\n //dataOutputStream.close();\n socket.shutdownOutput();\n\n InputStream inputstream = socket.getInputStream();\n reader = new InputStreamReader(inputstream);\n bufferreader = new BufferedReader(reader);\n String tem = null;\n final StringBuffer stringb = new StringBuffer();\n while((tem=bufferreader.readLine())!=null){\n stringb.append(tem);\n }\n sendMsg(msg_what, stringb.toString());\n dataOutputStream.flush();\n dataOutputStream.close();\n socket.close();\n inputstream.close();\n }catch(UnknownHostException e){\n e.printStackTrace();\n }catch(IOException e){\n e.printStackTrace();\n }finally {\n try{\n if(bufferreader!=null)\n bufferreader.close();\n }catch(IOException ex){\n ex.printStackTrace();\n }\n }\n }", "public void run() {\r\n try {\r\n this.is = new ObjectInputStream(clientSocket.getInputStream());\r\n this.os = new ObjectOutputStream(clientSocket.getOutputStream());\r\n while (this.readCommand()) {}\r\n } \r\n catch (IOException e) \r\n {\r\n \tSystem.out.println(\"XX. There was a problem with the Input/Output Communication:\");\r\n e.printStackTrace();\r\n }\r\n }", "public void makeConnection() {\n\t\t// make a socket, output stream, and try connecting to the server\n\t\twhile (!connection) {\n\t\t\ttry {\n\t\t\t\tsocket = new Socket(address, port);\n\t\t\t\toutStream = new ObjectOutputStream(socket.getOutputStream());\n\t\t\t\tconnection = true;\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "private void communicate() {\n\t\tString line = \"\";\n\t\tboolean running = true;\n\t\twhile (running) {\n\t\t\ttry {\n\t\t\t\tline = socketIn.readLine();\n\t\t\t\t//quit the program if user input is \"QUIT\"\n\t\t\t\tif(line == null)\n\t\t\t\t\tbreak;\n\t\t\t\tif (isPalindrome(line))\n\t\t\t\t\tsocketOut.println(line + \" is a palindrome\");\n\t\t\t\telse\n\t\t\t\t\tsocketOut.println(line + \" is NOT a palindrome\");\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.err.println(e.getStackTrace());\n\t\t\t}\n\t\t}\n\t\ttry {\n\t\t\tSystem.out.println(\"[SERVER] Closed\");\n\t\t\tserverSocket.close();\n\t\t\tsocketIn.close();\n\t\t\tsocketOut.close();\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Closing error: \" + e.getMessage());\n\t\t}\n\t}", "public TCPClient(){\n \t lengthStr=\"\";\n inFromUser = null;\n outToServer = null;\n inFromServer = null;\n clientSocket = null;\n }", "private void initServerSocket()\n\t{\n\t\tboundPort = new InetSocketAddress(port);\n\t\ttry\n\t\t{\n\t\t\tserverSocket = new ServerSocket(port);\n\n\t\t\tif (serverSocket.isBound())\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Server bound to data port \" + serverSocket.getLocalPort() + \" and is ready...\");\n\t\t\t}\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tSystem.out.println(\"Unable to initiate socket.\");\n\t\t}\n\n\t}", "public static void startChatServer() {\n\t\tbyte[] buffer = new byte[1024];\n\t\tStreamConnectionNotifier cn = null;\n\t\ttry {\n\t\t\tLocalDevice local = LocalDevice.getLocalDevice();\n\t\t\tlocal.setDiscoverable(DiscoveryAgent.GIAC);\n\t\t\tcn = (StreamConnectionNotifier) Connector.open(INSECURE_URL);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\twhile (true) {\n\t\t\tOutputThread t = null;\n\t\t\tStreamConnection sock = null;\n\t\t\tInputStream is = null;\n\t\t\tOutputStream os = null;\n\t\t\ttry {\n\t\t\t\tSystem.out.println(\"accepting connection:\");\n\t\t\t\tsock = cn.acceptAndOpen();\n\t\t\t\tSystem.out.println(\"accept!: \" + Charset.defaultCharset());\n\t\t\t\tis = sock.openInputStream();\n\t\t\t\tos = sock.openOutputStream();\n\n\t\t\t\tt = new OutputThread(os);\n\t\t\t\tt.start();\n\n\t\t\t\twhile (t.isAlive()) {\n\t\t\t\t\t//TODO: use timeout read?\n\t\t\t\t\tint len = is.read(buffer);\n\t\t\t\t\t// printAsHex(buffer, len);\n\t\t\t\t\tif (len > 0) {\n\t\t\t\t\t\tSystem.out.println(\"received message(\" + len + \"): \" + new String(buffer, 0, len));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//TODO: check connection is live or not,\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} finally {\n\t\t\t\tt.interrupt();\n\t\t\t\tt = null;\n\t\t\t\ttry {\n\t\t\t\t\tsock.close();\n\t\t\t\t\tcn.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t//\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "synchronized private final void connectToServer() throws IOException {\n if(this.provider.useSSH()){\n if(this.userinfo == null) this.userinfo = new SSHSocket.SshUserInfo();\n this.sock = MdsIp.newSSHSocket(this.userinfo, this.provider);\n }else this.sock = new Socket(this.provider.host, this.provider.port);\n if(DEBUG.D) System.out.println(this.sock.toString());\n this.sock.setTcpNoDelay(true);\n this.dis = this.sock.getInputStream();\n this.dos = this.sock.getOutputStream();\n /* connect to mdsip */\n final Message message = new Message(this.provider.user, this.getMsgId());\n message.useCompression(this.use_compression);\n this.sock.setSoTimeout(3000);\n long tick = -System.nanoTime();\n message.send(this.dos);\n final Message msg = Message.receive(this.dis, null);\n tick += System.nanoTime();\n if(DEBUG.N) System.out.println(tick);\n this.isLowLatency = tick < 50000000;// if response is faster than 50ms\n this.sock.setSoTimeout(0);\n if(msg.header.get(4) == 0){\n this.close();\n return;\n }\n this.receiveThread = new MRT();\n this.receiveThread.start();\n this.connected = true;\n MdsIp.this.dispatchMdsEvent(new MdsEvent(this, MdsEvent.HAVE_CONTEXT, \"Connected to \" + this.provider.toString()));\n }", "public static void main(String[] args) throws Throwable {\n String address = JOptionPane.showInputDialog(\"Connect to?\");\n\n InetAddress inetAddress = InetAddress.getByName(address);\n Socket socket = new Socket(inetAddress, 1234);\n InputStream input = socket.getInputStream();\n FileOutputStream out = new FileOutputStream(\"output.txt\");\n System.out.println(\"Receiving to file output.txt\" );\n\n // simple variant\n int r = 0;\n while( (r=input.read())!=-1) {\n out.write(r);\n }\n\n // // buffered variant\n // int numRead = 0;\n // byte[] buffer = new byte[3*512];\n // while((numRead = input.read(buffer))>= 0) {\n // out.write(buffer, 0, numRead);\n // }\n out.flush(); out.close();\n input.close(); socket.close();\n System.out.println(\"Finished, please open file:\" );\n System.out.println(new File(\"output.txt\").getAbsoluteFile());\n }", "private Socket connectToBackEnd() throws IOException {\n Socket socket = new Socket(serverAddress, serverPort);\n reader = new BufferedReader\n (new InputStreamReader(socket.getInputStream()));\n dataWriter = new DataOutputStream\n (new BufferedOutputStream(socket.getOutputStream()));\n return socket;\n }", "private native int open0(String host,\n int msid, int port) throws IOException;", "@DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:36:07.245 -0500\", hash_original_method = \"4C7BE72C58D9A70D111AB53708810EA4\", hash_generated_method = \"AF157A7772AD2D9C1E3D30BCBFFC6CCE\")\n \npublic LocalSocket accept() throws IOException\n {\n LocalSocketImpl acceptedImpl = new LocalSocketImpl();\n\n impl.accept (acceptedImpl);\n\n return new LocalSocket(acceptedImpl);\n }", "public DateClient(String serverName, int portNumber) {\n try {\n socket = new Socket(serverName, portNumber);\n stdIn = new BufferedReader (new InputStreamReader(System.in));\n socketIn = new BufferedReader (new InputStreamReader (socket.getInputStream()));\n socketOut = new PrintWriter (socket.getOutputStream(), true);\n }catch (UnknownHostException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public interface TcpSocket extends Connector {\n\t/** A no-op, stateless, socket instance. */\n\tTcpSocket NULL = new Null() {};\n\n\t@Override\n\tdefault String name() {\n\t\treturn String.format(\"%d->%s\", localPort(), hostPort());\n\t}\n\n\t/**\n\t * Provides the socket remote host and port.\n\t */\n\tHostPort hostPort();\n\n\t/**\n\t * Provides the local port.\n\t */\n\tint localPort();\n\n\t/**\n\t * Set socket option.\n\t */\n\t<T> void option(TcpSocketOption<T> option, T value) throws IOException;\n\n\t/**\n\t * Get socket option.\n\t */\n\t<T> T option(TcpSocketOption<T> option) throws IOException;\n\n\t/**\n\t * Set socket options.\n\t */\n\tdefault void options(TcpSocketOptions options) throws IOException {\n\t\toptions.applyAll(this);\n\t}\n\n\t/**\n\t * Get socket options.\n\t */\n\tdefault TcpSocketOptions options() throws IOException {\n\t\treturn TcpSocketOptions.from(this);\n\t}\n\n\t/**\n\t * An extension of SocketConnector that is aware of state.\n\t */\n\tinterface Fixable extends TcpSocket, Connector.Fixable {}\n\n\t/**\n\t * Determines if the exception indicates a socket is fatally broken.\n\t */\n\tstatic boolean isBroken(Exception e) {\n\t\treturn e instanceof SocketException; // check broken pipe?\n\t}\n\n\t/**\n\t * Connect the socket and wrap as a TcpSocket.\n\t */\n\tstatic Wrapper connect(HostPort hostPort) throws IOException {\n\t\t@SuppressWarnings(\"resource\")\n\t\tSocket socket = new Socket(hostPort.host, hostPort.port);\n\t\ttry {\n\t\t\treturn wrap(socket);\n\t\t} catch (RuntimeException | IOException e) {\n\t\t\tsocket.close();\n\t\t\tthrow e;\n\t\t}\n\t}\n\n\t/**\n\t * Wrapper for a jdk socket. The socket must already be connected.\n\t */\n\tstatic Wrapper wrap(Socket socket) throws IOException {\n\t\treturn new Wrapper(socket);\n\t}\n\n\t/**\n\t * Wrapper for a jdk socket. The socket must already be connected.\n\t */\n\tclass Wrapper implements TcpSocket {\n\t\tprivate final Socket socket;\n\t\tprivate final HostPort hostPort;\n\t\tprivate final int localPort;\n\t\tprivate final InputStream in;\n\t\tprivate final OutputStream out;\n\n\t\tprivate Wrapper(Socket socket) throws IOException {\n\t\t\tif (!socket.isConnected()) throw new IOException(\"Socket is not connected\");\n\t\t\tthis.socket = socket;\n\t\t\thostPort = HostPort.from((InetSocketAddress) socket.getRemoteSocketAddress());\n\t\t\tlocalPort = socket.getLocalPort();\n\t\t\tin = socket.getInputStream();\n\t\t\tout = socket.getOutputStream();\n\t\t}\n\n\t\t@Override\n\t\tpublic HostPort hostPort() {\n\t\t\treturn hostPort;\n\t\t}\n\n\t\t@Override\n\t\tpublic int localPort() {\n\t\t\treturn localPort;\n\t\t}\n\n\t\t@Override\n\t\tpublic <T> void option(TcpSocketOption<T> option, T value) throws IOException {\n\t\t\toption.set(socket, value);\n\t\t}\n\n\t\t@Override\n\t\tpublic <T> T option(TcpSocketOption<T> option) throws IOException {\n\t\t\treturn option.get(socket);\n\t\t}\n\n\t\t@Override\n\t\tpublic InputStream in() {\n\t\t\treturn in;\n\t\t}\n\n\t\t@Override\n\t\tpublic OutputStream out() {\n\t\t\treturn out;\n\t\t}\n\n\t\t@Override\n\t\tpublic void close() throws IOException {\n\t\t\tsocket.close();\n\t\t}\n\t}\n\n\t/**\n\t * A no-op, stateless, socket implementation.\n\t */\n\tinterface Null extends Connector.Null, TcpSocket.Fixable {\n\t\t@Override\n\t\tdefault HostPort hostPort() {\n\t\t\treturn HostPort.NULL;\n\t\t}\n\n\t\t@Override\n\t\tdefault int localPort() {\n\t\t\treturn 0;\n\t\t}\n\n\t\t@Override\n\t\tdefault <T> void option(TcpSocketOption<T> option, T value) throws IOException {}\n\n\t\t@Override\n\t\tdefault <T> T option(TcpSocketOption<T> option) throws IOException {\n\t\t\treturn Objects.requireNonNullElse(option.disableValue, BasicUtil.uncheckedCast(0));\n\t\t}\n\t}\n}", "private TcpClient()\n {\n socket = null;\n writer = null;\n connected = false;\n \n connect(\"localhost\", 7778);\n }", "public TCPReceiver(NetWorkInterface ni){\n\t\tthis.ni = ni;\n\t\ttry {\n\t\t\tmySocket = new ServerSocket(NetWorkInterface.portReceiver);\n\t\t} catch (UnknownHostException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void openServer() {\n try {\n this.serverSocket = new ServerSocket(this.portNumber);\n } catch (IOException ex) {\n System.out.println(ex);\n }\n }", "SocketWriter newSocketWriter(SocketConnection connection);", "public ServerTCP(int port) throws IOException, NoSuchAlgorithmException, NoSuchPaddingException, NoSuchProviderException, InvalidKeySpecException {\n\t\tthis.serverSocket = new ServerSocket(port);\n\t\tinput = new Scanner(new InputStreamReader(System.in));\n\t\tkeyGenerator = KeyGenerator.getInstance(\"AES\");\n\t\tserversharedkey = keyGenerator.generateKey();\n\t\t\n\t\tGetTimestamp(\"Creating sharedkey: \" ) ;\n\t\t\n\t\tencodedKey = exportkey();\n\t\t\n\t\tGetTimestamp(\"Sharedkey is created: \" ) ;\n\t\t\n\t\t\n\t\t\n\t}", "public Client(Socket socket, int port) throws IOException {\n this.serverSocket = new ServerSocket(port);\n this.socket = socket;\n this.getter = new Getter(\n new DataInputStream(\n new BufferedInputStream(\n socket.getInputStream()\n )\n )\n );\n this.sender = new Sender(\n new DataOutputStream(\n socket.getOutputStream()\n )\n );\n this.isServerAvailable = false;\n this.isQuitCommandAppear = false;\n }", "public ClientHandler(Socket s){\r\n mySocket = s;\r\n }", "public Socket createSocket() {\n try {\n // Create socket\n server = new Socket(\"127.0.0.1\", 8520);\n } catch (IOException ioe) {\n System.out.println(\"IOException: \" + ioe.getMessage());\n }\n return server;\n }", "@Override\r\n\tpublic Socket createSocket(InetAddress address, int port,\r\n\t\t\tInetAddress localAddress, int localPort) throws IOException {\n\t\treturn null;\r\n\t}", "public ServidorSocket() throws IOException {\n\t\tservidor = new ServerSocket(PUERTO);\n\t\tcliente = new Socket();\n\t}" ]
[ "0.6994027", "0.69697404", "0.6775641", "0.6698744", "0.6696692", "0.667896", "0.65902793", "0.6546142", "0.6496224", "0.6491099", "0.6472464", "0.6447205", "0.6438451", "0.64074856", "0.6394467", "0.63198674", "0.6299068", "0.62657017", "0.6252494", "0.6246771", "0.6214081", "0.619316", "0.6192739", "0.61848617", "0.61692154", "0.6147813", "0.61360765", "0.6119912", "0.6116877", "0.61164373", "0.61017346", "0.60813755", "0.6080178", "0.6058286", "0.6037615", "0.6033663", "0.60322744", "0.6030677", "0.6026468", "0.6010636", "0.5989557", "0.59870994", "0.5975842", "0.5963959", "0.5957182", "0.5946176", "0.5927238", "0.59222174", "0.592143", "0.5918127", "0.5917619", "0.5917002", "0.59072626", "0.5894306", "0.5890161", "0.5884931", "0.5883041", "0.58656555", "0.5863677", "0.5851369", "0.5851264", "0.5840533", "0.583975", "0.5838915", "0.58356375", "0.5835059", "0.5828081", "0.5825554", "0.58216", "0.58173054", "0.5809922", "0.58034664", "0.580119", "0.5796423", "0.5795734", "0.5787115", "0.57832223", "0.5777817", "0.57725805", "0.57679987", "0.5761393", "0.5759695", "0.5757059", "0.57552904", "0.5754875", "0.57509017", "0.5748943", "0.5745937", "0.5742017", "0.5730947", "0.5728485", "0.57274604", "0.57265323", "0.5725846", "0.5721518", "0.57167435", "0.57156694", "0.57083833", "0.5705692", "0.5700106" ]
0.6692825
5
constructor for client connection
public SocketIO(String ip, int port) throws UnknownHostException, IOException { this(new Socket(ip, port)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Client() {}", "public Client() {\n }", "public Client() {\r\n\t// TODO Auto-generated constructor stub\r\n\t \r\n }", "public Client() {\n\t\t// TODO Auto-generated constructor stub\n\t}", "Client(String host, int port) {\n super(host, port);\n }", "ClientConnection connection();", "public Client(Client client) {\n\n }", "public LpsClient() {\n super();\n }", "public HGDClient() {\n \n \t}", "public Cliente() {\n\t\tsuper();\n\t}", "public ClientTSap() {\n socketFactory = SocketFactory.getDefault();\n }", "public ServerConnecter() {\r\n\r\n\t}", "public Client() {\n _host_name = DEFAULT_SERVER;\n _port = PushCacheFilter.DEFAULT_PORT_NUM;\n }", "public Client(){\r\n\t\t// ask the user for a host, port, and user name\r\n\t\tString host = JOptionPane.showInputDialog(\"Host address:\");\r\n\t\t\r\n\t\tString port = JOptionPane.showInputDialog(\"Host port:\");\r\n\t\tboolean shouldRepeat = true;\r\n\t\tint portNum = 0;\r\n\t\twhile(shouldRepeat){\r\n\t\t\ttry{\r\n\t\t\tportNum = Integer.parseInt(port);\r\n\t\t\tshouldRepeat = false;\r\n\t\t\t}\r\n\t\t\tcatch(NumberFormatException e){\r\n\t\t\t\tport = JOptionPane.showInputDialog(\"Host port:\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tclientName = JOptionPane.showInputDialog(\"User name:\");\r\n\t\t\r\n\t\tif (host == null || port == null || clientName == null)\r\n\t\t\treturn;\r\n\t\t\r\n\t\ttry{\r\n\t\t\t// Open a connection to the server\r\n\t\t\tserver = new Socket(host, portNum);\r\n\t\t\tout = new ObjectOutputStream(server.getOutputStream());\r\n\t\t\tin = new ObjectInputStream(server.getInputStream());\r\n\t\t\t\r\n\t\t\tout.writeObject(clientName);\r\n\t\t\t\r\n\t\t\tsetupGUI();\r\n\t\t\t\r\n\t\t\t// start a thread for handling server events\r\n\t\t\tnew Thread(new ServerHandler()).start();\r\n\t\t\t\r\n\t\t}catch(Exception e){\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public UPKClient() {\n connectToServer(BASE_URL);\n }", "public Client(String h, int p) {\n\t\thost = h;\n\t\tport = p;\n\t}", "public Cliente() {\n }", "private Connection () {}", "private CorrelationClient() { }", "public AbstractClient(String host, int port) {\n // Initialize variables\n this.host = host;\n this.port = port;\n }", "public ChatClient() {\n\n }", "public ServiceClient() {\n\t\tsuper();\n\t}", "public ServerConnection()\n {\n //Initializing of the variables used in the constructor\n this.hostAddress = \"http://localhost\";\n this.port = 8882;\n }", "public Connection(Socket client_socket) {\r\n client = client_socket;\r\n try {\r\n in = new DataInputStream(client.getInputStream());\r\n out = new PrintStream(client.getOutputStream());\r\n }\r\n catch (IOException e) {\r\n try { client.close(); } catch (IOException e2) { ; }\r\n System.err.println(\"Exception while getting socket streams: \" + e);\r\n return;\r\n }\r\n this.start();\r\n }", "public TcpClient() {\n connector = new NioSocketConnector();\n connector.setHandler(this);\n connector.getFilterChain().addLast(\"codec\", \n new ProtocolCodecFilter(new TextLineCodecFactory(Charset.forName(\"UTF-8\")))); \n ConnectFuture connFuture = connector.connect(new InetSocketAddress(\"localhost\", TcpServer.PORT));\n connFuture.awaitUninterruptibly();\n session = connFuture.getSession();\n }", "public Client(ClientEvents event) throws UnknownHostException, IOException {\n\t\t// TODO Auto-generated constructor stub\n\t\t//super(\"83.52.33.147\", 3553);\n\t\tmIp = \"85.53.66.42\";\n\t\tmPort = 3553;\n\t\tthis.event = event;\n\t\tmInstance = this;\n\t\t\n\t\t//startConection();\n\t}", "public Connection() {\n\t\t\n\t}", "public GameClient() {\r\n super(new Client(Config.WRITE_BUFFER_SIZE, Config.OBJECT_BUFFER_SIZE), null, null);\r\n }", "ClientHandler(Socket socket) {\n this.client = socket;\n }", "public TCPClient(){\n \t lengthStr=\"\";\n inFromUser = null;\n outToServer = null;\n inFromServer = null;\n clientSocket = null;\n }", "public TurnoVOClient() {\r\n }", "private TcpClient()\n {\n socket = null;\n writer = null;\n connected = false;\n \n connect(\"localhost\", 7778);\n }", "public Ctacliente() {\n\t}", "Cliente(){}", "private Connection() {\n \n }", "public Client() {\n initComponents();\n \n Server server = new Server();\n server.start();\n \n }", "public ClientCredentials() {\n }", "public ClientHandler(Socket s){\r\n mySocket = s;\r\n }", "public LocalClient() {\n\t\tsuper(\"SERVER\", Arrays.asList(new String[] {\"*\"}), null, null);\n\t\tinputThread = new Thread(this);\n\t\tinputThread.start();\n\t}", "public ClientCon(String address, int port) {\n this.mAddress = address;\n this.mPort = port;\n this.currContext = ConContext.MAIN;\n gson = new Gson();\n\n this.connections = new HashMap<ConContext, Connection>();\n\n connections.put(ConContext.MAIN, new Connection(null, null, null));\n connections.put(ConContext.GAME, new Connection(null, null, null));\n\n responseHandler = new ResponseHandler(this);\n this.connectToMain();\n }", "Client(String server, int port, String username, ClientGUI cg) {\n\t\tthis.server = server;\n\t\tthis.port = port;\n\t\tthis.username = username;\n\t\tthis.cg = cg; // Saved if in GUI mode or not\n\t}", "public Echange_Client() throws UnknownHostException, IOException {\n start_Connexion(); \n }", "public NMQModuleClient() {\r\n }", "public Client(ClientConfiguration conf) {\n clientMessages = new Stack<>();\n serverMessages = new Stack<>();\n this.conf = conf;\n encryptionSessionHashMap = new HashMap<>();\n savedMessage = new HashMap<>();\n }", "private MatterAgentClient() {}", "public ClientLoginService(){\n this(MessageConnection.CHANNEL_DEFAULT_RELIABLE);\n }", "public Client(Configuration config) {\n if (config == null)\n throw new IllegalArgumentException(\"Null argument supplied\");\n this.config = config;\n connectivityStatus = ConnectivityStatus.Initial;\n lastInteraction = new Date(0l);\n recentPeers = new PeerList();\n refreshInterval = 30000l;\n randomizedRefreshInterval = (int)(refreshInterval * (1 - 0.25 * new Random ().nextDouble()));\n myLinkLocalAdress = Inet6Address.getByAddress(,, LINKLOCAL)\n }", "private SequencerConnection() { }", "public SocketChannelTarantoolConnection() {\n\t\tthis(\"localhost\", 33013);\n\t}", "public UDPclient()\n\t{\n\t}", "public RedisClient() {\n init();\n }", "public ClientConfiguration() {\n serverIp = DEFAULT_SERVER_IP;\n serverPort = DEFAULT_SERVER_PORT;\n }", "public Client(String hostname, int port) {\n _host_name = hostname;\n _port = port;\n }", "public AbaloneClient() {\n server = new AbaloneServer();\n clientTUI = new AbaloneClientTUI();\n }", "public ConnectionHandler(Socket clientSocket) {\n\t\tthis.clientSocket = clientSocket;\n\t\t//Set up a service object to get the current date and time\n\t\ttheDateService = new DateTimeService();\n\t}", "private Connection(){\n\n }", "public EO_ClientsImpl() {\n }", "ClientMessageSender() {\n\n\t}", "public ClientHandle(Socket cs) {\r\n \t\r\n this.threadSocket = cs;\r\n\r\n }", "public CoronosClient(String ip){\n //GUI creator\n loginBuilder();\n uiBuilder();\n\n //create Socket + Streams\n try {\n s = new Socket(ip, 16789);\n oos = new ObjectOutputStream(s.getOutputStream());\n ois = new ObjectInputStream(s.getInputStream());\n serverListener();\n } catch (UnknownHostException e) {\n e.printStackTrace();\n } catch (BindException be) {\n be.printStackTrace();\n } catch(ConnectException ce){\n JOptionPane.showMessageDialog(loginButton, \"Failed to connect to server, please contact your System Administrator\", \"Connection Error\", JOptionPane.ERROR_MESSAGE);\n } catch (IOException ioe) {\n ioe.printStackTrace();\n }\n }", "public ClientData() {\n\n this.name = \"\";\n this.key = \"\";\n this.serverIpString = \"\";\n this.serverPort = 0;\n this.clientListenPort = 0;\n this.clientsSocketPort = 0;\n this.clientsLocalHostName = \"\";\n this.clientsLocalhostAddressStr = \"\";\n\n this.socket = new Socket();\n\n try {\n this.socket.bind(null);\n } catch (IOException ex) {\n ClientInterface.getjTextArea1().append(\"Error. Unable to load data and create client.\");\n }\n \n try {\n this.clientsLocalHostName = InetAddress.getLocalHost().getHostName();\n this.clientsLocalhostAddressStr = InetAddress.getLocalHost().getHostAddress();\n } catch (UnknownHostException ex) {\n ClientInterface.getjTextArea1().append(\"Error. Unable to load data and create client.\");\n }\n this.clientsSocketPort = socket.getLocalPort();\n\n parseClientConfigFile();\n\n //Initialize ServerSocket and bind to specific port.\n try {\n serverS = new ServerSocket(clientListenPort);\n } catch (IOException ex) {\n ClientInterface.getjTextArea1().append(\"Error. Unable to load data and create client.\");\n }\n }", "public ApiSynthesisClient(String host, int port)\n {\n super(host, port);\n }", "public KVClient(String server, int port) {\n this.server = server;\n this.port = port;\n }", "private ClientLoader() {\r\n }", "protected ClientStatus() {\n }", "public abstract Client getClient();", "private void createClient() {\n tc = new TestClient();\n }", "public JSipClient() {\n\t\tinitComponents();\n\t}", "public GameServerClient(){\r\n\t\tinitComponents();\r\n\t\t}", "public ControlCenter(){\n serverConnect = new Sockets();\n serverConnect.startClient(\"127.0.0.1\", 5000);\n port = 5000;\n }", "public Client(String serverIP) {\n if (!connectToServer(serverIP)) {\n System.out.println(\"XX. Failed to open socket connection to: \" + serverIP);\n }\n }", "ServerClient(ChatServer serv, Socket cl, String user){\n this.server = serv;\n this.client = cl;\n this.username = user;\n this.clientConnected = true;\n this.room = serv.name;\n }", "private RedisClient() {\n\n }", "public ClientManager(String ipAddress) {\n this.ipAddress = ipAddress;\n }", "@Override\n\tpublic void createClient() {\n\t\t\n\t}", "public HRModuleClient() {\n }", "public TCPRequest(String host, int port) {\n this.host = host;\n this.port = port;\n try {\n this.clientSock = new Socket(this.host, this.port);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public Client( int id)\r\n\t\t{\r\n\t\t\r\n\t\tsuper( \"Client \"+id);\r\n\t\t\r\n\t\t//some configuration here\r\n\t\tc_id = id; //client's id\r\n\t\tseq_number = 1; //message sequence number\r\n\t\tserverPort = 1020; //server port\r\n\t\tserverAddress = \"localhost\"; // server IP address\r\n\t\t\r\n\t\t\r\n\t\tenterField = new JTextField( \"Type message here\" );\r\n\t\tenterField.addActionListener(\r\n\t\tnew ActionListener()\r\n\t\t\t{\r\n\t\t\t\tpublic void actionPerformed( ActionEvent event )\r\n\t\t\t\t{\r\n\t\t\t\t\t//sent request\r\n\t\t\t\t\tString message = event.getActionCommand();\r\n\t\t\t\t\tsendRequest(message);\r\n\t\t\t\t} // end actionPerformed\r\n\t\t\t} // end inner class\r\n\t\t); // end call to addActionListener\r\n\t\t\r\n\t\tadd( enterField, BorderLayout.NORTH );\r\n\t\t\t\r\n\t\tdisplayArea = new JTextArea();\r\n\t\tadd( new JScrollPane( displayArea ), BorderLayout.CENTER );\r\n\t\tsetSize( 400, 300 ); // set window size\r\n\t\tsetVisible( true ); // show window\r\n\t\t\t\r\n\t\ttry // create DatagramSocket for sending and receiving packets\r\n\t\t{\r\n\t\t\tsocket = new DatagramSocket();\r\n\t\t} // end try\r\n\t\tcatch ( SocketException socketException )\r\n\t\t{\r\n\t\t\tsocketException.printStackTrace();\r\n\t\t\tSystem.exit( 1 );\r\n\t\t} // end catch\r\n\t\t//msgSender.start(); //starts automatic message sender\r\n\t\tthis.waitForPackets(); //starts listening\r\n\t}", "public ThreadedConnectionHandler(Socket clientSocket) {\r\n this.clientSocket = clientSocket;\r\n //Set up a service object to get the current date and time\r\n this.theDateService = new DateTimeService();\r\n //this.lngNumberOfReadings = 0;\r\n this.theTemperatureService = new TemperatureService();\r\n }", "Client getClient();", "private ServerConnectionParser() {\n }", "public ClientThread(String ip, String port){ // initiate with IP and port\n this.Port = port;\n this.IP = ip;\n }", "public void init(){\n taskClient.connect(\"127.0.0.1\", 9123);\n }", "public ClienteServicio() {\n }", "public ConnectionManager() {\r\n\t\tthis(DEFAULT_PORT, true, true);\r\n\t}", "public TestCaseSocket() {\n\t}", "public Client(Socket socket) {\n\t\t\tthis.socket = socket;\n\t\t}", "public Gateway() {\n genClient = new GenericClient<Gateway>(this);\n }", "public TCPCanSocket(String host) throws IOException\n \t{\n \t\tthis(new Socket(host, DEFAULT_PORT));\n \t\tSystem.out.println( \"open client socket\" );\n \t}", "public ClientThread(String user, String host, String port)\n\t{\n\t\tsuper();\n\t\tthis._myName = user;\n\t\tthis._hostname = host;\n\t\tthis._portnum = port;\n\t}", "public Client(String nickname) throws RemoteException {\n\t\n\tthis.nickname=nickname;\n\n\t\t\t\t\t\t\t\t}", "public AbstractConnection() {\n }", "private APIClient() {\n }", "private Connection() {\n\t\tSystem.out.println(\">> Connection Object Constructed at \"+this);\n\t}", "Client(String server, int port, String username, ClientGUI clientgui) {\n\t\tthis.server = server;\n\t\tthis.port = port;\n\t\tthis.username = username;\n\t\tthis.clientGui = clientgui;\n\t}", "Client(String destination, int sendPort, int myPort, String myIP) {\n\t\tthis.destination = destination;\n\t\tthis.sendPort = sendPort;\n\t\tthis.myPort = myPort;\n\t\tthis.myIP = myIP;\n\t}", "public SocketParams() {\n init();\n }", "private Connection() {\n\t\tSystem.out.println(\"--Connection Created--\");\n\t}", "public Client() throws IOException\n {\n socket = new Socket(\"127.0.0.1\", 1234);\n\n socket2 = new Socket(\"127.0.0.1\", 1235);\n \n out = new ObjectOutputStream(socket.getOutputStream());\n in = new ObjectInputStream(socket.getInputStream());\n \n in2 = new ObjectInputStream(socket2.getInputStream());\n }", "public LiteClient(String hostName, int port) {\r\n\t\tsuper();\r\n\t\tthis.hostName = hostName;\r\n\t\tthis.port = port;\r\n\t\tinit();\r\n\t}", "public Client(String id, String serverHost, int serverPort)\n {\n this.id = id;\n sender = new Sender(serverHost, serverPort);\n }" ]
[ "0.8010528", "0.7888603", "0.7817617", "0.765635", "0.7595873", "0.75243133", "0.7418802", "0.7268798", "0.72505873", "0.72429985", "0.72171885", "0.7211492", "0.72110075", "0.72024965", "0.7172692", "0.71585983", "0.7142819", "0.71245086", "0.71234024", "0.7111404", "0.70971406", "0.7094205", "0.70893496", "0.7075629", "0.70330304", "0.6980628", "0.6964054", "0.69616294", "0.6960106", "0.6959373", "0.6928938", "0.68984187", "0.6892871", "0.6885992", "0.6883576", "0.6867817", "0.6858384", "0.68391955", "0.68371606", "0.6820159", "0.6812045", "0.67695826", "0.6759911", "0.6730898", "0.67297226", "0.67287254", "0.6727839", "0.67176074", "0.67168224", "0.6707311", "0.67055386", "0.6702934", "0.67022115", "0.669212", "0.6681799", "0.6680877", "0.6672359", "0.6659275", "0.6658637", "0.66479534", "0.6625495", "0.6606202", "0.6596633", "0.658855", "0.65720826", "0.65673846", "0.65660185", "0.65538806", "0.65496206", "0.6547641", "0.6543471", "0.6537519", "0.65308535", "0.65134156", "0.650755", "0.6504824", "0.65039104", "0.64975834", "0.6496602", "0.6494222", "0.6492107", "0.6489926", "0.64823455", "0.648127", "0.6480101", "0.64762074", "0.6475768", "0.6471907", "0.6462258", "0.6459783", "0.64494467", "0.6449323", "0.6448263", "0.6444304", "0.6442149", "0.6438739", "0.6430684", "0.6427365", "0.6425185", "0.6424374", "0.6422734" ]
0.0
-1
constructor for server connection (with single client, waits until connected to)
public SocketIO(int port) throws UnknownHostException, IOException { this((new ServerSocket(port)).accept()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Client(){\r\n\t\t// ask the user for a host, port, and user name\r\n\t\tString host = JOptionPane.showInputDialog(\"Host address:\");\r\n\t\t\r\n\t\tString port = JOptionPane.showInputDialog(\"Host port:\");\r\n\t\tboolean shouldRepeat = true;\r\n\t\tint portNum = 0;\r\n\t\twhile(shouldRepeat){\r\n\t\t\ttry{\r\n\t\t\tportNum = Integer.parseInt(port);\r\n\t\t\tshouldRepeat = false;\r\n\t\t\t}\r\n\t\t\tcatch(NumberFormatException e){\r\n\t\t\t\tport = JOptionPane.showInputDialog(\"Host port:\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tclientName = JOptionPane.showInputDialog(\"User name:\");\r\n\t\t\r\n\t\tif (host == null || port == null || clientName == null)\r\n\t\t\treturn;\r\n\t\t\r\n\t\ttry{\r\n\t\t\t// Open a connection to the server\r\n\t\t\tserver = new Socket(host, portNum);\r\n\t\t\tout = new ObjectOutputStream(server.getOutputStream());\r\n\t\t\tin = new ObjectInputStream(server.getInputStream());\r\n\t\t\t\r\n\t\t\tout.writeObject(clientName);\r\n\t\t\t\r\n\t\t\tsetupGUI();\r\n\t\t\t\r\n\t\t\t// start a thread for handling server events\r\n\t\t\tnew Thread(new ServerHandler()).start();\r\n\t\t\t\r\n\t\t}catch(Exception e){\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public LocalClient() {\n\t\tsuper(\"SERVER\", Arrays.asList(new String[] {\"*\"}), null, null);\n\t\tinputThread = new Thread(this);\n\t\tinputThread.start();\n\t}", "public Client() {\n initComponents();\n \n Server server = new Server();\n server.start();\n \n }", "private TcpClient()\n {\n socket = null;\n writer = null;\n connected = false;\n \n connect(\"localhost\", 7778);\n }", "public ServerConnecter() {\r\n\r\n\t}", "public TcpClient() {\n connector = new NioSocketConnector();\n connector.setHandler(this);\n connector.getFilterChain().addLast(\"codec\", \n new ProtocolCodecFilter(new TextLineCodecFactory(Charset.forName(\"UTF-8\")))); \n ConnectFuture connFuture = connector.connect(new InetSocketAddress(\"localhost\", TcpServer.PORT));\n connFuture.awaitUninterruptibly();\n session = connFuture.getSession();\n }", "public ServerConnection()\n {\n //Initializing of the variables used in the constructor\n this.hostAddress = \"http://localhost\";\n this.port = 8882;\n }", "public Client() {}", "public Connection(Socket client_socket) {\r\n client = client_socket;\r\n try {\r\n in = new DataInputStream(client.getInputStream());\r\n out = new PrintStream(client.getOutputStream());\r\n }\r\n catch (IOException e) {\r\n try { client.close(); } catch (IOException e2) { ; }\r\n System.err.println(\"Exception while getting socket streams: \" + e);\r\n return;\r\n }\r\n this.start();\r\n }", "public ClientHandler(Socket s){\r\n mySocket = s;\r\n }", "public SingleInvoker(InetSocketAddress serverAddress) {\n super(new SocketClient(serverAddress));\n sc = ((SocketClient) client);\n }", "public Client(String serverIP) {\n if (!connectToServer(serverIP)) {\n System.out.println(\"XX. Failed to open socket connection to: \" + serverIP);\n }\n }", "public Server() {\n\t\t\n\t\ttry {\n\t\t\tss= new ServerSocket(PORT);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace(); // Default\n\t\t}\n\t}", "public SocketServer() {\n \n super();\n start();\n\n }", "public AbaloneClient() {\n server = new AbaloneServer();\n clientTUI = new AbaloneClientTUI();\n }", "public Server() {\n\t\tsession = new WelcomeSession();\n\t\tmPort = DEFAULT_PORT;\n\t\texecutor = Executors.newCachedThreadPool();\n\t}", "ClientConnection connection();", "public Server(){\r\n \r\n this.m_Clients = new TeilnehmerListe();\r\n this.m_Port = 7575;\r\n }", "ClientHandler(Socket socket) {\n this.client = socket;\n }", "ServerThread(Server srv, Socket s, IProtocolHandler h) throws IOException {\n server = srv;\n fromClient = new BufferedReader(new InputStreamReader(s.getInputStream()));\n toClient = new PrintWriter(s.getOutputStream(), true);\n client = s;\n handler = h;\n id = UUID.randomUUID().toString();\n }", "public Server() {}", "public ClientWorker(ServerSocketChannel serverChannel){\n this.serverChannel = serverChannel;\n }", "public Server()\n {\n clientSessions = new ArrayList();\n }", "public ClientHandle(Socket cs) {\r\n \t\r\n this.threadSocket = cs;\r\n\r\n }", "public OOXXServer(){\n\t\ttry\n\t\t{\n\t\t\tserver = new ServerSocket(port);\n\t\t\t\n\t\t}\n\t\tcatch(java.io.IOException e)\n\t\t{\n\t\t}\n\t}", "public ServerThread(MyServer server) {\n\t\tthis.server = server;\n\t}", "public ClientConnection(Socket clientSocket, KVServer server) {\r\n\t\tthis.clientSocket = clientSocket;\r\n\t\tthis.isOpen = true;\r\n\t\tthis.m_server = server;\r\n\t}", "public void startServer() {\n\r\n try {\r\n echoServer = new ServerSocket(port);\r\n } catch (IOException e) {\r\n System.out.println(e);\r\n }\r\n // Whenever a connection is received, start a new thread to process the connection\r\n // and wait for the next connection.\r\n while (true) {\r\n try {\r\n clientSocket = echoServer.accept();\r\n numConnections++;\r\n ServerConnection oneconnection = new ServerConnection(clientSocket, numConnections, this);\r\n new Thread(oneconnection).start();\r\n } catch (IOException e) {\r\n System.out.println(e);\r\n }\r\n }\r\n\r\n }", "public ChatServer()\n {\n try\n {\n ServerSocket socketServidor = new ServerSocket(PORT);\n while (true)\n {\n Socket client = socketServidor.accept();\n Runnable nuevoCliente = new ClientThread(chat, client);\n Thread thread = new Thread(nuevoCliente);\n thread.start();\n }\n } catch (Exception e)\n {\n e.getMessage();\n }\n }", "ServerClient(ChatServer serv, Socket cl, String user){\n this.server = serv;\n this.client = cl;\n this.username = user;\n this.clientConnected = true;\n this.room = serv.name;\n }", "public TCPServerWorker(GENServer server, Socket socket) throws IOException {\n this.server = server;\n this.socket = socket;\n this.player = null;\n state = new WorkerConnectState(this, socket);\n System.out.println(\"New ServerWorker\");\n }", "public void init(){\n taskClient.connect(\"127.0.0.1\", 9123);\n }", "public Client() {\n }", "public ControlCenter(){\n serverConnect = new Sockets();\n serverConnect.startClient(\"127.0.0.1\", 5000);\n port = 5000;\n }", "public Server() throws IOException {\n try {\n this.serverSocket = new ServerSocket(this.port,100, InetAddress.getByName(host));\n } catch (UnknownHostException e) {\n System.out.println(\"Erreur lors de la construction du serveur (Hôte inconnu) - Server Constructor Error\");\n e.printStackTrace();\n } catch(IOException e) {\n e.printStackTrace();\n }\n }", "public TCPClient(){\n \t lengthStr=\"\";\n inFromUser = null;\n outToServer = null;\n inFromServer = null;\n clientSocket = null;\n }", "@SuppressWarnings(\"resource\")\r\n public void run() {\r\n try {\r\n ServerSocket server = new ServerSocket(ConfigurationFile.getClientPort()[clientNumber-1]);\r\n while(true) {\r\n Socket socket =server.accept();\r\n Thread thread = new Thread(new Connection(socket,hashtable));\r\n thread.start();\r\n }\r\n }\r\n catch(IOException e) {\r\n System.out.println(\"Server socket could not be created. Check configuration file.\");\r\n }\r\n }", "private void initConnection(Socket cli) {\t\n\tConnection conn = new Connection(this, cli);\n conn.setConnlist(connlist);\n\tThread t = new Thread(conn);\n\tt.start();\n\t\n\tconnlist.add(conn);\n\t\t\n\tsetConnectedStatus(true);\n }", "public ClientTSap() {\n socketFactory = SocketFactory.getDefault();\n }", "public TCPMessengerServer() {\n initComponents();\n customInitComponents();\n listenForClient(); \n }", "void initAndListen() {\n\t\twhile (true) {\n\t\t\ttry {\n\t\t\t\tSocket clientSocket = serverSocket.accept();\n\t\t\t\t// Startuje nowy watek z odbieraniem wiadomosci.\n\t\t\t\tnew ClientHandler(clientSocket, this);\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.err.println(\"Accept failed.\");\n\t\t\t\tSystem.exit(1);\n\t\t\t}\n\t\t}\n\t}", "public void Connect() {\n run = new Thread(\"Connect\") {\n @Override\n public void run() {\n running = true;\n try {\n server = new ServerSocket(9080);\n waitingForConnection();\n } catch (IOException ex) {\n Logger.getLogger(Dashboard.class\n .getName()).log(Level.SEVERE, null, ex);\n }\n }\n };\n run.start();\n }", "private void startServer() throws IOException {\n while (true) {\n System.out.println(\"[1] Waiting for connection...\");\n\n client = server.accept();\n System.out.println(\"[2] Connection accepted from: \" + client.getInetAddress());\n\n in = new BufferedReader(new InputStreamReader(client.getInputStream()));\n out = new PrintStream(client.getOutputStream(), true);\n\n while (!in.ready()) ;\n\n String line = in.readLine();\n ManageConnections connection = new ManageConnectionsFactory().getConnection(line);\n\n connection.goConnect(client, in, out);\n }\n }", "public ServerA(){}", "public Server() {\n print_addr();\n follow_updates();\n }", "public Servidor(Socket s) {\r\n\t\tconexao = s;\r\n\t}", "public ThreadedConnectionHandler(Socket clientSocket) {\r\n this.clientSocket = clientSocket;\r\n //Set up a service object to get the current date and time\r\n this.theDateService = new DateTimeService();\r\n //this.lngNumberOfReadings = 0;\r\n this.theTemperatureService = new TemperatureService();\r\n }", "private void startServer(){\n clients = new ArrayList<ClientThread>();\n ServerSocket ClientSocket = null;\n try {\n ClientSocket = new ServerSocket(ClientPort);\n ClientSocketConnection(ClientSocket);\n } catch (IOException e){\n e.printStackTrace();\n System.exit(1);\n }\n }", "public TCPCanSocket() throws IOException\n \t{\n \t\t// this(new ServerSocket(DEFAULT_PORT).accept());\n \t\tthis(new ServerSocket(DEFAULT_PORT, 100).accept());\n \t\tSystem.out.println( \"constructor: open server socket\" );\n \t}", "public Server() throws IOException{\n\t\tsuper();\n\t\tthis.serversocket = new java.net.ServerSocket(DEFAULTPORT);\n\t\tif (DEBUG){\n\t\t\tSystem.out.println(\"Server socket created:\" + this.serversocket.getLocalPort());\n\t\t\tclient_list.add(String.valueOf(this.serversocket.getLocalPort()));\n\t\t}\n\t}", "public Client(String id, String serverHost, int serverPort)\n {\n this.id = id;\n sender = new Sender(serverHost, serverPort);\n }", "public Client() throws IOException\n {\n socket = new Socket(\"127.0.0.1\", 1234);\n\n socket2 = new Socket(\"127.0.0.1\", 1235);\n \n out = new ObjectOutputStream(socket.getOutputStream());\n in = new ObjectInputStream(socket.getInputStream());\n \n in2 = new ObjectInputStream(socket2.getInputStream());\n }", "public void init(){\n\t\tmultiplexingClientServer = new MultiplexingClientServer(selectorCreator);\n\t}", "public void connect() {\n try {\n socket = new Socket(serverAddress, serverPort);\n outputStream = new ObjectOutputStream(socket.getOutputStream());\n inputStream = new ObjectInputStream(socket.getInputStream());\n //A thread which will constantly listen for updates from the server and forward them to Client\n new Thread(() -> {\n while (socket.isConnected()) {\n try {\n Renderable message = (Renderable) inputStream.readObject();\n if(message != null) {\n //logger.info(\"Received \" + message.getClass().getSimpleName() + \" from server.\");\n renderablePublisher.submit(message);\n }\n } catch (IOException | ClassNotFoundException e) {\n renderablePublisher.submit(new ServerOfflineUpdate());\n break;\n }\n }\n }).start();\n } catch (IOException e) {\n renderablePublisher.submit(new ServerOfflineUpdate());\n }\n }", "public Client(String h, int p) {\n\t\thost = h;\n\t\tport = p;\n\t}", "Client(String server, int port, String username, ClientGUI cg) {\n\t\tthis.server = server;\n\t\tthis.port = port;\n\t\tthis.username = username;\n\t\tthis.cg = cg; // Saved if in GUI mode or not\n\t}", "private void runServer() {\n while(true) {\n // This is a blocking call and waits until a new client is connected.\n Socket clientSocket = waitForClientConnection();\n handleClientInNewThread(clientSocket);\n } \n }", "public Client() {\n _host_name = DEFAULT_SERVER;\n _port = PushCacheFilter.DEFAULT_PORT_NUM;\n }", "public void startClientServer() {\n try {\n this.server_socket = new ServerSocket( port );\n this.start();\n } catch (IOException e ) {\n System.err.println( \"Failure: Socket couldn't OPEN! -> \" + e );\n } finally {\n System.out.println( \"Success: Server socket is now Listening on port \" + port + \"...\" );\n }\n }", "private void connect() {\n\t\ttry {\n\t\t\tsocket = new Socket(Server.ADDRESS, Server.PORT_NUMBER);\n\t\t\tthis.oos = new ObjectOutputStream(socket.getOutputStream());\n\t\t\tthis.ois = new ObjectInputStream(socket.getInputStream());\n\t\t\tServerListener serverlistener = new ServerListener();\n\t\t\tserverlistener.start();\n\t\t\tRequest request = new Request(RequestCode.START_DOCUMENT_STREAM);\n\t\t\trequest.setUsername(user.getUsername());\n\t\t\toos.writeObject(request);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public InitialValuesConnectionCenter() \n\t{\n\t\ttry {\n\t\t\tserverSocket = new ServerSocket(PORT);\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"IOException ServerConnectionCenter.\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public TcpClient(OnMessageReceived listener, String ip) {\n this.serverIp = ip;\n this.messageListener = listener;\n }", "private void establishServerConnection() {\n int lb_port = Integer.parseInt(gui.getLBPort_Text().getText());\n gui.getLBPort_Text().setEnabled(false);\n String lb_ip = gui.getLBIP_Text().getText();\n gui.getLBIP_Text().setEnabled(false);\n int server_port = Integer.parseInt(gui.getServerPort_Text().getText());\n gui.getServerPort_Text().setEnabled(false);\n String server_ip = gui.getServerIP_Text().getText();\n gui.getServerIP_Text().setEnabled(false);\n obtainId(server_ip, server_port);\n lbInfo = new ConnectionInfo(lb_ip, lb_port, 3);\n\n if (connection.startServer(server_port)) {\n connectionHandler = new ServerConnections(connection, lbInfo, requestsAnswered, processingRequests, gui.getCompleted_Text(), gui.getProcessing_Text());\n new Thread(connectionHandler).start();\n\n requestServerId();\n scheduler.scheduleAtFixedRate(heartbeat, 10, 10, TimeUnit.SECONDS);\n } else {\n gui.getLBPort_Text().setEnabled(true);\n gui.getLBIP_Text().setEnabled(true);\n gui.getServerPort_Text().setEnabled(true);\n gui.getServerIP_Text().setEnabled(true);\n gui.getButton_Connect().setEnabled(true);\n }\n }", "public Server(){\n\t\ttry {\n\t\t\t// initialize the server socket with the specified port\n\t\t\tsetServerSocket(new ServerSocket(PORT));\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"IO Exception while creating a server\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private JavashipsServer() {\n\t\ttry {\n\t\t\tServerSocket server = new ServerSocket(PORT);\n\n\t\t\tSystem.out.println(new Date().toString() + \" - Now accepting clients.\");\n\n\t\t\t/* Listen for connecting players */\n\t\t\twhile (true) {\n\t\t\t\tSystem.out.println(\"Waiting for 2 players to connect.\");\n\n\t\t\t\t/* Intercept the first player. */\n\t\t\t\tPlayer player1 = new Player(server.accept(), \"Player 1\");\n\t\t\t\tSystem.out.println(new Date().toString() +\n\t\t\t\t\t\t\" - First player has been found: \" +\n\t\t\t\t\t\tplayer1.playerSocket.getInetAddress().getHostAddress() +\n\t\t\t\t\t\t\"/\" +\n\t\t\t\t\t\tplayer1.playerSocket.getPort());\n\n\t\t\t\tplayer1.setFirstAttacker();\n\n\t\t\t\t/* Intercept the second player. */\n\t\t\t\tPlayer player2 = new Player(server.accept(), \"Player 2\");\n\t\t\t\tSystem.out.println(new Date().toString() +\n\t\t\t\t\t\t\" - Second player has been found: \" +\n\t\t\t\t\t\tplayer2.playerSocket.getInetAddress().getHostAddress() +\n\t\t\t\t\t\t\"/\" +\n\t\t\t\t\t\tplayer2.playerSocket.getPort());\n\n\t\t\t\t/* Let the players know who to talk to when talking to their opponent. */\n\t\t\t\tplayer1.setOpponent(player2);\n\t\t\t\tplayer2.setOpponent(player1);\n\n\t\t\t\tplayer1.start();\n\t\t\t\tplayer2.start();\n\t\t\t}\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void initialyzeServer(int port) {\n\n try {\n server = new ServerSocket(port);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n while (true) {\n try {\n\n Client c = new Client(server.accept(), \"client \" + clientIterator, this);\n\n sockets.add(c);\n ex.submit(c);\n\n System.out.println(race);\n\n race.getBroker().registerClient(c);\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n clientIterator++;\n\n System.out.println(\"Client\" + clientIterator + \" has connected the server\");\n }\n }", "@Override\n\tpublic void run(){\n\t\tInetAddress IPAddress = serverTcpSocket.getInetAddress();\n\t\tfor (ClientObj c: clients)\n\t\t\tif (c.getId() == client.getId()){\n\t\t\t\tSystem.out.print(IPAddress + \" Client already connected!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\ttry{\n\t\t\t// Check handshake received for correctness\n\t\t\t//(connect c->s) [herader | \"JUSTIN\\0\" | connection port] (udp)\n\t\t\t//(connect response s->c) [header | client id | port] (udp)\n\t \n\t // open the connection\n\t\t clientSocket = null;\n\t\t Socket clientListener = null;\n\t\t // wait for client connection on tcp port\n\t\t //serverTcpSocket.setSoTimeout(5000);\n\t \tSystem.out.println (\" Waiting for tcp connection.....\");\n\t \tclientSocket = serverTcpSocket.accept();\n\t \tclientListener = serverTcpSocket.accept();\n\t \tclient.setListenerSocket(clientListener);\n\t\t\tIPAddress = clientSocket.getInetAddress();\n\t\t\tint recv_port = clientSocket.getPort();\n\t\t\tSystem.out.println(IPAddress + \": Client connected @ port \" + recv_port);\n\n\t\t // handle tcp connection\n\t\t\tclientSocket.setSoTimeout(Constants.ACK_TIMEOUT);\n\t\t out = new BufferedOutputStream(clientSocket.getOutputStream());\n\t\t\tin = new BufferedInputStream(clientSocket.getInputStream());\n\t\t\tclient.setAddress(clientSocket.getInetAddress());\n\t\t\tclient.setPort(clientSocket.getPort());\n\t\t clients.add(client);\n\t\t\t\n\t\t // handle requests\n\t\t\twhile (!shutdown_normally) {\n\t\t\t\t// read just the header, then handle the req based on the info in the header\n\t\t\t\tif ((buf = Utility.readIn(in, Constants.HEADER_LEN)) == null)\n\t\t\t\t\tbreak;\n\t\t\t\tint flag = buf.getInt(0);\n\t\t\t\tint len2 = buf.getInt(4);\n\t\t\t\tint id = buf.getInt(8);\n\t\t\t\t\n\t\t\t\t// check for correctness of header\n\t\t\t\t\n\t\t\t\tif (flag < Constants.OPEN_CONNECTION || \n\t\t\t\t\t\tflag > Constants.NUM_FLAGS || \n\t\t\t\t\t\tid != client.getId() || \n\t\t\t\t\t\tlen2 < 0){\n\t\t\t\t\tout.close(); \n\t\t\t\t\tin.close(); \n\t\t\t\t\tclientSocket.close(); \n\t\t\t\t\tserverTcpSocket.close();\n\t\t\t\t\tclients.remove(client);\n\t\t\t\t\tthrow new RuntimeException(\n\t\t\t\t\t\t\t\"Connection - FAILURE! (malformed header)\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// read payload\n\t\t\t\tif ((buf = Utility.readIn(in, Utility.getPaddedLength(len2))) == null)\n\t\t\t\t\tthrow new IOException(\"read failed.\");\n\t\t\t\t// update address (necessary?)\n\t\t\t\tclients.get(clients.indexOf(client)).setAddress(clientSocket.getInetAddress());\n\t\t\t\tclient.setAddress(clientSocket.getInetAddress());\n\t\t\t\tswitch (flag){\n\t\t\t\t\tcase Constants.ACK:\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Constants.VIEW_REQ:\n\t\t\t\t\t\tSystem.out.println(client.getAddress() + \n\t\t\t\t\t\t\t\t\": Processing view request...\");\n\t\t\t\t\t\tViewFiles(buf);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Constants.DOWNLOAD_REQ:\n\t\t\t\t\t\tSystem.out.println(client.getAddress() + \n\t\t\t\t\t\t\t\t\": Processing download request...\");\n\t\t\t\t\t\tDownload(buf);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Constants.UPLOAD_REQ:\n\t\t\t\t\t\tSystem.out.println(client.getAddress() + \n\t\t\t\t\t\t\t\t\": Processing upload request...\");\n\t\t\t\t\t\tUpload(buf);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Constants.DOWNLOAD_ACK:\n\t\t\t\t\t\tSystem.out.println(client.getAddress() + \n\t\t\t\t\t\t\t\t\": Processing download acknowledgment...\");\n\t\t\t\t\t\tDownloadCompleted(buf);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Constants.CLOSE_CONNECTION:\n\t\t\t\t\t\tshutdown_normally = true;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// close all open sockets\n\t\t out.close(); \n\t\t in.close(); \n\t\t clientSocket.close(); \n\t\t serverTcpSocket.close();\n\t\t} catch (SocketTimeoutException e) {\n\t\t\tSystem.err.println(IPAddress + \": Timeout waiting for response.\");\n\t\t} catch (UnknownHostException e) {\n\t\t\t// IPAdress unknown\n\t\t\tSystem.err.println(\"Don't know about host \" + IPAddress);\n\t\t} catch (IOException e) {\n\t\t\t// Error in communication\n\t\t\tSystem.err.println(\"Couldn't get I/O for the connection to \" +\n\t\t\t\t\tIPAddress);\n\t\t} catch (RuntimeException e){\n\t\t\t// Malformed Header or payload most likely\n\t\t\tSystem.err.println(IPAddress + \": Connection - FAILURE! (\" + e.getMessage() + \")\");\n\t\t} finally {\n\t\t\t// remove this client from active lists, close all (possibly) open sockets\n\t\t\tSystem.out.println(IPAddress + \": Connection - Closing!\");\n\t\t\tclients.remove(client);\n\t\t\ttry {\n\t\t\t\tSocket clientConnection = client.getListenerSocket();\n\t\t\t\tOutputStream out_c = new BufferedOutputStream(clientConnection.getOutputStream());\n\t\t\t\tbuf = Utility.addHeader(Constants.CLOSE_CONNECTION, 0, client.getId());\n\t\t\t\tout_c.write(buf.array());\n\t\t\t\tout_c.flush();\n\t\t\t\tout_c.close();\n\t\t\t\tclientConnection.close();\n\n\t\t\t\tif (out != null)\n\t\t\t\t\tout.close();\n\t\t\t\tif (in != null)\n\t\t\t\t\tin.close();\n\t\t\t\tif (!clientSocket.isClosed())\n\t\t\t\t\tclientSocket.close();\n\t\t\t\tif (!serverTcpSocket.isClosed())\n\t\t\t\t\tserverTcpSocket.close();\n\t\t\t} catch (IOException e){\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n }", "public SocketChannelTarantoolConnection() {\n\t\tthis(\"localhost\", 33013);\n\t}", "@Override\n public void initialize(URL location, ResourceBundle resources) {\n new Thread( ()-> {\n try {\n //Start the server\n ServerSocket serverSocket = new ServerSocket(8080);\n\n //show in terminal server has started\n System.out.println(\"Server Started: at \" + new Date() + \"\\n\");\n\n //main loop that will accept connections\n while (true) {\n //accept a new socket connection, this socket comes from client\n Socket clientSocket = serverSocket.accept();\n\n //thread that will handle what to do with new socket\n new Thread(new HandleAclient(clientSocket)).start();\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }).start();\n\n }", "public void conectServer() {\n\n\t}", "private void connectToServer() {\n\t\ttry {\n\t\t\tsocket = new Socket(InetAddress.getLocalHost(), Server.SERVER_PORT);\n\t\t\tin = new BufferedReader(new InputStreamReader(\n\t\t\tsocket.getInputStream()));\n\t\t\tout = new PrintWriter(socket.getOutputStream());\n\t\t}\n\t\tcatch(IOException e) {\n\t\t\tSystem.out.println(\"CLIENT: Cannot connect to server\");\n\t\t\tSystem.exit(-1);\n\t\t}\n\t}", "public ClientThread(Socket socket){\n this.socket = socket;\n }", "@Override\r\n public Object connect() {\n if(status()){\r\n //creates thread that checks messages in the network\r\n System.out.println(\"notifying network that connection is good\");\r\n notifyObservers(this);\r\n }\r\n return socket;\r\n }", "public UPKClient() {\n connectToServer(BASE_URL);\n }", "@Override\n\tpublic void run()\n\t{\n\t\tSocket clientSocket;\n\t\tMemoryIO serverIO;\n\t\t// Detect whether the listener is shutdown. If not, it must be running all the time to wait for potential connections from clients. 11/27/2014, Bing Li\n\t\twhile (!super.isShutdown())\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// Wait and accept a connecting from a possible client residing on the coordinator. 11/27/2014, Bing Li\n\t\t\t\tclientSocket = super.accept();\n\t\t\t\t// Check whether the connected server IOs exceed the upper limit. 11/27/2014, Bing Li\n\t\t\t\tif (MemoryIORegistry.REGISTRY().getIOCount() >= ServerConfig.MAX_SERVER_IO_COUNT)\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// If the upper limit is reached, the listener has to wait until an existing server IO is disposed. 11/27/2014, Bing Li\n\t\t\t\t\t\tsuper.holdOn();\n\t\t\t\t\t}\n\t\t\t\t\tcatch (InterruptedException e)\n\t\t\t\t\t{\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// If the upper limit of IOs is not reached, a server IO is initialized. A common Collaborator and the socket are the initial parameters. The shared common collaborator guarantees all of the server IOs from a certain client could notify with each other with the same lock. Then, the upper limit of server IOs is under the control. 11/27/2014, Bing Li\n//\t\t\t\tserverIO = new MemoryIO(clientSocket, super.getCollaborator(), ServerConfig.COORDINATOR_PORT_FOR_MEMORY);\n\t\t\t\tserverIO = new MemoryIO(clientSocket, super.getCollaborator());\n\t\t\t\t// Add the new created server IO into the registry for further management. 11/27/2014, Bing Li\n\t\t\t\tMemoryIORegistry.REGISTRY().addIO(serverIO);\n\t\t\t\t// Execute the new created server IO concurrently to respond the client requests in an asynchronous manner. 11/27/2014, Bing Li\n\t\t\t\tsuper.execute(serverIO);\n\t\t\t}\n\t\t\tcatch (IOException e)\n\t\t\t{\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public Server() throws IOException\n {\n socket = new ServerSocket(port);\n }", "public static Comms connect() {\r\n\t\tComms client = null;\r\n\t\ttry(ServerSocket server = new ServerSocket(4444)) {\r\n\t\t\tclient = new Comms(server.accept());\r\n\t\t} catch(Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn client;\r\n\t}", "public ConnectionManager() {\r\n\t\tthis(DEFAULT_PORT, true, true);\r\n\t}", "public TCPServer() throws SocketException\n\t{\n\t\tsuper();\n\t\tsetCheck(null);\n\t}", "public ServerNMS() {\n\t\tclients = new LinkedList<PrintWriter>();\n\t}", "public Client() {\r\n\t// TODO Auto-generated constructor stub\r\n\t \r\n }", "public TCPServer(int port) throws IOException {\n\tthis.socket = new ServerSocket(port);\n\tthis.clients = new ArrayList();\n\n\tSystem.out.println(\"SERVER: Started\");\n }", "@Override\r\n\tpublic void initial() {\n\t\ttry {\r\n\t\t\tserverSocket = new ServerSocket(port);\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t// System.out.println(\"LocalProxy run on \" + port);\r\n\t}", "public void makeConnection() {\n\t\ttry {\n\t\t\tif(sock != null) {\n\t\t\t\ttable.printMsg(\"Cannot join a server twice! You've already connected.\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsock = new Socket(serverIP, serverPort);\n\t\t\toos = new ObjectOutputStream(sock.getOutputStream());\n\t\t\tois = new ObjectInputStream(sock.getInputStream());\n\t\t\tThread thread = new Thread(new ServerHandler());\n\t\t\tthread.start();\n\t\t} catch(Exception e) {\n\t\t\ttable.printMsg(\"Cannot Join Server.\");\n\t\t\tsock = null;\n\t\t\ttable.repaint();\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}", "public PingClient() throws IOException {\n selector = Selector.open();\n Connector connector = new Connector();\n Printer printer = new Printer();\n connector.start();\n printer.start();\n receiveTarget();\n }", "public Server() {\n try {\n welcomeSocket = new ServerSocket(PORT);\n System.out.println(\"Server listening on \" + PORT);\n } catch (IOException e) {\n System.out.println(\"Error creating welcome socket. Is this socket available?\");\n }\n }", "public void connect() {\n synchronized (globalLock) {\n if (isRunning) {\n throw new IllegalStateException(\"WebSocketClient is not reusable\");\n }\n\n this.isRunning = true;\n createAndStartConnectionThread();\n }\n }", "public void creatSocket() {\n\n try {\n\n server = new ServerSocket(PORT);\n\n mExecutorService = Executors.newCachedThreadPool();\n\n while (true) {\n\n Socket client = server.accept();\n\n mExecutorService.execute(new SockectService(client));\n\n Log.d(TAG, \"Creating Socket\" );\n\n }\n\n } catch (Exception e) {\n\n e.printStackTrace();\n\n }\n\n }", "public ServerTask(Socket sk)\r\n {\r\n this.sk=sk;\r\n }", "public static void doConnect() {\r\n\t\tlogger.info(\"Connecting to server......\");\r\n\t\tChannelFuture future = null;\r\n\t\ttry {\r\n\t\t\tfuture = bootstrap.connect(new InetSocketAddress(host, port));\r\n\t\t\tfuture.addListener(channelFutureListener);\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\t// future.addListener(channelFutureListener);\r\n\t\t\tlogger.warn(\"Closed connection.\");\r\n\t\t}\r\n\r\n\t}", "private Connection () {}", "private Socket createClient()\n\t{\n\t\tSocket client = null;\n\t\ttry {\n\t\t\tclient = this.server.accept();\n\t\t}\n\t\tcatch(IOException e)\n\t\t{\n\t\t\tinsertLogEntry(e.getMessage(), e.getStackTrace().toString());\n\t\t}\n\t\t\n\t\treturn client;\n\t}", "@Override\n public void run() {\n //Create server socket\n try (ServerSocket serverSocket = new ServerSocket(serverPort))\n {\n //In loop to continuously accept connections from client\n //main thread doing this\n while (true)\n {\n System.out.println(\"Waiting for client(s) to connect..\");\n //Socket represents connection to client\n Socket clientSocket = serverSocket.accept();\n System.out.println(\"Accepted connection from \" + clientSocket);\n //Message to write to client when connected via outputstream\n OutputStream outputStream = clientSocket.getOutputStream();\n outputStream.write((\"You have connected. Please write: login <username> to login!\\n\" + \"Write <help> for list of additional commands!\\n\").getBytes());\n //Server worker, handles communication with client socket\n ServerWorker worker = new ServerWorker(this, clientSocket);\n //Adding worker to workerlist\n workerList.add(worker);\n //Starting thread worker\n worker.start();\n }\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public TCPRequest(ServerSocket ss) {\n try {\n this.clientSock = ss.accept();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void startServer(){\r\n try {\r\n\r\n while(true){\r\n\r\n s = sc.accept();\r\n new ServerThread(s).start();\r\n }\r\n }\r\n catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n finally {\r\n try {\r\n sc.close();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }\r\n }", "public Server() {\n\t\tinit(new Config());\n\t}", "public void start()\n {\n isRunning = true;\n try\n {\n //metoden opretter en ny socket for serveren på den valgte port\n ServerSocket serverSocket = new ServerSocket(port);\n //mens serveren kører venter den på en client\n while (isRunning)\n {\n serverDisplay(\"Serveren venter på clienter på port: \" + port);\n //accepterer clienten på socketen\n Socket socket = serverSocket.accept();\n\n if (!isRunning)\n {\n break;\n }\n // laver en ny thread til clienten med socketen der er blevet accepteret\n HandleClientThread handleClientThread = new HandleClientThread(socket);\n\n // her blever tråden tilføjet til arryet af clienter\n clientThreadArrayList.add(handleClientThread);\n // Starer handleclient tråden som håndtere clienter\n handleClientThread.start();\n }\n try\n {\n //Her lukker serveren socketen\n serverSocket.close();\n for (int i = 0; i < clientThreadArrayList.size() ; i++)\n {\n HandleClientThread hct = clientThreadArrayList.get(i);\n try\n {\n hct.inputStream.close();\n hct.outputStream.close();\n hct.socket.close();\n }\n catch (IOException e)\n {\n System.out.println(\"Uknowen command \" + e);\n }\n }\n }\n catch (Exception e)\n {\n serverDisplay(\"Kunne ikke lukke serveren og clienterne pga. \" + e);\n }\n }\n catch (IOException e)\n {\n String message = dateFormat.format(new Date()) + \"Fejl på ny server socket\" + e + \"\\n\";\n serverDisplay(message);\n }\n }", "public void run() {\n // Initial connect request comes in\n Request request = getRequest();\n\n if (request == null) {\n closeConnection();\n return;\n }\n\n if (request.getConnectRequest() == null) {\n closeConnection();\n System.err.println(\"Received invalid initial request from Remote Client.\");\n return;\n }\n\n ObjectFactory objectFactory = new ObjectFactory();\n Response responseWrapper = objectFactory.createResponse();\n responseWrapper.setId(request.getId());\n responseWrapper.setSuccess(true);\n responseWrapper.setConnectResponse(objectFactory.createConnectResponse());\n responseWrapper.getConnectResponse().setId(id);\n\n // Return connect response with our (statistically) unique ID.\n if (!sendMessage(responseWrapper)) {\n closeConnection();\n System.err.println(\"Unable to respond to connect Request from remote Client.\");\n return;\n }\n\n // register our thread with the server\n Server.register(id, this);\n\n // have handler manage the protocol until it decides it is done.\n while ((request = getRequest()) != null) {\n\n Response response = handler.process(this, request);\n\n if (response == null) {\n continue;\n }\n\n if (!sendMessage(response)) {\n break;\n }\n }\n\n // client is done so thread can be de-registered\n if (handler instanceof IShutdownHandler) {\n ((IShutdownHandler) handler).logout(Server.getState(id));\n }\n Server.unregister(id);\n\n // close communication to client.\n closeConnection();\n }", "@Override\n public void run()\n {\n lock = new Lock();\n messenger = new Messenger(notifier);\n clientList = new ClientList(notifier, messenger, connectionLimit);\n publisher = new Publisher(lock, clientList);\n\n try\n {\n notifier.sendToConsole(\"Server Started\");\n LOGGER.info(\"Server Started\");\n\n // Set up networking\n socketFactory = (SSLServerSocketFactory) SSLServerSocketFactory\n .getDefault();\n serverSocket = (SSLServerSocket) socketFactory\n .createServerSocket(port);\n serverSocket.setEnabledCipherSuites(enabledCipherSuites);\n\n int idCounter = 1;\n\n // Now repeatedly listen for connections\n while (true)\n {\n // Blocks whilst waiting for an incoming connection\n socket = (SSLSocket) serverSocket.accept();\n\n conn = new ClientConnection(socket, idCounter, notifier, lock,\n publisher, clientList, password);\n new Thread((Runnable) conn).start();\n\n LOGGER.info(\"Someone connected: \" + idCounter);\n idCounter++;\n }\n\n } catch (final SocketException e)\n {\n LOGGER.severe(\"Socket Exception: Server closed?\");\n notifier.sendToConsole(\"Server Stopped\");\n } catch (final IOException e)\n {\n LOGGER.severe(e.getMessage());\n notifier.sendError(e);\n } finally\n {\n kill();\n }\n }", "public ChatServer(){\r\n\t\tblnKeepRunning = true;\r\n\t\ttry{\r\n\t\t\tss = new ServerSocket(SERVER_PORT);\t\r\n\t\t\tThread t = new Thread(new Listener(), \"Chat Server Main Thread\"); //Run the service in its own thread\r\n\t\t\tt.start(); //The Hollywood Principle - \"Don't Call Us, We'll Call You.\". Threads are based on the Template Pattern\r\n\t\t}catch(Exception e){\t\t\t\r\n\t\t\te.printStackTrace();\t\r\n\t\t}\r\n\t}", "public GameServerClient(){\r\n\t\tinitComponents();\r\n\t\t}" ]
[ "0.7192116", "0.7185757", "0.7121298", "0.70681494", "0.70262074", "0.7016299", "0.69696474", "0.6850811", "0.6761003", "0.67466325", "0.66703737", "0.66210806", "0.6612429", "0.66005975", "0.65990657", "0.6585618", "0.6581173", "0.65581405", "0.65529454", "0.65460557", "0.6541347", "0.65242875", "0.6519492", "0.6487498", "0.648176", "0.6481182", "0.6473948", "0.64641035", "0.6441606", "0.6441465", "0.6439616", "0.64382833", "0.6430948", "0.6422829", "0.6420451", "0.6410381", "0.6406978", "0.6405995", "0.64059293", "0.639895", "0.63885134", "0.6388046", "0.63800997", "0.636605", "0.63589305", "0.6340003", "0.632718", "0.6317778", "0.6317219", "0.63101244", "0.6307521", "0.6304315", "0.6296877", "0.62956476", "0.62934667", "0.6290321", "0.62876064", "0.6278852", "0.6275132", "0.6274051", "0.6257356", "0.6244816", "0.6230418", "0.62290204", "0.6221197", "0.62130755", "0.6200032", "0.6199403", "0.61927253", "0.61927086", "0.61895", "0.6184177", "0.6182724", "0.61797035", "0.61792606", "0.6172641", "0.6169249", "0.61668724", "0.6156865", "0.61566097", "0.61505216", "0.6146508", "0.61460394", "0.61448747", "0.61438257", "0.61328095", "0.6132058", "0.6128096", "0.6125177", "0.61175877", "0.6115895", "0.6115794", "0.61132985", "0.6105423", "0.6101108", "0.60979605", "0.6093107", "0.60875875", "0.60839194", "0.60726964", "0.6066532" ]
0.0
-1
/ / / / / / / / /
@SuppressForbidden(reason = "to obtain default number of available processors") /* */ synchronized int availableProcessors() { /* 65 */ if (this.availableProcessors == 0) { /* */ /* 67 */ int availableProcessors = SystemPropertyUtil.getInt("io.netty.availableProcessors", /* */ /* 69 */ Runtime.getRuntime().availableProcessors()); /* 70 */ setAvailableProcessors(availableProcessors); /* */ } /* 72 */ return this.availableProcessors; /* */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int parent(int i){return (i-1)/2;}", "private int leftChild(int i){return 2*i+1;}", "public void divide() {\n\t\t\n\t}", "private int rightChild(int i){return 2*i+2;}", "public void zeichneQuadrate(){\n for (int i=0; i<10;i++)\n rect (50+i*25,50,25,25);\n }", "public abstract void bepaalGrootte();", "public static void bottomHalf() {\n\n for(int i = 1; i <= SIZE; i++) {\n for(int j = 1; j <= i - 1; j++) {\n System.out.print(\" \");\n }\n \n\t System.out.print(\"\\\\_\");\n\t for(int j = 3*SIZE-i; j >= i; j--) {\n\t System.out.print(\"/\\\\\");\n\t }\n\t System.out.println(\"_/\");\n }\n }", "double passer();", "public String ring();", "int getWidth() {return width;}", "public void gored() {\n\t\t\n\t}", "public double getWidth() {\n return this.left.getLeft(0) - this.right.getRight(0); \n }", "private static Object[] newPath(int length, Object[] leaf) {\n Object[] node = leaf;\n for (int i = 0; i < length; i += 5) {\n node = new Object[] { node };\n }\n return node;\n }", "laptop(){\r\n length= 0 ;\r\n weight = 0;\r\n height = 0;\r\n width = 0;\r\n }", "public String toString(){ return \"DIV\";}", "public double getWidth() {\n return this.size * 2.0; \n }", "public void getTile_B8();", "public Integer getWidth(){return this.width;}", "public abstract String division();", "private double[] getExtents(){\n return new double[] { -90, -180, 90, 180 };\n }", "int width();", "private int leftChild(int index){\n\t\treturn (2*index) +1;\n\t}", "@Override\n public double getPerimiter() {\n return 4 * width;\n }", "private int get_right_child(int index){\r\n return 2 * index + 2;\r\n }", "@Override\n public void bfs() {\n\n }", "public double getWidth() { return _width<0? -_width : _width; }", "private void traverseBayeredPatternHalfSizeRGB(){\n int originalPositionX = 0;\n int originalPositionY = 1;\n\n for (int newX = 0; originalPositionX < originalImageHeight -1; newX++){\n for (int newY = 0; originalPositionY < originalImageWidth -1; newY++){\n Point newPosition = new Point(newX,newY);\n int newAbsoultPosition = getAbsolutPixelPosition(newPosition, originalImageHeight / 2, originalImageWidth / 2);\n halfSizePixRGB[newAbsoultPosition] = getAverageRGB(new Point(originalPositionX,originalPositionY));\n originalPositionY += 2;\n }\n originalPositionY = 0;\n originalPositionX += 2;\n }\n }", "@Override\npublic void processDirection() {\n\t\n}", "double volume(){\n return width*height*depth;\n }", "public double getWidth() {\n return this.getRight(this.tree.getRight(0)) - this.getLeft(this.tree.getLeft(0)); \n }", "public static void sizePathCompression(){\n\t\tint n = 10;\t\n\n\t\tdsf S = new dsf(n*n);\n\t\tMaze five = new Maze(n);\n\n\t\tRandom random;\n\t\tint sets = n*n;\t//number of sets in the DSF\n\t\tint randomNumber;\n\t\tint randomDirection;\n\t\tint row;\n\t\tint col;\n\n\t\tchar upperRight; \t//bottom or right\n\n\t\tS.print();\n\n\t\twhile(sets > 1){\n\t\t\trandom = new Random();\n\t\t\trandomNumber = random.nextInt((n*n) - 1);\n\t\t\t//System.out.println(\"RANDOM NUMBER: \"+randomNumber);\n\t\t\trow = randomNumber /n;\t//SWITCHED\n\t\t\tcol = randomNumber %n;\t//SWITCHED\n\t\t\trandomDirection = random.nextInt(2);\n\t\t\tString direct;\n\t\t\tif(randomDirection == 0)\n\t\t\t\tdirect = \"upper\";\n\t\t\telse\n\t\t\t\tdirect = \"right\";\n\t\t\t//System.out.println(\"RANDOM DIRECTI0N: \"+direct);\n\t\t\tupperRight = five.direction(randomDirection);\n\n\t\t\tif(upperRight == 'u'){\n\t\t\t\tif((randomNumber) < ((n*n)-n)){\n\t\t\t\t\tSystem.out.println(\"Sets: \"+sets);\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber + n)){\n\t\t\t\t\t\tS.unionBySize(randomNumber+n, randomNumber);\n\t\t\t\t\t\tfive.remove_wall(col, row, 'u');\n\t\t\t\t\t\t//S.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(upperRight == 'r'){\n\t\t\t\tif(((randomNumber)%(n*n)) != n-1){\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber+1)){\n\t\t\t\t\t\tS.unionBySize(randomNumber, randomNumber+1);\n\t\t\t\t\t\tfive.remove_wall(col, row, 'r');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbuildAdjacencyList(five, n);\n\t\tuserSelection_SolveMaze(n);\n\n\t\tStdDraw.show(0);\n\t\tfive.draw();\n\t\tfive.printCellNumbers();\t\n\t}", "public int generateRoshambo(){\n ;]\n\n }", "Operations operations();", "private void pointer(Graphics image,int x,int y,int height,int b,int dir) {\n\n\t\tint[] xt=new int[3];\n\t\tint[] yt=new int[3];\n\n\t\tif(dir==0) {\n\t\t\txt[0]=x;\n\t\t\txt[1]=xt[2]=x+height;\n\t\t\tyt[0]=y;\n\t\t\tyt[1]=y+b/2;\n\t\t\tyt[2]=y-b/2;\n\t\t} else {\n\t\t\txt[0]=x;\n\t\t\txt[1]=x+b/2;\n\t\t\txt[2]=x-b/2;\n\t\t\tyt[0]=y;\n\t\t\tyt[1]=yt[2]=y-height;\n\t\t}\n\t\timage.fillPolygon(xt,yt,3);\n\t}", "public int getEdgeCount() \n {\n return 3;\n }", "protected boolean\nshouldCompactPathLists()\n//\n////////////////////////////////////////////////////////////////////////\n{\n return true;\n}", "double getNewWidth();", "public int getWidth() {\r\n\treturn this.width;\r\n}", "long getWidth();", "public void SubRect(){\n\t\n}", "void mo33732Px();", "static void pyramid(){\n\t}", "public double getPerimiter(){return (2*height +2*width);}", "public int my_leaf_count();", "@Override\r\n\tpublic void walk() {\n\r\n\t}", "public void skystonePos4() {\n }", "public static void main(String[] args) {\n\n\n for(int a=0; a<7;a++){\n for(int b=0;b<7-a;b++){\n System.out.print(\" \");\n }\n for(int c=0; c<=a;c++){\n System.out.print(\"* \");\n }\n System.out.println(\" \");\n }\n\n }", "void walk() {\n\t\t\n\t}", "int[] union(int s1,int t1,int s2,int t2)\r\n\t{\r\n\t\tint [] st=new int[2];\r\n\t\t//Please fill in the program here\r\n\t\tst[0] = incCapacity();\r\n\t\taddEdge(st[0], epssymbol, s1);\r\n\t\taddEdge(st[0], epssymbol, s2);\r\n\t\tst[1] = incCapacity();\r\n\t\taddEdge(t1, epssymbol, st[1]);\r\n\t\taddEdge(t2, epssymbol, st[1]);\r\n\r\n\t\treturn st;\r\n\t}", "public static void main(String[] args) {\n\t\tScanner obj=new Scanner(System.in);\r\n\t\tint a=0;\r\n\t\tint count=0;\r\n System.out.println(\"enter size\");\r\n\t\ta=obj.nextInt();\r\n\t\tint m=2*a+1;\r\n\t\tint n=2*a+2;\r\n\t\tint mid=(m+1)/2;\r\n\t\tfor(int i=1;i<=m;i++)\r\n\t\t{\r\n\t\t\tcount=0;\r\n\t\t\tfor(int j=1;j<=n;j++)\r\n\t\t\t{\r\n\t\t\t\tcount++;\r\n\t\t\t\tif((i==1)||(i==m)||(j==1)||(j==n))//frame begin\r\n\t\t\t\t{\r\n\t\t\t\t\tif((i==1)||(i==m))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif((j==1)||(j==n))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"+\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"-\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif((j==1)||(j==n))\r\n\t {\r\n\t\t\t\t\t\t\tSystem.out.print(\"|\");//frame left and right\r\n\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}//frame end\r\n\t\t\t\telse if (i<mid)//upper-half\r\n\t\t\t\t{\r\n\t\t\t\t\tif(count<=2)\r\n\t\t\t\t\t{\r\n\t\t\t\t for(int k=mid;k>i;k--)\r\n\t\t\t\t {\r\n\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t }\r\n\t\t\t\t System.out.print(\"/\");\r\n\t\t\t\t for(int l=1;l<=2*i-4;l++)\r\n\t\t\t\t {\r\n\t\t\t\t\t if(i%2==0)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t System.out.print(\"=\");\r\n\t\t\t\t\t }\r\n\t\t\t\t\t else\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t }\r\n\t\t\t\t }\r\n\t\t\t\tSystem.out.print(\"\\\\\");\r\n\t\t\t\t for(int k=mid;k>i;k--)\r\n\t\t\t\t {\r\n\t\t\t\t\t System.out.print(\" \");\r\n\t\t\t\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}//end of upper half\r\n\t\t\t\telse if(i>mid)//lower half\r\n\t\t\t\t{\r\n\t\t\t\t\tif(count<=2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\tfor(int k=mid;k<i;k++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t System.out.print(\"\\\\\");\r\n\t\t\t\t\t for(int l=2*m-6;l>2*i-4;l--)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t if(i%2==0)\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t System.out.print(\"=\");\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t else\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t\t } \r\n\t\t\t\t\t }\r\n\t\t\t\t\t System.out.print(\"/\");\r\n\t\t\t\t\t for(int k=mid;k<i;k++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t\t}\r\n\t\t\t }\r\n\t\t\t\t\t}//end of lower half\r\n\t\t\t\telse if(i==mid)//middle part\r\n\t\t\t\t{\r\n\t\t\t\t\tif(j==2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\"<\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(j==n-1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\">\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(i%2==0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"=\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"-\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}//end\r\n\t\t\t}//end-of-j\r\n\t\t\tSystem.out.println();\r\n\t\t}//end\r\n\r\n\t}", "public void foundLeaf(int width, int height, int level, int currX, int currY, int location) {\n level = level +2;\n if (location == 1) {\n\n\n canvas.addLine(currX - (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n (currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue()) - ( (new Double(spatialHeight / Math.pow(2, level ))).intValue()),\n currX - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY * 2,\n Color.BLACK);\n\n\n canvas.addLine(((currX - (new Double(spatialWidth / Math.pow(2, level))).intValue())) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(), \n currX,\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.BLACK);\n\n\n\n }\n\n if (location == 2) {\n\n\n canvas.addLine(currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n (currY + (new Double(spatialHeight / Math.pow(2, level))).intValue()) - (new Double(spatialHeight / Math.pow(2, level))).intValue(),\n currX + (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n ( currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue()) + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.black);\n\n canvas.addLine((currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue()) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n (currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue()) + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.black);\n\n\n\n }\n\n if (location == 3) {\n\n canvas.addLine(currX - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n (currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue()) - (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n currX - (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n currY,\n Color.BLACK);\n\n\n\n canvas.addLine((currX - (new Double(spatialWidth / Math.pow(2, level))).intValue()) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n\tcurrY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(), \n (currX - (new Double(spatialWidth / Math.pow(2, level ))).intValue()) + (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.BLACK);\n\n\n }\n\n if (location == 4) {\n\n\n canvas.addLine(currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n (currY - (new Double(spatialHeight / Math.pow(2, level))).intValue()) - (new Double(spatialHeight / Math.pow(2, level))).intValue(),\n currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY,\n Color.BLACK);\n\n\n canvas.addLine((currX + (new Double(spatialWidth / Math.pow(2, level))).intValue()) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue() + (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(), Color.BLACK);\n\n\n }\n\n\n\n\n }", "private static void breadcrumbArrow(int width, int height, int indent, int c1, int c2) {\n\n\t\tdouble x0 = 0, y0 = height / 2d;\n\t\tdouble x1 = indent, y1 = 0;\n\t\tdouble x2 = indent, y2 = height / 2d;\n\t\tdouble x3 = indent, y3 = height;\n\t\tdouble x4 = width, y4 = 0;\n\t\tdouble x5 = width, y5 = height / 2d;\n\t\tdouble x6 = width, y6 = height;\n\t\tdouble x7 = indent + width, y7 = 0;\n\t\tdouble x8 = indent + width, y8 = height;\n\n\t\tint fc1 = ColorHelper.mixAlphaColors(c1, c2, 0);\n\t\tint fc2 = ColorHelper.mixAlphaColors(c1, c2, (indent)/(width + 2f * indent));\n\t\tint fc3 = ColorHelper.mixAlphaColors(c1, c2, (indent + width)/(width + 2f * indent));\n\t\tint fc4 = ColorHelper.mixAlphaColors(c1, c2, 1);\n\n\t\tRenderSystem.disableTexture();\n\t\tRenderSystem.enableBlend();\n\t\tRenderSystem.disableAlphaTest();\n\t\tRenderSystem.defaultBlendFunc();\n\t\tRenderSystem.shadeModel(GL11.GL_SMOOTH);\n\n\t\tTessellator tessellator = Tessellator.getInstance();\n\t\tBufferBuilder bufferbuilder = tessellator.getBuffer();\n\t\tbufferbuilder.begin(GL11.GL_TRIANGLES, DefaultVertexFormats.POSITION_COLOR);\n\n\t\tbufferbuilder.vertex(x0, y0, 0).color(fc1 >> 16 & 0xFF, fc1 >> 8 & 0xFF, fc1 & 0xFF, fc1 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x1, y1, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x2, y2, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x0, y0, 0).color(fc1 >> 16 & 0xFF, fc1 >> 8 & 0xFF, fc1 & 0xFF, fc1 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x2, y2, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x3, y3, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x3, y3, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x1, y1, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x4, y4, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x3, y3, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x4, y4, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x6, y6, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x5, y5, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x4, y4, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x7, y7, 0).color(fc4 >> 16 & 0xFF, fc4 >> 8 & 0xFF, fc4 & 0xFF, fc4 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x6, y6, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x5, y5, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x8, y8, 0).color(fc4 >> 16 & 0xFF, fc4 >> 8 & 0xFF, fc4 & 0xFF, fc4 >> 24 & 0xFF).endVertex();\n\n\t\ttessellator.draw();\n\t\tRenderSystem.shadeModel(GL11.GL_FLAT);\n\t\tRenderSystem.disableBlend();\n\t\tRenderSystem.enableAlphaTest();\n\t\tRenderSystem.enableTexture();\n\t}", "double seBlesser();", "void sharpen();", "void sharpen();", "public static void unionPathCompression(){\n\t\tint n = 10;\t\n\n\t\tdsf S = new dsf(n*n);\n\t\tMaze two = new Maze(n);\n\n\t\tRandom random;\n\t\tint sets = n*n;\t//number of sets in the DSF\n\t\tint randomNumber;\n\t\tint randomDirection;\n\t\tint row;\n\t\tint col;\n\n\t\tchar upperRight; \t//bottom or right\n\n\t\tS.print();\n\n\t\twhile(sets > 1){\n\t\t\trandom = new Random();\n\t\t\trandomNumber = random.nextInt((n*n) - 1);\n\t\t\t//System.out.println(\"RANDOM NUMBER: \"+randomNumber);\n\t\t\trow = randomNumber /n;\t//SWITCHED\n\t\t\tcol = randomNumber %n;\t//SWITCHED\n\t\t\trandomDirection = random.nextInt(2);\n\t\t\tString direct;\n\t\t\tif(randomDirection == 0)\n\t\t\t\tdirect = \"upper\";\n\t\t\telse\n\t\t\t\tdirect = \"right\";\n\t\t\tSystem.out.println(\"RANDOM DIRECTI0N: \"+direct);\n\t\t\tupperRight = two.direction(randomDirection);\n\n\t\t\tif(upperRight == 'u'){\n\t\t\t\tif((randomNumber) < ((n*n)-n)){\n\t\t\t\t\tSystem.out.println(\"Sets: \"+sets);\n\t\t\t\t\tif(S.findAndCompress(randomNumber+n) != S.findAndCompress(randomNumber)){\n\t\t\t\t\t\tS.union(randomNumber+n, randomNumber);\n\t\t\t\t\t\ttwo.remove_wall(col, row, 'u');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(upperRight == 'r'){\n\t\t\t\tif(((randomNumber)%(n*n)) != n-1){\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber+1)){\n\t\t\t\t\t\tS.union(randomNumber, randomNumber+1);\n\t\t\t\t\t\ttwo.remove_wall(col, row, 'r');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbuildAdjacencyList(two, n);\n\t\tuserSelection_SolveMaze(n);\n\n\n\t\tStdDraw.show(0);\n\t\ttwo.draw();\n\t\ttwo.printCellNumbers();\n\t}", "Parallelogram(){\n length = width = height = 0;\n }", "private int get_left_child(int index){\r\n return 2 * index + 1;\r\n }", "public void leerPlanesDietas();", "public String getRing();", "static int getNumPatterns() { return 64; }", "private void traversePath()\n\t{\n\t\trobot.forward(50);\n\t\trobot.right(90);\n\t\trobot.forward(50);\n\t\trobot.right(90);\n\t\trobot.forward(50);\n\t\trobot.left(90);\n\t\trobot.forward(50);\n\t\trobot.left(90);\n\t}", "double Volume(){\r\n return Height * Width * Depth;\r\n }", "public int getWidth(){\n return width;\n }", "@Override\n\tpublic void walk() {\n\t\t\n\t}", "public void lowerFlatbed(){\n flatbed.lowerFlatbed();\n }", "double getPerimeter(){\n return 2*height+width;\n }", "private int get_parent(int index){\r\n return (index-1)/2;\r\n }", "protected int parent(int i) { return (i - 1) / 2; }", "protected int getWidth()\n\t{\n\t\treturn 0;\n\t}", "public static String makeShapeA() {\n\tString result = \"\";\n\t\tfor (int i = 0; i < 8 ; i++) {\n\t\t\tresult+=printHash(i);\n\t\t\t\n\t\t}return result;\n\t\t\t//System.out.println(printHash(i));\n\t\t}", "@Override\n protected int mapSize() {\n return left.size()+right.size()-hidden.size();\n }", "private void e()\r\n/* 273: */ {\r\n/* 274:278 */ this.r = false;\r\n/* 275:279 */ this.s = false;\r\n/* 276:280 */ this.t = false;\r\n/* 277:281 */ this.u = false;\r\n/* 278:282 */ this.v = false;\r\n/* 279: */ }", "@Override\n public String toString()\n {\n\treturn getClass().getSimpleName() + \" (\" + getLength() + \"x\" + getWidth() + \")\";\n }", "public abstract double getBaseWidth();", "public void stg() {\n\n\t}", "@Override\n\tpublic void draw() {\n\t\t\n\t}", "@Override\n\tpublic void draw() {\n\t\t\n\t}", "@Override\n\tpublic float getWidth() {\n\t\treturn 26;\n\t}", "@Override\r\n\tpublic double perimeter() {\n\t\treturn 2*length*breadth;\r\n\t}", "void doubleBox(int sides, float x1, float y1, float z1, float x2, float y2, float z2)\r\n/* 100: */ {\r\n/* 101: 99 */ int s2 = sides << 1 & 0x2A | sides >> 1 & 0x15;\r\n/* 102: */ \r\n/* 103:101 */ this.context.renderBox(sides, x1, y1, z1, x2, y2, z2);\r\n/* 104:102 */ this.context.renderBox(s2, x2, y2, z2, x1, y1, z1);\r\n/* 105: */ }", "public void draw(){\n for(int i = 1; i <= height; i++){\n for(int s = 1; s <= i; s++)\n System.out.print(\"*\");\n System.out.println();\n }\n }", "int fi(int x, int y) {\n\t\treturn (x + 1) + (width + 2) * (y + 1);\n\t}", "int expand();", "private byte r() {\r\n\t\treturn (left_map == 0 ) ? (byte) 1 : 0;\r\n\t}", "public static void main(String[] args) {\n\t\tfor(int j=0;j<8;j++){\n\t\t\tfor(int i=0;i<8;i++){\n\t\t\t\t//上下两侧\n\t\t\t\tif(j==0||j==7){\n\t\t\t\t\tSystem.out.print(\"*\");\n\t\t\t\t}else{\n\t\t\t\t\t//中间\n\t\t\t\t\tif(i>0&&i<7){\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t}else{\n\t\t\t\t\t\tSystem.out.print(\"*\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public void draw4x4 (char design){\n System.out.println(\"\"+design+design+design+design);\n System.out.println(design+\" \"+design);\n System.out.println(design+\" \"+design);\n System.out.println(\"\"+design+design+design+design);\n}", "@Override\n protected void paint2d(Graphics2D g) {\n \n }", "public int upright();", "int getTribeSize();", "int getWidth1();", "int getR();", "String directsTo();", "public int getWidth()\n {return width;}", "@Override\r\n\tpublic int getWidth() {\n\t\treturn 0;\r\n\t}", "int depth();", "int depth();", "public\nstatic\nvoid\nmain(String args[]) \n\n{ \n\nBinaryTree tree = \nnew\nBinaryTree(); \n\ntree.root = \nnew\nNode(\n20\n); \n\ntree.root.left = \nnew\nNode(\n8\n); \n\ntree.root.left.left = \nnew\nNode(\n4\n); \n\ntree.root.left.right = \nnew\nNode(\n12\n); \n\ntree.root.left.right.left = \nnew\nNode(\n10\n); \n\ntree.root.left.right.right = \nnew\nNode(\n14\n); \n\ntree.root.right = \nnew\nNode(\n22\n); \n\ntree.root.right.right = \nnew\nNode(\n25\n); \n\ntree.printBoundary(tree.root); \n\n}", "public void renderCenterBlock(int cons, int side, int end)\r\n/* 143: */ {\r\n/* 144:135 */ if (cons == 0)\r\n/* 145: */ {\r\n/* 146:136 */ this.context.setTex(end);\r\n/* 147:137 */ doubleBox(63, 0.375F, 0.375F, 0.375F, 0.625F, 0.625F, 0.625F);\r\n/* 148:138 */ return;\r\n/* 149: */ }\r\n/* 150:139 */ if (cons == 3)\r\n/* 151: */ {\r\n/* 152:140 */ this.context.setTexFlags(1773);\r\n/* 153:141 */ this.context.setTex(end, end, side, side, side, side);\r\n/* 154:142 */ doubleBox(60, 0.375F, 0.0F, 0.375F, 0.625F, 1.0F, 0.625F);\r\n/* 155:143 */ return;\r\n/* 156: */ }\r\n/* 157:144 */ if (cons == 12)\r\n/* 158: */ {\r\n/* 159:145 */ this.context.setTexFlags(184365);\r\n/* 160:146 */ this.context.setTex(side, side, end, end, side, side);\r\n/* 161:147 */ doubleBox(51, 0.375F, 0.375F, 0.0F, 0.625F, 0.625F, 1.0F);\r\n/* 162:148 */ return;\r\n/* 163: */ }\r\n/* 164:149 */ if (cons == 48)\r\n/* 165: */ {\r\n/* 166:150 */ this.context.setTexFlags(187200);\r\n/* 167:151 */ this.context.setTex(side, side, side, side, end, end);\r\n/* 168:152 */ doubleBox(15, 0.0F, 0.375F, 0.375F, 1.0F, 0.625F, 0.625F);\r\n/* 169:153 */ return;\r\n/* 170: */ }\r\n/* 171:155 */ this.context.setTex(end);\r\n/* 172:156 */ doubleBox(0x3F ^ cons, 0.375F, 0.375F, 0.375F, 0.625F, 0.625F, 0.625F);\r\n/* 173:157 */ if ((cons & 0x1) > 0)\r\n/* 174: */ {\r\n/* 175:158 */ this.context.setTexFlags(1773);\r\n/* 176:159 */ this.context.setTex(end, end, side, side, side, side);\r\n/* 177:160 */ doubleBox(60, 0.375F, 0.0F, 0.375F, 0.625F, 0.375F, 0.625F);\r\n/* 178: */ }\r\n/* 179:162 */ if ((cons & 0x2) > 0)\r\n/* 180: */ {\r\n/* 181:163 */ this.context.setTexFlags(1773);\r\n/* 182:164 */ this.context.setTex(end, end, side, side, side, side);\r\n/* 183:165 */ doubleBox(60, 0.375F, 0.625F, 0.375F, 0.625F, 1.0F, 0.625F);\r\n/* 184: */ }\r\n/* 185:167 */ if ((cons & 0x4) > 0)\r\n/* 186: */ {\r\n/* 187:168 */ this.context.setTexFlags(184365);\r\n/* 188:169 */ this.context.setTex(side, side, end, end, side, side);\r\n/* 189:170 */ doubleBox(51, 0.375F, 0.375F, 0.0F, 0.625F, 0.625F, 0.375F);\r\n/* 190: */ }\r\n/* 191:172 */ if ((cons & 0x8) > 0)\r\n/* 192: */ {\r\n/* 193:173 */ this.context.setTexFlags(184365);\r\n/* 194:174 */ this.context.setTex(side, side, end, end, side, side);\r\n/* 195:175 */ doubleBox(51, 0.375F, 0.375F, 0.625F, 0.625F, 0.625F, 1.0F);\r\n/* 196: */ }\r\n/* 197:177 */ if ((cons & 0x10) > 0)\r\n/* 198: */ {\r\n/* 199:178 */ this.context.setTexFlags(187200);\r\n/* 200:179 */ this.context.setTex(side, side, side, side, end, end);\r\n/* 201:180 */ doubleBox(15, 0.0F, 0.375F, 0.375F, 0.375F, 0.625F, 0.625F);\r\n/* 202: */ }\r\n/* 203:182 */ if ((cons & 0x20) > 0)\r\n/* 204: */ {\r\n/* 205:183 */ this.context.setTexFlags(187200);\r\n/* 206:184 */ this.context.setTex(side, side, side, side, end, end);\r\n/* 207:185 */ doubleBox(15, 0.625F, 0.375F, 0.375F, 1.0F, 0.625F, 0.625F);\r\n/* 208: */ }\r\n/* 209: */ }", "double getWidth();", "double getWidth();" ]
[ "0.5531016", "0.54378587", "0.52516115", "0.52405924", "0.5151045", "0.5127977", "0.50680465", "0.5066997", "0.50218964", "0.5013022", "0.5007318", "0.50048536", "0.49997565", "0.4994835", "0.49735898", "0.49699947", "0.49680406", "0.49594593", "0.4937881", "0.49361676", "0.49287266", "0.4884688", "0.4874051", "0.4871873", "0.48511675", "0.48435977", "0.48318782", "0.48268357", "0.48253223", "0.48089546", "0.4805502", "0.48046046", "0.4803564", "0.48035362", "0.47987092", "0.47966656", "0.47941628", "0.47918317", "0.4789212", "0.4783637", "0.47747543", "0.4774159", "0.47730577", "0.47666246", "0.47664872", "0.47615", "0.4755131", "0.47543177", "0.47509375", "0.47481856", "0.47429588", "0.47421312", "0.47413164", "0.47407025", "0.47407025", "0.47362685", "0.47353023", "0.47351807", "0.47331676", "0.47328842", "0.47319365", "0.4729934", "0.47290468", "0.47287467", "0.47275317", "0.47259426", "0.47239763", "0.4723621", "0.4715134", "0.47056246", "0.47034666", "0.47034577", "0.4701833", "0.46977103", "0.46967983", "0.46885592", "0.46881223", "0.46881223", "0.4685835", "0.4677769", "0.46758488", "0.46741006", "0.46703368", "0.46684504", "0.4664061", "0.4664013", "0.46639267", "0.46607205", "0.4659042", "0.46581274", "0.4656714", "0.46495056", "0.464903", "0.4648408", "0.46467063", "0.4643833", "0.4643833", "0.46426296", "0.46422264", "0.4639917", "0.4639917" ]
0.0
-1
/ / / / / / / / / /
public static void setAvailableProcessors(int availableProcessors) { /* 87 */ holder.setAvailableProcessors(availableProcessors); /* */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int parent(int i){return (i-1)/2;}", "private int leftChild(int i){return 2*i+1;}", "private int rightChild(int i){return 2*i+2;}", "public void divide() {\n\t\t\n\t}", "public abstract void bepaalGrootte();", "public void zeichneQuadrate(){\n for (int i=0; i<10;i++)\n rect (50+i*25,50,25,25);\n }", "double passer();", "int getWidth() {return width;}", "public static void bottomHalf() {\n\n for(int i = 1; i <= SIZE; i++) {\n for(int j = 1; j <= i - 1; j++) {\n System.out.print(\" \");\n }\n \n\t System.out.print(\"\\\\_\");\n\t for(int j = 3*SIZE-i; j >= i; j--) {\n\t System.out.print(\"/\\\\\");\n\t }\n\t System.out.println(\"_/\");\n }\n }", "public double getWidth() {\n return this.left.getLeft(0) - this.right.getRight(0); \n }", "public String ring();", "private static Object[] newPath(int length, Object[] leaf) {\n Object[] node = leaf;\n for (int i = 0; i < length; i += 5) {\n node = new Object[] { node };\n }\n return node;\n }", "public Integer getWidth(){return this.width;}", "public double getWidth() {\n return this.size * 2.0; \n }", "public void gored() {\n\t\t\n\t}", "public void getTile_B8();", "laptop(){\r\n length= 0 ;\r\n weight = 0;\r\n height = 0;\r\n width = 0;\r\n }", "private double[] getExtents(){\n return new double[] { -90, -180, 90, 180 };\n }", "public String toString(){ return \"DIV\";}", "int width();", "public abstract String division();", "private int leftChild(int index){\n\t\treturn (2*index) +1;\n\t}", "@Override\n public double getPerimiter() {\n return 4 * width;\n }", "private int get_right_child(int index){\r\n return 2 * index + 2;\r\n }", "public double getWidth() { return _width<0? -_width : _width; }", "@Override\n public void bfs() {\n\n }", "public int getEdgeCount() \n {\n return 3;\n }", "private void traverseBayeredPatternHalfSizeRGB(){\n int originalPositionX = 0;\n int originalPositionY = 1;\n\n for (int newX = 0; originalPositionX < originalImageHeight -1; newX++){\n for (int newY = 0; originalPositionY < originalImageWidth -1; newY++){\n Point newPosition = new Point(newX,newY);\n int newAbsoultPosition = getAbsolutPixelPosition(newPosition, originalImageHeight / 2, originalImageWidth / 2);\n halfSizePixRGB[newAbsoultPosition] = getAverageRGB(new Point(originalPositionX,originalPositionY));\n originalPositionY += 2;\n }\n originalPositionY = 0;\n originalPositionX += 2;\n }\n }", "public int getWidth() {\r\n\treturn this.width;\r\n}", "@Override\npublic void processDirection() {\n\t\n}", "double getNewWidth();", "long getWidth();", "public int generateRoshambo(){\n ;]\n\n }", "public double getWidth() {\n return this.getRight(this.tree.getRight(0)) - this.getLeft(this.tree.getLeft(0)); \n }", "double volume(){\n return width*height*depth;\n }", "public static void sizePathCompression(){\n\t\tint n = 10;\t\n\n\t\tdsf S = new dsf(n*n);\n\t\tMaze five = new Maze(n);\n\n\t\tRandom random;\n\t\tint sets = n*n;\t//number of sets in the DSF\n\t\tint randomNumber;\n\t\tint randomDirection;\n\t\tint row;\n\t\tint col;\n\n\t\tchar upperRight; \t//bottom or right\n\n\t\tS.print();\n\n\t\twhile(sets > 1){\n\t\t\trandom = new Random();\n\t\t\trandomNumber = random.nextInt((n*n) - 1);\n\t\t\t//System.out.println(\"RANDOM NUMBER: \"+randomNumber);\n\t\t\trow = randomNumber /n;\t//SWITCHED\n\t\t\tcol = randomNumber %n;\t//SWITCHED\n\t\t\trandomDirection = random.nextInt(2);\n\t\t\tString direct;\n\t\t\tif(randomDirection == 0)\n\t\t\t\tdirect = \"upper\";\n\t\t\telse\n\t\t\t\tdirect = \"right\";\n\t\t\t//System.out.println(\"RANDOM DIRECTI0N: \"+direct);\n\t\t\tupperRight = five.direction(randomDirection);\n\n\t\t\tif(upperRight == 'u'){\n\t\t\t\tif((randomNumber) < ((n*n)-n)){\n\t\t\t\t\tSystem.out.println(\"Sets: \"+sets);\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber + n)){\n\t\t\t\t\t\tS.unionBySize(randomNumber+n, randomNumber);\n\t\t\t\t\t\tfive.remove_wall(col, row, 'u');\n\t\t\t\t\t\t//S.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(upperRight == 'r'){\n\t\t\t\tif(((randomNumber)%(n*n)) != n-1){\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber+1)){\n\t\t\t\t\t\tS.unionBySize(randomNumber, randomNumber+1);\n\t\t\t\t\t\tfive.remove_wall(col, row, 'r');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbuildAdjacencyList(five, n);\n\t\tuserSelection_SolveMaze(n);\n\n\t\tStdDraw.show(0);\n\t\tfive.draw();\n\t\tfive.printCellNumbers();\t\n\t}", "public int my_leaf_count();", "protected boolean\nshouldCompactPathLists()\n//\n////////////////////////////////////////////////////////////////////////\n{\n return true;\n}", "Operations operations();", "static int getNumPatterns() { return 64; }", "void mo33732Px();", "public double getPerimiter(){return (2*height +2*width);}", "double seBlesser();", "public void SubRect(){\n\t\n}", "@Override\n protected int mapSize() {\n return left.size()+right.size()-hidden.size();\n }", "private int get_left_child(int index){\r\n return 2 * index + 1;\r\n }", "@Override\r\n\tpublic void walk() {\n\r\n\t}", "public void skystonePos4() {\n }", "int[] union(int s1,int t1,int s2,int t2)\r\n\t{\r\n\t\tint [] st=new int[2];\r\n\t\t//Please fill in the program here\r\n\t\tst[0] = incCapacity();\r\n\t\taddEdge(st[0], epssymbol, s1);\r\n\t\taddEdge(st[0], epssymbol, s2);\r\n\t\tst[1] = incCapacity();\r\n\t\taddEdge(t1, epssymbol, st[1]);\r\n\t\taddEdge(t2, epssymbol, st[1]);\r\n\r\n\t\treturn st;\r\n\t}", "public int getWidth(){\n return width;\n }", "static void pyramid(){\n\t}", "public void leerPlanesDietas();", "private void pointer(Graphics image,int x,int y,int height,int b,int dir) {\n\n\t\tint[] xt=new int[3];\n\t\tint[] yt=new int[3];\n\n\t\tif(dir==0) {\n\t\t\txt[0]=x;\n\t\t\txt[1]=xt[2]=x+height;\n\t\t\tyt[0]=y;\n\t\t\tyt[1]=y+b/2;\n\t\t\tyt[2]=y-b/2;\n\t\t} else {\n\t\t\txt[0]=x;\n\t\t\txt[1]=x+b/2;\n\t\t\txt[2]=x-b/2;\n\t\t\tyt[0]=y;\n\t\t\tyt[1]=yt[2]=y-height;\n\t\t}\n\t\timage.fillPolygon(xt,yt,3);\n\t}", "public String getRing();", "private int get_parent(int index){\r\n return (index-1)/2;\r\n }", "public static void main(String[] args) {\n\t\tScanner obj=new Scanner(System.in);\r\n\t\tint a=0;\r\n\t\tint count=0;\r\n System.out.println(\"enter size\");\r\n\t\ta=obj.nextInt();\r\n\t\tint m=2*a+1;\r\n\t\tint n=2*a+2;\r\n\t\tint mid=(m+1)/2;\r\n\t\tfor(int i=1;i<=m;i++)\r\n\t\t{\r\n\t\t\tcount=0;\r\n\t\t\tfor(int j=1;j<=n;j++)\r\n\t\t\t{\r\n\t\t\t\tcount++;\r\n\t\t\t\tif((i==1)||(i==m)||(j==1)||(j==n))//frame begin\r\n\t\t\t\t{\r\n\t\t\t\t\tif((i==1)||(i==m))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif((j==1)||(j==n))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"+\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"-\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif((j==1)||(j==n))\r\n\t {\r\n\t\t\t\t\t\t\tSystem.out.print(\"|\");//frame left and right\r\n\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}//frame end\r\n\t\t\t\telse if (i<mid)//upper-half\r\n\t\t\t\t{\r\n\t\t\t\t\tif(count<=2)\r\n\t\t\t\t\t{\r\n\t\t\t\t for(int k=mid;k>i;k--)\r\n\t\t\t\t {\r\n\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t }\r\n\t\t\t\t System.out.print(\"/\");\r\n\t\t\t\t for(int l=1;l<=2*i-4;l++)\r\n\t\t\t\t {\r\n\t\t\t\t\t if(i%2==0)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t System.out.print(\"=\");\r\n\t\t\t\t\t }\r\n\t\t\t\t\t else\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t }\r\n\t\t\t\t }\r\n\t\t\t\tSystem.out.print(\"\\\\\");\r\n\t\t\t\t for(int k=mid;k>i;k--)\r\n\t\t\t\t {\r\n\t\t\t\t\t System.out.print(\" \");\r\n\t\t\t\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}//end of upper half\r\n\t\t\t\telse if(i>mid)//lower half\r\n\t\t\t\t{\r\n\t\t\t\t\tif(count<=2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\tfor(int k=mid;k<i;k++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t System.out.print(\"\\\\\");\r\n\t\t\t\t\t for(int l=2*m-6;l>2*i-4;l--)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t if(i%2==0)\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t System.out.print(\"=\");\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t else\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t\t } \r\n\t\t\t\t\t }\r\n\t\t\t\t\t System.out.print(\"/\");\r\n\t\t\t\t\t for(int k=mid;k<i;k++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t\t}\r\n\t\t\t }\r\n\t\t\t\t\t}//end of lower half\r\n\t\t\t\telse if(i==mid)//middle part\r\n\t\t\t\t{\r\n\t\t\t\t\tif(j==2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\"<\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(j==n-1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\">\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(i%2==0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"=\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"-\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}//end\r\n\t\t\t}//end-of-j\r\n\t\t\tSystem.out.println();\r\n\t\t}//end\r\n\r\n\t}", "protected int getWidth()\n\t{\n\t\treturn 0;\n\t}", "@Override\n public String toString()\n {\n\treturn getClass().getSimpleName() + \" (\" + getLength() + \"x\" + getWidth() + \")\";\n }", "public void lowerFlatbed(){\n flatbed.lowerFlatbed();\n }", "void walk() {\n\t\t\n\t}", "protected int parent(int i) { return (i - 1) / 2; }", "int getTribeSize();", "@Override\n\tpublic float getWidth() {\n\t\treturn 26;\n\t}", "@Override\n\tpublic void walk() {\n\t\t\n\t}", "Parallelogram(){\n length = width = height = 0;\n }", "public abstract double getBaseWidth();", "double Volume(){\r\n return Height * Width * Depth;\r\n }", "public void foundLeaf(int width, int height, int level, int currX, int currY, int location) {\n level = level +2;\n if (location == 1) {\n\n\n canvas.addLine(currX - (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n (currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue()) - ( (new Double(spatialHeight / Math.pow(2, level ))).intValue()),\n currX - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY * 2,\n Color.BLACK);\n\n\n canvas.addLine(((currX - (new Double(spatialWidth / Math.pow(2, level))).intValue())) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(), \n currX,\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.BLACK);\n\n\n\n }\n\n if (location == 2) {\n\n\n canvas.addLine(currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n (currY + (new Double(spatialHeight / Math.pow(2, level))).intValue()) - (new Double(spatialHeight / Math.pow(2, level))).intValue(),\n currX + (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n ( currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue()) + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.black);\n\n canvas.addLine((currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue()) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n (currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue()) + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.black);\n\n\n\n }\n\n if (location == 3) {\n\n canvas.addLine(currX - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n (currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue()) - (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n currX - (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n currY,\n Color.BLACK);\n\n\n\n canvas.addLine((currX - (new Double(spatialWidth / Math.pow(2, level))).intValue()) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n\tcurrY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(), \n (currX - (new Double(spatialWidth / Math.pow(2, level ))).intValue()) + (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.BLACK);\n\n\n }\n\n if (location == 4) {\n\n\n canvas.addLine(currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n (currY - (new Double(spatialHeight / Math.pow(2, level))).intValue()) - (new Double(spatialHeight / Math.pow(2, level))).intValue(),\n currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY,\n Color.BLACK);\n\n\n canvas.addLine((currX + (new Double(spatialWidth / Math.pow(2, level))).intValue()) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue() + (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(), Color.BLACK);\n\n\n }\n\n\n\n\n }", "public static void main(String[] args) {\n\n\n for(int a=0; a<7;a++){\n for(int b=0;b<7-a;b++){\n System.out.print(\" \");\n }\n for(int c=0; c<=a;c++){\n System.out.print(\"* \");\n }\n System.out.println(\" \");\n }\n\n }", "public static void unionPathCompression(){\n\t\tint n = 10;\t\n\n\t\tdsf S = new dsf(n*n);\n\t\tMaze two = new Maze(n);\n\n\t\tRandom random;\n\t\tint sets = n*n;\t//number of sets in the DSF\n\t\tint randomNumber;\n\t\tint randomDirection;\n\t\tint row;\n\t\tint col;\n\n\t\tchar upperRight; \t//bottom or right\n\n\t\tS.print();\n\n\t\twhile(sets > 1){\n\t\t\trandom = new Random();\n\t\t\trandomNumber = random.nextInt((n*n) - 1);\n\t\t\t//System.out.println(\"RANDOM NUMBER: \"+randomNumber);\n\t\t\trow = randomNumber /n;\t//SWITCHED\n\t\t\tcol = randomNumber %n;\t//SWITCHED\n\t\t\trandomDirection = random.nextInt(2);\n\t\t\tString direct;\n\t\t\tif(randomDirection == 0)\n\t\t\t\tdirect = \"upper\";\n\t\t\telse\n\t\t\t\tdirect = \"right\";\n\t\t\tSystem.out.println(\"RANDOM DIRECTI0N: \"+direct);\n\t\t\tupperRight = two.direction(randomDirection);\n\n\t\t\tif(upperRight == 'u'){\n\t\t\t\tif((randomNumber) < ((n*n)-n)){\n\t\t\t\t\tSystem.out.println(\"Sets: \"+sets);\n\t\t\t\t\tif(S.findAndCompress(randomNumber+n) != S.findAndCompress(randomNumber)){\n\t\t\t\t\t\tS.union(randomNumber+n, randomNumber);\n\t\t\t\t\t\ttwo.remove_wall(col, row, 'u');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(upperRight == 'r'){\n\t\t\t\tif(((randomNumber)%(n*n)) != n-1){\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber+1)){\n\t\t\t\t\t\tS.union(randomNumber, randomNumber+1);\n\t\t\t\t\t\ttwo.remove_wall(col, row, 'r');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbuildAdjacencyList(two, n);\n\t\tuserSelection_SolveMaze(n);\n\n\n\t\tStdDraw.show(0);\n\t\ttwo.draw();\n\t\ttwo.printCellNumbers();\n\t}", "void sharpen();", "void sharpen();", "double getPerimeter(){\n return 2*height+width;\n }", "private static void breadcrumbArrow(int width, int height, int indent, int c1, int c2) {\n\n\t\tdouble x0 = 0, y0 = height / 2d;\n\t\tdouble x1 = indent, y1 = 0;\n\t\tdouble x2 = indent, y2 = height / 2d;\n\t\tdouble x3 = indent, y3 = height;\n\t\tdouble x4 = width, y4 = 0;\n\t\tdouble x5 = width, y5 = height / 2d;\n\t\tdouble x6 = width, y6 = height;\n\t\tdouble x7 = indent + width, y7 = 0;\n\t\tdouble x8 = indent + width, y8 = height;\n\n\t\tint fc1 = ColorHelper.mixAlphaColors(c1, c2, 0);\n\t\tint fc2 = ColorHelper.mixAlphaColors(c1, c2, (indent)/(width + 2f * indent));\n\t\tint fc3 = ColorHelper.mixAlphaColors(c1, c2, (indent + width)/(width + 2f * indent));\n\t\tint fc4 = ColorHelper.mixAlphaColors(c1, c2, 1);\n\n\t\tRenderSystem.disableTexture();\n\t\tRenderSystem.enableBlend();\n\t\tRenderSystem.disableAlphaTest();\n\t\tRenderSystem.defaultBlendFunc();\n\t\tRenderSystem.shadeModel(GL11.GL_SMOOTH);\n\n\t\tTessellator tessellator = Tessellator.getInstance();\n\t\tBufferBuilder bufferbuilder = tessellator.getBuffer();\n\t\tbufferbuilder.begin(GL11.GL_TRIANGLES, DefaultVertexFormats.POSITION_COLOR);\n\n\t\tbufferbuilder.vertex(x0, y0, 0).color(fc1 >> 16 & 0xFF, fc1 >> 8 & 0xFF, fc1 & 0xFF, fc1 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x1, y1, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x2, y2, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x0, y0, 0).color(fc1 >> 16 & 0xFF, fc1 >> 8 & 0xFF, fc1 & 0xFF, fc1 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x2, y2, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x3, y3, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x3, y3, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x1, y1, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x4, y4, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x3, y3, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x4, y4, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x6, y6, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x5, y5, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x4, y4, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x7, y7, 0).color(fc4 >> 16 & 0xFF, fc4 >> 8 & 0xFF, fc4 & 0xFF, fc4 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x6, y6, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x5, y5, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x8, y8, 0).color(fc4 >> 16 & 0xFF, fc4 >> 8 & 0xFF, fc4 & 0xFF, fc4 >> 24 & 0xFF).endVertex();\n\n\t\ttessellator.draw();\n\t\tRenderSystem.shadeModel(GL11.GL_FLAT);\n\t\tRenderSystem.disableBlend();\n\t\tRenderSystem.enableAlphaTest();\n\t\tRenderSystem.enableTexture();\n\t}", "public static String makeShapeA() {\n\tString result = \"\";\n\t\tfor (int i = 0; i < 8 ; i++) {\n\t\t\tresult+=printHash(i);\n\t\t\t\n\t\t}return result;\n\t\t\t//System.out.println(printHash(i));\n\t\t}", "int expand();", "private void e()\r\n/* 273: */ {\r\n/* 274:278 */ this.r = false;\r\n/* 275:279 */ this.s = false;\r\n/* 276:280 */ this.t = false;\r\n/* 277:281 */ this.u = false;\r\n/* 278:282 */ this.v = false;\r\n/* 279: */ }", "private void traversePath()\n\t{\n\t\trobot.forward(50);\n\t\trobot.right(90);\n\t\trobot.forward(50);\n\t\trobot.right(90);\n\t\trobot.forward(50);\n\t\trobot.left(90);\n\t\trobot.forward(50);\n\t\trobot.left(90);\n\t}", "private byte r() {\r\n\t\treturn (left_map == 0 ) ? (byte) 1 : 0;\r\n\t}", "public static int size_parent() {\n return (8 / 8);\n }", "public int getWidth()\n {return width;}", "@Override\r\n\tpublic int getWidth() {\n\t\treturn 0;\r\n\t}", "@Override\r\n\tpublic double perimeter() {\n\t\treturn 2*length*breadth;\r\n\t}", "String directsTo();", "int depth();", "int depth();", "int getWidth1();", "public abstract int getSpotsNeeded();", "public int upright();", "public void stg() {\n\n\t}", "int getR();", "int fi(int x, int y) {\n\t\treturn (x + 1) + (width + 2) * (y + 1);\n\t}", "public String getRingback();", "double getWidth();", "double getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();", "int getWidth();" ]
[ "0.5540896", "0.5446543", "0.5227331", "0.52141076", "0.5111389", "0.50963986", "0.50654864", "0.5038032", "0.50336593", "0.501189", "0.50033337", "0.5002645", "0.4999724", "0.4997505", "0.49938273", "0.4988672", "0.4982446", "0.49785286", "0.4967535", "0.49578318", "0.4915642", "0.49043542", "0.4896837", "0.48817068", "0.48615584", "0.48489416", "0.4838888", "0.48292333", "0.48239383", "0.48229367", "0.48212478", "0.48193154", "0.48124096", "0.48111546", "0.4806745", "0.4804178", "0.48025957", "0.47942734", "0.4787015", "0.47851548", "0.47835702", "0.47725245", "0.47664967", "0.476185", "0.4760751", "0.47598377", "0.4759025", "0.4757917", "0.47506076", "0.47504088", "0.47497043", "0.47486544", "0.4747894", "0.4746228", "0.4741946", "0.47376034", "0.47327974", "0.47300422", "0.4727591", "0.47272107", "0.47263286", "0.47261053", "0.47214398", "0.47212386", "0.47205597", "0.47184741", "0.47169027", "0.47127956", "0.47109538", "0.47052673", "0.47015747", "0.47015747", "0.47005445", "0.46963036", "0.46961927", "0.46945545", "0.46940103", "0.46804753", "0.4678816", "0.46784258", "0.4676913", "0.46759227", "0.46728146", "0.46719387", "0.46686554", "0.46686554", "0.4666156", "0.46614605", "0.46611053", "0.466004", "0.46565068", "0.46531367", "0.4652937", "0.4652573", "0.4652573", "0.46524948", "0.46524948", "0.46524948", "0.46524948", "0.46524948", "0.46524948" ]
0.0
-1
/ / / / / / / / /
public static int availableProcessors() { /* 98 */ return holder.availableProcessors(); /* */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int parent(int i){return (i-1)/2;}", "private int leftChild(int i){return 2*i+1;}", "public void divide() {\n\t\t\n\t}", "private int rightChild(int i){return 2*i+2;}", "public void zeichneQuadrate(){\n for (int i=0; i<10;i++)\n rect (50+i*25,50,25,25);\n }", "public abstract void bepaalGrootte();", "public static void bottomHalf() {\n\n for(int i = 1; i <= SIZE; i++) {\n for(int j = 1; j <= i - 1; j++) {\n System.out.print(\" \");\n }\n \n\t System.out.print(\"\\\\_\");\n\t for(int j = 3*SIZE-i; j >= i; j--) {\n\t System.out.print(\"/\\\\\");\n\t }\n\t System.out.println(\"_/\");\n }\n }", "double passer();", "public String ring();", "int getWidth() {return width;}", "public void gored() {\n\t\t\n\t}", "public double getWidth() {\n return this.left.getLeft(0) - this.right.getRight(0); \n }", "private static Object[] newPath(int length, Object[] leaf) {\n Object[] node = leaf;\n for (int i = 0; i < length; i += 5) {\n node = new Object[] { node };\n }\n return node;\n }", "laptop(){\r\n length= 0 ;\r\n weight = 0;\r\n height = 0;\r\n width = 0;\r\n }", "public String toString(){ return \"DIV\";}", "public double getWidth() {\n return this.size * 2.0; \n }", "public void getTile_B8();", "public Integer getWidth(){return this.width;}", "public abstract String division();", "private double[] getExtents(){\n return new double[] { -90, -180, 90, 180 };\n }", "int width();", "private int leftChild(int index){\n\t\treturn (2*index) +1;\n\t}", "@Override\n public double getPerimiter() {\n return 4 * width;\n }", "private int get_right_child(int index){\r\n return 2 * index + 2;\r\n }", "@Override\n public void bfs() {\n\n }", "public double getWidth() { return _width<0? -_width : _width; }", "private void traverseBayeredPatternHalfSizeRGB(){\n int originalPositionX = 0;\n int originalPositionY = 1;\n\n for (int newX = 0; originalPositionX < originalImageHeight -1; newX++){\n for (int newY = 0; originalPositionY < originalImageWidth -1; newY++){\n Point newPosition = new Point(newX,newY);\n int newAbsoultPosition = getAbsolutPixelPosition(newPosition, originalImageHeight / 2, originalImageWidth / 2);\n halfSizePixRGB[newAbsoultPosition] = getAverageRGB(new Point(originalPositionX,originalPositionY));\n originalPositionY += 2;\n }\n originalPositionY = 0;\n originalPositionX += 2;\n }\n }", "@Override\npublic void processDirection() {\n\t\n}", "double volume(){\n return width*height*depth;\n }", "public double getWidth() {\n return this.getRight(this.tree.getRight(0)) - this.getLeft(this.tree.getLeft(0)); \n }", "public static void sizePathCompression(){\n\t\tint n = 10;\t\n\n\t\tdsf S = new dsf(n*n);\n\t\tMaze five = new Maze(n);\n\n\t\tRandom random;\n\t\tint sets = n*n;\t//number of sets in the DSF\n\t\tint randomNumber;\n\t\tint randomDirection;\n\t\tint row;\n\t\tint col;\n\n\t\tchar upperRight; \t//bottom or right\n\n\t\tS.print();\n\n\t\twhile(sets > 1){\n\t\t\trandom = new Random();\n\t\t\trandomNumber = random.nextInt((n*n) - 1);\n\t\t\t//System.out.println(\"RANDOM NUMBER: \"+randomNumber);\n\t\t\trow = randomNumber /n;\t//SWITCHED\n\t\t\tcol = randomNumber %n;\t//SWITCHED\n\t\t\trandomDirection = random.nextInt(2);\n\t\t\tString direct;\n\t\t\tif(randomDirection == 0)\n\t\t\t\tdirect = \"upper\";\n\t\t\telse\n\t\t\t\tdirect = \"right\";\n\t\t\t//System.out.println(\"RANDOM DIRECTI0N: \"+direct);\n\t\t\tupperRight = five.direction(randomDirection);\n\n\t\t\tif(upperRight == 'u'){\n\t\t\t\tif((randomNumber) < ((n*n)-n)){\n\t\t\t\t\tSystem.out.println(\"Sets: \"+sets);\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber + n)){\n\t\t\t\t\t\tS.unionBySize(randomNumber+n, randomNumber);\n\t\t\t\t\t\tfive.remove_wall(col, row, 'u');\n\t\t\t\t\t\t//S.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(upperRight == 'r'){\n\t\t\t\tif(((randomNumber)%(n*n)) != n-1){\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber+1)){\n\t\t\t\t\t\tS.unionBySize(randomNumber, randomNumber+1);\n\t\t\t\t\t\tfive.remove_wall(col, row, 'r');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbuildAdjacencyList(five, n);\n\t\tuserSelection_SolveMaze(n);\n\n\t\tStdDraw.show(0);\n\t\tfive.draw();\n\t\tfive.printCellNumbers();\t\n\t}", "public int generateRoshambo(){\n ;]\n\n }", "Operations operations();", "private void pointer(Graphics image,int x,int y,int height,int b,int dir) {\n\n\t\tint[] xt=new int[3];\n\t\tint[] yt=new int[3];\n\n\t\tif(dir==0) {\n\t\t\txt[0]=x;\n\t\t\txt[1]=xt[2]=x+height;\n\t\t\tyt[0]=y;\n\t\t\tyt[1]=y+b/2;\n\t\t\tyt[2]=y-b/2;\n\t\t} else {\n\t\t\txt[0]=x;\n\t\t\txt[1]=x+b/2;\n\t\t\txt[2]=x-b/2;\n\t\t\tyt[0]=y;\n\t\t\tyt[1]=yt[2]=y-height;\n\t\t}\n\t\timage.fillPolygon(xt,yt,3);\n\t}", "public int getEdgeCount() \n {\n return 3;\n }", "protected boolean\nshouldCompactPathLists()\n//\n////////////////////////////////////////////////////////////////////////\n{\n return true;\n}", "double getNewWidth();", "public int getWidth() {\r\n\treturn this.width;\r\n}", "long getWidth();", "public void SubRect(){\n\t\n}", "void mo33732Px();", "static void pyramid(){\n\t}", "public double getPerimiter(){return (2*height +2*width);}", "public int my_leaf_count();", "@Override\r\n\tpublic void walk() {\n\r\n\t}", "public void skystonePos4() {\n }", "public static void main(String[] args) {\n\n\n for(int a=0; a<7;a++){\n for(int b=0;b<7-a;b++){\n System.out.print(\" \");\n }\n for(int c=0; c<=a;c++){\n System.out.print(\"* \");\n }\n System.out.println(\" \");\n }\n\n }", "void walk() {\n\t\t\n\t}", "int[] union(int s1,int t1,int s2,int t2)\r\n\t{\r\n\t\tint [] st=new int[2];\r\n\t\t//Please fill in the program here\r\n\t\tst[0] = incCapacity();\r\n\t\taddEdge(st[0], epssymbol, s1);\r\n\t\taddEdge(st[0], epssymbol, s2);\r\n\t\tst[1] = incCapacity();\r\n\t\taddEdge(t1, epssymbol, st[1]);\r\n\t\taddEdge(t2, epssymbol, st[1]);\r\n\r\n\t\treturn st;\r\n\t}", "public static void main(String[] args) {\n\t\tScanner obj=new Scanner(System.in);\r\n\t\tint a=0;\r\n\t\tint count=0;\r\n System.out.println(\"enter size\");\r\n\t\ta=obj.nextInt();\r\n\t\tint m=2*a+1;\r\n\t\tint n=2*a+2;\r\n\t\tint mid=(m+1)/2;\r\n\t\tfor(int i=1;i<=m;i++)\r\n\t\t{\r\n\t\t\tcount=0;\r\n\t\t\tfor(int j=1;j<=n;j++)\r\n\t\t\t{\r\n\t\t\t\tcount++;\r\n\t\t\t\tif((i==1)||(i==m)||(j==1)||(j==n))//frame begin\r\n\t\t\t\t{\r\n\t\t\t\t\tif((i==1)||(i==m))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif((j==1)||(j==n))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"+\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"-\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif((j==1)||(j==n))\r\n\t {\r\n\t\t\t\t\t\t\tSystem.out.print(\"|\");//frame left and right\r\n\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}//frame end\r\n\t\t\t\telse if (i<mid)//upper-half\r\n\t\t\t\t{\r\n\t\t\t\t\tif(count<=2)\r\n\t\t\t\t\t{\r\n\t\t\t\t for(int k=mid;k>i;k--)\r\n\t\t\t\t {\r\n\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t }\r\n\t\t\t\t System.out.print(\"/\");\r\n\t\t\t\t for(int l=1;l<=2*i-4;l++)\r\n\t\t\t\t {\r\n\t\t\t\t\t if(i%2==0)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t System.out.print(\"=\");\r\n\t\t\t\t\t }\r\n\t\t\t\t\t else\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t }\r\n\t\t\t\t }\r\n\t\t\t\tSystem.out.print(\"\\\\\");\r\n\t\t\t\t for(int k=mid;k>i;k--)\r\n\t\t\t\t {\r\n\t\t\t\t\t System.out.print(\" \");\r\n\t\t\t\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}//end of upper half\r\n\t\t\t\telse if(i>mid)//lower half\r\n\t\t\t\t{\r\n\t\t\t\t\tif(count<=2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\tfor(int k=mid;k<i;k++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t System.out.print(\"\\\\\");\r\n\t\t\t\t\t for(int l=2*m-6;l>2*i-4;l--)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t if(i%2==0)\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t System.out.print(\"=\");\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t else\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t\t } \r\n\t\t\t\t\t }\r\n\t\t\t\t\t System.out.print(\"/\");\r\n\t\t\t\t\t for(int k=mid;k<i;k++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t\t}\r\n\t\t\t }\r\n\t\t\t\t\t}//end of lower half\r\n\t\t\t\telse if(i==mid)//middle part\r\n\t\t\t\t{\r\n\t\t\t\t\tif(j==2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\"<\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(j==n-1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\">\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(i%2==0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"=\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"-\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}//end\r\n\t\t\t}//end-of-j\r\n\t\t\tSystem.out.println();\r\n\t\t}//end\r\n\r\n\t}", "public void foundLeaf(int width, int height, int level, int currX, int currY, int location) {\n level = level +2;\n if (location == 1) {\n\n\n canvas.addLine(currX - (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n (currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue()) - ( (new Double(spatialHeight / Math.pow(2, level ))).intValue()),\n currX - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY * 2,\n Color.BLACK);\n\n\n canvas.addLine(((currX - (new Double(spatialWidth / Math.pow(2, level))).intValue())) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(), \n currX,\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.BLACK);\n\n\n\n }\n\n if (location == 2) {\n\n\n canvas.addLine(currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n (currY + (new Double(spatialHeight / Math.pow(2, level))).intValue()) - (new Double(spatialHeight / Math.pow(2, level))).intValue(),\n currX + (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n ( currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue()) + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.black);\n\n canvas.addLine((currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue()) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n (currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue()) + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.black);\n\n\n\n }\n\n if (location == 3) {\n\n canvas.addLine(currX - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n (currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue()) - (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n currX - (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n currY,\n Color.BLACK);\n\n\n\n canvas.addLine((currX - (new Double(spatialWidth / Math.pow(2, level))).intValue()) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n\tcurrY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(), \n (currX - (new Double(spatialWidth / Math.pow(2, level ))).intValue()) + (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.BLACK);\n\n\n }\n\n if (location == 4) {\n\n\n canvas.addLine(currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n (currY - (new Double(spatialHeight / Math.pow(2, level))).intValue()) - (new Double(spatialHeight / Math.pow(2, level))).intValue(),\n currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY,\n Color.BLACK);\n\n\n canvas.addLine((currX + (new Double(spatialWidth / Math.pow(2, level))).intValue()) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue() + (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(), Color.BLACK);\n\n\n }\n\n\n\n\n }", "private static void breadcrumbArrow(int width, int height, int indent, int c1, int c2) {\n\n\t\tdouble x0 = 0, y0 = height / 2d;\n\t\tdouble x1 = indent, y1 = 0;\n\t\tdouble x2 = indent, y2 = height / 2d;\n\t\tdouble x3 = indent, y3 = height;\n\t\tdouble x4 = width, y4 = 0;\n\t\tdouble x5 = width, y5 = height / 2d;\n\t\tdouble x6 = width, y6 = height;\n\t\tdouble x7 = indent + width, y7 = 0;\n\t\tdouble x8 = indent + width, y8 = height;\n\n\t\tint fc1 = ColorHelper.mixAlphaColors(c1, c2, 0);\n\t\tint fc2 = ColorHelper.mixAlphaColors(c1, c2, (indent)/(width + 2f * indent));\n\t\tint fc3 = ColorHelper.mixAlphaColors(c1, c2, (indent + width)/(width + 2f * indent));\n\t\tint fc4 = ColorHelper.mixAlphaColors(c1, c2, 1);\n\n\t\tRenderSystem.disableTexture();\n\t\tRenderSystem.enableBlend();\n\t\tRenderSystem.disableAlphaTest();\n\t\tRenderSystem.defaultBlendFunc();\n\t\tRenderSystem.shadeModel(GL11.GL_SMOOTH);\n\n\t\tTessellator tessellator = Tessellator.getInstance();\n\t\tBufferBuilder bufferbuilder = tessellator.getBuffer();\n\t\tbufferbuilder.begin(GL11.GL_TRIANGLES, DefaultVertexFormats.POSITION_COLOR);\n\n\t\tbufferbuilder.vertex(x0, y0, 0).color(fc1 >> 16 & 0xFF, fc1 >> 8 & 0xFF, fc1 & 0xFF, fc1 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x1, y1, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x2, y2, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x0, y0, 0).color(fc1 >> 16 & 0xFF, fc1 >> 8 & 0xFF, fc1 & 0xFF, fc1 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x2, y2, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x3, y3, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x3, y3, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x1, y1, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x4, y4, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x3, y3, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x4, y4, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x6, y6, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x5, y5, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x4, y4, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x7, y7, 0).color(fc4 >> 16 & 0xFF, fc4 >> 8 & 0xFF, fc4 & 0xFF, fc4 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x6, y6, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x5, y5, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x8, y8, 0).color(fc4 >> 16 & 0xFF, fc4 >> 8 & 0xFF, fc4 & 0xFF, fc4 >> 24 & 0xFF).endVertex();\n\n\t\ttessellator.draw();\n\t\tRenderSystem.shadeModel(GL11.GL_FLAT);\n\t\tRenderSystem.disableBlend();\n\t\tRenderSystem.enableAlphaTest();\n\t\tRenderSystem.enableTexture();\n\t}", "double seBlesser();", "void sharpen();", "void sharpen();", "public static void unionPathCompression(){\n\t\tint n = 10;\t\n\n\t\tdsf S = new dsf(n*n);\n\t\tMaze two = new Maze(n);\n\n\t\tRandom random;\n\t\tint sets = n*n;\t//number of sets in the DSF\n\t\tint randomNumber;\n\t\tint randomDirection;\n\t\tint row;\n\t\tint col;\n\n\t\tchar upperRight; \t//bottom or right\n\n\t\tS.print();\n\n\t\twhile(sets > 1){\n\t\t\trandom = new Random();\n\t\t\trandomNumber = random.nextInt((n*n) - 1);\n\t\t\t//System.out.println(\"RANDOM NUMBER: \"+randomNumber);\n\t\t\trow = randomNumber /n;\t//SWITCHED\n\t\t\tcol = randomNumber %n;\t//SWITCHED\n\t\t\trandomDirection = random.nextInt(2);\n\t\t\tString direct;\n\t\t\tif(randomDirection == 0)\n\t\t\t\tdirect = \"upper\";\n\t\t\telse\n\t\t\t\tdirect = \"right\";\n\t\t\tSystem.out.println(\"RANDOM DIRECTI0N: \"+direct);\n\t\t\tupperRight = two.direction(randomDirection);\n\n\t\t\tif(upperRight == 'u'){\n\t\t\t\tif((randomNumber) < ((n*n)-n)){\n\t\t\t\t\tSystem.out.println(\"Sets: \"+sets);\n\t\t\t\t\tif(S.findAndCompress(randomNumber+n) != S.findAndCompress(randomNumber)){\n\t\t\t\t\t\tS.union(randomNumber+n, randomNumber);\n\t\t\t\t\t\ttwo.remove_wall(col, row, 'u');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(upperRight == 'r'){\n\t\t\t\tif(((randomNumber)%(n*n)) != n-1){\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber+1)){\n\t\t\t\t\t\tS.union(randomNumber, randomNumber+1);\n\t\t\t\t\t\ttwo.remove_wall(col, row, 'r');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbuildAdjacencyList(two, n);\n\t\tuserSelection_SolveMaze(n);\n\n\n\t\tStdDraw.show(0);\n\t\ttwo.draw();\n\t\ttwo.printCellNumbers();\n\t}", "Parallelogram(){\n length = width = height = 0;\n }", "private int get_left_child(int index){\r\n return 2 * index + 1;\r\n }", "public void leerPlanesDietas();", "public String getRing();", "static int getNumPatterns() { return 64; }", "private void traversePath()\n\t{\n\t\trobot.forward(50);\n\t\trobot.right(90);\n\t\trobot.forward(50);\n\t\trobot.right(90);\n\t\trobot.forward(50);\n\t\trobot.left(90);\n\t\trobot.forward(50);\n\t\trobot.left(90);\n\t}", "double Volume(){\r\n return Height * Width * Depth;\r\n }", "public int getWidth(){\n return width;\n }", "@Override\n\tpublic void walk() {\n\t\t\n\t}", "public void lowerFlatbed(){\n flatbed.lowerFlatbed();\n }", "double getPerimeter(){\n return 2*height+width;\n }", "private int get_parent(int index){\r\n return (index-1)/2;\r\n }", "protected int parent(int i) { return (i - 1) / 2; }", "protected int getWidth()\n\t{\n\t\treturn 0;\n\t}", "public static String makeShapeA() {\n\tString result = \"\";\n\t\tfor (int i = 0; i < 8 ; i++) {\n\t\t\tresult+=printHash(i);\n\t\t\t\n\t\t}return result;\n\t\t\t//System.out.println(printHash(i));\n\t\t}", "@Override\n protected int mapSize() {\n return left.size()+right.size()-hidden.size();\n }", "private void e()\r\n/* 273: */ {\r\n/* 274:278 */ this.r = false;\r\n/* 275:279 */ this.s = false;\r\n/* 276:280 */ this.t = false;\r\n/* 277:281 */ this.u = false;\r\n/* 278:282 */ this.v = false;\r\n/* 279: */ }", "@Override\n public String toString()\n {\n\treturn getClass().getSimpleName() + \" (\" + getLength() + \"x\" + getWidth() + \")\";\n }", "public abstract double getBaseWidth();", "public void stg() {\n\n\t}", "@Override\n\tpublic void draw() {\n\t\t\n\t}", "@Override\n\tpublic void draw() {\n\t\t\n\t}", "@Override\n\tpublic float getWidth() {\n\t\treturn 26;\n\t}", "@Override\r\n\tpublic double perimeter() {\n\t\treturn 2*length*breadth;\r\n\t}", "void doubleBox(int sides, float x1, float y1, float z1, float x2, float y2, float z2)\r\n/* 100: */ {\r\n/* 101: 99 */ int s2 = sides << 1 & 0x2A | sides >> 1 & 0x15;\r\n/* 102: */ \r\n/* 103:101 */ this.context.renderBox(sides, x1, y1, z1, x2, y2, z2);\r\n/* 104:102 */ this.context.renderBox(s2, x2, y2, z2, x1, y1, z1);\r\n/* 105: */ }", "public void draw(){\n for(int i = 1; i <= height; i++){\n for(int s = 1; s <= i; s++)\n System.out.print(\"*\");\n System.out.println();\n }\n }", "int fi(int x, int y) {\n\t\treturn (x + 1) + (width + 2) * (y + 1);\n\t}", "int expand();", "private byte r() {\r\n\t\treturn (left_map == 0 ) ? (byte) 1 : 0;\r\n\t}", "public static void main(String[] args) {\n\t\tfor(int j=0;j<8;j++){\n\t\t\tfor(int i=0;i<8;i++){\n\t\t\t\t//上下两侧\n\t\t\t\tif(j==0||j==7){\n\t\t\t\t\tSystem.out.print(\"*\");\n\t\t\t\t}else{\n\t\t\t\t\t//中间\n\t\t\t\t\tif(i>0&&i<7){\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t}else{\n\t\t\t\t\t\tSystem.out.print(\"*\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public void draw4x4 (char design){\n System.out.println(\"\"+design+design+design+design);\n System.out.println(design+\" \"+design);\n System.out.println(design+\" \"+design);\n System.out.println(\"\"+design+design+design+design);\n}", "@Override\n protected void paint2d(Graphics2D g) {\n \n }", "public int upright();", "int getTribeSize();", "int getWidth1();", "int getR();", "String directsTo();", "public int getWidth()\n {return width;}", "@Override\r\n\tpublic int getWidth() {\n\t\treturn 0;\r\n\t}", "int depth();", "int depth();", "public\nstatic\nvoid\nmain(String args[]) \n\n{ \n\nBinaryTree tree = \nnew\nBinaryTree(); \n\ntree.root = \nnew\nNode(\n20\n); \n\ntree.root.left = \nnew\nNode(\n8\n); \n\ntree.root.left.left = \nnew\nNode(\n4\n); \n\ntree.root.left.right = \nnew\nNode(\n12\n); \n\ntree.root.left.right.left = \nnew\nNode(\n10\n); \n\ntree.root.left.right.right = \nnew\nNode(\n14\n); \n\ntree.root.right = \nnew\nNode(\n22\n); \n\ntree.root.right.right = \nnew\nNode(\n25\n); \n\ntree.printBoundary(tree.root); \n\n}", "public void renderCenterBlock(int cons, int side, int end)\r\n/* 143: */ {\r\n/* 144:135 */ if (cons == 0)\r\n/* 145: */ {\r\n/* 146:136 */ this.context.setTex(end);\r\n/* 147:137 */ doubleBox(63, 0.375F, 0.375F, 0.375F, 0.625F, 0.625F, 0.625F);\r\n/* 148:138 */ return;\r\n/* 149: */ }\r\n/* 150:139 */ if (cons == 3)\r\n/* 151: */ {\r\n/* 152:140 */ this.context.setTexFlags(1773);\r\n/* 153:141 */ this.context.setTex(end, end, side, side, side, side);\r\n/* 154:142 */ doubleBox(60, 0.375F, 0.0F, 0.375F, 0.625F, 1.0F, 0.625F);\r\n/* 155:143 */ return;\r\n/* 156: */ }\r\n/* 157:144 */ if (cons == 12)\r\n/* 158: */ {\r\n/* 159:145 */ this.context.setTexFlags(184365);\r\n/* 160:146 */ this.context.setTex(side, side, end, end, side, side);\r\n/* 161:147 */ doubleBox(51, 0.375F, 0.375F, 0.0F, 0.625F, 0.625F, 1.0F);\r\n/* 162:148 */ return;\r\n/* 163: */ }\r\n/* 164:149 */ if (cons == 48)\r\n/* 165: */ {\r\n/* 166:150 */ this.context.setTexFlags(187200);\r\n/* 167:151 */ this.context.setTex(side, side, side, side, end, end);\r\n/* 168:152 */ doubleBox(15, 0.0F, 0.375F, 0.375F, 1.0F, 0.625F, 0.625F);\r\n/* 169:153 */ return;\r\n/* 170: */ }\r\n/* 171:155 */ this.context.setTex(end);\r\n/* 172:156 */ doubleBox(0x3F ^ cons, 0.375F, 0.375F, 0.375F, 0.625F, 0.625F, 0.625F);\r\n/* 173:157 */ if ((cons & 0x1) > 0)\r\n/* 174: */ {\r\n/* 175:158 */ this.context.setTexFlags(1773);\r\n/* 176:159 */ this.context.setTex(end, end, side, side, side, side);\r\n/* 177:160 */ doubleBox(60, 0.375F, 0.0F, 0.375F, 0.625F, 0.375F, 0.625F);\r\n/* 178: */ }\r\n/* 179:162 */ if ((cons & 0x2) > 0)\r\n/* 180: */ {\r\n/* 181:163 */ this.context.setTexFlags(1773);\r\n/* 182:164 */ this.context.setTex(end, end, side, side, side, side);\r\n/* 183:165 */ doubleBox(60, 0.375F, 0.625F, 0.375F, 0.625F, 1.0F, 0.625F);\r\n/* 184: */ }\r\n/* 185:167 */ if ((cons & 0x4) > 0)\r\n/* 186: */ {\r\n/* 187:168 */ this.context.setTexFlags(184365);\r\n/* 188:169 */ this.context.setTex(side, side, end, end, side, side);\r\n/* 189:170 */ doubleBox(51, 0.375F, 0.375F, 0.0F, 0.625F, 0.625F, 0.375F);\r\n/* 190: */ }\r\n/* 191:172 */ if ((cons & 0x8) > 0)\r\n/* 192: */ {\r\n/* 193:173 */ this.context.setTexFlags(184365);\r\n/* 194:174 */ this.context.setTex(side, side, end, end, side, side);\r\n/* 195:175 */ doubleBox(51, 0.375F, 0.375F, 0.625F, 0.625F, 0.625F, 1.0F);\r\n/* 196: */ }\r\n/* 197:177 */ if ((cons & 0x10) > 0)\r\n/* 198: */ {\r\n/* 199:178 */ this.context.setTexFlags(187200);\r\n/* 200:179 */ this.context.setTex(side, side, side, side, end, end);\r\n/* 201:180 */ doubleBox(15, 0.0F, 0.375F, 0.375F, 0.375F, 0.625F, 0.625F);\r\n/* 202: */ }\r\n/* 203:182 */ if ((cons & 0x20) > 0)\r\n/* 204: */ {\r\n/* 205:183 */ this.context.setTexFlags(187200);\r\n/* 206:184 */ this.context.setTex(side, side, side, side, end, end);\r\n/* 207:185 */ doubleBox(15, 0.625F, 0.375F, 0.375F, 1.0F, 0.625F, 0.625F);\r\n/* 208: */ }\r\n/* 209: */ }", "double getWidth();", "double getWidth();" ]
[ "0.5531016", "0.54378587", "0.52516115", "0.52405924", "0.5151045", "0.5127977", "0.50680465", "0.5066997", "0.50218964", "0.5013022", "0.5007318", "0.50048536", "0.49997565", "0.4994835", "0.49735898", "0.49699947", "0.49680406", "0.49594593", "0.4937881", "0.49361676", "0.49287266", "0.4884688", "0.4874051", "0.4871873", "0.48511675", "0.48435977", "0.48318782", "0.48268357", "0.48253223", "0.48089546", "0.4805502", "0.48046046", "0.4803564", "0.48035362", "0.47987092", "0.47966656", "0.47941628", "0.47918317", "0.4789212", "0.4783637", "0.47747543", "0.4774159", "0.47730577", "0.47666246", "0.47664872", "0.47615", "0.4755131", "0.47543177", "0.47509375", "0.47481856", "0.47429588", "0.47421312", "0.47413164", "0.47407025", "0.47407025", "0.47362685", "0.47353023", "0.47351807", "0.47331676", "0.47328842", "0.47319365", "0.4729934", "0.47290468", "0.47287467", "0.47275317", "0.47259426", "0.47239763", "0.4723621", "0.4715134", "0.47056246", "0.47034666", "0.47034577", "0.4701833", "0.46977103", "0.46967983", "0.46885592", "0.46881223", "0.46881223", "0.4685835", "0.4677769", "0.46758488", "0.46741006", "0.46703368", "0.46684504", "0.4664061", "0.4664013", "0.46639267", "0.46607205", "0.4659042", "0.46581274", "0.4656714", "0.46495056", "0.464903", "0.4648408", "0.46467063", "0.4643833", "0.4643833", "0.46426296", "0.46422264", "0.4639917", "0.4639917" ]
0.0
-1
Need to add each chunk of List object into finalList
public void buildExecutable(T processIntObject) { this.executableMap.put(counter++, new FutureVo(processIntObject)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static <T> List<List<T>> chunkList(List<T> list, final int L) {\n\t\tList<List<T>> parts = new ArrayList<List<T>>();\n\t\tfinal int N = list.size();\n\t\t\n\t\tfor (int i = 0; i < N; i += L) {\n\t\t\tparts.add(new ArrayList<T>(\n\t\t\t\t\tlist.subList(i, Math.min(N, i + L)))\n\t\t\t\t\t);\n\t\t}\n\t\t\n\t\treturn parts;\n\t}", "private List<Chunk> getChunks(EditList editList) {\n List<Chunk> chunks = new ArrayList<>();\n for(Edit edit: editList) {\n chunks.add(new Chunk(edit));\n }\n return chunks;\n }", "private final void filterList(List<? extends Entity> list) {\n if (!list.isEmpty()) {\n if (getDataList().isEmpty()) {\n getDataList().addAll(0, list);\n return;\n }\n ArrayList arrayList = new ArrayList();\n arrayList.addAll(list);\n for (int size = list.size() - 1; size >= 0; size--) {\n int size2 = getDataList().size() - 1;\n while (true) {\n if (size2 < 0) {\n break;\n }\n String entityId = ((Entity) list.get(size)).getEntityId();\n Parcelable parcelable = getDataList().get(size2);\n Object obj = null;\n if (!(parcelable instanceof Entity)) {\n parcelable = null;\n }\n Entity entity = (Entity) parcelable;\n Intrinsics.checkNotNull(entity);\n if (TextUtils.equals(entityId, entity.getEntityId())) {\n arrayList.remove(list.get(size));\n Long dateline = ((Entity) list.get(size)).getDateline();\n Parcelable parcelable2 = getDataList().get(size2);\n if (!(parcelable2 instanceof Entity)) {\n parcelable2 = null;\n }\n Entity entity2 = (Entity) parcelable2;\n Intrinsics.checkNotNull(entity2);\n if (!Intrinsics.areEqual(dateline, entity2.getDateline())) {\n Object obj2 = list.get(size);\n if (obj2 instanceof Message) {\n obj = obj2;\n }\n Message message = (Message) obj;\n Intrinsics.checkNotNull(message);\n int findNewIndex = findNewIndex(message);\n if (findNewIndex <= -1 || findNewIndex == size2) {\n getDataList().set(size2, list.get(size));\n } else {\n getDataList().add(findNewIndex, list.get(size));\n List<Parcelable> dataList = getDataList();\n int i = size2 + 1;\n if (!(findNewIndex > size2)) {\n size2 = i;\n }\n dataList.remove(size2);\n }\n }\n }\n size2--;\n }\n }\n for (int size3 = arrayList.size() - 1; size3 >= 0; size3--) {\n Object obj3 = arrayList.get(size3);\n Intrinsics.checkNotNullExpressionValue(obj3, \"noExistedData[newListIndex]\");\n Parcelable parcelable3 = (Parcelable) obj3;\n if (parcelable3 instanceof Message) {\n if (((Message) parcelable3).isToped()) {\n getDataList().add(0, parcelable3);\n } else if (findLastTopIndex() <= -1) {\n getDataList().add(findLastTopIndex() + 1, parcelable3);\n }\n }\n }\n }\n }", "private synchronized void addResultToMultiList() {\n\t addObjectToMultiList(resultArrayList);\r\n\t }", "private static void copyRemainder(ArrayList<Integer> inputList, int inputIndex, ArrayList<Integer> outList, int outIndex) {\n while (inputIndex < inputList.size()) {\n outList.set(outIndex, inputList.get(inputIndex));\n\n inputIndex++;\n outIndex++;\n }\n }", "void mo54426b(int i, List<DownloadChunk> list);", "void mo54414a(int i, List<DownloadChunk> list);", "private List<Chunk> saveChunks(List<byte[]> cs, String chunkprefix) {\r\n\t\tList<Chunk> chunks = new ArrayList<>();\r\n\t\tfor (int i = 0; i < cs.size(); i++) {\r\n\t\t\tbyte[] f = cs.get(i);\r\n\t\t\tChunk c = new Chunk();\r\n\t\t\tc.setChunkname(Utility.buildChunkName(chunkprefix, i));\r\n\t\t\tc.setContent(f);\r\n\t\t\tc.setSize(f.length);\r\n\t\t\tchunks.add(c);\r\n\t\t}\r\n\t\treturn chunks;\r\n\t}", "public static <T> Map<Integer, List<T>> paginate(List<T> originalList, int chunkSize) {\n Map<Integer, List<T>> chunks = new LinkedHashMap<>();\n List<List<T>> listOfChunks = new ArrayList<>();\n\n for (int i = 0; i < originalList.size() / chunkSize; i++) {\n listOfChunks.add(originalList.subList(i * chunkSize, i * chunkSize + chunkSize));\n }\n\n if (originalList.size() % chunkSize != 0) {\n listOfChunks.add(originalList.subList(originalList.size() - originalList.size() % chunkSize, originalList.size()));\n }\n\n for (int i = 0; i < listOfChunks.size(); i++) {\n chunks.put(i, listOfChunks.get(i));\n }\n\n return chunks;\n }", "List<F> getChunks();", "public ArrayList getChunks() {\n ArrayList tmp = new ArrayList();\n for (Iterator i = iterator(); i.hasNext(); ) {\n tmp.addAll(((Element) i.next()).getChunks());\n }\n return tmp;\n }", "private void grow() {\r\n\t\t\r\n\t\t Student [] newList = new Student[sizeOfList(list) + 4];\r\n\t int size = sizeOfList(list);\r\n\t \r\n\t for(int i = 0; i < size; i++) {\r\n\t \t newList[i] = list[i];\r\n\t }\r\n\t list = newList;\r\n\t}", "private List<Integer> createListCombinInSlot(List<Integer> tempListForSize) {\n List<Integer> list = new ArrayList<>();\n count++;//slot counter\n if (tempListForSize.size() == 0) {// if the first time run\n for (int i = 0; i < SIZE; i++) {\n int idImageCombination = createListShowCombin(i);\n list.add(idImageCombination);// add the random id of the picture\n }\n } else {// if not the first time run\n switch (count) {\n case 1:\n items.clear();\n list.addAll(tempList);\n tempList.clear();\n break;\n case 2:\n items2.clear();\n list.addAll(tempList2);\n tempList2.clear();\n break;\n case 3:\n items3.clear();\n list.addAll(tempList3);\n tempList3.clear();\n break;\n }//switch\n for (int i = 3; i < SIZE; i++) {\n\n int idImageCombination = createListShowCombin(i);\n switch (count) {\n case 1:\n list.add(idImageCombination);// add the random id of the picture\n break;\n case 2:\n list.add(idImageCombination);// add the random id of the picture\n break;\n case 3:\n list.add(idImageCombination);// add the random id of the picture\n break;\n }//switch\n }//for\n }//if\n flag = false;\n return list;\n }", "public ArrayList<Chunk> getResult() {\n\t\treturn copyOfChunks;\n\t}", "private List<ChunkGroupMetadata> getAppendedRowMetadata() {\n List<ChunkGroupMetadata> append = new ArrayList<>();\n if (lastFlushedChunkGroupIndex < chunkGroupMetadataList.size()) {\n append.addAll(\n chunkGroupMetadataList.subList(\n lastFlushedChunkGroupIndex, chunkGroupMetadataList.size()));\n lastFlushedChunkGroupIndex = chunkGroupMetadataList.size();\n }\n return append;\n }", "void expand(List<R> results);", "@SuppressWarnings(\"unchecked\")\n\tprotected void grow(){\n\t\t// makes new arraylist\n\t\tT[] temp = (T[]) new Object[data.length *2];\n\t\tfor(int i = 0; i < data.length; i++ ){\n\t\t\ttemp[i] = data[i];\n\t\t}\n\t\tdata = temp;\n\t}", "public List<Object> toList() {\n int i = this.capacityHint;\n int i2 = this.size;\n ArrayList arrayList = new ArrayList(i2 + 1);\n Object[] head2 = head();\n int i3 = 0;\n while (true) {\n int i4 = 0;\n while (i3 < i2) {\n arrayList.add(head2[i4]);\n i3++;\n i4++;\n if (i4 == i) {\n head2 = head2[i];\n }\n }\n return arrayList;\n }\n }", "public static <T> List<List<T>> chunked(Iterable<T> iterable, int size) {\n List<List<T>> chunks = new ArrayList<>();\n List<T> chunk = null;\n Iterator<T> it = iterable.iterator();\n for (int i = 0; it.hasNext(); i++) {\n if (i % size == 0) {\n chunk = new ArrayList<>(size);\n chunks.add(chunk);\n }\n\n chunk.add(it.next());\n }\n return chunks;\n }", "static <T> List<List<T>> chopped(List<T> list, final int L) {\n List<List<T>> parts = new ArrayList<List<T>>();\n final int N = list.size();\n for (int i = 0; i < N; i += L) {\n parts.add(new ArrayList<T>(\n list.subList(i, Math.min(N, i + L)))\n );\n }\n return parts;\n }", "java.util.List<entities.Torrent.ChunkInfo>\n getChunksList();", "static <T> List<List<T>> chopped(List<T> list, final int L) {\n\t\tList<List<T>> parts = new ArrayList<List<T>>();\n\t\tfinal int N = list.size();\n\t\tfor (int i = 0; i < N; i += L) {\n\t\t\tparts.add(new ArrayList<T>(list.subList(i, Math.min(N, i + L))));\n\t\t}\n\t\treturn parts;\n\t}", "public List<List<RecordBean>> splitRecordBeans(List<RecordBean> recordBeans){\n\n recordBeans.sort(RecordBeanComparator);\n List<List<RecordBean>> totalList = new ArrayList();\n for (int i = 0; i < recordBeans.size(); i++){\n Time beginTime = getTimeValueFromRecordBean(recordBeans.get(i));\n if(beginTime != null){\n List<RecordBean> tempList = new ArrayList<>();\n tempList.add(recordBeans.get(i));\n for (int j = i+1; j < recordBeans.size(); j++){\n Time currentTime = getTimeValueFromRecordBean(recordBeans.get(j));\n if(currentTime != null){\n long timeDifference = getTimeDifference(beginTime, currentTime);\n if(timeDifference >= 2){\n totalList.add(new ArrayList<>(tempList));\n beginTime = currentTime;\n tempList.clear();\n tempList.add(recordBeans.get(j));\n }else{\n tempList.add(recordBeans.get(j));\n }\n }\n }\n break;\n }\n }\n return totalList;\n }", "private static ArrayList<String> getOptimizedList(ArrayList<String> objList){\n\t\tArrayList<String> optimizedList = new ArrayList<String>();\r\n\t\tint limit = 1; // quantidade de objs escolhida da lista original (por exemplo, 2 objetos serao escolhidos aleatoriamente)\r\n\t\t\r\n\t\tRandom generator = new Random();\r\n\t\t\r\n\t\tfor(int i=0; i<limit; i++){\r\n\t\t\toptimizedList.add(objList.get(generator.nextInt(objList.size())));\r\n\t\t}\r\n\t\t\r\n\t\treturn optimizedList;\r\n\t}", "protected ArrayList<ArrayList<String>> method1() {\n\n ArrayList<ArrayList<String>> arr = new ArrayList<ArrayList<String>>();\n ArrayList<String> n_clone = new ArrayList<>(Arrays.asList(input));\n\n // Create equal amount of containers as requested.\n for (int i=0;i<num;i++) {\n arr.add(new ArrayList<String>());\n }\n\n // Iterate through given Array while putting items\n // into the containers you just created.\n Iterator itor = n_clone.iterator();\n int count = 0;\n while (itor.hasNext()) {\n if (count < this.num) {\n arr.get(count).add((String)itor.next());\n count++;\n } else {\n count = 0;\n }\n }\n\n System.out.println(\"Paying no attention to order, the Array - \");\n printArrayList(new ArrayList<>(Arrays.asList(input)));\n System.out.println(\"divided into \" + this.num + \" sections is: \\n\");\n printMatrix(arr);\n\n return arr;\n }", "private void resize() {\n int listSize = numItemInList();\n //debug\n //System.out.println(\"resize: \" + nextindex + \"/\" + list.length + \" items:\" + listSize);\n if (listSize <= list.length / 2) {\n for (int i = 0; i < listSize; i++) {\n list[i] = list[startIndex + i];\n }\n } else {\n Object[] newList = new Object[this.list.length * 2];\n\n// System.arraycopy(this.list, startIndex, newList, 0, this.list.length-startIndex);\n for (int i = 0; i < listSize; i++) {\n newList[i] = list[i + startIndex];\n }\n this.list = newList;\n //debug\n //System.out.println(\"After resize:\" + nextindex + \" / \" + list.length + \" items:\" + numItemInList());\n }\n nextindex = nextindex - startIndex;\n startIndex = 0;\n }", "@SuppressWarnings(\"unchecked\")\n private void Splice(List<T> list, List<T> result) {\n int size = list.size();\n\n int i = 0;\n while (i < size - 1)\n if (EvRandomizer.INSTANCE.nextDouble() < splice_probability) {\n T child = list.get(i);\n child.addAlleles(list.get(i + 1).getGenes(), list.get(i + 1)\n .getAlleles());\n\n result.add(child);\n i += 2;\n } else {\n result.add(list.get(i));\n i++;\n }\n if (i < size)\n result.add(list.get(i));\n }", "private void connectListsOfChunkIndices(ArrayList<Integer> originChunkList\n\t\t\t, ArrayList<Integer> destinationChunkList) {\n\t\tint count = 0;\n\t\tfor (Integer i : destinationChunkList) {\n\t\t\twhile (count < originChunkList.size() && originChunkList.get(count) < i) {\n\t\t\t\tconnectOnLine(originChunkList.get(count), i);\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\t}", "public final List<l> apply(List<j> list) {\n kotlin.jvm.internal.h.e(list, \"it\");\n boolean a = this.dlr.a(this.dls, list);\n Iterable<j> iterable = list;\n Collection arrayList = new ArrayList(n.e(iterable, 10));\n for (j jVar : iterable) {\n kotlin.jvm.internal.h.d(jVar, \"it\");\n arrayList.add(new l(jVar, a ^ 1));\n }\n return (List) arrayList;\n }", "int insertBatch(List<Basicinfo> list);", "List<H> generateSections(List<T> listItems);", "List<AbstractExternalData> bundleBuckets(Iterable<DatasetListWithTotal> buckets)\n {\n long total = 0;\n\n List<AbstractExternalData> result = new LinkedList<AbstractExternalData>();\n\n for (DatasetListWithTotal bucket : buckets)\n {\n long bucketSize = bucket.getCumulatedSize();\n if (total + bucketSize < maxArchiveSize)\n {\n result.addAll(bucket.getList());\n total += bucketSize;\n }\n }\n if (total >= minArchiveSize)\n {\n return result;\n }\n else\n {\n return null;\n }\n }", "public void rc(){\n List<Integer> numbers = new ArrayList<>();\n var result = List.of(1,2,3,4,5,6,7,8,9,10);\n result\n .parallelStream()\n .forEach(number->addToList(numbers,number));\n print.accept(numbers);\n }", "public static List<List<String>> divideList(List<String> contents, int numberOfLists) {\n\n\t\tList<List<String>> dividedList = new ArrayList<List<String>>();\n\t\tint partsSize = contents.size() / numberOfLists;\n\t\tSystem.out.println(partsSize);\n\n\t\tList<String> newList = new ArrayList<String>();\n\t\tfor (int i = 0; i < contents.size(); i++) {\n\t\t\tnewList.add(contents.get(i));\n\n\t\t\tif((dividedList.size() < numberOfLists - 1) && (newList.size() == partsSize)) {\n\t\t\t\tdividedList.add(newList);\n\t\t\t\tnewList = new ArrayList<String>();\n\t\t\t\tcontinue;\n\t\t\t}\t\n\t\t}\n\t\tdividedList.add(newList);\n\t\treturn dividedList;\n\t}", "private void grow() {\n OmaLista<OmaPari<K, V>>[] newList = new OmaLista[this.values.length * 2];\n\n for (int i = 0; i < this.values.length; i++) {\n copy(newList, i);\n }\n\n this.values = newList;\n }", "private void m152570a(List<ByteBuffer> list) {\n synchronized (this.f113322u) {\n for (ByteBuffer byteBuffer : list) {\n m152578e(byteBuffer);\n }\n }\n }", "public static void restoreList() {\n\n if (copyList.isEmpty())\n return;\n\n\n getList().clear();\n\n for (Map<String, ?> item : copyList) {\n getList().add(item);\n }\n\n copyList.clear();\n //Log.d(\"test\", \"After restore: Champlist size \" + getSize() + \" copylist size \" + copyList.size());\n\n }", "private List<EffectInfoModel> m19296a(List<TemplateInfo> list, List<TemplateInfo> list2, Set<Long> set) {\n ArrayList arrayList = new ArrayList();\n int count = this.bOt.getCount();\n if (count == 0) {\n return arrayList;\n }\n for (int i = 0; i < count; i++) {\n EffectInfoModel vh = this.bOt.mo35214vh(i);\n if (vh != null && !vh.isbNeedDownload() && C8451b.m24479up(QTemplateIDUtils.getTemplateSubType(vh.mTemplateId))) {\n TemplateInfo a = m19294a(vh.mTemplateId, (List<TemplateInfo>[]) new List[]{list2, list});\n if (a != null && !a.isRecommendItem()) {\n vh.mThumbUrl = a.strIcon;\n vh.mName = a.strTitle;\n vh.strSceneName = a.strScene;\n }\n if (set.add(Long.valueOf(vh.mTemplateId))) {\n arrayList.add(vh);\n }\n }\n }\n return arrayList;\n }", "public FplList append(FplList list) {\n\t\tif (list == null || list.isEmpty()) {\n\t\t\treturn this;\n\t\t}\n\t\tif (isEmpty()) {\n\t\t\treturn list;\n\t\t}\n\t\tint totalSize = size() + list.size();\n\t\tint totalBuckets = shape.length + list.shape.length;\n\n\t\tFplValue[] lastBucket = shape[shape.length - 1];\n\t\tFplValue[] listFirstBucket = list.shape[0];\n\n\t\tif (lastBucket.length + listFirstBucket.length <= BASE_SIZE) {\n\t\t\tif (needsReshaping(totalBuckets - 1, totalSize)) {\n\t\t\t\treturn new FplList(mergedShape(shape, list.shape, totalSize));\n\t\t\t} else {\n\t\t\t\tFplValue[][] buckets = copyOf(shape, shape.length + list.shape.length - 1);\n\t\t\t\tFplValue[] bucket = copyOf(lastBucket, lastBucket.length + listFirstBucket.length);\n\t\t\t\tarraycopy(listFirstBucket, 0, bucket, lastBucket.length, listFirstBucket.length);\n\t\t\t\tbuckets[shape.length - 1] = bucket;\n\t\t\t\tarraycopy(list.shape, 1, buckets, shape.length, list.shape.length - 1);\n\t\t\t\treturn new FplList(buckets);\n\t\t\t}\n\t\t} else {\n\t\t\tif (needsReshaping(totalBuckets, totalSize)) {\n\t\t\t\treturn new FplList(mergedShape(shape, list.shape, totalSize));\n\t\t\t} else {\n\t\t\t\tFplValue[][] buckets = copyOf(shape, shape.length + list.shape.length);\n\t\t\t\tarraycopy(list.shape, 0, buckets, shape.length, list.shape.length);\n\t\t\t\treturn new FplList(buckets);\n\t\t\t}\n\t\t}\n\t}", "private void prepareListData() {\n mCategoryList = new ArrayList<>();\n mFullList = new ArrayList<>();\n for (Category cat : fileSystem.getLocalInformationList())\n {\n List<Object> phraseList = cat.phraseList;\n mCategoryList.add(new Category(phraseList, cat.name));\n }\n mFullList.addAll(mCategoryList);\n\n }", "public List<m> b(List<CheckoutItem> list) {\n ArrayList arrayList = new ArrayList();\n for (final CheckoutItem next : list) {\n com.shopee.app.d.b.a.a a2 = h.a(next);\n arrayList.add(new com.shopee.app.ui.order.b.a.a());\n List<OrderDetail> orderDetailList = next.getOrderDetailList();\n int i = 0;\n for (OrderDetail next2 : orderDetailList) {\n i += next2.getDistinctItemCount();\n com.shopee.app.ui.order.b.a.c cVar = new com.shopee.app.ui.order.b.a.c();\n cVar.b(next2);\n cVar.a(new c.a(next2, a2));\n arrayList.add(cVar);\n com.shopee.app.ui.order.b.a.d dVar = new com.shopee.app.ui.order.b.a.d();\n dVar.b(next2);\n dVar.a(new d.a(next2));\n arrayList.add(dVar);\n }\n if (i > orderDetailList.size()) {\n final int size = i - orderDetailList.size();\n com.shopee.app.ui.order.b.a.h hVar = new com.shopee.app.ui.order.b.a.h();\n hVar.b(next);\n hVar.a(new h.a() {\n public int a() {\n return size;\n }\n\n public List<Long> b() {\n return Arrays.asList(new Long[]{Long.valueOf(next.getCheckoutId())});\n }\n });\n arrayList.add(hVar);\n }\n g gVar = new g();\n gVar.b(next);\n gVar.a(new g.a() {\n public int e() {\n return R.string.sp_label_order_total;\n }\n\n public int a() {\n return next.getTotalCount();\n }\n\n public long b() {\n return next.getTotalPrice();\n }\n\n public List<Long> c() {\n return Arrays.asList(new Long[]{Long.valueOf(next.getCheckoutId())});\n }\n\n public int d() {\n if (next.isEscrow()) {\n return R.drawable.ic_guarantee;\n }\n return 0;\n }\n });\n arrayList.add(gVar);\n com.shopee.app.ui.order.b.a.b bVar = new com.shopee.app.ui.order.b.a.b();\n bVar.b(next);\n bVar.a(a2);\n arrayList.add(bVar);\n }\n return arrayList;\n }", "private static List concatList(List x, List y) {\n List ret = new ArrayList<Long>(x);\n ret.addAll(y);\n return ret;\n }", "private static List concatList(List x, List y) {\n List ret = new ArrayList<Long>(x);\n ret.addAll(y);\n return ret;\n }", "private ArrayList<ArrayList<Course>> semiPermutationOfCourseList(ArrayList<Course> originalCourseList) {\n ArrayList<ArrayList<Course>> results = new ArrayList<ArrayList<Course>>();\n if (originalCourseList == null || originalCourseList.size() == 0) {\n return results;\n }\n\n for (int i = 0; i < originalCourseList.size(); i++) {\n ArrayList<Course> tempList = new ArrayList<>();\n tempList = new ArrayList<>(originalCourseList.subList(i, originalCourseList.size()));\n for (int j = 0; j < i; j++) {\n tempList.add(originalCourseList.get(j));\n }\n results.add(tempList);\n }\n\n return results;\n }", "List<DownloadChunk> mo54445j(int i);", "@Override\r\n\tpublic void fill(ArrayList<T> list) {\r\n\t\t//Copy of list\r\n\t\tArrayList<T> copyData = list;\r\n\t\t// Add copy of list to the Stack\r\n\t\tfor (T e: copyData) {\r\n\t\t\tdata.add(e);\r\n\t\t}\r\n\t}", "private void generateNextChunk() {\n \n chunkNumber++;\n \n // generate a chunk filled with content\n List<Object> list = chunkFactory.generateChunk(chunkNumber);\n Vector3f newChunkPosition =\n new Vector3f(nextChunkX, 0f, 0f);\n nextChunkX += P.chunkLength;\n\n for (Object object : list) {\n if (object instanceof Spatial) {\n Spatial spatial = (Spatial) object;\n addToLevel(spatial, spatial.getLocalTranslation().add(newChunkPosition));\n } else if (object instanceof SpotLight) {\n SpotLight light = (SpotLight) object;\n addToLevel(light, light.getPosition().add(newChunkPosition));\n } else if (object instanceof PointLight) {\n PointLight light = (PointLight) object;\n addToLevel(light, light.getPosition().add(newChunkPosition)); \n }\n }\n\n }", "@Override\r\n\tpublic List<GridTask<LinPackResult>> split() {\r\n\t\tList<GridTask<LinPackResult>> list = new ArrayList<GridTask<LinPackResult>>();\r\n\t\tfor (int i=0; i < tasks; i++) {\r\n\t\t\tlist.add(new LinPackTask(cycles));\r\n\t\t}\r\n\t\t\r\n\t\tsw = new StopWatch();\r\n\t\t\r\n\t\tsw.start();\r\n\t\t\r\n\t\treturn list;\r\n\t}", "private List<byte[]> split(InputStream inStream, long size) throws IOException {\r\n\t\tList<byte[]> chunkList = new ArrayList<byte[]>();\r\n\t\tint totalBytesRead = 0;\r\n\t\ttry {\r\n\t\t\twhile (totalBytesRead < size) {\r\n\t\t\t\tbyte[] buffer = splitNextChunk(inStream, size, totalBytesRead);\r\n\t\t\t\ttotalBytesRead += buffer.length;\r\n\t\t\t\tchunkList.add(buffer);\r\n\t\t\t}\r\n\t\t} finally {\r\n\t\t\tinStream.close();\r\n\t\t}\r\n\t\treturn chunkList;\r\n\t}", "private void getListRepartition(List list) {\r\n int i;\r\n int id_rep = 1;\r\n Object[] obj;\r\n\r\n this.idNewRep = 1;\r\n this.idNewRepElem = 1;\r\n\r\n for (i = 0; i < list.size(); i++) {\r\n obj = (Object[]) list.get(i);\r\n\r\n // si on change d'id_, on passe à une autre répartition\r\n if (id_rep != Integer.parseInt(obj[3].toString())) {\r\n\r\n id_rep = Integer.parseInt(obj[3].toString());\r\n\r\n this.repartitions.add(new Repartition(Integer.parseInt(obj[3].toString()), obj[0].toString(), this.idAxe));\r\n // System.out.println(\"Axe : \" + this.idAxe + \"Repartition \" + obj[0].toString());\r\n this.ligneRepartitions.add(String.valueOf(this.repartitions.size() - 1));\r\n\r\n if (id_rep > this.idNewRep) {\r\n this.idNewRep = id_rep;\r\n }\r\n\r\n }\r\n\r\n this.repartitionElements.add(new RepartitionElement(Integer.parseInt(obj[4].toString()), Integer.parseInt(obj[3].toString()), Integer.parseInt(obj[2].toString()), Float.parseFloat(obj[1]\r\n .toString())));\r\n\r\n if (Integer.parseInt(obj[3].toString()) > this.idNewRepElem) {\r\n this.idNewRepElem = Integer.parseInt(obj[3].toString());\r\n }\r\n }\r\n }", "private ArrayList<ArrayList<Object>> getJoinedIntermediate(List<Table> tables) {\n\t\tArrayList<ArrayList<Object>> rtn = new ArrayList<ArrayList<Object>>(); \n\n\t\ttry {\n\t\t\tfor(int iterator = 0; iterator < tables.size(); iterator++) {\n\t\t\t\tTable table = tables.get(iterator);\n\t\t\t\tif(rtn.isEmpty()) {\t\t\t\t\t\n\t\t\t\t\tArrayList<Tuple> tuples = (ArrayList<Tuple>) table.getTuples();\n\t\t\t\t\tfor(Tuple tuple : tuples) {\n\t\t\t\t\t\tArrayList<Object> objectTuple = new ArrayList<Object>();\n\t\t\t\t\t\t\n\t\t\t\t\t\tField fields[] = tuple.getClass().getDeclaredFields();\n\t\t\t\t\t\tfor(int i = 0; i < fields.length; i++) {\n\t\t\t\t\t\t\tField field = fields[i];\n\t\t\t\t\t\t\tfield.setAccessible(true);\n\t\t\t\t\t\t\tobjectTuple.add(field.get(tuple));\n\t\t\t\t\t\t\tfield.setAccessible(false);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\trtn.add(objectTuple);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tint originalTableSize = rtn.size();\n\t\t\t\t\tArrayList<Tuple> tuples = (ArrayList<Tuple>) table.getTuples();\n\t\t\t\t\t\n\t\t\t\t\t// Copy existing tuples for join\n\t\t\t\t\tfor(int j = 0; j < tuples.size() - 1; j++)\n\t\t\t\t\t\tfor(int i = 0; i < originalTableSize; i++)\n\t\t\t\t\t\t\trtn.add(new ArrayList<Object>(rtn.get(i)));\n\t\t\t\t\t\n\t\t\t\t\t// Join\n\t\t\t\t\tfor(int j = 0; j < tuples.size(); j++) {\n\t\t\t\t\t\tTuple tuple = tuples.get(j);\n\t\t\t\t\t\tField fields[] = tuple.getClass().getDeclaredFields();\n\t\t\t\t\t\tfor(int i = 0; i < fields.length; i++) {\n\t\t\t\t\t\t\tField field = fields[i];\n\t\t\t\t\t\t\tfor(int iter = 0; iter < originalTableSize; iter++) {\n\t\t\t\t\t\t\t\tfield.setAccessible(true);\n\t\t\t\t\t\t\t\trtn.get(j * originalTableSize + iter).add(field.get(tuple));\n\t\t\t\t\t\t\t\tfield.setAccessible(false);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch (IllegalAccessException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t/*catch (ClassNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tcatch (MalformedURLException e)\t{\n\t\t\te.printStackTrace();\n\t\t}*/\n\t\t\n\t\treturn rtn;\n\t}", "@SuppressWarnings(\"unchecked\")\n\tprivate void growArray() {\n\t\tint tempSize = size * 2;\n\t\tE[] tempList = (E[]) new Object[tempSize];\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\ttempList[i] = list[i];\n\t\t}\n\t\tlist = tempList;\n\t}", "private void prepareTheList()\n {\n int count = 0;\n for (String imageName : imageNames)\n {\n RecyclerUtils pu = new RecyclerUtils(imageName, imageDescription[count] ,images[count]);\n recyclerUtilsList.add(pu);\n count++;\n }\n }", "public void addAll(List<ContentValues> result) {\n for (ContentValues c : result) {\n add(c);\n }\n }", "public List<V> transformList(List<E> list) {\n \tList<V> result = new ArrayList<>(list.size());\n if (list != null) {\n for (E entity : list) {\n result.add(getCachedVO(entity));\n }\n }\n \treturn result;\n }", "private Object[] buildList(int size) {\n list.clear();\n int expectedSize = ArrayList.INITIAL_CAPACITY;\n while (expectedSize < size) {\n expectedSize *= 2;\n }\n Object[] expected = new Object[expectedSize];\n\n for (int i = 0; i < size; i++) {\n String data = i + \"a\";\n list.addToBack(data);\n expected[i] = data;\n }\n return expected;\n }", "@Override\r\n\tprotected void process(List<String> chunks) {\r\n\t\tfor (String data: chunks) {\r\n\t\t\thandleData(data);\r\n\t\t}\r\n\t}", "public void add(List<SermCit> citList){\n //Add one by one\n for (SermCit x : citList){\n add(x);\n }\n }", "ArrayList deepCopyShapeList(List aShapeList){\n ArrayList newList = new ArrayList();\r\n\r\n if (aShapeList.size() > 0) {\r\n Iterator iter = aShapeList.iterator();\r\n\r\n while (iter.hasNext())\r\n newList.add(((TShape)iter.next()).copy());\r\n }\r\n return\r\n newList;\r\n}", "List <JAVATYPE> convertList(List<JAVATYPE> oldList, final METATYPE meta);", "@Override\n public VLongArrayListWritable finishPartial() {\n return null;\n }", "@Override\n public void onSuccess(List<BlocksByHeightQuery.Datum> list) {\n List<com.arcblock.btcblockviewer.BlocksByHeightQuery.Datum> oldList = new ArrayList<>();\n oldList.addAll(mBlocks);\n\n // set mBlocks with new data\n mBlocks = list;\n DiffUtil.DiffResult result = DiffUtil.calculateDiff(new CoreKitDiffUtil<>(oldList, mBlocks), true);\n // need this line , otherwise the update will have no effect\n mListBlocksAdapter.setNewListData(mBlocks);\n result.dispatchUpdatesTo(mListBlocksAdapter);\n\n refreshNextAndPre();\n\n //2. view status change and loadMore component need\n if (mPagedQueryHelper.isHasMore()) {\n mListBlocksAdapter.setEnableLoadMore(true);\n mListBlocksAdapter.loadMoreComplete();\n } else {\n mListBlocksAdapter.loadMoreEnd();\n }\n }", "public void addBatch(List<Map<String, String>> batchData);", "private List<EffectInfoModel> m19295a(List<TemplateInfo> list, long j, Set<Long> set) {\n ArrayList arrayList = new ArrayList();\n if (list == null || list.isEmpty()) {\n return arrayList;\n }\n for (TemplateInfo templateInfo : list) {\n if (templateInfo.isRecommendItem()) {\n long rq = C2575a.m7391rq(templateInfo.ttid);\n if (C8451b.m24479up(QTemplateIDUtils.getTemplateSubType(rq))) {\n boolean isPhotoTemplate = QTemplateIDUtils.isPhotoTemplate(rq);\n if ((1048576 & j) == 0 || !isPhotoTemplate) {\n EffectInfoModel bw = this.bOt.mo35204bw(rq);\n if (bw == null) {\n bw = new EffectInfoModel(rq, \"\");\n bw.setbNeedDownload(true);\n }\n bw.mName = templateInfo.strTitle;\n bw.mThumbUrl = templateInfo.strIcon;\n bw.strSceneName = templateInfo.strScene;\n if (set.add(Long.valueOf(rq))) {\n arrayList.add(bw);\n }\n }\n }\n }\n }\n return arrayList;\n }", "private List<Result> addAllResults(List<Result> result) {\n\n MongoCollection<Document> collection = mongoDatabase.getCollection(\"result\");\n List<Result> allResults = new LinkedList<>();\n for (Result res : result) {\n Document newResult = new Document();\n newResult.put(\"student1\", res.getStudent1());\n newResult.put(\"student2\", res.getStudent2());\n newResult.put(\"percentage\", res.getPercentage());\n newResult.put(\"snippets\", res.getSnippets());\n newResult.put(\"type\", res.getType().toString());\n collection.insertOne(newResult);\n\n\n ObjectId resultId = newResult.getObjectId(\"_id\");\n res.setObjectId(resultId);\n newResult.put(\"hexId\", resultId.toHexString());\n res.setHexId(resultId.toHexString());\n Bson updateOperationDocument = new Document(\"$set\", newResult);\n collection.updateOne(eq(\"_id\", new ObjectId(resultId.toHexString())), updateOperationDocument);\n\n allResults.add(res);\n }\n return allResults;\n }", "public static void main(String... args){\n\n List<List<Integer>> listN = new ArrayList<>();\n\n List<Integer> list1N = new ArrayList<>();\n list1N.add(1);\n list1N.add(2);\n list1N.add(3);\n\n\n List<Integer> list2N = new ArrayList<>();\n list2N.add(4);\n list2N.add(5);\n\n\n\n List<Integer> list3N = new ArrayList<>();\n list3N.add(5);\n list3N.add(6);\n\n\n List<Integer> list4N = new ArrayList<>();\n list4N.add(7);\n list4N.add(8);\n list4N.add(9);\n\n listN.add(list1N);\n listN.add(list2N);\n listN.add(list3N);\n listN.add(list4N);\n\n List<Integer> outputN = getMergedLLEfficient(listN);\n\n for(Integer elem : outputN)\n System.out.println(elem);\n }", "static ArrayList runLengthEncodingSequence(List<List> lists){\r\n\t\t\r\n\t\tArrayList encodinglist=new ArrayList<>();\r\n\t\t\r\n\t\tfor(List a: lists)\r\n\t\t{\r\n\t\t\tArrayList encodinglistinner=new ArrayList<>();\r\n\t\t\tencodinglistinner.add(a.size());\r\n\t\t\tencodinglistinner.add(a.get(0));\r\n\t\t\tencodinglist.add(encodinglistinner);\r\n\t\t}\r\n\t\treturn encodinglist;\r\n\t\r\n\t}", "private static void merge(ArrayList<Integer> leftList, ArrayList<Integer> rightList, ArrayList<Integer> outList) {\n\n int leftIndex = 0;\n int rightIndex = 0;\n int outIndex = 0;\n\n while (leftIndex < leftList.size() && rightIndex < rightList.size()) {\n\n if (leftList.get(leftIndex).compareTo(rightList.get(rightIndex)) <= 0) {\n outList.set(outIndex, leftList.get(leftIndex));\n leftIndex++;\n } else {\n outList.set(outIndex, rightList.get(rightIndex));\n rightIndex++;\n }\n\n outIndex++;\n\n }\n\n if (leftIndex < leftList.size()) {\n copyRemainder(leftList, leftIndex, outList, outIndex);\n } else {\n copyRemainder(rightList, rightIndex, outList, outIndex);\n }\n\n }", "private void helper(List<Integer> tempList,ArrayList<Integer> list) {\n //stopping condition\n if(list.size()==0) {\n ans.add(new ArrayList<>(tempList)); // add a copy of tempList\n }\n else {\n for(int i=0;i<list.size();i++) {\n if(i==0 || list.get(i-1) != list.get(i)) // avoid duplication\n {\n ArrayList<Integer> newlist = new ArrayList<>(list);\n tempList.add(list.get(i));\n newlist.remove(i);\n helper(tempList,newlist);\n tempList.remove(tempList.size()-1);\n }\n\n }\n }\n }", "private List<Instance> flushResultBuffer() {\n\t\tList<Instance> resultBuffer = this.resultBuffer;\n\t\tthis.resultBuffer = new LinkedList<Instance>();\n\t\treturn resultBuffer;\n\t}", "abstract protected Object newList( int capacity );", "@Split\n public List<InputMapper> split(@PartitionSize final long bundles) {\n\t\tfinal List<InputMapper> partitions = new ArrayList<>();\n\t final Collection<Member> members = new ArrayList<>();\n\t long current = 0;\n\t for (final Map.Entry<Member, Future<Long>> entries : getSizeByMembers().entrySet()) {\n\t final long memberSize = getFutureValue(entries.getValue());\n\t if (members.isEmpty()) {\n\t members.add(entries.getKey());\n\t current += memberSize;\n\t } else if (current + memberSize > bundles) {\n\t partitions.add(\n\t new InputMapper(configuration, jsonFactory, jsonb, service, toIdentifiers(members)));\n\t // reset current iteration\n\t members.clear();\n\t current = 0;\n\t }\n\t }\n\t if (!members.isEmpty()) {\n\t partitions.add(new InputMapper(configuration, jsonFactory, jsonb, service, toIdentifiers(members)));\n\t }\n\n\t if (partitions.isEmpty()) { // just execute this if no plan (= no distribution)\n\t partitions.add(this);\n\t }\n\t return partitions;\n }", "java.util.List<? extends entities.Torrent.ChunkInfoOrBuilder>\n getChunksOrBuilderList();", "@Nonnull \r\n\tpublic static <T> CloseableIterable<List<T>> chunkify(\r\n\t\t\t@Nonnull Observable<? extends T> source) {\r\n\t\treturn collect(\r\n\t\t\t\tsource,\r\n\t\t\t\tnew Func0<List<T>>() {\r\n\t\t\t\t\t@Override\r\n\t\t\t\t\tpublic List<T> invoke() {\r\n\t\t\t\t\t\treturn new ArrayList<T>();\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\tnew Func2<List<T>, T, List<T>>() {\r\n\t\t\t\t\t@Override\r\n\t\t\t\t\tpublic List<T> invoke(List<T> param1, T param2) {\r\n\t\t\t\t\t\tparam1.add(param2);\r\n\t\t\t\t\t\treturn param1;\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\tnew Func1<List<T>, List<T>>() {\r\n\t\t\t\t\t@Override\r\n\t\t\t\t\tpublic List<T> invoke(List<T> param) {\r\n\t\t\t\t\t\treturn new ArrayList<T>();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t);\r\n\t}", "private static List<AggregatedBodyPart> parse(String boundary, List<byte[]> data) {\n final ByteBufsDecoderInput input = new ByteBufsDecoderInput(ByteBufAllocator.DEFAULT);\n final List<BodyPart> output = new ArrayList<>();\n final MimeParser parser = new MimeParser(input, output::add, boundary,\n // Use onBodyPartBegin and requestUpstreamForBodyPartData\n new MultipartDecoder(StreamMessage.of(), \"boundary\",\n ByteBufAllocator.DEFAULT));\n for (byte[] bytes : data) {\n input.add(Unpooled.wrappedBuffer(bytes));\n parser.parse();\n }\n parser.close();\n return output.stream()\n .map(part -> {\n final HttpData content = Flux.from(part.content())\n .map(HttpData::array)\n .reduce(Bytes::concat)\n .map(HttpData::wrap)\n .block();\n return AggregatedBodyPart.of(part.headers(), content);\n }).collect(toImmutableList());\n }", "public static <T> List<T> reduceToSingleList3(Stream<List<T>> stream) {\n List<T> list = stream.reduce(new ArrayList<T>(), (list1, list2) -> {\n list1.addAll(list2);\n return list1;\n });\n return list;\n }", "public int[][] chunkValues(ArrayList<ArrayList<ArrayList<String>>> listOfFID){\n\t\tint[] values = new int[listOfFID.size()];\n\t\tint[][] chunkMatrix = new int[values.length][2];\n\t\tfor(int i = 0; i < values.length; i++){\n\t\t\tint[] chunkInfo = chunkSize(listOfFID.get(i), values.length);\n\t\t\tchunkMatrix[i] = chunkInfo;\t\t\t\n\t\t}\t\n\t\treturn chunkMatrix;\n\t}", "@Override public List<Long> reduce(List<ComputeJobResult> list) throws IgniteException {\n List<Chromosome> parents = list.stream().map((x) -> (Chromosome)x.getData()).collect(Collectors.toList());\n\n return createParents(parents);\n }", "@Override\n @Transactional\n public void addBulkInsertsAfterExtraction() {\n List<ScrapBook> scrapBooks = new ArrayList<ScrapBook>();\n boolean jobDone = false;\n boolean pause = false;\n while (!jobDone) {\n pause = false;\n int lineCount = 0;\n while (!pause) {\n ++lineCount;\n if (lineCount % 30 == 0) {\n scrapBooks = springJdbcTemplateExtractor.getPaginationList(\"SELECT * FROM ScrapBook\", 1, 30);\n pause = true;\n }\n }\n //convert scrapbook to book and insert into db\n convertedToBookAndInsert(scrapBooks);\n // delete all inserted scrapbooks\n springJdbcTemplateExtractor.deleteCollection(scrapBooks);\n scrapBooks = null;\n if (0 == springJdbcTemplateExtractor.findTotalScrapBook()) {\n jobDone = true;\n }\n }\n }", "public java.util.List<entities.Torrent.ChunkInfo> getChunksList() {\n if (chunksBuilder_ == null) {\n return java.util.Collections.unmodifiableList(chunks_);\n } else {\n return chunksBuilder_.getMessageList();\n }\n }", "private void autoExpand(long toLength) {\n \t\tlist.ensureCapacity((int) toLength);\n \t\tfor (int i = getLength(); i < toLength; i++) {\n \t\t\tlist.add(getRuby().getNil());\n \t\t}\n \t}", "private List<PhotoAlbumDetailDTO> listEntity2DTO(List<PhotoAlbumEntity> entityList){\n List<PhotoAlbumDetailDTO> list = new ArrayList<>();\n for (PhotoAlbumEntity entity : entityList) {\n list.add(new PhotoAlbumDetailDTO(entity));\n }\n return list;\n }", "private List<LocalAlbum> convertToLocalAlbumsList(List<Album> albumList){\n List<LocalAlbum> list = new ArrayList<>();\n for (Album album : albumList) {\n LocalAlbum localAlbum = new LocalAlbum(album.getAlbumId(),album.getId(),album.getTitle(),album.getUrl(),album.getThumbnailUrl());\n list.add(localAlbum);\n localAlbum.save();\n }\n return list;\n }", "@Deprecated\n public synchronized void splitOutputList() {\n logger.debug3(\"Splitting\");\n listStack.push(new ArrayList());\n }", "protected void compress(){\r\n\t\t\r\n \tmodCount++;\r\n\t\tArrayNode<T> current = beginMarker.next;\r\n\t\t\r\n\t\t//find non-full node\r\n\t\twhile (current != endMarker){\r\n\t\t\tif (current.getLength()== current.getArraySize()){\r\n\t\t\t\tcurrent = current.next;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tArrayNode<T> removing = current.next;\r\n\t\t\t\t//compression done\r\n\t\t\t\tif (removing==endMarker){\r\n\t\t\t\t\t//remove empty nodes\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t//empty node\r\n\t\t\t\twhile (removing.getArraySize()==0){\r\n\t\t\t\t\tremoving = removing.next;\r\n\t\t\t\t\tif (removing==endMarker)\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t//not sure why this is needed\r\n\t\t\t\tif (removing==endMarker){\r\n\t\t\t\t\t//remove empty nodes\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t//move elements from \"removing\" node to \"current\"\r\n\t\t\t\tT temp = removing.removeFirst();\r\n\t\t\t\tcurrent.insertSorted(temp);\r\n\t\t\t\t\r\n\t\t\t\t//check current length, go to next if full, otherwise redo loop\r\n\t\t\t\tif (current.getLength()==current.getArraySize()){\r\n\t\t\t\t\tcurrent = current.next;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//do another sweep at end to remove empty nodes\r\n\t\tcurrent = beginMarker.next;\r\n\t\twhile (current != endMarker){\r\n\t\t\tif (current.getArraySize()==0){\r\n\t\t\t\tcurrent.prev.next = current.next;\r\n\t\t\t\tcurrent.next.prev = current.prev;\r\n\t\t\t\tcurrent = current.next;\r\n\t\t\t\tsize--;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tcurrent = current.next;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public BaselineList(ArrayList<float[]> list) {\n\t\tthis.listNum = list.size();\n\t\tthis.capacity = listNum * 2;\n\t\tthis.list = new ArrayList<float[]>(list);\n\t}", "public void prepareList()\n {\n listImg = new ArrayList<Drawable>();\n for(int i=0;i<n;i++)\n {\n \ta.moveToPosition(i);\n \tString immagine = a.getString(0);\n \tCaricaImmagine caricaImmagineAsync = new CaricaImmagine();\n \t\tcaricaImmagineAsync.execute(new String[]{immagine});\n }\n }", "private static void testAdd(ArrayList list, int[] content) {\n System.out.print(\"Adding to the list: \");\n for (int index = 0; index < content[index]; index++) {\n list.addToEnd(content);\n } // end for\n System.out.println();\n displayList(list);\n }", "private Chunk generateChunk(int size) {\n String json;\n ObjectMapper objectMapper = new ObjectMapper();\n List<Record> recordList = new ArrayList<>();\n int i = 1;\n while (i <= size) {\n json = \"{ \\\"Price\\\" :\" + priceGenerator.nextDouble() * 100 + \" }\";\n try {\n recordList.add(new Record(String.valueOf(i), LocalDateTime.now(), objectMapper.readTree(json)));\n } catch (JsonProcessingException e) {\n log.error(\"Issue with the chunk generation: \" + e.getMessage());\n return null;\n }\n i++;\n\n }\n log.info(\"Generated Chunk :\");\n recordList.forEach((record) -> log.info(record.toString()));\n return new Chunk(recordList);\n }", "public void processList(List<String> inList);", "private ArrayList<String> dataConvertForMasterList(ArrayList<Response.Messages> message_array_list){\n\t\tArrayList<String> all_returned_data = new ArrayList<String>();\n\n\t\tString str1, str2, str3, str4, longString;\n\t\tstr1 = \"\";\n\t\tstr2 = \"\";\n\t\tstr3 = \"\";\n\t\tstr4 = \"\";\n\t\tlongString = \"\";\n\n\t\tArrayList<String> body_preview_data = new ArrayList<String>();\n\t\tArrayList<String> subject_data = new ArrayList<String>();\n\t\t//ArrayList<String> from_data = new ArrayList<String>(); //Declared above already. Leaving this in for testing purposes\n\t\tArrayList<String> date_data = new ArrayList<String>();\n\n\t\ttry{\n\t\t\tbody_preview_data = mf.fBody_Preview(message_array_list);\n\t\t\tsubject_data = mf.fSubject(message_array_list);\n\t\t\tfrom_data = mf.fFrom(message_array_list);\n\t\t\tdate_data = mf.fDate(message_array_list);\n\t\t} catch (NullPointerException e){\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\t//For loop to combine all data into readable format for message preview list\n\t\tfor (int i = 0; i<message_array_list.size(); i++){\n\t\t\tstr1 = date_data.get(i);\n\t\t\tstr2 = from_data.get(i);\n\t\t\tstr3 = subject_data.get(i);\n\t\t\tstr4 = body_preview_data.get(i)+ \"...\";\n\n\t\t\t//Adjust the date string to remove the +0000. First 20 characters (to eliminate time zone declaration)\n\t\t\tString adjust_date = str1.substring(0, Math.min(str1.length(), 20));\n\n\t\t\tlongString = adjust_date + \"\\n\" + str2 + \"\\n\" + str3 + \"\\n\" + str4;\n\n\t\t\tall_returned_data.add(longString);\n\t\t}\n\t\treturn all_returned_data;\n\t}", "public List<List<String>> accountsMerge(List<List<String>> accounts) {\n\n List<Account> accts = new ArrayList<>();\n Map<String, Account> mapMailToAccount = new HashMap<>();\n for (List<String> account : accounts) {\n String name = account.get(0);\n Account acct = new Account(name);\n accts.add(acct);\n for(int i=1;i<account.size();i++){\n String mail = account.get(i);\n Account mappedAcct = mapMailToAccount.get(mail);\n if (mappedAcct == null) {\n mapMailToAccount.put(mail, acct);\n acct.mails.add(mail);\n } else {\n union(acct, mappedAcct);\n }\n }\n }\n for (Account acct : accts) {\n if (acct.parent != acct) {\n acct.parent = find(acct);\n acct.parent.mails.addAll(acct.mails);\n }\n }\n List<List<String>> mergedAccounts = new ArrayList<>();\n for (Account acct : accts) {\n if (acct.parent == acct) {\n mergedAccounts.add(acct.convertToList());\n }\n }\n return mergedAccounts;\n}", "void mo100444b(List<C40429b> list);", "public ArrayBackedList(IList list) {\n while (list.size() > stringArray.length) {\n reallocArray();\n }\n for (int i = 0; i < list.size(); i++) {\n stringArray[i] = list.get(i);\n }\n }", "@Override\n public List<LeafNodeObject> chunking() throws IOException {\n int horizon = 16384;\n List<LeafNodeObject> list = new ArrayList<>();\n int inputLength = fileContent.length;\n\n if (inputLength <= 0) {\n throw new IOException(\"Cannot support the length less than 0\");\n } else if (inputLength <= horizon) {\n list.add(this.getChunk(0, inputLength));\n return list;\n }\n\n long chunkStart = 0;\n UInteger[] hashValues = this.getHashValues();\n\n while (chunkStart + 1 < inputLength) {\n long chunkEndMax = Math.min(chunkStart + this.maxChunkSize, inputLength);\n long chunkEnd = (int) chunkEndMax;\n\n for (long n = chunkStart; n < chunkEndMax; n++) {\n boolean isBoundary = true;\n\n if (n == chunkStart) {\n n = chunkStart + horizon;\n }\n\n if (n - chunkStart == this.maxChunkSize) {\n break;\n }\n\n long end = Math.min(n + horizon, chunkEndMax);\n for (long i = n - horizon; i < end; i++) {\n if (i != n &&\n hashValues[(int) n].intValue() <= hashValues[(int) i].intValue()) {\n isBoundary = false;\n break;\n }\n }\n\n if (!isBoundary) {\n continue;\n }\n\n if (n + horizon > inputLength) {\n n = chunkEndMax;\n continue;\n }\n\n if ((n - (n % horizon) + (2 * horizon)) > inputLength) {\n continue;\n }\n\n if (inputLength % horizon == 0 &&\n ((int) chunkStart - ((int) chunkStart % horizon) + (2 * horizon)) ==\n inputLength) {\n continue;\n }\n\n chunkEnd = n;\n break;\n }\n\n list.add(this.getChunk(chunkStart, chunkEnd));\n chunkStart = chunkEnd;\n }\n\n return list;\n }", "public static List<Chunk> extractChunks(List<SVGElement> elements) {\n\t\tList<Chunk> chunkList = new ArrayList<Chunk>();\n\t\tfor (AbstractCMElement element : elements) {\n\t\t\tif (element instanceof Chunk) {\n\t\t\t\tchunkList.add((Chunk) element);\n\t\t\t}\n\t\t}\n\t\treturn chunkList;\n\t}", "void insertBatch(List<InspectionAgency> recordLst);", "private List<Multiset.Entry<E>> snapshot() {\n\t\t\tList<Multiset.Entry<E>> list = Lists\n\t\t\t\t\t.newArrayListWithExpectedSize(size());\n\t\t\tfor (Multiset.Entry<E> entry : this) {\n\t\t\t\tlist.add(entry);\n\t\t\t}\n\t\t\treturn list;\n\t\t}", "public Builder addAllChunks(\n java.lang.Iterable<? extends entities.Torrent.ChunkInfo> values) {\n if (chunksBuilder_ == null) {\n ensureChunksIsMutable();\n com.google.protobuf.AbstractMessageLite.Builder.addAll(\n values, chunks_);\n onChanged();\n } else {\n chunksBuilder_.addAllMessages(values);\n }\n return this;\n }", "public static List<RespSubFieldsDTO> converFromBOListToDTOList(\n\t\t\tList<CloudSvrSecQuesMaster> boList) {\n\n\t\tList<RespSubFieldsDTO> respSubFieldsDTOs = new ArrayList<RespSubFieldsDTO>();\n\n\t\tList<CloudSvrSecQuesMaster> randomList = new ArrayList<CloudSvrSecQuesMaster>();\n\n\t\tif (!boList.isEmpty()) {\n\n\t\t\tList<Integer> l = UserHelper.nextInt();\n\t\t\tint tmp1 = l.get(0);\n\t\t\tint tmp2 = l.get(1);\n\n\t\t\tCloudSvrSecQuesMaster random1 = boList.get(tmp1);\n\t\t\tCloudSvrSecQuesMaster random2 = boList.get(tmp2);\n\t\t\trandomList.add(random1);\n\t\t\trandomList.add(random2);\n\t\t}\n\n\t\tfor (CloudSvrSecQuesMaster secQuestionMaster : randomList) {\n\n\t\t\tRespSubFieldsDTO respSubFieldsDTO = new RespSubFieldsDTO();\n\t\t\trespSubFieldsDTO.setQuestionId(secQuestionMaster.getId());\n\t\t\trespSubFieldsDTO.setQuestionName(secQuestionMaster.getQuestion());\n\t\t\trespSubFieldsDTOs.add(respSubFieldsDTO);\n\t\t}\n\n\t\treturn respSubFieldsDTOs;\n\t}", "private void prepareFileList(ArrayList<HashMap<String, String>> fileList,boolean append) {\n\t\tif (fileList != null) {\n\t\t\tif (!append) {\n\t\t\t\tfileListData.clear();\n\t\t\t}\n\t\t\tfor (HashMap<String, String> hashMap : fileList) {\n\t\t\t\tSmartListItem item = new SmartListItem();\n\t\t\t\titem.setItemLayout(R.layout.jreview_article_attatchments_list_item);\n\t\t\t\tArrayList<Object> obj = new ArrayList<Object>();\n\t\t\t\tobj.add(hashMap);\n\t\t\t\titem.setValues(obj);\n\t\t\t\tif (append) {\n\t\t\t\t\tfileListAdapter.add(item);\n\t\t\t\t} else {\n\t\t\t\t\tfileListData.add(item);\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t}" ]
[ "0.64251107", "0.60665005", "0.6031982", "0.59577525", "0.5861146", "0.5800847", "0.57638866", "0.57238877", "0.5709301", "0.5637512", "0.5606481", "0.55725765", "0.54881966", "0.5459777", "0.5458461", "0.5445654", "0.5439839", "0.5438304", "0.54337573", "0.54335254", "0.542572", "0.5414359", "0.54000723", "0.5393729", "0.5372446", "0.53668576", "0.53656113", "0.5354503", "0.5299209", "0.52852494", "0.528119", "0.52751136", "0.5274304", "0.52582437", "0.52331054", "0.52245045", "0.52206683", "0.52115643", "0.52073014", "0.52039385", "0.5190974", "0.51838154", "0.51838154", "0.518133", "0.51808834", "0.5164919", "0.51457965", "0.5140976", "0.51367956", "0.5134828", "0.5134034", "0.51305413", "0.5129079", "0.5122295", "0.51217", "0.5111523", "0.51037717", "0.5095038", "0.50830007", "0.5082033", "0.5069294", "0.50589657", "0.5047559", "0.5028188", "0.5025214", "0.50226265", "0.5022568", "0.5022227", "0.50195473", "0.50194854", "0.501072", "0.500722", "0.50013995", "0.49930707", "0.4981003", "0.4979532", "0.49759603", "0.49747333", "0.49712232", "0.49638912", "0.4963885", "0.49638397", "0.4955254", "0.49544966", "0.4953458", "0.49510872", "0.49494162", "0.49452823", "0.49435952", "0.49374887", "0.49365276", "0.4933378", "0.4926185", "0.4922066", "0.49201915", "0.49181175", "0.49106258", "0.49103963", "0.4908122", "0.49043843", "0.49037254" ]
0.0
-1
Return FutureObject of the Thread.
public Object get(Integer counter) throws InterruptedException, ExecutionException { System.out.println("Main Object " + this.executableMap.get(counter).getProcessExecuteInt().getNumber()); return this.executableMap.get(counter).getFutureObject(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public synchronized Thread getThread() {\n return thread;\n }", "public Thread getThread();", "public Thread getThread() {\n return thread;\n }", "@Override\n public Object get() throws InterruptedException, ExecutionException {\n return getSafely();\n }", "public ChannelFuture getChannelFuture() {\n return channelFuture;\n }", "@Override\n\tpublic V get() {\n\t\tV result = null;\n\t\ttry {\n\t\t\tresult = fTask.get();\n\t\t} catch (InterruptedException | ExecutionException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn result;\n\t}", "DispatchTask getTask()\n {\n synchronized (m_lock)\n {\n return m_runnable;\n }\n }", "public LoadThread getThread() {\r\n return thread;\r\n }", "private <T> Future<T> newFuture(final T response) {\n FutureTask<T> t = new FutureTask<T>(new Callable<T>() {\n @Override\n public T call() {\n return response;\n }\n });\n t.run();\n return t;\n }", "private <T> T extractValueFromFuture(Future<T> future) {\n T val = null;\n try {\n val = future.get();\n } catch (InterruptedException | ExecutionException e) {\n e.printStackTrace();\n }\n return val;\n }", "public CompletableFuture<Object> future() {\n return messageFuture;\n }", "public KThread nextThread() \n\t\t{\n\t\t\tLib.assertTrue(Machine.interrupt().disabled());\n\t\t\tif (waitQueue.isEmpty())\n\t\t\t{\n\t\t\t\towner=null;\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\towner=waitQueue.peek(); //Set the head of the waitQueue as owner\n\t\t\tThreadState waiterState = getThreadState(owner);\n\t\t\tgetThreadState(owner).acquire(this); //Make the new owner acquire the queue\n\t\t\treturn waitQueue.poll(); //return next thread\n\t\t}", "Future<T> then(Runnable result);", "public Node getNode() {\n return thread;\n }", "private DispatchTask next()\n {\n synchronized (m_lock)\n {\n while (null == m_runnable)\n {\n if (m_released)\n {\n return null;\n }\n\n try\n {\n m_lock.wait();\n } catch (InterruptedException e)\n {\n // Not needed\n }\n }\n\n return m_runnable;\n }\n }", "public BThread getThread() {\n Long __key = this.threadDaoId;\n if (thread__resolvedKey == null || !thread__resolvedKey.equals(__key)) {\n if (daoSession == null) {\n throw new DaoException(\"Entity is detached from DAO context\");\n }\n BThreadDao targetDao = daoSession.getBThreadDao();\n BThread threadNew = targetDao.load(__key);\n synchronized (this) {\n thread = threadNew;\n \tthread__resolvedKey = __key;\n }\n }\n return thread;\n }", "public static Object getFutureValue(ListenableFuture<?> future) {\n Object failure;\n if (future instanceof TrustedFuture) {\n Object v = ((AbstractFuture) future).value;\n if (!(v instanceof Cancellation)) {\n return v;\n }\n Cancellation c = (Cancellation) v;\n if (!c.wasInterrupted) {\n return v;\n }\n if (c.cause != null) {\n return new Cancellation(false, c.cause);\n }\n return Cancellation.CAUSELESS_CANCELLED;\n }\n try {\n Object v2 = Futures.getDone(future);\n if (v2 == null) {\n failure = NULL;\n } else {\n failure = v2;\n }\n } catch (ExecutionException exception) {\n failure = new Failure(exception.getCause());\n } catch (CancellationException cancellation) {\n failure = new Cancellation(false, cancellation);\n } catch (Throwable t) {\n failure = new Failure(t);\n }\n return failure;\n }", "@Test\n @DisplayName(\"Future with result\")\n void testFutureWithResult() throws ExecutionException, InterruptedException {\n final ExecutorService executor = Executors.newSingleThreadExecutor();\n final Future<String> future = executor.submit(this::getThreadName);\n\n // check if the future has already been finished. this isn't the case since the above callable sleeps for one second before returning the integer\n assertFalse(future.isDone());\n // calling the method get() blocks the current thread and waits until the callable completes before returning the actual result\n final String result = future.get();\n // now the future is finally done\n assertTrue(future.isDone());\n\n assertThat(result).matches(Pattern.compile(\"Thread \\\"pool-\\\\d-thread-\\\\d\\\"\"));\n }", "private synchronized WorkerThread getThread() {\n\t\tfor (int i = 0; i < this.threadPool.size(); ++i) {\n\t\t\tif (this.threadPool.get(i).available()) {\n\t\t\t\tthis.threadPool.get(i).setAvailable(false);\n\t\t\t\treturn this.threadPool.get(i);\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public interface Future\n{\n\n public abstract boolean cancel(boolean flag);\n\n public abstract boolean isCancelled();\n\n public abstract boolean isDone();\n\n public abstract Object get()\n throws ExecutionException, InterruptedException;\n\n public abstract Object get(long l, TimeUnit timeunit)\n throws ExecutionException, InterruptedException, TimeoutException;\n}", "private V getDoneValue(Object obj) throws ExecutionException {\n if (obj instanceof Cancellation) {\n throw cancellationExceptionWithCause(\"Task was cancelled.\", ((Cancellation) obj).cause);\n } else if (obj instanceof Failure) {\n throw new ExecutionException(((Failure) obj).exception);\n } else if (obj == NULL) {\n return null;\n } else {\n return obj;\n }\n }", "public final T getResult() {\n try {\n try {\n ForkJoinPool.managedBlock(this);\n } catch (InterruptedException e) {\n }\n return self();\n }catch(Throwable t){\n throw new RuntimeException(t);\n }\n }", "public FutureTask<T> getFutureTask(int taskNo, Class<T> realT){\n return (new FutureTask(taskNo,realT));\n }", "public synchronized Thread getAssociatedThread()\r\n {\r\n return associatedThread;\r\n }", "private BlockingFuture setRetractingFuture(ATFarReference reference) {\n\t\t// first assign future to a local variable to avoid race conditions on writing to the outboxFuture_ variable!\n\t\tfinal BlockingFuture future = new BlockingFuture();\n\t\tsynchronized(this) { \n\t\t\t// synchronized access because different thread in the pool could\n\t\t\t// be processing retractUnsentMessages requests for different references. \n\t\t\tretractFutures_.put(reference, future);\n\t\t}\n\t\treturn future;\n\t}", "public static @NonNull <T> Future<T> awaitFuture(@NonNull Future<T> future) {\n try {\n // await the future and rethrow exceptions if any occur\n return future.asStage().sync().future();\n } catch (InterruptedException exception) {\n Thread.currentThread().interrupt(); // reset the interrupted state of the thread\n throw new IllegalThreadStateException();\n }\n }", "public Object call() throws Exception {\n\t\t\t\t\tsynchronized (this) {\n\t\t\t\t\t\tif ( reference.asNativeRemoteFarReference().getTransmitting()){\n\t\t\t\t\t\t\t// if there is a thread transmitting a message for this reference:\n\t\t\t\t\t\t\t// resolve the future with a BlockingFuture to wait for the result of the transmission.\n\t\t\t\t\t\t\tBlockingFuture future = setRetractingFuture(reference);\n\t\t\t\t\t\t\treturn future.get();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// if there is no thread transmitting a message for this reference:\n\t\t\t\t\t\t\t// resolve the future immediately with the content of its oubox.\n\t\t\t\t\t\t\treturn reference.asNativeRemoteFarReference().impl_retractOutgoingLetters();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}", "final EventDispatchThread getDispatchThread() {\n\treturn dispatchThread;\n }", "Callable<E> getTask();", "T get() throws InterruptedException, LightExecutionException;", "public Object getResults() throws InterruptedException, ExecutionException {\n\t\t\treturn result.get();\n\t}", "protected BufferedImage createImage() throws InterruptedException {\r\n try {\r\n // block until thread comes back.\r\n if (futureTask != null) {\r\n image = futureTask.get();\r\n }\r\n if (image == null) {\r\n image = call();\r\n }\r\n } catch (InterruptedException e) {\r\n Thread.currentThread().interrupt();\r\n logger.fine(\"Image loading interrupted\");\r\n throw new InterruptedException(e.getMessage());\r\n } catch (Exception e) {\r\n logger.log(Level.WARNING, \"Image loading execution exception\", e);\r\n }\r\n return image;\r\n }", "CompletableFuture<?> submit(Runnable request);", "@Override // java.lang.Runnable\n public final void run() {\n ListenableFuture<? extends I> listenableFuture = this.h;\n F f = this.i;\n boolean z = true;\n boolean isCancelled = isCancelled() | (listenableFuture == null);\n if (f != null) {\n z = false;\n }\n if (!isCancelled && !z) {\n this.h = null;\n if (listenableFuture.isCancelled()) {\n setFuture(listenableFuture);\n return;\n }\n try {\n try {\n Object o = o(f, Futures.getDone(listenableFuture));\n this.i = null;\n p(o);\n } catch (Throwable th) {\n this.i = null;\n throw th;\n }\n } catch (CancellationException unused) {\n cancel(false);\n } catch (ExecutionException e) {\n setException(e.getCause());\n } catch (RuntimeException e2) {\n setException(e2);\n } catch (Error e3) {\n setException(e3);\n }\n }\n }", "public ThreadFactory threadFactory() {\n return threadFactory_;\n }", "public CompletableFuture<?> getReleaseFuture() {\n\t\treturn releaseFuture;\n\t}", "public Result invoke() throws InterruptedException {\n // push the job to the queue. The manager thread will pull.\n queue.add(this);\n \n // wait for the manager to notify of success.\n // a more sophisticated controller could make this an async wait.\n // the purpose though is to force all comms with the camera to be\n // synchronous, and on a single 'controlled' thread.\n synchronized (this) {\n while (!complete) {\n this.wait();\n }\n }\n return result;\n }", "public static void main(String[] args)\n {\n ExecutorService executorService = Executors.newCachedThreadPool();\n Future<Integer> future = executorService.submit(new Callable<Integer>() {\n public Integer call()\n {\n Random random = new Random();\n int duration = random.nextInt(500);\n System.out.println(\"Starting...\");\n try {\n Thread.sleep(duration);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n System.out.println(\"Finished\");\n return duration;\n }\n });\n executorService.shutdown();\n try {\n System.out.println(\"result is : \"+future.get());\n\n\n } catch (InterruptedException e) {\n e.printStackTrace();\n } catch (ExecutionException e) {\n e.printStackTrace();\n }\n System.out.println(\"future object done? :\"+future.isDone());\n System.out.println(\"future object cancelled? :\"+future.isCancelled());\n }", "ThreadStart createThreadStart();", "public Promise<V> await()\r\n/* 207: */ throws InterruptedException\r\n/* 208: */ {\r\n/* 209:242 */ if (isDone()) {\r\n/* 210:243 */ return this;\r\n/* 211: */ }\r\n/* 212:246 */ if (Thread.interrupted()) {\r\n/* 213:247 */ throw new InterruptedException(toString());\r\n/* 214: */ }\r\n/* 215:250 */ synchronized (this)\r\n/* 216: */ {\r\n/* 217:251 */ while (!isDone())\r\n/* 218: */ {\r\n/* 219:252 */ checkDeadLock();\r\n/* 220:253 */ incWaiters();\r\n/* 221: */ try\r\n/* 222: */ {\r\n/* 223:255 */ wait();\r\n/* 224: */ }\r\n/* 225: */ finally\r\n/* 226: */ {\r\n/* 227:257 */ decWaiters();\r\n/* 228: */ }\r\n/* 229: */ }\r\n/* 230: */ }\r\n/* 231:261 */ return this;\r\n/* 232: */ }", "public Object waitForValueObject() throws Exception {\n\t\t\n\t\twaitingForCode = DebugConstants.WAIT_FOR_OBJECT;\n\t\tthread.waitOnCompletion(this);\n\t\treturn oval;\n\t}", "public interface ThreadApi {\n Future executeInBackground(Runnable task);\n boolean executeInMainThread(Runnable task);\n boolean executeInMainThread(Runnable task, long delay);\n}", "public static void main(String[] args) throws Exception {\n FutureTask<String> futureTask = new FutureTask<String>(new Callable<String>() {\n @Override\n public String call() throws Exception {\n Thread.sleep(10000);\n System.out.println(\"thread done ...\");\n return \"hello world\";\n }\n });\n futureTask.run();\n// executorService.submit(futureTask);\n System.out.println(futureTask.get());\n// executorService.shutdown();\n }", "public synchronized Object get() {\n try {\n Object obj = queue.take().getElement();\n\n // set next offset\n delayOffset = System.currentTimeMillis();\n\n return obj;\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n return null;\n }", "public synchronized HttpThread getThread() {\n \t\tadjustThreadCount();\n \n \t\twhile (upper > 0) {\n \t\t\tint count = idleThreads.size();\n \t\t\tif (count > 0) {\n \t\t\t\tint i = count - 1;\n \n \t\t\t\tHttpThread thread = (HttpThread) idleThreads.elementAt(i);\n \t\t\t\tidleThreads.removeElementAt(i);\n \t\t\t\tif (thread.getPriority() != priority) {\n \t\t\t\t\tthread.setPriority(priority);\n \t\t\t\t}\n \t\t\t\tactiveThreads.addElement(thread);\n \t\t\t\t//new Exception((size-i)+\" Threads are at work!\").printStackTrace();\n \t\t\t\tif (Http.DEBUG) {\n \t\t\t\t\thttp.logDebug(thread.getName() + \": becoming active\"); //$NON-NLS-1$\n \t\t\t\t}\n \n \t\t\t\treturn thread;\n \t\t\t}\n \t\t\ttry {\n \t\t\t\twait();\n \t\t\t} catch (InterruptedException e) {\n \t\t\t\t// ignore and check exit condition\n \t\t\t}\n \t\t}\n \n \t\treturn null;\n \t}", "public NetworkEvent fetch() throws InterruptedException {\n\t\treturn eventQueue.take();\n\t}", "public ChannelProgressivePromise await()\r\n/* 106: */ throws InterruptedException\r\n/* 107: */ {\r\n/* 108:138 */ super.await();\r\n/* 109:139 */ return this;\r\n/* 110: */ }", "public ExecutorService getEventExecutor() {\n return executor;\n }", "@Override\n\tpublic V get(long timeout, TimeUnit unit) {\n\t\tV result = null;\n\t\ttry {\n\t\t\tresult = fTask.get(timeout, unit);\n\t\t} catch (InterruptedException | ExecutionException | TimeoutException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn result;\n\t}", "public XnioIoThread getIoThread() {\n return readable.getIoThread();\n }", "public Object runAndGetResult() {\n run();\n return getResult();\n }", "Future_<V> take() throws InterruptedException;", "public E poll() {\n try {\n return b(2, (Long) null, (TimeUnit) null);\n } catch (InterruptedException unused) {\n return null;\n }\n }", "public int waitFor() throws Exception {\n \n int result = future.get();\n service.shutdown();\n return result;\n }", "public Thread startThread() {\n Thread thread = createThread();\n thread.start();\n return thread;\n }", "public static void main(String[] args) throws InterruptedException {\n\r\n FutureService futureService = new FutureService();\r\n Future<String> future = futureService.submit(() -> {\r\n try {\r\n Thread.sleep(10_000);\r\n } catch (InterruptedException e) {\r\n e.printStackTrace();\r\n }\r\n return \"FINISH\";\r\n }, System.out::println);\r\n System.out.println(\"================\");\r\n System.out.println(\"do other thing.\");\r\n Thread.sleep(1_000L);\r\n System.out.println(\"================\");\r\n\r\n// System.out.println(future.get());\r\n }", "public AbstractThread getThread () {\n ToolsDebugger debugger = (ToolsDebugger) getDebugger ();\n ToolsThread tt = ((ToolsThreadGroup) debugger.getThreadGroupRoot ()).getThread (thread);\n if (tt != null) return tt;\n debugger.lastCurrentThread = thread;\n return new ToolsThread ((ToolsDebugger) getDebugger (), null, thread);\n }", "@Test\n public void testFutureWithoutDone() throws Exception {\n Callable<String> task = new Callable<String>() {\n public String call() throws Exception {\n // do something that takes some time\n LOG.info(\"Starting to process task\");\n Thread.sleep(5000);\n LOG.info(\"Task is now done\");\n return \"Camel rocks\";\n }\n };\n\n // this is the thread pool we will use\n ExecutorService executor = Executors.newCachedThreadPool();\n\n // now submit the task to the thread pool\n // and get the Future handle back so we can later get the result\n LOG.info(\"Submitting task to ExecutorService\");\n Future<String> future = executor.submit(task);\n LOG.info(\"Task submitted and we got a Future handle\");\n\n // instead of testing when we are done we can just get\n // the result and it will automatic wait until the task is done\n String answer = future.get();\n LOG.info(\"The answer is: \" + answer);\n }", "private Object getTask(Runnable runnable)\r\n {\r\n Object innerTask = \r\n ObservableExecutors.getInnerTask(runnable, Object.class);\r\n if (innerTask != null)\r\n {\r\n return innerTask;\r\n }\r\n return runnable;\r\n }", "public void awaitTermination() throws InterruptedException, ExecutionException {\n executor.awaitTermination(1, TimeUnit.SECONDS);\n if (future != null) {\n future.get();\n }\n }", "public String getThread()\n\t{\n\t\treturn this.thread;\n\t}", "private Thread getThreadFor(Agent ag) {\n return getDataFor(ag).thread;\n }", "public MainThreadExecutor getHandler() {\n return handler;\n }", "public Future<?> stress() throws InterruptedException, ExecutionException {\n if (future != null) {\n future.get();\n }\n return executor.submit(new Callable<Object>() {\n public Object call() throws Exception {\n stressInternal();\n return null;\n }\n });\n }", "public Runnable getRunnable() {\n return runnable;\n }", "public abstract T await();", "public Executor getMainThreadExecutor() {\n return mMainThreadExecutor;\n }", "V m19258a() throws CancellationException, ExecutionException, InterruptedException {\n acquireSharedInterruptibly(-1);\n return getValue();\n }", "private void startRetrieve() {\n final Thread retrieveThread = new Thread(new FutureThread());\n retrieveThread.start();\n }", "@Override\n public void onSuccess() {\n threadExchangeObject.value = true;\n }", "@Override\n public ExecutorService getWrapped() {\n return es;\n }", "public void testThread() {\n ExecutorService executor = Executors.newSingleThreadExecutor();\n // result of the thread\n Future<String> future = null;\n\n future = executor.submit(new TestTask());\n try {\n String result = future.get(2000, TimeUnit.MILLISECONDS);\n System.out.println(result);\n } catch (InterruptedException e) {\n e.printStackTrace();\n } catch (ExecutionException e) {\n e.printStackTrace();\n } catch (TimeoutException e) {\n System.out.println(\"the execution was terminated after 5 s\");\n boolean cancelled = future.cancel(true);\n System.out.println(cancelled);\n\n\n }\n\n try {\n System.out.println(\"attempt to shutdown executor\");\n executor.shutdown();\n executor.awaitTermination(5, TimeUnit.SECONDS);\n }\n catch (InterruptedException e) {\n System.err.println(\"tasks interrupted\");\n }\n finally {\n if (!executor.isTerminated()) {\n System.err.println(\"cancel non-finished tasks\");\n }\n executor.shutdownNow();\n System.out.println(\"shutdown finished\");\n }\n\n }", "default T await() {\n return await(0, TimeUnit.NANOSECONDS);\n }", "public final T getResult() {\n join();\n return self();\n }", "public Class getReadTask(SelectorThread selectorThread);", "ActorThreadPool getThreadPool();", "public Thread execute() {\n shutdown = false;\n Thread serverThread = new Thread( new Runnable() {\n @Override\n public void run() {\n start();\n }\n } );\n\n // start the thread running, calling this server start()\n serverThread.start();\n try {\n Thread.yield();\n Thread.sleep( 200 );\n } catch ( InterruptedException e ) {}\n return serverThread;\n }", "protected void makeThreadObjectFinish() {\n\t\ttry {\n\t\t\tif (syncCommands != null) {\n\t\t\t\tsyncCommands.join();\n\t\t\t}\n\t\t} catch (Exception e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t}", "public ListenableFuture<SendResult> getSendResultFuture() {\n return this.sendResultFuture;\n }", "public Serializable pop() throws InterruptedException {\n Serializable temp = null;\n if(taskQueue.isEmpty()){\n waitForThread();//blocks for taskQueue.\n }\n temp = taskQueue.removeFirst();\n threadLimit++;\n \n return temp;\n }", "public interface ASyncTaskListener {\n public void onThreadFinished(Object result);\n}", "public static void main(String[] args) throws InterruptedException, ExecutionException{\n new Thread(future1).start();\n //Main thread can do own required thing first\n doOwnThing();\n //At the needed time, main thread can get the result\n System.out.println(future1.isDone());\n System.out.println(future1.isCancelled());\n System.out.println(future1.get());\n future1.cancel(false);\n System.out.println(future1.isDone());\n System.out.println(future1.isCancelled());\n \n \n new Thread(future2).start();\n doOwnThing();\n System.out.println(future2.get());\n }", "private static void threadPoolWithSubmit() throws InterruptedException, ExecutionException {\n Executor executor = Executors.newFixedThreadPool(1);\n Callable<String> callable=()->{\n try{\n Thread.sleep(4000);\n System.out.println(\"In callable\");\n Thread.sleep(4000);\n System.out.println(\"In runnable for task id 1\");\n }catch(Exception e){\n e.printStackTrace();\n }\n return \"success\";\n };\n Future<String> future =((ExecutorService) executor).submit(callable);\n System.out.println(\"Future result - \"+future.get()+\" Future is blocking as it blocks until result is obtained\");\n System.out.println(\"End of method \");\n ((ExecutorService) executor).shutdown();\n /*Output\n In callable\n In runnable for task id 1\n Future result - success Future is blocking as it blocks until result is obtained\n End of method\n */\n }", "public Thread getThread(int type, String name, Runnable r);", "public boolean hasFuture();", "Thread getLocker();", "public Object getObject() throws javax.naming.NamingException {\n if (ThreadContext.isValid()) {\n ThreadContext cntx = ThreadContext.getThreadContext();\n byte operation = cntx.getCurrentOperation();\n checkOperation(operation);\n }\n return ref.getObject();\n }", "public static <T> T getResult(IgniteInternalFuture<T> fut) {\n try {\n return fut.get();\n }\n catch (IgniteCheckedException e) {\n throw U.convertException(e);\n }\n }", "@Override\n @SuppressWarnings(\"unchecked\")\n public <T> T getObject() {\n waitFor();\n return (T) response;\n }", "public E peek() {\n try {\n return b(1, (Long) null, (TimeUnit) null);\n } catch (InterruptedException unused) {\n return null;\n }\n }", "static public boolean getCapture() {\n final Future<Boolean> task = ThreadPoolWorkQueue.submit(new Callable<Boolean>() {\n @Override public Boolean call() {\n return getCaptureSync();\n }\n });\n\n try {\n return task.get();\n }\n catch (Exception e) {\n return getCaptureSync();\n }\n }", "public static Executor currentExecutor() {\n return (Executor)Thread.currentThread();\n }", "@Test\n\tpublic void testValueFactoryRequiresMainThreadHeldByOtherInJFFRun() throws Exception {\n\t\tSynchronizationContext ctxt = SingleThreadedSynchronizationContext.create();\n\t\tSynchronizationContext.setSynchronizationContext(ctxt);\n\t\tJoinableFutureContext context = new JoinableFutureContext();\n\t\tJoinableFutureFactory asyncPump = context.getFactory();\n\t\tThread originalThread = Thread.currentThread();\n\n\t\tAsyncManualResetEvent evt = new AsyncManualResetEvent();\n\t\tAsyncLazy<Object> lazy = new AsyncLazy<>(\n\t\t\t() -> {\n\t\t\t\t// It is important that no await appear before this JTF.Run call, since\n\t\t\t\t// we're testing that the value factory is not invoked while the AsyncLazy\n\t\t\t\t// holds a private lock that would deadlock when called from another thread.\n\t\t\t\tasyncPump.run(() -> Async.awaitAsync(asyncPump.switchToMainThreadAsync(getTimeoutToken())));\n\t\t\t\treturn Async.awaitAsync(\n\t\t\t\t\tAsync.yieldAsync(),\n\t\t\t\t\t() -> CompletableFuture.completedFuture(new Object()));\n\t\t\t},\n\t\t\tasyncPump);\n\n\t\tCompletableFuture<?> backgroundRequest = Futures.supplyAsync(() -> Async.awaitAsync(lazy.getValueAsync()));\n\n\t\t// Give the background thread time to call getValueAsync(), but it doesn't yield (when the test was written).\n\t\tThread.sleep(ASYNC_DELAY.toMillis());\n\t\tasyncPump.run(() -> Async.awaitAsync(\n\t\t\tlazy.getValueAsync(getTimeoutToken()),\n\t\t\tforegroundValue -> Async.awaitAsync(\n\t\t\t\tbackgroundRequest,\n\t\t\t\tbackgroundValue -> {\n\t\t\t\t\tAssert.assertSame(foregroundValue, backgroundValue);\n\t\t\t\t\treturn Futures.completedNull();\n\t\t\t\t})));\n\t}", "public Object get() {\r\n Object res;\r\n synchronized (this) {\r\n while (empty) {\r\n try {\r\n wait();\r\n } catch (InterruptedException ex) {\r\n System.err.println(\"Unexpected interrupt\");\r\n }\r\n }\r\n res= data;\r\n empty= true;\r\n notifyAll();\r\n }\r\n return res;\r\n }", "public static ExecutorService m22732e() {\n if (f20304e == null) {\n synchronized (C7258h.class) {\n if (f20304e == null) {\n f20304e = C7268n.m22763a().mo18997a(C7265m.m22758a(ThreadPoolType.BACKGROUND).mo18996a(), true);\n }\n }\n }\n return f20304e;\n }", "@Override\r\n\tpublic Executor getAsyncExecutor() {\n\t\treturn null;\r\n\t}", "public void run()\r\n/* 996: */ {\r\n/* 997:838 */ if (DefaultPromise.this.listeners == null) {\r\n/* 998: */ for (;;)\r\n/* 999: */ {\r\n/* :00:840 */ GenericFutureListener<?> l = (GenericFutureListener)poll();\r\n/* :01:841 */ if (l == null) {\r\n/* :02: */ break;\r\n/* :03: */ }\r\n/* :04:844 */ DefaultPromise.notifyListener0(DefaultPromise.this, l);\r\n/* :05: */ }\r\n/* :06: */ }\r\n/* :07:849 */ DefaultPromise.execute(DefaultPromise.this.executor(), this);\r\n/* :08: */ }", "public static TpuFutureStub newFutureStub(io.grpc.Channel channel) {\n io.grpc.stub.AbstractStub.StubFactory<TpuFutureStub> factory =\n new io.grpc.stub.AbstractStub.StubFactory<TpuFutureStub>() {\n @java.lang.Override\n public TpuFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {\n return new TpuFutureStub(channel, callOptions);\n }\n };\n return TpuFutureStub.newStub(factory, channel);\n }", "long getThreadId();", "public static Task getCurrentTask(Fiber paramFiber)\n/* 194 */ throws Pausable { return null; }" ]
[ "0.624137", "0.6189811", "0.6187546", "0.60478604", "0.5978814", "0.5902827", "0.58403975", "0.5828956", "0.56471926", "0.56202364", "0.56154525", "0.5600971", "0.5593577", "0.5547239", "0.55436987", "0.55127984", "0.5487177", "0.5485607", "0.5483017", "0.5482306", "0.5462621", "0.5432007", "0.53827375", "0.5363068", "0.5348909", "0.53320956", "0.5324995", "0.5319458", "0.5311218", "0.5306468", "0.52915895", "0.5286271", "0.52665", "0.52633303", "0.5243204", "0.5236702", "0.5226653", "0.51897347", "0.5183891", "0.5180559", "0.5174825", "0.5170386", "0.51644355", "0.51312506", "0.5127557", "0.5124147", "0.5109375", "0.51088184", "0.51049185", "0.5103419", "0.50900555", "0.50807065", "0.5078734", "0.50720656", "0.50684696", "0.50638485", "0.50637954", "0.50611633", "0.50561064", "0.50475335", "0.50401324", "0.5038933", "0.5029114", "0.50277746", "0.5019633", "0.50157416", "0.50051403", "0.49954203", "0.4992815", "0.49846", "0.49841926", "0.49790737", "0.49615133", "0.4958539", "0.4954272", "0.49428633", "0.4940472", "0.49267855", "0.49253803", "0.49230486", "0.49117452", "0.49108723", "0.4909359", "0.4908527", "0.4908339", "0.49027133", "0.48937798", "0.48894465", "0.48873404", "0.48817125", "0.4869387", "0.48601022", "0.4847275", "0.48458892", "0.4837393", "0.48351726", "0.4834658", "0.4826171", "0.48157665", "0.48153982" ]
0.5244067
34
Accept header may be needed for some downloads
public static RequestCallback getOctetStreamRequestCallback() { return request -> request.getHeaders() .setAccept(Arrays.asList(MediaType.APPLICATION_OCTET_STREAM, MediaType.ALL)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void mimicSunRequestHeaders() {\n if (!isHeaderSet(method.getRequestHeader(\"Accept\"))) {\n setRequestProperty(\"Accept\", acceptHeader);\n }\n if (!isHeaderSet(method.getRequestHeader(\"Connection\"))) {\n setRequestProperty(\"Connection\", \"keep-alive\");\n }\n }", "public void setAccept(List<MediaType> acceptableMediaTypes)\r\n/* 82: */ {\r\n/* 83:139 */ set(\"Accept\", MediaType.toString(acceptableMediaTypes));\r\n/* 84: */ }", "default String getContentType() {\n return \"application/octet-stream\";\n }", "public List<MediaType> getAccept()\r\n/* 87: */ {\r\n/* 88:148 */ String value = getFirst(\"Accept\");\r\n/* 89:149 */ return value != null ? MediaType.parseMediaTypes(value) : Collections.emptyList();\r\n/* 90: */ }", "public final String getAcceptContentType() {\n return properties.get(ACCEPT_CONTENT_TYPE_PROPERTY);\n }", "@Override\n protected com.squareup.okhttp.Request.Builder universal_header(com.squareup.okhttp.Request.Builder chain) {\n chain.addHeader(\"Accept\", \"*/*\");\n chain.addHeader(\"Accept-Language\", \"zh-TW,zh;q=0.8,en-US;q=0.6,en;q=0.4,zh-CN;q=0.2\");\n chain.addHeader(\"Content-Type\", \"text/html; charset=utf-8\");\n chain.addHeader(\"User-Agent\", \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.111 Safari/537.36\");\n return super.universal_header(chain);\n }", "private static void setContentTypeHeader(HttpResponse response, File file) {\n\t\tresponse.headers().set(HttpHeaderNames.CONTENT_TYPE, HttpHeaderValues.APPLICATION_OCTET_STREAM);\r\n\t}", "public int accept(HttpResponseProlog prolog, HttpHeaders headers);", "public String getAcceptEncodingHeaderValue() {\n return acceptEncodingHeaderValue;\n }", "public void setAcceptHeader(AcceptHeader header)\n\t{\n\t\tif (header == null)\n\t\t\treturn;\n\t\t\n\t\tString headerName = header.getName();\n\t\tString lowerName = headerName.toLowerCase();\n\t\t\n\t\tthis.acceptHeaders.put(lowerName, header);\n\t\tsetHeader(headerName, header.parseHeaderValue());\n\t}", "@Override\n public boolean accepts(HttpResponse response) {\n Header[] headers = response.getHeaders(HttpHeaders.CONTENT_TYPE);\n for (Header header : headers) {\n if (header != null && header.getValue().contains(NTLMConstants.CONTENT_TYPE_FOR_SPNEGO)) {\n return true;\n }\n }\n return false;\n }", "protected abstract MediaType getSupportedMediaType();", "@Override\n\tprotected ResponseEntity<Object> handleHttpMediaTypeNotAcceptable(\n\t\t\tHttpMediaTypeNotAcceptableException ex, HttpHeaders headers,\n\t\t\tHttpStatus status, WebRequest request) {\n\t\tMediaType mediaType= MediaType.parseMediaType(request.getHeader(\"accept\"));\n\t\tHttpMediaTypeNotSupportedException exa = new HttpMediaTypeNotSupportedException(mediaType, ex.getSupportedMediaTypes());\n\t\theaders.setAccept(ex.getSupportedMediaTypes());\n\t\tResponseError body= createResponseError(exa, HttpStatus.UNSUPPORTED_MEDIA_TYPE,HttpStatus.UNSUPPORTED_MEDIA_TYPE.toString(), \"ERROR_BUSINESS_EXCEPTION\");\n\t\treturn handleExceptionInternal(exa,body, headers, HttpStatus.UNSUPPORTED_MEDIA_TYPE, request);\n\t}", "public Response get(Cluster cluster, String path, String accept)\n throws IOException {\n Header[] headers = new Header[1];\n headers[0] = new Header(\"Accept\", accept);\n return get(cluster, path, headers);\n }", "Response serveFile(String uri, Map<String, String> header, File file, String mime) {\n\t\t\tResponse res;\n\t\t\ttry {\n\t\t\t\t// Calculate etag\n\t\t\t\tString etag = Integer.toHexString((file.getAbsolutePath() + file.lastModified()\n\t\t\t\t\t\t+ \"\" + file.length()).hashCode());\n\n\t\t\t\t// Support (simple) skipping:\n\t\t\t\tlong startFrom = 0;\n\t\t\t\tlong endAt = -1;\n\t\t\t\tString range = header.get(\"range\");\n\t\t\t\tif (range != null) {\n\t\t\t\t\tif (range.startsWith(\"bytes=\")) {\n\t\t\t\t\t\trange = range.substring(\"bytes=\".length());\n\t\t\t\t\t\tint minus = range.indexOf('-');\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tif (minus > 0) {\n\t\t\t\t\t\t\t\tstartFrom = Long.parseLong(range.substring(0, minus));\n\t\t\t\t\t\t\t\tendAt = Long.parseLong(range.substring(minus + 1));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (NumberFormatException ignored) {\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// get if-range header. If present, it must match etag or else\n\t\t\t\t// we\n\t\t\t\t// should ignore the range request\n\t\t\t\tString ifRange = header.get(\"if-range\");\n\t\t\t\tboolean headerIfRangeMissingOrMatching = (ifRange == null || etag.equals(ifRange));\n\n\t\t\t\tString ifNoneMatch = header.get(\"if-none-match\");\n\t\t\t\tboolean headerIfNoneMatchPresentAndMatching = ifNoneMatch != null\n\t\t\t\t\t\t&& (\"*\".equals(ifNoneMatch) || ifNoneMatch.equals(etag));\n\n\t\t\t\t// Change return code and add Content-Range header when skipping\n\t\t\t\t// is\n\t\t\t\t// requested\n\t\t\t\tlong fileLen = file.length();\n\n\t\t\t\tif (headerIfRangeMissingOrMatching && range != null && startFrom >= 0\n\t\t\t\t\t\t&& startFrom < fileLen) {\n\t\t\t\t\t// range request that matches current etag\n\t\t\t\t\t// and the startFrom of the range is satisfiable\n\t\t\t\t\tif (headerIfNoneMatchPresentAndMatching) {\n\t\t\t\t\t\t// range request that matches current etag\n\t\t\t\t\t\t// and the startFrom of the range is satisfiable\n\t\t\t\t\t\t// would return range from file\n\t\t\t\t\t\t// respond with not-modified\n\t\t\t\t\t\tres = newFixedLengthResponse(Response.Status.NOT_MODIFIED, mime, \"\");\n\t\t\t\t\t\tres.addHeader(\"ETag\", etag);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (endAt < 0) {\n\t\t\t\t\t\t\tendAt = fileLen - 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlong newLen = endAt - startFrom + 1;\n\t\t\t\t\t\tif (newLen < 0) {\n\t\t\t\t\t\t\tnewLen = 0;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tFileInputStream fis = new FileInputStream(file);\n\t\t\t\t\t\tfis.skip(startFrom);\n\n\t\t\t\t\t\tres = newFixedLengthResponse(Response.Status.PARTIAL_CONTENT, mime, fis,\n\t\t\t\t\t\t\t\tnewLen);\n\t\t\t\t\t\tres.addHeader(\"Accept-Ranges\", \"bytes\");\n\t\t\t\t\t\tres.addHeader(\"Content-Length\", \"\" + newLen);\n\t\t\t\t\t\tres.addHeader(\"Content-Range\", \"bytes \" + startFrom + \"-\" + endAt + \"/\"\n\t\t\t\t\t\t\t\t+ fileLen);\n\t\t\t\t\t\tres.addHeader(\"ETag\", etag);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\n\t\t\t\t\tif (headerIfRangeMissingOrMatching && range != null && startFrom >= fileLen) {\n\t\t\t\t\t\t// return the size of the file\n\t\t\t\t\t\t// 4xx responses are not trumped by if-none-match\n\t\t\t\t\t\tres = newFixedLengthResponse(Response.Status.RANGE_NOT_SATISFIABLE,\n\t\t\t\t\t\t\t\tNanoHTTPDSingleFile.MIME_PLAINTEXT, \"\");\n\t\t\t\t\t\tres.addHeader(\"Content-Range\", \"bytes */\" + fileLen);\n\t\t\t\t\t\tres.addHeader(\"ETag\", etag);\n\t\t\t\t\t} else if (range == null && headerIfNoneMatchPresentAndMatching) {\n\t\t\t\t\t\t// full-file-fetch request\n\t\t\t\t\t\t// would return entire file\n\t\t\t\t\t\t// respond with not-modified\n\t\t\t\t\t\tres = newFixedLengthResponse(Response.Status.NOT_MODIFIED, mime, \"\");\n\t\t\t\t\t\tres.addHeader(\"ETag\", etag);\n\t\t\t\t\t} else if (!headerIfRangeMissingOrMatching\n\t\t\t\t\t\t\t&& headerIfNoneMatchPresentAndMatching) {\n\t\t\t\t\t\t// range request that doesn't match current etag\n\t\t\t\t\t\t// would return entire (different) file\n\t\t\t\t\t\t// respond with not-modified\n\n\t\t\t\t\t\tres = newFixedLengthResponse(Response.Status.NOT_MODIFIED, mime, \"\");\n\t\t\t\t\t\tres.addHeader(\"ETag\", etag);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// supply the file\n\t\t\t\t\t\tres = newFixedFileResponse(file, mime);\n\t\t\t\t\t\tres.addHeader(\"Content-Length\", \"\" + fileLen);\n\t\t\t\t\t\tres.addHeader(\"ETag\", etag);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (IOException ioe) {\n\t\t\t\tres = getForbiddenResponse(\"Reading file failed.\");\n\t\t\t}\n\n\t\t\treturn res;\n\t\t}", "MimeType mediaType();", "private void setContentType(HttpServletResponse response, Format format) {\r\n switch (format) {\r\n case html:\r\n case htmlfragment:\r\n response.setContentType(\"text/html;charset=UTF-8\");\r\n break;\r\n case kml:\r\n response.setContentType(\"application/vnd.google-earth.kml+xml;charset=UTF-8\");\r\n response.setHeader(\"Content-Disposition\",\"attachment; filename=\\\"document.kml\\\"\");\r\n break;\r\n case json:\r\n response.setContentType(\"application/json;charset=UTF-8\");\r\n response.setHeader(\"Content-disposition\", \"attachment; filename=\\\"document.json\\\"\");\r\n break;\r\n case pjson:\r\n\t response.setContentType(\"text/plain;charset=UTF-8\");\r\n\t break; \r\n default:\r\n case xml:\r\n response.setContentType(\"text/xml;charset=UTF-8\");\r\n break;\r\n }\r\n}", "public final GetHTTP removeAcceptContentType() {\n properties.remove(ACCEPT_CONTENT_TYPE_PROPERTY);\n return this;\n }", "private Map<String, String> getDefaultAdditionalHeader() {\n Map<String, String> additionalHeader = new HashMap<>();\n additionalHeader.put(\"accept-encoding \", \"gzip, deflate, sdch\");\n additionalHeader.put(\"Referer\", referer);\n additionalHeader.put(\"Upgrade-Insecure-Requests\", \"1\");\n return additionalHeader;\n }", "@Override\n public boolean isDownloadable() {\n return true;\n }", "public static boolean useJsonResponse(HttpServletRequest request) {\n String acceptHeaderValue = request.getHeader(\"Accept\");\n if (acceptHeaderValue == null) {\n return false;\n }\n HttpHeaders httpHeaders = new HttpHeaders();\n httpHeaders.add(HttpHeaders.ACCEPT, acceptHeaderValue);\n List<MediaType> acceptedMediaTypes = httpHeaders.getAccept();\n boolean acceptsHtml = acceptedMediaTypes.contains(MediaType.TEXT_HTML);\n boolean acceptsJson = acceptedMediaTypes.contains(MediaType.APPLICATION_JSON);\n if (acceptsJson && (!acceptsHtml)) {\n return true;\n } else {\n return false;\n }\n }", "@HEAD\n @Produces({TURTLE_WITH_CHARSET + \";qs=1.0\", JSON_LD + \";qs=0.8\",\n N3_WITH_CHARSET, N3_ALT2_WITH_CHARSET, RDF_XML, NTRIPLES, TEXT_PLAIN_WITH_CHARSET,\n TEXT_HTML_WITH_CHARSET, \"*/*\"})\n public Response head(@DefaultValue(\"false\") @QueryParam(\"inline\") final boolean inlineDisposition)\n throws UnsupportedAlgorithmException {\n LOGGER.info(\"HEAD for: {}\", externalPath);\n\n final String datetimeHeader = headers.getHeaderString(ACCEPT_DATETIME);\n if (!isBlank(datetimeHeader) && resource().isOriginalResource()) {\n return getMemento(datetimeHeader, resource(), inlineDisposition);\n }\n\n final ImmutableList<MediaType> acceptableMediaTypes = ImmutableList.copyOf(headers\n .getAcceptableMediaTypes());\n\n checkCacheControlHeaders(request, servletResponse, resource(), transaction());\n\n addResourceHttpHeaders(resource(), inlineDisposition);\n\n Response.ResponseBuilder builder = ok();\n\n if (resource() instanceof Binary) {\n final Binary binary = (Binary) resource();\n final MediaType mediaType = getBinaryResourceMediaType(binary);\n\n if (!acceptableMediaTypes.isEmpty()) {\n if (acceptableMediaTypes.stream().noneMatch(t -> t.isCompatible(mediaType))) {\n return notAcceptable(VariantListBuilder.newInstance().mediaTypes(mediaType).build()).build();\n }\n }\n\n if (binary.isRedirect()) {\n builder = temporaryRedirect(binary.getExternalURI());\n }\n\n // we set the content-type explicitly to avoid content-negotiation from getting in the way\n builder.type(mediaType.toString());\n\n // Respect the Want-Digest header with fixity check\n final String wantDigest = headers.getHeaderString(WANT_DIGEST);\n if (!isNullOrEmpty(wantDigest)) {\n builder.header(DIGEST, handleWantDigestHeader(binary, wantDigest));\n }\n } else {\n if (!acceptableMediaTypes.isEmpty() && NOT_WILDCARD.test(acceptableMediaTypes)) {\n // Accept header is not empty and is not */*\n if (!IS_RDF_TYPE.test(acceptableMediaTypes)) {\n return notAcceptable(VariantListBuilder.newInstance().mediaTypes().build()).build();\n }\n } else if (acceptableMediaTypes.isEmpty() || !NOT_WILDCARD.test(acceptableMediaTypes)) {\n // If there is no Accept header or it is */*, so default to text/turtle\n builder.type(TURTLE_WITH_CHARSET);\n }\n setVaryAndPreferenceAppliedHeaders(servletResponse, prefer, resource());\n }\n\n\n return builder.build();\n }", "@SuppressWarnings(\"deprecation\")\r\n @Override\r\n public AvailableStatus requestFileInformation(final DownloadLink link) throws IOException, PluginException {\r\n br = new Browser();\r\n // need to correct links that are added prior to fixing!\r\n correctDownloadLink(link);\r\n prepBrowser(br);\r\n br.setFollowRedirects(true);\r\n final URLConnectionAdapter con = br.openGetConnection(link.getDownloadURL());\r\n if (con.getResponseCode() == 503 || con.getResponseCode() == 404) {\r\n con.disconnect();\r\n throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);\r\n }\r\n br.followConnection();\r\n if (br.containsHTML(\"<title>\\\\s*-\\\\s*(?:Yunfile|Dix3)[^<]*</title>\")) {\r\n throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);\r\n }\r\n // Access denied\r\n if (br.containsHTML(\"Access denied<|资源已被禁止访问</span>\")) {\r\n throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);\r\n }\r\n // Not found\r\n if (br.containsHTML(\"<span>(资源未找到|Not found)</span>\")) {\r\n throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);\r\n }\r\n /* Wrong link */\r\n if (br.containsHTML(\">Wrong</span>\")) {\r\n throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);\r\n }\r\n String filename = null, filesize = null;\r\n // if (br.getURL().matches(\"http://page\\\\d+\\\\.yunfile.com/fs/[a-z0-9]+/\")) ;\r\n filename = br.getRegex(\"Downloading:&nbsp;<a></a>&nbsp;([^<>]*) - [^<>]+<\").getMatch(0);\r\n if (filename == null) {\r\n filename = br.getRegex(\"<title>(.*?)\\\\s*-\\\\s*(?:Yunfile|Dix3)[^<]*</title>\").getMatch(0);\r\n }\r\n if (filename == null) {\r\n filename = br.getRegex(\"<h2 class=\\\"title\\\">文件下载\\\\&nbsp;\\\\&nbsp;([^<>\\\"]*?)</h2>\").getMatch(0);\r\n }\r\n filesize = br.getRegex(\"文件大小: <b>([^<>\\\"]*?)</b>\").getMatch(0);\r\n if (filesize == null) {\r\n filesize = br.getRegex(\"File Size: <b>([^<>\\\"]*?)</b>\").getMatch(0);\r\n }\r\n if (filesize == null) {\r\n filesize = br.getRegex(\"id=\\\"file_show_filename\\\">[^<>]+</span> \\\\- ([^<>\\\"]+) <\").getMatch(0);\r\n }\r\n if (filename == null) {\r\n throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);\r\n }\r\n link.setName(decode(\"111\", filename.trim()));\r\n link.setDownloadSize(SizeFormatter.getSize(filesize));\r\n return AvailableStatus.TRUE;\r\n }", "@Test(priority=5)\r\n\tpublic void validateHeader()\r\n\t{\r\n\t\tgiven()\r\n\t\t.get(\"https://reqres.in/api/users/2\")\r\n\t\t.then() \r\n\t \t.header(\"Content-Type\", containsString(\"application/json\")); \r\n\t\t//application/json; charset=utf-8 \r\n\t}", "public void setAccept(boolean accept) {\n this.accept = accept;\n }", "public final GetHTTP setAcceptContentType(final String acceptContentType) {\n properties.put(ACCEPT_CONTENT_TYPE_PROPERTY, acceptContentType);\n return this;\n }", "Set<HttpMethod> optionsForAllow(URI url) throws RestClientException;", "public final String getAcceptAttribute() {\n return getAttributeValue(\"accept\");\n }", "private void setContentIfRequired(UniSaveRequest.Entries uniSaveRequest, String acceptHeader) {\n if (acceptHeader.equals(FASTA_MEDIA_TYPE_VALUE)\n || acceptHeader.equals(FF_MEDIA_TYPE_VALUE)) {\n uniSaveRequest.setIncludeContent(true);\n }\n }", "public interface HttpMimeType {\n\n\t// Image\n \n public static final String APNG_IMAGE = \"image/apng\";\n \n public static final String BMP_IMAGE = \"image/bmp\";\n\n\tpublic static final String GIF_IMAGE = \"image/gif\";\n\t\n\tpublic static final String ICO_IMAGE = \"image/ico\";\n\n\tpublic static final String JPEG_IMAGE = \"image/jpeg\";\n\n\tpublic static final String JPG_IMAGE = \"image/jpg\";\n\n public static final String PNG_IMAGE = \"image/png\";\n\n\tpublic static final String SVG_IMAGE = \"image/svg+xml\";\n\n\tpublic static final String TIFF_IMAGE = \"image/tiff\";\n\t\n\tpublic static final String WEBP_IMAGE = \"image/webp\";\n\n\t// text formats\n\n\tpublic static final String TEXT_PLAIN = \"text/plain\";\n\n\tpublic static final String CSV = \"text/csv\";\n\n\tpublic static final String CSS = \"text/css\";\n\n\tpublic static final String HTML = \"text/html\";\n\n\tpublic static final String JAVASCRIPT = \"text/javascript\";\n\n\tpublic static final String RTF = \"text/rtf\";\n\n\tpublic static final String XML = \"text/xml\";\n\n\t// document formats\n\n\tpublic static final String JSON = \"application/json\";\n\n\tpublic static final String ATOM = \"application/atom+xml\";\n\n\tpublic static final String PDF = \"application/pdf\";\n\n\tpublic static final String POSTSCRIPT = \"application/postscript\";\n\n\tpublic static final String XLS = \"application/vnd.ms-excel\";\n\n\tpublic static final String XLSX = \"application/vnd.ms-excel\";\n\n\tpublic static final String PPT = \"application/vnd.ms-powerpoint\";\n\n\tpublic static final String PPTX = \"application/vnd.ms-powerpoint\";\n\n\tpublic static final String XPS = \"application/vnd.ms-xpsdocument\";\n\n\t// binary\n\n\tpublic static final String BINARY = \"application/octet-stream\";\n\n\t// music ones\n\n\tpublic static final String MP4_AUDIO = \"audio/mp4\";\n\n\tpublic static final String MP3_AUDIO = \"audio/mpeg\";\n\n\tpublic static final String OGG_VORBIS_AUDIO = \"audio/ogg\";\n\n\tpublic static final String OPUS_AUDIO = \"audio/opus\";\n\n\tpublic static final String VORBIS_AUDIO = \"audio/vorbis\";\n\n\tpublic static final String WEBM_AUDIO = \"audio/webm\";\n\n\t// video\n\n\tpublic static final String MPEG_VIDEO = \"video/mpeg\";\n\n\tpublic static final String MP4_VIDEO = \"video/mp4\";\n\n\tpublic static final String OGG_THEORA_VIDEO = \"video/ogg\";\n\n\tpublic static final String QUICKTIME_VIDEO = \"video/quicktime\";\n\n\tpublic static final String WEBM_VIDEO = \"video/webm\";\n\n\t// feeds\n\n\tpublic static final String RDF = \"application/rdf+xml\";\n\n\tpublic static final String RSS = \"application/rss+xml\";\n\n}", "private void validatePreferHeader(ODataRequest request) throws ODataHandlerException {\n List<String> returnPreference = request.getHeaders(PREFER);\n if (null != returnPreference) {\n for (String preference : returnPreference) {\n if (preference.equals(RETURN_MINIMAL) || preference.equals(RETURN_REPRESENTATION)) {\n throw new ODataHandlerException(\"Prefer Header not supported: \" + preference,\n ODataHandlerException.MessageKeys.INVALID_PREFER_HEADER, preference);\n } \n }\n }\n }", "String getContentDisposition();", "@Override\n public boolean accept(String link) {\n \n URL url;\n URLConnection connection;\n String type;\n boolean ret;\n\n ret = false;\n try {\n url = new URL (link);\n connection = url.openConnection ();\n type = connection.getContentType ();\n if (type == null)\n ret = false;\n else\n ret = type.startsWith (\"text/html\");\n }catch (IOException e) {\n// XLogger.getInstance().log(Level.WARNING, \"{0}. {1}\", this.getClass(), e, link);\n }\n \n return (ret);\n }", "public interface HttpRequest {\n // MIME types\n public static final String JNLP_MIME_TYPE = \"application/x-java-jnlp-file\";\n public static final String ERROR_MIME_TYPE = \"application/x-java-jnlp-error\";\n public static final String JAR_MIME_TYPE = \"application/x-java-archive\";\n public static final String JARDIFF_MIME_TYPE = \"application/x-java-archive-diff\";\n public static final String GIF_MIME_TYPE = \"image/gif\";\n public static final String JPEG_MIME_TYPE = \"image/jpeg\";\n \n // Low-level interface\n HttpResponse doHeadRequest(URL url) throws IOException;\n HttpResponse doGetRequest (URL url) throws IOException;\n \n HttpResponse doHeadRequest(URL url, String[] headerKeys, String[] headerValues) throws IOException;\n HttpResponse doGetRequest (URL url, String[] headerKeys, String[] headerValues) throws IOException;\n}", "@Override\n public boolean startContent(int statusCode, Compression compression) {\n return true;\n }", "private static void initializeResponse(String contentType, String header){\r\n\t\t // Initialize response.\r\n\t response.reset(); // Some JSF component library or some Filter might have set some headers in the buffer beforehand. We want to get rid of them, else it may collide.\r\n\t response.setContentType(contentType); // Check http://www.iana.org/assignments/media-types for all types. Use if necessary ServletContext#getMimeType() for auto-detection based on filename.\r\n\t response.setHeader(\"Content-disposition\", header); // The Save As popup magic is done here. You can give it any filename you want, this only won't work in MSIE, it will use current request URL as filename instead.\r\n\r\n\t}", "@Override\n\tprotected void doOptions(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doOptions(req, resp);\n\t\tH5Utils.setHeaders(resp);\n\t}", "@Override\n\tprotected void doOptions(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doOptions(req, resp);\n\t\tH5Utils.setHeaders(resp);\n\t}", "@Override\r\n\tprotected ResponseEntity<Object> handleHttpMediaTypeNotSupported(HttpMediaTypeNotSupportedException ex,\r\n\t\t\tHttpHeaders headers, HttpStatus status, WebRequest request) {\n\t\treturn super.handleHttpMediaTypeNotSupported(ex, headers, status, request);\r\n\t}", "@Override\n public void intercept(RequestInterceptor.RequestFacade request) {\n request.addHeader(\"Accept\", \"application/json\");\n }", "public void setContentType(Header contentType) {\n/* 114 */ this.contentType = contentType;\n/* */ }", "File downloadExtension(DownloadExtensionRequest request);", "@SuppressWarnings(\"deprecation\")\r\n @Override\r\n public AvailableStatus requestFileInformation(final DownloadLink link) throws IOException, PluginException {\r\n this.setBrowserExclusive();\r\n br.setFollowRedirects(true);\r\n br.getPage(link.getDownloadURL().replace(\"http://\", \"https://\"));\r\n if (br.getHttpConnection().getResponseCode() == 404) {\r\n throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);\r\n }\r\n String filename = br.getRegex(\"property\\\\s*=\\\\s*\\\\'og:title\\\\'.*?content\\\\s*=\\\\s*\\\"([^<>\\\"]*?)\\\"\").getMatch(0);\r\n if (filename == null) {\r\n /* Fallback */\r\n filename = new Regex(link.getPluginPatternMatcher(), \"([^/]+)$\").getMatch(0);\r\n }\r\n final String uploadDate = br.getRegex(\"itemprop='uploadDate'>(\\\\d{4}-\\\\d{2}-\\\\d{2})\").getMatch(0);\r\n filename = Encoding.htmlDecode(filename.trim());\r\n if (uploadDate != null) {\r\n filename = uploadDate + \"_\" + filename;\r\n }\r\n link.setFinalFileName(filename + \".mp4\");\r\n return AvailableStatus.TRUE;\r\n }", "RequestHeaders headers();", "public void setContentTypeHeader(HttpResponse response, String filename) {\r\n //determine filetype by checking filename ending (filetype\r\n String[] splitarray = filename.split(\"\\\\.\");\r\n String filetype = splitarray[splitarray.length-1];\r\n //hardcoded types for all used files, if needed add other filetypes here\r\n switch (filetype) {\r\n case \"js\":\r\n response.headers().set(HttpHeaders.Names.CONTENT_TYPE, \"application/javascript\");\r\n break;\r\n case \"css\":\r\n response.headers().set(HttpHeaders.Names.CONTENT_TYPE, \"text/css\");\r\n break;\r\n case \"ico\":\r\n response.headers().set(HttpHeaders.Names.CONTENT_TYPE, \"image/x-icon\");\r\n break;\r\n default:\r\n response.headers().set(HttpHeaders.Names.CONTENT_TYPE, \"text/html\");\r\n break;\r\n }\r\n }", "private static void addGzipHeader(Request request, Response response) {\n response.header(\"Content-Encoding\", \"gzip\");\n }", "public boolean getSupportsDownloads() \n {\n return true; \n }", "@RequestMapping(value = \"**\", method = {RequestMethod.GET})\r\n public ResponseEntity<?> getFileResponse(HttpServletRequest request, @RequestHeader HttpHeaders headers)\r\n throws WapException {\r\n return super.getFileResponse(request, headers);\r\n }", "protected static HttpHeaders getJsonHeaders(){ \n HttpHeaders headers = new HttpHeaders();\n headers.setAccept(Arrays.asList(MediaType.APPLICATION_JSON));\n headers.setContentType(MediaType.APPLICATION_JSON);\n return headers;\n }", "boolean supportsAccepts();", "@Override\n protected ResponseEntity<Object> handleHttpMediaTypeNotSupported(\n HttpMediaTypeNotSupportedException ex,\n HttpHeaders headers,\n HttpStatus status,\n WebRequest request) {\n\n LOGGER.info(\"handleHttpMediaTypeNotSupported\");\n return new ResponseEntity<>(new ErrorDto(\"handleHttpMediaTypeNotSupported\"), HttpStatus.UNSUPPORTED_MEDIA_TYPE);\n }", "public String getAccept() {\n return accept;\n }", "public static String getCompression(HttpServletRequest req) {\n String encoding = req.getHeader(HttpHeaders.ACCEPT_ENCODING);\n if (null != encoding) {\n if (BaseFileServlet.GZIP_PATTERN.matcher(encoding).find()) {\n return \"gzip\";\n //} else if (BR_PATTERN.matcher(encoding).find()) {\n // return \"br\";\n }\n }\n return \"none\";\n }", "@Override\n public void onClick(DialogInterface dialog, int which)\n {\n DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url));\n //cookie\n String cookie= CookieManager.getInstance().getCookie(url);\n //Add cookie and User-Agent to request\n request.addRequestHeader(\"Cookie\",cookie);\n request.addRequestHeader(\"User-Agent\",userAgent);\n\n //file scanned by MediaScannar\n request.allowScanningByMediaScanner();\n //Download is visible and its progress, after completion too.\n request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);\n //DownloadManager created\n DownloadManager downloadManager= (DownloadManager) getContext().getSystemService(Context.DOWNLOAD_SERVICE);\n //Saving file in Download folder\n request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, filename);\n //download enqued\n downloadManager.enqueue(request);\n }", "public boolean isSupported(MediaType mediaType);", "public void setContentEncoding(Header contentEncoding) {\n/* 143 */ this.contentEncoding = contentEncoding;\n/* */ }", "@Override \r\n public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimetype, \r\n\t long contentLength) {\n \tString filename = SDHelper.getAppDataPath() + File.separator \r\n\t\t\t\t\t+ getFilename(url);\r\n \tFile file =new File(filename);\r\n \tif (file.exists()) {\r\n\t\t\t\tIntent intent = new Intent(Intent.ACTION_VIEW);\r\n\t\t\t\tintent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\r\n\t\t\t\tString ext = getExt(file);\r\n\t\t\t\tString mark = null;\r\n\t\t\t if (ext.equalsIgnoreCase(\"doc\")||ext.equalsIgnoreCase(\"docx\"))\r\n\t\t\t\t\tmark = \"application/msword\";\r\n\t\t\t\telse if (ext.equalsIgnoreCase(\"xls\")||ext.equalsIgnoreCase(\"xlsx\"))\r\n\t\t\t\t\tmark = \"application/vnd.ms-excel\";\r\n\t\t\t\telse if (ext.equalsIgnoreCase(\"ppt\")||ext.equalsIgnoreCase(\"pptx\"))\r\n\t\t\t\t\tmark = \"application/vnd.ms-powerpoint\";\r\n\t\t\t\telse if (ext.equalsIgnoreCase(\"pdf\"))\r\n\t\t\t\t\tmark = \"application/pdf\";\r\n\t\t\t\t\r\n\t\t\t\telse if (ext.equalsIgnoreCase(\"apk\"))\r\n\t\t\t\t\tmark = \t\"application/vnd.android.package-archive\"; \r\n\t\t\t\tintent.setDataAndType(Uri.fromFile(file), mark);\r\n\t\t\t\tmContext.startActivity(intent);\r\n\r\n \t}\r\n \telse \r\n \t new getFileAsync().execute(url);\r\n \t\r\n \t}", "@Override\r\n\tpublic void download() {\n\t\t\r\n\t}", "@Test\n public void sending_request_headers() {\n given()\n .baseUri(\"http://data.fixer.io/api\")\n .queryParam(\"access_key\", \"b406c5d0bd55d77d592af69a930f4feb\")\n .queryParam(\"Symbols\", \"USD\")\n .header(\"If-None-Match\", \"03a4545f530000f3491fbca200000001\")\n .header(\"If-Modified-Since\", \"Tue, 30 Jun 2020 01:01:25 GMT\").\n when()\n .get(\"/latest\").\n then()\n .log().all()\n .statusCode(200);\n }", "@Override\n public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimetype,\n long contentLength) {\n }", "public interface CompressedResource {\r\n\t\r\n\t/**\r\n\t * Return the supported encoding from the list of allowable encodings from the user agent\r\n\t * \r\n\t * If none are supported return null.\r\n\t * \r\n\t * @param acceptableEncodings\r\n\t * @return - null if none of the given encodings are supported, otherwise the content encoding header value to be used\r\n\t */\r\n\tString getSupportedEncoding(String acceptableEncodings);\r\n\t\r\n\t/**\r\n\t * \r\n\t * @param contentEncoding - the supported encoding returned from getSupportedEncoding\r\n\t * @param out\r\n\t * @param range\r\n\t * @param params\r\n\t * @param contentType\r\n\t * @throws IOException\r\n\t * @throws NotAuthorizedException\r\n\t * @throws BadRequestException\r\n\t * @throws NotFoundException \r\n\t */\r\n\tvoid sendCompressedContent( String contentEncoding, OutputStream out, Range range, Map<String,String> params, String contentType ) throws IOException, NotAuthorizedException, BadRequestException, NotFoundException;\r\n\t\r\n\t/**\r\n\t * Return the content length, if known, for the given encoding. Otherwise \r\n\t * return null\r\n\t * \r\n\t * @param contentEncoding\r\n\t * @return - null, or the length of the content encoded with the given encoding\r\n\t */\r\n\tLong getCompressedContentLength(String contentEncoding);\r\n}", "public void doHead() throws IOException {\n\n // search ressource\n\n byte[] contentByte = null;\n try {\n contentByte = ToolBox.readFileByte(RESOURCE_DIRECTORY, this.url);\n this.statusCode = OK;\n ContentType contentType = new ContentType(this.extension);\n sendHeader(statusCode, contentType.getContentType(), contentByte.length);\n } catch (IOException e) {\n System.out.println(\"Ressource non trouvé\");\n statusCode = NOT_FOUND;\n contentByte = ToolBox.readFileByte(RESPONSE_PAGE_DIRECTORY, \"pageNotFound.html\");\n sendHeader(statusCode, \"text/html\", contentByte.length);\n }\n\n }", "private Set<Protocol> discoverSupportedProtocols() throws IOException {\n HttpHead head = new HttpHead(uri);\n head.addHeader(HttpHeaders.ACCEPT, \"text/xml, application/x-frpc\");\n HttpResponse response = httpClient.execute(head);\n // get all \"Accept\" header values as Set of strings\n Set<String> acceptHeaderValues = Arrays.stream(response.getHeaders(HttpHeaders.ACCEPT))\n .map(Header::getElements).flatMap(Arrays::stream).map(HeaderElement::getName)\n .collect(Collectors.toSet());\n // check if they contain \"application/x-frpc\" or \"text/xml\" or both\n Set<Protocol> result = EnumSet.noneOf(Protocol.class);\n if (acceptHeaderValues.contains(Protocol.FRPC.getContentType())) {\n result.add(Protocol.FRPC);\n }\n if (acceptHeaderValues.contains(Protocol.XML_RPC.getContentType())) {\n result.add(Protocol.XML_RPC);\n }\n // return the result as set of protocols supported by the server\n return result;\n }", "private void downFile(HttpServletRequest req, HttpServletResponse res, String file_path ,String file_id, String file_name) throws Exception{\n\t\tSystem.out.println(file_path);\n\t\tSystem.out.println(file_id);\n\t\tSystem.out.println(file_name);\n\t\tFile file = null;\n\t\tBufferedInputStream fin = null;\n\t\tBufferedOutputStream outs = null;\n\ttry {\n\n\t\tfile = new File(file_path + \"\\\\\" + file_id);\n\t // ���� ����\n\t int filelength = (int) file.length();\n\t byte[] bytestream = new byte[2048];\n\t int read = 0;\n\t \n\t if(!file.exists()){\n\t \tthrow new Exception(\"mis.file.noexist\");\n\t }\n\t\t\n\t fin = new BufferedInputStream(new FileInputStream(file));\n\t outs = new BufferedOutputStream(res.getOutputStream());\n\t \n\t\n\t\tString clientHead = req.getHeader(\"User-Agent\");\n\t\t\n\t\tres.setContentLength(filelength);\n\t\tif (clientHead.indexOf(\"MSIE 5.5\") > -1)\n\t\t{\t\t\t\n\t\t\tres.setContentType(\"application/x-filler; charset=EUC-KR\");\n\t\t\tres.setHeader(\"Content-Type\", \"doesn/matter;\");\n\t\t\tres.setHeader(\"Content-Disposition\", \"filename=\\\"\" + file_name + \"\\\";\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tres.setHeader(\"Content-Type\", \"application/octet-stream;\");\n\t\t\tres.setHeader(\"Content-Disposition\", \"attachment;filename=\\\"\" + file_name + \"\\\";\");\n\t\t}\n\t\tres.setHeader (\"Content-Length\", \"\" + filelength);\n\t\n\t //try {\n\t\tif(filelength>0) {\n\t\t\twhile ((read = fin.read(bytestream)) != -1) {\n\t\t\t\touts.write(bytestream, 0, read);\n\t\t\t}\n\t\t}\n\t \n\t //close\n\t outs.close();\n\t fin.close();\n\t} catch (Exception e) {\n\t\t\n\t} finally {\n\t\tif(outs != null) { try { outs.close(); } catch(Exception e) {} }\n\t\tif(fin != null) { try { fin.close(); } catch(Exception e) {} }\n\t}\n}", "public void process(HttpRequest request, HttpContext context) {\n\t\t\t\tif (!request.containsHeader(HEADER_ACCEPT_ENCODING)) {\r\n\t\t\t\t\trequest.addHeader(HEADER_ACCEPT_ENCODING, ENCODING_GZIP);\r\n\t\t\t\t}\r\n\t\t\t}", "@Override\n protected WebResourceResponse parseResponse(@NonNull String urlStr, @Nullable Map<String, String> requestHeaders, boolean analyzeForDownload, boolean quickDownload) {\n if (analyzeForDownload || quickDownload) {\n activity.onGalleryPageStarted();\n\n if (BuildConfig.DEBUG) Timber.v(\"WebView : parseResponse Pixiv %s\", urlStr);\n\n ContentParser contentParser = new PixivContent();\n compositeDisposable.add(Single.fromCallable(() -> contentParser.toContent(urlStr))\n .subscribeOn(Schedulers.io())\n .observeOn(Schedulers.computation())\n .map(content -> super.processContent(content, content.getGalleryUrl(), quickDownload))\n .observeOn(AndroidSchedulers.mainThread())\n .subscribe(\n content2 -> activity.onResultReady(content2, quickDownload),\n Timber::e\n )\n );\n }\n return null;\n }", "boolean hasDownloadRequest();", "private String calculateAllowHeaders(Map<String, String> queryHeaders) {\n\t\t\treturn System.getProperty(ACCESS_CONTROL_ALLOW_HEADER_PROPERTY_NAME,\n\t\t\t\t\tDEFAULT_ALLOWED_HEADERS);\n\t\t}", "@GetMapping(\"/downloadFile/{fileName:.+}\")\n public ResponseEntity<Resource> downloadFile(@PathVariable String fileName, HttpServletRequest request) {\n Resource resource = storageService.loadFileAsResource(fileName);\n\n // Try to determine file's content type\n String contentType = null;\n try {\n contentType = request.getServletContext().getMimeType(resource.getFile().getAbsolutePath());\n } catch (IOException ex) {\n //\n }\n\n // Fallback to the default content type if type could not be determined\n if (contentType == null) {\n contentType = \"application/octet-stream\";\n }\n\n return ResponseEntity.ok().contentType(MediaType.parseMediaType(contentType))\n .header(HttpHeaders.CONTENT_DISPOSITION, \"attachment; filename=\\\"\" + resource.getFilename() + \"\\\"\")\n .body(resource);\n }", "public boolean handles(String contentType, String packaging);", "@Test\n public void getWitheaders(){\n with().accept(ContentType.JSON)\n .when().get(\"http://34.223.219.142:1212/ords/hr/countries/US\")\n .then().statusCode(200);\n }", "public Response get(String path, String accept) throws IOException {\n return get(cluster, path, accept);\n }", "@GetMapping(\"/downloadFile/{fileName:.+}\")\n public ResponseEntity<Resource> downloadFile(@PathVariable String fileName, HttpServletRequest request) throws CustomizeExp {\n Resource resource = fileService.loadFileAsResource(fileName);\n\n // Try to determine file's content type\n String contentType = null;\n try {\n contentType = request.getServletContext().getMimeType(resource.getFile().getAbsolutePath());\n } catch (IOException ex) {\n log.warn(\"无法确定文件类型\");\n }\n\n // Fallback to the default content type if type could not be determined\n if(contentType == null) {\n contentType = \"application/octet-stream\";\n }\n\n return ResponseEntity.ok()\n .contentType(MediaType.parseMediaType(contentType))\n .header(HttpHeaders.CONTENT_DISPOSITION, \"attachment; filename=\\\"\" + resource.getFilename() + \"\\\"\")\n .body(resource);\n }", "abstract boolean ignoreContentLength();", "public abstract HttpHeaders headers();", "MediaType getMediaType();", "public void setContentDisposition\n (ContentDispositionHeader contentDispositionHeader) {\n this.setHeader( contentDispositionHeader);\n \n }", "public ShareFileHttpHeaders() {}", "private HttpHeaders getHeaders(String contentType) {\n HttpHeaders httpHeaders = new HttpHeaders();\n httpHeaders.set(WebConstants.CONTENT_TYPE, WebConstants.TEXT_PLAIN_UTF8);\n return httpHeaders;\n }", "private static void setAcceptLanguage(HttpURLConnection conn) {\n Locale locale = Locale.getDefault();\n\n // Do nothing if no language is set.\n if(locale.getLanguage().length() == 0) {\n return;\n }\n\n StringBuilder sb = new StringBuilder();\n\n // Add country information if available.\n if(locale.getCountry().length() > 0) {\n sb.append(locale.getLanguage() + \"-\" + locale.getCountry() + \",\");\n }\n\n // Add just language (Q-score taken from Firefox)\n sb.append(locale.getLanguage() + \";q=0.5\");\n\n conn.setRequestProperty(\"Accept-Language\", sb.toString());\n }", "@Override\n public String getContentType() {\n return command.dirDeploy ? null : \"application/zip\";\n }", "private HttpHeaders getHeaders() {\n\t\tHttpHeaders headers = new HttpHeaders();\n\t\theaders.setAccept(Arrays.asList(MediaType.APPLICATION_JSON));\n\t\treturn headers;\n\t}", "private boolean inspectHeader() throws UrlCacheException {\n\n\t\tif(header.contains(\"HTTP/1.1 2\")){\n\t\t\treturn true;\n\t\t}\n\t\telse if(header.contains(\"HTTP/1.1 304\"))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tthrow new UrlCacheException();\n\t\t\n\t}", "protected static void setContentTypeHeader(HttpResponse response, File file) {\n\t\tresponse.setHeader(HttpHeaders.Names.CONTENT_TYPE, mimeTypesMap.getContentType(file.getName())\n\t\t\t\t+ \"; charset=UTF-8\");\n\t}", "@Test\n\tpublic void verifyHeader() {\n\t\t\tHeaders head = response.getHeaders();\n\t\t\tAssert.assertEquals(head.getValues(\"Content-Type\").toString(), \"[application/json; charset=utf-8]\");\n\t\t}", "@Override\n public void filter(final ClientRequestContext requestContext) throws IOException {\n final String userAgent = VersionInfo.getUserAgent(\"Apache-HttpClient\", \"org.apache.http.client\", HttpClientBuilder.class);\n // Finally, we can add the header\n requestContext.getHeaders().add(HttpHeaders.USER_AGENT, userAgent);\n }", "Headers getHeaders();", "public MediaType getDefault();", "@GetMapping(\"/downloadFile/{fileName:.+}\")\n public ResponseEntity<Resource> downloadFile(@PathVariable String fileName, HttpServletRequest request) {\n Resource resource = docFileService.loadFileAsResource(fileName);\n\n // Try to determine file's content type\n String contentType = null;\n try {\n contentType = request.getServletContext().getMimeType(resource.getFile().getAbsolutePath());\n } catch (IOException ex) {\n System.out.println(\"Could not determine file type.\");\n }\n\n // Fallback to the default content type if type could not be determined\n if(contentType == null) {\n contentType = \"application/octet-stream\";\n }\n\n return ResponseEntity.ok()\n .contentType(MediaType.parseMediaType(contentType))\n .header(HttpHeaders.CONTENT_DISPOSITION, \"attachment; filename=\\\"\" + resource.getFilename() + \"\\\"\")\n .body(resource);\n }", "@SuppressWarnings(\"resource\")\n\t\tprivate Response respond(Map<String, String> headers, IHTTPSession session, String uri) {\n\t\t\tResponse r;\n\t\t\tif (cors != null && Method.OPTIONS.equals(session.getMethod())) {\n\t\t\t\tr = new NanoHTTPDSingleFile.Response(Response.Status.OK, MIME_PLAINTEXT, null, 0);\n\t\t\t} else {\n\t\t\t\tr = defaultRespond(headers, session, uri);\n\t\t\t}\n\n\t\t\tif (cors != null) {\n\t\t\t\tr = addCORSHeaders(headers, r, cors);\n\t\t\t}\n\t\t\treturn r;\n\t\t}", "@Override\n public void setContentType(String arg0) {\n\n }", "public AcceptHeader getAcceptHeader(String headerName)\n\t{\n\t\tString lowerName = headerName.toLowerCase();\n\t\tAcceptHeader header = this.acceptHeaders.get(lowerName);\n\t\tif (header == null)\n\t\t{\n\t\t\tString headerValue = getHeaderValue(headerName);\n\t\t\tif (headerValue != null)\n\t\t\t{\n\t\t\t\theader = new AcceptHeader(headerName, headerValue);\n\t\t\t\tthis.acceptHeaders.put(lowerName, header);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn header;\n\t}", "private static void download(String arquivo, HttpServletRequest request, HttpServletResponse response) throws IOException {\n File f = new File(arquivo);\n response.setContentLength((int) f.length());\n response.setContentType(\"application/octet-stream\");\n response.setHeader(\"Content-Transfer-Encoding\", \"binary\");\n response.setHeader(\"Content-Disposition\", \"attachment; filename=\\\"\" + f.getName() + \"\\\"\");\n\n byte[] buf = new byte[4096];\n BufferedInputStream in = new BufferedInputStream(new FileInputStream(f));\n BufferedOutputStream out = new BufferedOutputStream(response.getOutputStream());\n int i = 0;\n while ((i = in.read(buf)) > 0) {\n out.write(buf, 0, i);\n }\n out.close();\n in.close();\n }", "private HttpHeaders getHttpHeader(String authToken, boolean setContentType, Optional<Map> headerInformation, boolean setFormData) {\n HttpHeaders headers = new HttpHeaders();\n headers.set(\"Authorization\",authToken);\n\n if(null != headerInformation && headerInformation.isPresent()){\n Map headerInformationToSet = headerInformation.get();\n headerInformationToSet.forEach((k, v) -> {\n headers.set(k.toString(), v.toString());\n });\n }\n\n if(setFormData){\n headers.setContentType(MediaType.MULTIPART_FORM_DATA);\n }\n\n if(setContentType) {\n headers.setContentType(MediaType.APPLICATION_JSON);\n headers.add(\"Accept\", MediaType.APPLICATION_JSON_VALUE);\n }\n return headers;\n }", "public boolean isContentTypeSupported(String contentType)\n {\n if(contentType.equals(DEFAULT_MIME_TYPE))\n return true;\n else if(contentType.equals(\"text/html\"))\n return true;\n else\n return false;\n }", "public MediaType getContentType()\r\n/* 193: */ {\r\n/* 194:289 */ String value = getFirst(\"Content-Type\");\r\n/* 195:290 */ return value != null ? MediaType.parseMediaType(value) : null;\r\n/* 196: */ }", "default boolean visitHeader() {\n\t\treturn true;\n\t}", "void setContentType(HttpServletResponse response);", "public void setAcceptCharset(List<Charset> acceptableCharsets)\r\n/* 93: */ {\r\n/* 94:157 */ StringBuilder builder = new StringBuilder();\r\n/* 95:158 */ for (Iterator<Charset> iterator = acceptableCharsets.iterator(); iterator.hasNext();)\r\n/* 96: */ {\r\n/* 97:159 */ Charset charset = (Charset)iterator.next();\r\n/* 98:160 */ builder.append(charset.name().toLowerCase(Locale.ENGLISH));\r\n/* 99:161 */ if (iterator.hasNext()) {\r\n/* 100:162 */ builder.append(\", \");\r\n/* 101: */ }\r\n/* 102: */ }\r\n/* 103:165 */ set(\"Accept-Charset\", builder.toString());\r\n/* 104: */ }", "public Requested<Object[]> get(String Accept) {\n String url = (\"https://api.github.com//user/keys\");\n HashMap<String, String> headerProperties = new HashMap<String, String>();\n if (Accept!= null) {\n headerProperties.put(\"Accept\", (\"\"+ Accept));\n }\n return requestGet(url, headerProperties, Object[].class);\n }" ]
[ "0.6107017", "0.60879487", "0.60676473", "0.6038628", "0.59627527", "0.58989435", "0.58835644", "0.5729695", "0.57268035", "0.5724742", "0.5695841", "0.5667903", "0.5641067", "0.56251776", "0.5577278", "0.55547285", "0.55521214", "0.55113244", "0.55035055", "0.5492646", "0.54896194", "0.5481858", "0.54732376", "0.54587543", "0.54586536", "0.54551244", "0.54452485", "0.5400475", "0.5384237", "0.53432745", "0.534159", "0.5315074", "0.5313285", "0.5273683", "0.5260763", "0.52464193", "0.5216978", "0.5216978", "0.5196617", "0.51961535", "0.5177785", "0.5171195", "0.5168418", "0.51606756", "0.5150393", "0.5137853", "0.51360476", "0.5124196", "0.51226157", "0.5110542", "0.5106912", "0.50906575", "0.50741535", "0.5072958", "0.50721973", "0.50490355", "0.5029211", "0.5024925", "0.5021377", "0.49829414", "0.49744076", "0.4968656", "0.4964566", "0.49486336", "0.49427086", "0.49421147", "0.49333522", "0.4931627", "0.4917025", "0.49164099", "0.49115822", "0.4898049", "0.48934206", "0.48908", "0.48895445", "0.48888904", "0.4881838", "0.48786166", "0.48676765", "0.48666957", "0.4865689", "0.48639426", "0.48594335", "0.4851485", "0.4850565", "0.48384598", "0.48309734", "0.48292777", "0.48242566", "0.48187104", "0.4810504", "0.4807686", "0.47929206", "0.47895944", "0.47841585", "0.4782888", "0.47823328", "0.4769837", "0.47626665", "0.4749875" ]
0.5282259
33
Convert the given object to string with each line indented by 4 spaces (except the first line).
private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String toIndentedString(Object object) {\n if (object == null) {\n return EndpointCentralConstants.NULL_STRING;\n }\n return object.toString().replace(EndpointCentralConstants.LINE_BREAK,\n EndpointCentralConstants.LINE_BREAK + EndpointCentralConstants.TAB_SPACES);\n }", "private String toIndentedString(Object o)\n/* */ {\n/* 128 */ if (o == null) {\n/* 129 */ return \"null\";\n/* */ }\n/* 131 */ return o.toString().replace(\"\\n\", \"\\n \");\n/* */ }", "private String toIndentedString( Object o )\n {\n if ( o == null )\n {\n return \"null\";\n }\n return o.toString().replace( \"\\n\", \"\\n \" );\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }" ]
[ "0.7884413", "0.7549383", "0.7497253", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267", "0.74617267" ]
0.0
-1
write your code here
public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String s = scanner.nextLine(); int vowels = 0; int consonats = 0; int result = 0; for (int i = 0; i < s.length(); i++){ if (isVowel(s.charAt(i))) { vowels++; consonats = 0; } else { vowels = 0; consonats++; } if (vowels == 3){ result++; vowels = 1; } if (consonats == 3){ result++; consonats = 1; } } System.out.println(result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void logic(){\r\n\r\n\t}", "public static void generateCode()\n {\n \n }", "@Override\n\tprotected void logic() {\n\n\t}", "private static void cajas() {\n\t\t\n\t}", "void pramitiTechTutorials() {\n\t\n}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "public void ganar() {\n // TODO implement here\n }", "public static void main(String[] args) {\n // write your code here - this is called comment and it always starts with double slash\n // and comlier will ignore this because of the // sign.\n // I am gonna say hello\n // JAVA IS CASE SENSITIVE LANGUAGE\n // System and system are very different things in java\n //Hello AND hello are different for java\n // System.out.println(\"Hello Batch 15!\");\n // System.out.println(\"I am still here.\");\n // System.out.println(\"I love Java.\");\n\n // Write a program to display your information.\n // When you run it, it should have this outcome.\n // I am your name here\n // I am from batch 15\n // I am from your city here\n // I love Java\n\n System.out.println(\"I am Sevim.\");\n System.out.println(\"I am from Batch 15.\");\n System.out.println(\"I'm from New Jersey.\");\n System.out.println(\"I love Java.\");\n\n\n\n }", "CD withCode();", "private stendhal() {\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "public void gored() {\n\t\t\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\r\n\tpublic void runn() {\n\t\t\r\n\t}", "public void genCode(CodeFile code) {\n\t\t\n\t}", "public void hello(){\n\t\t\r\n \t\r\n\t\t\r\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "public void baocun() {\n\t\t\n\t}", "public void mo38117a() {\n }", "public void furyo ()\t{\n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "private void strin() {\n\n\t}", "public void themesa()\n {\n \n \n \n \n }", "Programming(){\n\t}", "@Override\n\tvoid output() {\n\t\t\n\t}", "private void yy() {\n\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "void rajib () {\n\t\t \n\t\t System.out.println(\"Rajib is IT Eng\");\n\t }", "private void kk12() {\n\n\t}", "public void edit() {\n\t\tSystem.out.println(\"编写java笔记\");\r\n\t}", "public static void main(String[] args) {\n\t// write your code here\n }", "private static void ThridUmpireReview() {\n\t\tSystem.out.println(\" Umpier Reviews the Score Board\");\n\t\t \n\t\t\n\t}", "@Override\r\n\t\tpublic void doDomething() {\r\n\t\t\tSystem.out.println(\"I am here\");\r\n\t\t\t\r\n\t\t}", "protected void mo6255a() {\n }", "public void gen(CodeSeq code, ICodeEnv env) {\n\r\n\t}", "@Override\n\tpublic void function() {\n\t\t\n\t}", "public void working()\n {\n \n \n }", "@Override\n\tprotected void postRun() {\n\n\t}", "public void perder() {\n // TODO implement here\n }", "public void smell() {\n\t\t\n\t}", "protected void execute() {\n\t\t\n\t}", "public void mo55254a() {\n }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tpublic void orgasm() {\n\t\t\n\t}", "public void cocinar(){\n\n }", "@Override\r\n\tvoid func04() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\t\tprotected void run() {\n\t\t\t\r\n\t\t}", "@Override\n\tprotected void interr() {\n\t}", "public void run() {\n\t\t\t\t\n\t\t\t}", "protected void execute() {\n\n\n \n }", "@Override\n public void execute() {\n \n \n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\r\n\tpublic void crawl_data() {\n\t\t\r\n\t}", "@Override\n public void memoria() {\n \n }", "public static void main(String args[]) throws Exception\n {\n \n \n \n }", "@Override\r\n\tpublic void code() {\n\t\tus.code();\r\n\t\tSystem.out.println(\"我会java...\");\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "protected void display() {\n\r\n\t}", "private void sout() {\n\t\t\n\t}", "private static void oneUserExample()\t{\n\t}", "public void nhapdltextlh(){\n\n }", "public void miseAJour();", "protected void additionalProcessing() {\n\t}", "private void sub() {\n\n\t}", "@Override\n\tpublic void view() {\n\t\t\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void engine() {\r\n\t\t// TODO Auto-generated method stub\t\t\r\n\t}", "@Override\r\n\tpublic void code() {\n\t\tSystem.out.println(\"我会C语言....\");\r\n\t}", "void mo67924c();", "@Override\n\tpublic void dosomething() {\n\t\t\n\t}", "@Override\r\n public void run() {\n basicEditor.createEdge(); // replaced Bibianas method with Moritz Roidl, Orthodoxos Kipouridis\r\n }", "public void mo5382o() {\n }", "@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void doF6() {\n\t\t\r\n\t}", "public void mo3376r() {\n }", "public static void main(String[] args)\r\n {\n System.out.println(\"Mehedi Hasan Nirob\");\r\n //multiple line comment\r\n /*\r\n At first printing my phone number\r\n then print my address \r\n then print my university name\r\n */\r\n System.out.println(\"01736121659\\nJamalpur\\nDhaka International University\");\r\n \r\n }", "void kiemTraThangHopLi() {\n }", "public void skystonePos5() {\n }", "public final void cpp() {\n }", "public final void mo51373a() {\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(\"This is the main class of this project\");\r\n\t\tSystem.out.println(\"how about this\");\r\n\r\n\t\t\r\n\t\tSystem.out.println(\"new push\");\r\n\r\n\t\t//how to update this line\r\n\t\t\r\n\t\tSystem.out.println(\"hello there\");\r\n\r\n\t\tSystem.out.println(\"zen me shuoXXXXXXXXXXXKKKKkKKKKKKXXXXXXXX\");\r\n\r\n\t\tSystem.out.println(\"eventually we succeeded!\");\r\n\t\t//wa!!!\r\n\t\t\r\n\r\n\r\n\t\t//hen shu fu !\r\n\t\t\r\n\t\t//it is a good day\r\n\t\t\r\n\t\t//testing\r\n\r\n\t\t\r\n\t\tSystem.out.println(\"hope it works\");\r\n\t\t\r\n\r\n\t\t\r\n\r\n\t}", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}" ]
[ "0.61019534", "0.6054925", "0.58806974", "0.58270746", "0.5796887", "0.56999695", "0.5690986", "0.56556827", "0.5648637", "0.5640487", "0.56354505", "0.56032085", "0.56016207", "0.56006724", "0.5589654", "0.5583692", "0.55785793", "0.55733466", "0.5560209", "0.55325305", "0.55133164", "0.55123806", "0.55114794", "0.5500045", "0.5489272", "0.5482718", "0.5482718", "0.5477585", "0.5477585", "0.54645246", "0.5461012", "0.54548836", "0.5442613", "0.5430592", "0.5423748", "0.5419415", "0.5407118", "0.54048806", "0.5399331", "0.539896", "0.5389593", "0.5386248", "0.5378453", "0.53751254", "0.5360644", "0.5357343", "0.5345515", "0.53441405", "0.5322276", "0.5318302", "0.53118485", "0.53118485", "0.53085434", "0.530508", "0.53038436", "0.5301922", "0.5296964", "0.52920514", "0.52903354", "0.5289583", "0.5287506", "0.52869135", "0.5286737", "0.5286737", "0.5286737", "0.5286737", "0.5286737", "0.5286737", "0.5286737", "0.52859664", "0.52849185", "0.52817136", "0.52791214", "0.5278664", "0.5278048", "0.5276269", "0.52728665", "0.5265451", "0.526483", "0.526005", "0.5259683", "0.52577406", "0.5257731", "0.5257731", "0.52560073", "0.5255759", "0.5255707", "0.5250705", "0.5246863", "0.5243053", "0.52429926", "0.5242727", "0.52396125", "0.5239378", "0.5232576", "0.5224529", "0.52240705", "0.52210563", "0.52203166", "0.521787", "0.52172214" ]
0.0
-1
Construtor de um Utilizador
public Utilizador(){ this.id = ""; this.email = ""; this.nome = ""; this.password = ""; this.morada = ""; this.dataNasc = new GregorianCalendar(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public UsuarioControlador() {\n }", "public Utilizador(){\n this.email = \"\";\n this.password = \"\";\n this.nome = \"\";\n this.genero = \"\";\n this.morada = \"\";\n this.data_nasc = new GregorianCalendar();\n this.data_reg = new GregorianCalendar();\n this.amigos = new TreeSet<>();\n this.pedido_amizade = new TreeSet<>();\n this.atividades = new HashMap<>();\n this.eventos = new TreeSet<>();\n }", "public GestaoUtilizador() {\n initComponents();\n listarutilizador();\n }", "public Utilisateur() {\n\t\tsuper();\n\t}", "public ControladorUsuario() {\n }", "public solicitudControlador() {\n }", "public UsuarioMB() {\n }", "public UsuarioControlador() {\r\n\t\tsuper(Usuario.class);\r\n\t}", "public OmsUsuario() {\n\t}", "public TTau() {}", "public InventarioControlador() {\n }", "public Usuario () {\r\n\t\t\r\n\t\t\r\n\t}", "public Cgg_res_oficial_seguimiento_usuario(){}", "public Usuario() {\r\n }", "public Usuario() {\r\n }", "public TCubico(){}", "private UsineJoueur() {}", "public ControllerAdministrarTrabajadores() {\r\n }", "private DittaAutonoleggio(){\n \n }", "public TblActividadUbicacion() {\r\n }", "public UConnecte() {\n\t\tsuper();\n\t}", "public Tmio1Sitio() {\r\n\t}", "public Sistema(){\r\n\t\t\r\n\t}", "private Units() {\n // Nothing to do\n }", "public TutorIndustrial() {}", "public Caso_de_uso () {\n }", "public TebakNusantara()\n {\n }", "public DonusturucuBean() {\n }", "public Administrator() {\n // no-agrs constructor (ham dung khong tham so)\n }", "private ControleurAcceuil(){ }", "public Unidadmedida() {\r\n\t}", "public VistaUsuarioContenido() {\n initComponents();\n }", "public JogadorTradutor() {\n this.nome= \"Sem Registro\";\n this.pontuacao = pontuacao;\n id = id;\n \n geradorDesafioItaliano = new GerarPalavra(); // primeira palavra ja é gerada para o cliente\n }", "public DarAyudaAcceso() {\r\n }", "public MenuUsuario(ControladorUsuario1 controladorUsuario) {\n initComponents();\n controladorU=controladorUsuario;\n }", "public TelaEsqueceuSenha() {\n initComponents();\n }", "public TelaCadastrarUsuarios() {\n initComponents();\n carregarTabela();\n carregarComboBoxFuncionarios();\n carregarImagens();\n }", "public AntrianPasien() {\r\n\r\n }", "public FiltroCreditoTipo() {\r\n\t}", "@Generated\n public Usuarios() {\n }", "public Contribuinte()\n {\n this.nif = \"\";\n this.nome = \"\";\n this.morada = \"\"; \n }", "public TVendor() {\r\n\t\t// Default constructor\r\n\t}", "public Fruitore(String nomeUtente)\r\n\t{\r\n\t\tthis.nomeUtente = nomeUtente;\r\n\t}", "public Fruitore()\r\n\t{\r\n\t\tthis.nomeUtente = Costanti.STRINGA_VUOTA;\r\n\t}", "public MorteSubita() {\n }", "public UnitConverter() {\r\n getParameters();\r\n }", "public SysSkillConferpo()\n {\n }", "public M6_UsuarioNuevo() {\n initComponents();\n }", "public UserParameter() {\n }", "public AdministratorImpl() {\n\n\t}", "public LocalResidenciaColaborador() {\n //ORM\n }", "User()\n\t{\n\n\t}", "public Asignacion_usuario_Perfil1() {\n int CodigoAplicacion = 120;\n initComponents();\n llenadoDeCombos();\n llenadoDeTablas();\n \n\n \n }", "public TipoInformazioniController() {\n\n\t}", "public ControladorPrueba() {\r\n }", "public AgenteEstAleatorio() {\r\n }", "public User() {\n /**\n * default Cto'r\n */\n }", "public Veiculo() {\r\n\r\n }", "public TcUnidadEdoDTO() {\n }", "public CrearCuenta(UsuarioVO usu) {\r\n\t\tsuper();\r\n\t\tlogger.trace(\"Constructor CrearCuenta\");\r\n\t\tinitialize();\r\n\t\tthis.setExtendedState(JFrame.MAXIMIZED_BOTH);\r\n\t\tthis.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tusuario = usu;\r\n\t}", "public Puntaje() {\n nombre = \"\";\n puntos = 0;\n }", "public CadastroUsuario() {\n initComponents();\n }", "public CuentaDeposito() {\n super();\n }", "public TelaExcluirUsuario() {\n initComponents();\n }", "public MPaciente() {\r\n\t}", "public BuscarUsuario() {\n initComponents();\n }", "public ControllerRol() {\n }", "public UsuariosBean() {\n }", "public void construirCargo() {\n persona.setCargo(Cargos.SUPERVISOR);\n }", "public ControllerProtagonista() {\n\t}", "public Alojamiento() {\r\n\t}", "public Espacio (int id, int capacidad, int ocupacion, TipoEspacio tipo, Localizacion localizacion){\n this.id = id;\n this.capacidad = capacidad;\n this.ocupacion = ocupacion;\n this.TIPO = tipo;\n this.localizacion = localizacion;\n }", "public Transportista() {\n }", "public TUser() {\n this(\"t_user\", null);\n }", "public GUIGestionUsuarios(Administrador administrador, VentanaDisponible myUnicaVentana ) {\n this.administrador=administrador;\n initComponents();\n //setIconImage(new ImageIcon(getClass().getResource(\"/recursos/clothing.png\")).getImage());\n btnGroupCargoAU.add(rbtnAdministradorAU);\n btnGroupCargoAU.add(rbtnFuncionarioAU);\n \n btnGroupCargoUU.add(rbtnAdministradorUU);\n btnGroupCargoUU.add(rbtnFuncionarioUU);\n this.myUnicaVentana = myUnicaVentana;\n }", "public Cuenta(Usuario usuario) { // constructor que crea objetos tipo cuenta que recibe por parámetro\n //un objeto de tipo usuario\n\n this.usuario = usuario;\n saldo = 0;\n }", "public Unit() {\n\n }", "public Vehiculo() {\r\n }", "public ListaUsuario() {\n initComponents();\n\n exibir();\n }", "public InstrutorCadastrarTela() {\n initComponents();\n //Limite de caracateres e apenas caracteres permitidos\n jTextFieldNome.setDocument(new classesBasicas.CaracterLimitePermitido(60));\n //Limitando os caracteres para (N), independende de ser numero ou letras\n jTextFieldRg.setDocument(new classesBasicas.JTextFieldLimite(20)); \n }", "protected Universitas(String namauniv){\n this.namauniv = namauniv;\n }", "public gestion_utilisateur() {\n initComponents();\n }", "public Funcionario() {\r\n\t\t\r\n\t}", "public Pasien() {\r\n }", "public Laboratorio() {}", "public Cgg_jur_anticipo(){}", "public LibrarianUser() {\n\t\tsuper();\n\t}", "public UserPerfil() {\n initComponents();\n\n\n }", "public RequestDatosUsuario(){\r\n\t\tsuper();\r\n\t}", "public SlanjePoruke() {\n }", "Petunia() {\r\n\t\t}", "public Propiedad(){\n\t}", "public Users() {}", "public Jeu(){\n Saisie.Initialiser();\n this.premierJoueur = CreationDePersonnage(\"joueur1\");\n this.secondJoueur = CreationDePersonnage(\"joueur2\");\n Combat();\n Saisie.Terminer();\n }", "public Ciudad()\n {\n\n }", "public TacChrtypmstVOImpl() {\n }", "public ServicioUjaPack() {\n }", "public VentanaAdministradorVista() {\n initComponents();\n }", "public Estado() {\r\n }", "public Troco() {\n }" ]
[ "0.6618651", "0.6561669", "0.6544048", "0.6475011", "0.64581233", "0.63284266", "0.63132817", "0.63003623", "0.62240636", "0.6181876", "0.61705554", "0.61085695", "0.60875773", "0.60870534", "0.60870534", "0.6067592", "0.6063399", "0.6057556", "0.6053763", "0.6017163", "0.6001057", "0.59563476", "0.5952965", "0.5919357", "0.58890593", "0.5863717", "0.5861993", "0.5854794", "0.58492583", "0.5836533", "0.5828584", "0.58165133", "0.58006865", "0.5787905", "0.5772465", "0.57500565", "0.57443994", "0.57388103", "0.57286185", "0.570821", "0.5707513", "0.5706732", "0.56972414", "0.5695932", "0.5693999", "0.5674063", "0.56684065", "0.5664402", "0.56603706", "0.5648609", "0.5636446", "0.56362075", "0.5631319", "0.5630811", "0.56273216", "0.56259", "0.5619872", "0.5613322", "0.5608568", "0.5600427", "0.55977124", "0.55844086", "0.5577774", "0.55726534", "0.5569345", "0.5566971", "0.5561558", "0.55611867", "0.55609727", "0.55551916", "0.5548609", "0.55406857", "0.55341566", "0.5533815", "0.5532092", "0.55283827", "0.5525887", "0.5517029", "0.55143213", "0.5514228", "0.55124074", "0.55055237", "0.55051714", "0.5500067", "0.54977155", "0.54968363", "0.549683", "0.54943764", "0.5493742", "0.5492711", "0.5492145", "0.54885715", "0.54870087", "0.5482223", "0.5481812", "0.5479568", "0.5479066", "0.5472347", "0.54665637", "0.54634684" ]
0.6731325
0
JPAkompatibler Kostruktor. Wird nur von JPA verwendet und darf private sein.
public UserRegistration() { // JPA benötigt einen Default-Konstruktor! }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected CompanyJPA() {\n\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "public interface JPQLQueryCriteria{\n\t\n}", "public abstract FHIRPersistence getPersistenceImpl() throws Exception;", "public interface DanhMucGiayToPersistence extends BasePersistence<DanhMucGiayTo> {\n\t/*\n\t * NOTE FOR DEVELOPERS:\n\t *\n\t * Never modify or reference this interface directly. Always use {@link DanhMucGiayToUtil} to access the danh muc giay to persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface.\n\t */\n\n\t/**\n\t* Caches the danh muc giay to in the entity cache if it is enabled.\n\t*\n\t* @param danhMucGiayTo the danh muc giay to\n\t*/\n\tpublic void cacheResult(\n\t\torg.oep.cmon.dao.tlct.model.DanhMucGiayTo danhMucGiayTo);\n\n\t/**\n\t* Caches the danh muc giay tos in the entity cache if it is enabled.\n\t*\n\t* @param danhMucGiayTos the danh muc giay tos\n\t*/\n\tpublic void cacheResult(\n\t\tjava.util.List<org.oep.cmon.dao.tlct.model.DanhMucGiayTo> danhMucGiayTos);\n\n\t/**\n\t* Creates a new danh muc giay to with the primary key. Does not add the danh muc giay to to the database.\n\t*\n\t* @param id the primary key for the new danh muc giay to\n\t* @return the new danh muc giay to\n\t*/\n\tpublic org.oep.cmon.dao.tlct.model.DanhMucGiayTo create(long id);\n\n\t/**\n\t* Removes the danh muc giay to with the primary key from the database. Also notifies the appropriate model listeners.\n\t*\n\t* @param id the primary key of the danh muc giay to\n\t* @return the danh muc giay to that was removed\n\t* @throws org.oep.cmon.dao.tlct.NoSuchDanhMucGiayToException if a danh muc giay to with the primary key could not be found\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic org.oep.cmon.dao.tlct.model.DanhMucGiayTo remove(long id)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException,\n\t\t\torg.oep.cmon.dao.tlct.NoSuchDanhMucGiayToException;\n\n\tpublic org.oep.cmon.dao.tlct.model.DanhMucGiayTo updateImpl(\n\t\torg.oep.cmon.dao.tlct.model.DanhMucGiayTo danhMucGiayTo, boolean merge)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;\n\n\t/**\n\t* Returns the danh muc giay to with the primary key or throws a {@link org.oep.cmon.dao.tlct.NoSuchDanhMucGiayToException} if it could not be found.\n\t*\n\t* @param id the primary key of the danh muc giay to\n\t* @return the danh muc giay to\n\t* @throws org.oep.cmon.dao.tlct.NoSuchDanhMucGiayToException if a danh muc giay to with the primary key could not be found\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic org.oep.cmon.dao.tlct.model.DanhMucGiayTo findByPrimaryKey(long id)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException,\n\t\t\torg.oep.cmon.dao.tlct.NoSuchDanhMucGiayToException;\n\n\t/**\n\t* Returns the danh muc giay to with the primary key or returns <code>null</code> if it could not be found.\n\t*\n\t* @param id the primary key of the danh muc giay to\n\t* @return the danh muc giay to, or <code>null</code> if a danh muc giay to with the primary key could not be found\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic org.oep.cmon.dao.tlct.model.DanhMucGiayTo fetchByPrimaryKey(long id)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;\n\n\t/**\n\t* Returns the danh muc giay to where ma = &#63; or throws a {@link org.oep.cmon.dao.tlct.NoSuchDanhMucGiayToException} if it could not be found.\n\t*\n\t* @param ma the ma\n\t* @return the matching danh muc giay to\n\t* @throws org.oep.cmon.dao.tlct.NoSuchDanhMucGiayToException if a matching danh muc giay to could not be found\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic org.oep.cmon.dao.tlct.model.DanhMucGiayTo findByMa(\n\t\tjava.lang.String ma)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException,\n\t\t\torg.oep.cmon.dao.tlct.NoSuchDanhMucGiayToException;\n\n\t/**\n\t* Returns the danh muc giay to where ma = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.\n\t*\n\t* @param ma the ma\n\t* @return the matching danh muc giay to, or <code>null</code> if a matching danh muc giay to could not be found\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic org.oep.cmon.dao.tlct.model.DanhMucGiayTo fetchByMa(\n\t\tjava.lang.String ma)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;\n\n\t/**\n\t* Returns the danh muc giay to where ma = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.\n\t*\n\t* @param ma the ma\n\t* @param retrieveFromCache whether to use the finder cache\n\t* @return the matching danh muc giay to, or <code>null</code> if a matching danh muc giay to could not be found\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic org.oep.cmon.dao.tlct.model.DanhMucGiayTo fetchByMa(\n\t\tjava.lang.String ma, boolean retrieveFromCache)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;\n\n\t/**\n\t* Returns the danh muc giay to where ma = &#63; or throws a {@link org.oep.cmon.dao.tlct.NoSuchDanhMucGiayToException} if it could not be found.\n\t*\n\t* @param ma the ma\n\t* @return the matching danh muc giay to\n\t* @throws org.oep.cmon.dao.tlct.NoSuchDanhMucGiayToException if a matching danh muc giay to could not be found\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic org.oep.cmon.dao.tlct.model.DanhMucGiayTo findByByMa(\n\t\tjava.lang.String ma)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException,\n\t\t\torg.oep.cmon.dao.tlct.NoSuchDanhMucGiayToException;\n\n\t/**\n\t* Returns the danh muc giay to where ma = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.\n\t*\n\t* @param ma the ma\n\t* @return the matching danh muc giay to, or <code>null</code> if a matching danh muc giay to could not be found\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic org.oep.cmon.dao.tlct.model.DanhMucGiayTo fetchByByMa(\n\t\tjava.lang.String ma)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;\n\n\t/**\n\t* Returns the danh muc giay to where ma = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.\n\t*\n\t* @param ma the ma\n\t* @param retrieveFromCache whether to use the finder cache\n\t* @return the matching danh muc giay to, or <code>null</code> if a matching danh muc giay to could not be found\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic org.oep.cmon.dao.tlct.model.DanhMucGiayTo fetchByByMa(\n\t\tjava.lang.String ma, boolean retrieveFromCache)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;\n\n\t/**\n\t* Returns all the danh muc giay tos where daXoa = &#63;.\n\t*\n\t* @param daXoa the da xoa\n\t* @return the matching danh muc giay tos\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic java.util.List<org.oep.cmon.dao.tlct.model.DanhMucGiayTo> findByTrangThai(\n\t\tint daXoa) throws com.liferay.portal.kernel.exception.SystemException;\n\n\t/**\n\t* Returns a range of all the danh muc giay tos where daXoa = &#63;.\n\t*\n\t* <p>\n\t* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.\n\t* </p>\n\t*\n\t* @param daXoa the da xoa\n\t* @param start the lower bound of the range of danh muc giay tos\n\t* @param end the upper bound of the range of danh muc giay tos (not inclusive)\n\t* @return the range of matching danh muc giay tos\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic java.util.List<org.oep.cmon.dao.tlct.model.DanhMucGiayTo> findByTrangThai(\n\t\tint daXoa, int start, int end)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;\n\n\t/**\n\t* Returns an ordered range of all the danh muc giay tos where daXoa = &#63;.\n\t*\n\t* <p>\n\t* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.\n\t* </p>\n\t*\n\t* @param daXoa the da xoa\n\t* @param start the lower bound of the range of danh muc giay tos\n\t* @param end the upper bound of the range of danh muc giay tos (not inclusive)\n\t* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)\n\t* @return the ordered range of matching danh muc giay tos\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic java.util.List<org.oep.cmon.dao.tlct.model.DanhMucGiayTo> findByTrangThai(\n\t\tint daXoa, int start, int end,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator orderByComparator)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;\n\n\t/**\n\t* Returns the first danh muc giay to in the ordered set where daXoa = &#63;.\n\t*\n\t* <p>\n\t* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.\n\t* </p>\n\t*\n\t* @param daXoa the da xoa\n\t* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)\n\t* @return the first matching danh muc giay to\n\t* @throws org.oep.cmon.dao.tlct.NoSuchDanhMucGiayToException if a matching danh muc giay to could not be found\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic org.oep.cmon.dao.tlct.model.DanhMucGiayTo findByTrangThai_First(\n\t\tint daXoa,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator orderByComparator)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException,\n\t\t\torg.oep.cmon.dao.tlct.NoSuchDanhMucGiayToException;\n\n\t/**\n\t* Returns the last danh muc giay to in the ordered set where daXoa = &#63;.\n\t*\n\t* <p>\n\t* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.\n\t* </p>\n\t*\n\t* @param daXoa the da xoa\n\t* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)\n\t* @return the last matching danh muc giay to\n\t* @throws org.oep.cmon.dao.tlct.NoSuchDanhMucGiayToException if a matching danh muc giay to could not be found\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic org.oep.cmon.dao.tlct.model.DanhMucGiayTo findByTrangThai_Last(\n\t\tint daXoa,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator orderByComparator)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException,\n\t\t\torg.oep.cmon.dao.tlct.NoSuchDanhMucGiayToException;\n\n\t/**\n\t* Returns the danh muc giay tos before and after the current danh muc giay to in the ordered set where daXoa = &#63;.\n\t*\n\t* <p>\n\t* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.\n\t* </p>\n\t*\n\t* @param id the primary key of the current danh muc giay to\n\t* @param daXoa the da xoa\n\t* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)\n\t* @return the previous, current, and next danh muc giay to\n\t* @throws org.oep.cmon.dao.tlct.NoSuchDanhMucGiayToException if a danh muc giay to with the primary key could not be found\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic org.oep.cmon.dao.tlct.model.DanhMucGiayTo[] findByTrangThai_PrevAndNext(\n\t\tlong id, int daXoa,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator orderByComparator)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException,\n\t\t\torg.oep.cmon.dao.tlct.NoSuchDanhMucGiayToException;\n\n\t/**\n\t* Returns all the danh muc giay tos.\n\t*\n\t* @return the danh muc giay tos\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic java.util.List<org.oep.cmon.dao.tlct.model.DanhMucGiayTo> findAll()\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;\n\n\t/**\n\t* Returns a range of all the danh muc giay tos.\n\t*\n\t* <p>\n\t* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.\n\t* </p>\n\t*\n\t* @param start the lower bound of the range of danh muc giay tos\n\t* @param end the upper bound of the range of danh muc giay tos (not inclusive)\n\t* @return the range of danh muc giay tos\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic java.util.List<org.oep.cmon.dao.tlct.model.DanhMucGiayTo> findAll(\n\t\tint start, int end)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;\n\n\t/**\n\t* Returns an ordered range of all the danh muc giay tos.\n\t*\n\t* <p>\n\t* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.\n\t* </p>\n\t*\n\t* @param start the lower bound of the range of danh muc giay tos\n\t* @param end the upper bound of the range of danh muc giay tos (not inclusive)\n\t* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)\n\t* @return the ordered range of danh muc giay tos\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic java.util.List<org.oep.cmon.dao.tlct.model.DanhMucGiayTo> findAll(\n\t\tint start, int end,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator orderByComparator)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;\n\n\t/**\n\t* Removes the danh muc giay to where ma = &#63; from the database.\n\t*\n\t* @param ma the ma\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic void removeByMa(java.lang.String ma)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException,\n\t\t\torg.oep.cmon.dao.tlct.NoSuchDanhMucGiayToException;\n\n\t/**\n\t* Removes the danh muc giay to where ma = &#63; from the database.\n\t*\n\t* @param ma the ma\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic void removeByByMa(java.lang.String ma)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException,\n\t\t\torg.oep.cmon.dao.tlct.NoSuchDanhMucGiayToException;\n\n\t/**\n\t* Removes all the danh muc giay tos where daXoa = &#63; from the database.\n\t*\n\t* @param daXoa the da xoa\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic void removeByTrangThai(int daXoa)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;\n\n\t/**\n\t* Removes all the danh muc giay tos from the database.\n\t*\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic void removeAll()\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;\n\n\t/**\n\t* Returns the number of danh muc giay tos where ma = &#63;.\n\t*\n\t* @param ma the ma\n\t* @return the number of matching danh muc giay tos\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic int countByMa(java.lang.String ma)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;\n\n\t/**\n\t* Returns the number of danh muc giay tos where ma = &#63;.\n\t*\n\t* @param ma the ma\n\t* @return the number of matching danh muc giay tos\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic int countByByMa(java.lang.String ma)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;\n\n\t/**\n\t* Returns the number of danh muc giay tos where daXoa = &#63;.\n\t*\n\t* @param daXoa the da xoa\n\t* @return the number of matching danh muc giay tos\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic int countByTrangThai(int daXoa)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;\n\n\t/**\n\t* Returns the number of danh muc giay tos.\n\t*\n\t* @return the number of danh muc giay tos\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic int countAll()\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;\n}", "public DerivedPartOfPerspectivesFKDAOJDBC() {\n \t\n }", "public interface LoggerJPA extends\n JpaRepository<LoggerEntity,Long>,\n JpaSpecificationExecutor<LoggerEntity>,\n Serializable {\n}", "public interface Compromiso_peticionLocal extends javax.ejb.EJBLocalObject {\n\t/**\n\t * Get accessor for persistent attribute: tiag_id\n\t */\n\tpublic java.lang.Long getTiag_id();\n\t/**\n\t * Set accessor for persistent attribute: tiag_id\n\t */\n\tpublic void setTiag_id(java.lang.Long newTiag_id);\n\t/**\n\t * Get accessor for persistent attribute: id_rango\n\t */\n\tpublic java.lang.Integer getId_rango();\n\t/**\n\t * Set accessor for persistent attribute: id_rango\n\t */\n\tpublic void setId_rango(java.lang.Integer newId_rango);\n\t/**\n\t * Get accessor for persistent attribute: peti_numero\n\t */\n\tpublic java.lang.Long getPeti_numero();\n\t/**\n\t * Set accessor for persistent attribute: peti_numero\n\t */\n\tpublic void setPeti_numero(java.lang.Long newPeti_numero);\n\t/**\n\t * Get accessor for persistent attribute: codigo_pcom\n\t */\n\tpublic java.lang.String getCodigo_pcom();\n\t/**\n\t * Set accessor for persistent attribute: codigo_pcom\n\t */\n\tpublic void setCodigo_pcom(java.lang.String newCodigo_pcom);\n\t/**\n\t * Get accessor for persistent attribute: dia_especifico\n\t */\n\tpublic java.sql.Timestamp getDia_especifico();\n\t/**\n\t * Set accessor for persistent attribute: dia_especifico\n\t */\n\tpublic void setDia_especifico(java.sql.Timestamp newDia_especifico);\n\t/**\n\t * Get accessor for persistent attribute: id_tecnico\n\t */\n\tpublic java.lang.Long getId_tecnico();\n\t/**\n\t * Set accessor for persistent attribute: id_tecnico\n\t */\n\tpublic void setId_tecnico(java.lang.Long newId_tecnico);\n\t/**\n\t * Get accessor for persistent attribute: user_mac\n\t */\n\tpublic java.lang.String getUser_mac();\n\t/**\n\t * Set accessor for persistent attribute: user_mac\n\t */\n\tpublic void setUser_mac(java.lang.String newUser_mac);\n\t/**\n\t * Get accessor for persistent attribute: hora_desde\n\t */\n\tpublic java.lang.String getHora_desde();\n\t/**\n\t * Set accessor for persistent attribute: hora_desde\n\t */\n\tpublic void setHora_desde(java.lang.String newHora_desde);\n\t/**\n\t * Get accessor for persistent attribute: hora_hasta\n\t */\n\tpublic java.lang.String getHora_hasta();\n\t/**\n\t * Set accessor for persistent attribute: hora_hasta\n\t */\n\tpublic void setHora_hasta(java.lang.String newHora_hasta);\n\t/**\n\t * Get accessor for persistent attribute: codigo_agencia\n\t */\n\tpublic java.lang.String getCodigo_agencia();\n\t/**\n\t * Set accessor for persistent attribute: codigo_agencia\n\t */\n\tpublic void setCodigo_agencia(java.lang.String newCodigo_agencia);\n\t/**\n\t * Get accessor for persistent attribute: estado\n\t */\n\tpublic java.lang.Short getEstado();\n\t/**\n\t * Set accessor for persistent attribute: estado\n\t */\n\tpublic void setEstado(java.lang.Short newEstado);\n\t/**\n\t * Get accessor for persistent attribute: grse_id\n\t */\n\tpublic java.lang.Integer getGrse_id();\n\t/**\n\t * Set accessor for persistent attribute: grse_id\n\t */\n\tpublic void setGrse_id(java.lang.Integer newGrse_id);\n\t/**\n\t * Get accessor for persistent attribute: fecha\n\t */\n\tpublic java.sql.Timestamp getFecha();\n\t/**\n\t * Set accessor for persistent attribute: fecha\n\t */\n\tpublic void setFecha(java.sql.Timestamp newFecha);\n\t/**\n\t * Get accessor for persistent attribute: care_id\n\t */\n\tpublic java.lang.Integer getCare_id();\n\t/**\n\t * Set accessor for persistent attribute: care_id\n\t */\n\tpublic void setCare_id(java.lang.Integer newCare_id);\n\t/**\n\t * Get accessor for persistent attribute: usua_id\n\t */\n\tpublic java.lang.Long getUsua_id();\n\t/**\n\t * Set accessor for persistent attribute: usua_id\n\t */\n\tpublic void setUsua_id(java.lang.Long newUsua_id);\n\t/**\n\t * Get accessor for persistent attribute: id_cita_previa\n\t */\n\tpublic java.lang.Long getId_cita_previa();\n\t/**\n\t * Set accessor for persistent attribute: id_cita_previa\n\t */\n\tpublic void setId_cita_previa(java.lang.Long newId_cita_previa);\n}", "public interface ThuTuc2GiayToPersistence extends BasePersistence<ThuTuc2GiayTo> {\n\t/*\n\t * NOTE FOR DEVELOPERS:\n\t *\n\t * Never modify or reference this interface directly. Always use {@link ThuTuc2GiayToUtil} to access the thu tuc2 giay to persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface.\n\t */\n\n\t/**\n\t* Caches the thu tuc2 giay to in the entity cache if it is enabled.\n\t*\n\t* @param thuTuc2GiayTo the thu tuc2 giay to\n\t*/\n\tpublic void cacheResult(\n\t\torg.oep.cmon.dao.dvc.model.ThuTuc2GiayTo thuTuc2GiayTo);\n\n\t/**\n\t* Caches the thu tuc2 giay tos in the entity cache if it is enabled.\n\t*\n\t* @param thuTuc2GiayTos the thu tuc2 giay tos\n\t*/\n\tpublic void cacheResult(\n\t\tjava.util.List<org.oep.cmon.dao.dvc.model.ThuTuc2GiayTo> thuTuc2GiayTos);\n\n\t/**\n\t* Creates a new thu tuc2 giay to with the primary key. Does not add the thu tuc2 giay to to the database.\n\t*\n\t* @param id the primary key for the new thu tuc2 giay to\n\t* @return the new thu tuc2 giay to\n\t*/\n\tpublic org.oep.cmon.dao.dvc.model.ThuTuc2GiayTo create(long id);\n\n\t/**\n\t* Removes the thu tuc2 giay to with the primary key from the database. Also notifies the appropriate model listeners.\n\t*\n\t* @param id the primary key of the thu tuc2 giay to\n\t* @return the thu tuc2 giay to that was removed\n\t* @throws org.oep.cmon.dao.dvc.NoSuchThuTuc2GiayToException if a thu tuc2 giay to with the primary key could not be found\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic org.oep.cmon.dao.dvc.model.ThuTuc2GiayTo remove(long id)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException,\n\t\t\torg.oep.cmon.dao.dvc.NoSuchThuTuc2GiayToException;\n\n\tpublic org.oep.cmon.dao.dvc.model.ThuTuc2GiayTo updateImpl(\n\t\torg.oep.cmon.dao.dvc.model.ThuTuc2GiayTo thuTuc2GiayTo, boolean merge)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;\n\n\t/**\n\t* Returns the thu tuc2 giay to with the primary key or throws a {@link org.oep.cmon.dao.dvc.NoSuchThuTuc2GiayToException} if it could not be found.\n\t*\n\t* @param id the primary key of the thu tuc2 giay to\n\t* @return the thu tuc2 giay to\n\t* @throws org.oep.cmon.dao.dvc.NoSuchThuTuc2GiayToException if a thu tuc2 giay to with the primary key could not be found\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic org.oep.cmon.dao.dvc.model.ThuTuc2GiayTo findByPrimaryKey(long id)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException,\n\t\t\torg.oep.cmon.dao.dvc.NoSuchThuTuc2GiayToException;\n\n\t/**\n\t* Returns the thu tuc2 giay to with the primary key or returns <code>null</code> if it could not be found.\n\t*\n\t* @param id the primary key of the thu tuc2 giay to\n\t* @return the thu tuc2 giay to, or <code>null</code> if a thu tuc2 giay to with the primary key could not be found\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic org.oep.cmon.dao.dvc.model.ThuTuc2GiayTo fetchByPrimaryKey(long id)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;\n\n\t/**\n\t* Returns all the thu tuc2 giay tos where daXoa = &#63;.\n\t*\n\t* @param daXoa the da xoa\n\t* @return the matching thu tuc2 giay tos\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic java.util.List<org.oep.cmon.dao.dvc.model.ThuTuc2GiayTo> findByTrangThai(\n\t\tint daXoa) throws com.liferay.portal.kernel.exception.SystemException;\n\n\t/**\n\t* Returns a range of all the thu tuc2 giay tos where daXoa = &#63;.\n\t*\n\t* <p>\n\t* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.\n\t* </p>\n\t*\n\t* @param daXoa the da xoa\n\t* @param start the lower bound of the range of thu tuc2 giay tos\n\t* @param end the upper bound of the range of thu tuc2 giay tos (not inclusive)\n\t* @return the range of matching thu tuc2 giay tos\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic java.util.List<org.oep.cmon.dao.dvc.model.ThuTuc2GiayTo> findByTrangThai(\n\t\tint daXoa, int start, int end)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;\n\n\t/**\n\t* Returns an ordered range of all the thu tuc2 giay tos where daXoa = &#63;.\n\t*\n\t* <p>\n\t* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.\n\t* </p>\n\t*\n\t* @param daXoa the da xoa\n\t* @param start the lower bound of the range of thu tuc2 giay tos\n\t* @param end the upper bound of the range of thu tuc2 giay tos (not inclusive)\n\t* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)\n\t* @return the ordered range of matching thu tuc2 giay tos\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic java.util.List<org.oep.cmon.dao.dvc.model.ThuTuc2GiayTo> findByTrangThai(\n\t\tint daXoa, int start, int end,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator orderByComparator)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;\n\n\t/**\n\t* Returns the first thu tuc2 giay to in the ordered set where daXoa = &#63;.\n\t*\n\t* <p>\n\t* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.\n\t* </p>\n\t*\n\t* @param daXoa the da xoa\n\t* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)\n\t* @return the first matching thu tuc2 giay to\n\t* @throws org.oep.cmon.dao.dvc.NoSuchThuTuc2GiayToException if a matching thu tuc2 giay to could not be found\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic org.oep.cmon.dao.dvc.model.ThuTuc2GiayTo findByTrangThai_First(\n\t\tint daXoa,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator orderByComparator)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException,\n\t\t\torg.oep.cmon.dao.dvc.NoSuchThuTuc2GiayToException;\n\n\t/**\n\t* Returns the last thu tuc2 giay to in the ordered set where daXoa = &#63;.\n\t*\n\t* <p>\n\t* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.\n\t* </p>\n\t*\n\t* @param daXoa the da xoa\n\t* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)\n\t* @return the last matching thu tuc2 giay to\n\t* @throws org.oep.cmon.dao.dvc.NoSuchThuTuc2GiayToException if a matching thu tuc2 giay to could not be found\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic org.oep.cmon.dao.dvc.model.ThuTuc2GiayTo findByTrangThai_Last(\n\t\tint daXoa,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator orderByComparator)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException,\n\t\t\torg.oep.cmon.dao.dvc.NoSuchThuTuc2GiayToException;\n\n\t/**\n\t* Returns the thu tuc2 giay tos before and after the current thu tuc2 giay to in the ordered set where daXoa = &#63;.\n\t*\n\t* <p>\n\t* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.\n\t* </p>\n\t*\n\t* @param id the primary key of the current thu tuc2 giay to\n\t* @param daXoa the da xoa\n\t* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)\n\t* @return the previous, current, and next thu tuc2 giay to\n\t* @throws org.oep.cmon.dao.dvc.NoSuchThuTuc2GiayToException if a thu tuc2 giay to with the primary key could not be found\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic org.oep.cmon.dao.dvc.model.ThuTuc2GiayTo[] findByTrangThai_PrevAndNext(\n\t\tlong id, int daXoa,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator orderByComparator)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException,\n\t\t\torg.oep.cmon.dao.dvc.NoSuchThuTuc2GiayToException;\n\n\t/**\n\t* Returns all the thu tuc2 giay tos where thuTucHanhChinhId = &#63; and daXoa = &#63; and giaidoan = &#63;.\n\t*\n\t* @param thuTucHanhChinhId the thu tuc hanh chinh ID\n\t* @param daXoa the da xoa\n\t* @param giaidoan the giaidoan\n\t* @return the matching thu tuc2 giay tos\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic java.util.List<org.oep.cmon.dao.dvc.model.ThuTuc2GiayTo> findByThuTuchanhChinh(\n\t\tlong thuTucHanhChinhId, int daXoa, int giaidoan)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;\n\n\t/**\n\t* Returns a range of all the thu tuc2 giay tos where thuTucHanhChinhId = &#63; and daXoa = &#63; and giaidoan = &#63;.\n\t*\n\t* <p>\n\t* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.\n\t* </p>\n\t*\n\t* @param thuTucHanhChinhId the thu tuc hanh chinh ID\n\t* @param daXoa the da xoa\n\t* @param giaidoan the giaidoan\n\t* @param start the lower bound of the range of thu tuc2 giay tos\n\t* @param end the upper bound of the range of thu tuc2 giay tos (not inclusive)\n\t* @return the range of matching thu tuc2 giay tos\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic java.util.List<org.oep.cmon.dao.dvc.model.ThuTuc2GiayTo> findByThuTuchanhChinh(\n\t\tlong thuTucHanhChinhId, int daXoa, int giaidoan, int start, int end)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;\n\n\t/**\n\t* Returns an ordered range of all the thu tuc2 giay tos where thuTucHanhChinhId = &#63; and daXoa = &#63; and giaidoan = &#63;.\n\t*\n\t* <p>\n\t* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.\n\t* </p>\n\t*\n\t* @param thuTucHanhChinhId the thu tuc hanh chinh ID\n\t* @param daXoa the da xoa\n\t* @param giaidoan the giaidoan\n\t* @param start the lower bound of the range of thu tuc2 giay tos\n\t* @param end the upper bound of the range of thu tuc2 giay tos (not inclusive)\n\t* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)\n\t* @return the ordered range of matching thu tuc2 giay tos\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic java.util.List<org.oep.cmon.dao.dvc.model.ThuTuc2GiayTo> findByThuTuchanhChinh(\n\t\tlong thuTucHanhChinhId, int daXoa, int giaidoan, int start, int end,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator orderByComparator)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;\n\n\t/**\n\t* Returns the first thu tuc2 giay to in the ordered set where thuTucHanhChinhId = &#63; and daXoa = &#63; and giaidoan = &#63;.\n\t*\n\t* <p>\n\t* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.\n\t* </p>\n\t*\n\t* @param thuTucHanhChinhId the thu tuc hanh chinh ID\n\t* @param daXoa the da xoa\n\t* @param giaidoan the giaidoan\n\t* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)\n\t* @return the first matching thu tuc2 giay to\n\t* @throws org.oep.cmon.dao.dvc.NoSuchThuTuc2GiayToException if a matching thu tuc2 giay to could not be found\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic org.oep.cmon.dao.dvc.model.ThuTuc2GiayTo findByThuTuchanhChinh_First(\n\t\tlong thuTucHanhChinhId, int daXoa, int giaidoan,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator orderByComparator)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException,\n\t\t\torg.oep.cmon.dao.dvc.NoSuchThuTuc2GiayToException;\n\n\t/**\n\t* Returns the last thu tuc2 giay to in the ordered set where thuTucHanhChinhId = &#63; and daXoa = &#63; and giaidoan = &#63;.\n\t*\n\t* <p>\n\t* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.\n\t* </p>\n\t*\n\t* @param thuTucHanhChinhId the thu tuc hanh chinh ID\n\t* @param daXoa the da xoa\n\t* @param giaidoan the giaidoan\n\t* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)\n\t* @return the last matching thu tuc2 giay to\n\t* @throws org.oep.cmon.dao.dvc.NoSuchThuTuc2GiayToException if a matching thu tuc2 giay to could not be found\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic org.oep.cmon.dao.dvc.model.ThuTuc2GiayTo findByThuTuchanhChinh_Last(\n\t\tlong thuTucHanhChinhId, int daXoa, int giaidoan,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator orderByComparator)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException,\n\t\t\torg.oep.cmon.dao.dvc.NoSuchThuTuc2GiayToException;\n\n\t/**\n\t* Returns the thu tuc2 giay tos before and after the current thu tuc2 giay to in the ordered set where thuTucHanhChinhId = &#63; and daXoa = &#63; and giaidoan = &#63;.\n\t*\n\t* <p>\n\t* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.\n\t* </p>\n\t*\n\t* @param id the primary key of the current thu tuc2 giay to\n\t* @param thuTucHanhChinhId the thu tuc hanh chinh ID\n\t* @param daXoa the da xoa\n\t* @param giaidoan the giaidoan\n\t* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)\n\t* @return the previous, current, and next thu tuc2 giay to\n\t* @throws org.oep.cmon.dao.dvc.NoSuchThuTuc2GiayToException if a thu tuc2 giay to with the primary key could not be found\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic org.oep.cmon.dao.dvc.model.ThuTuc2GiayTo[] findByThuTuchanhChinh_PrevAndNext(\n\t\tlong id, long thuTucHanhChinhId, int daXoa, int giaidoan,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator orderByComparator)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException,\n\t\t\torg.oep.cmon.dao.dvc.NoSuchThuTuc2GiayToException;\n\n\t/**\n\t* Returns all the thu tuc2 giay tos where thuTucHanhChinhId = &#63; and danhMucGiayToId = &#63; and giaidoan = &#63;.\n\t*\n\t* @param thuTucHanhChinhId the thu tuc hanh chinh ID\n\t* @param danhMucGiayToId the danh muc giay to ID\n\t* @param giaidoan the giaidoan\n\t* @return the matching thu tuc2 giay tos\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic java.util.List<org.oep.cmon.dao.dvc.model.ThuTuc2GiayTo> findByThuTuc2GiayTo(\n\t\tlong thuTucHanhChinhId, long danhMucGiayToId, int giaidoan)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;\n\n\t/**\n\t* Returns a range of all the thu tuc2 giay tos where thuTucHanhChinhId = &#63; and danhMucGiayToId = &#63; and giaidoan = &#63;.\n\t*\n\t* <p>\n\t* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.\n\t* </p>\n\t*\n\t* @param thuTucHanhChinhId the thu tuc hanh chinh ID\n\t* @param danhMucGiayToId the danh muc giay to ID\n\t* @param giaidoan the giaidoan\n\t* @param start the lower bound of the range of thu tuc2 giay tos\n\t* @param end the upper bound of the range of thu tuc2 giay tos (not inclusive)\n\t* @return the range of matching thu tuc2 giay tos\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic java.util.List<org.oep.cmon.dao.dvc.model.ThuTuc2GiayTo> findByThuTuc2GiayTo(\n\t\tlong thuTucHanhChinhId, long danhMucGiayToId, int giaidoan, int start,\n\t\tint end) throws com.liferay.portal.kernel.exception.SystemException;\n\n\t/**\n\t* Returns an ordered range of all the thu tuc2 giay tos where thuTucHanhChinhId = &#63; and danhMucGiayToId = &#63; and giaidoan = &#63;.\n\t*\n\t* <p>\n\t* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.\n\t* </p>\n\t*\n\t* @param thuTucHanhChinhId the thu tuc hanh chinh ID\n\t* @param danhMucGiayToId the danh muc giay to ID\n\t* @param giaidoan the giaidoan\n\t* @param start the lower bound of the range of thu tuc2 giay tos\n\t* @param end the upper bound of the range of thu tuc2 giay tos (not inclusive)\n\t* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)\n\t* @return the ordered range of matching thu tuc2 giay tos\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic java.util.List<org.oep.cmon.dao.dvc.model.ThuTuc2GiayTo> findByThuTuc2GiayTo(\n\t\tlong thuTucHanhChinhId, long danhMucGiayToId, int giaidoan, int start,\n\t\tint end,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator orderByComparator)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;\n\n\t/**\n\t* Returns the first thu tuc2 giay to in the ordered set where thuTucHanhChinhId = &#63; and danhMucGiayToId = &#63; and giaidoan = &#63;.\n\t*\n\t* <p>\n\t* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.\n\t* </p>\n\t*\n\t* @param thuTucHanhChinhId the thu tuc hanh chinh ID\n\t* @param danhMucGiayToId the danh muc giay to ID\n\t* @param giaidoan the giaidoan\n\t* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)\n\t* @return the first matching thu tuc2 giay to\n\t* @throws org.oep.cmon.dao.dvc.NoSuchThuTuc2GiayToException if a matching thu tuc2 giay to could not be found\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic org.oep.cmon.dao.dvc.model.ThuTuc2GiayTo findByThuTuc2GiayTo_First(\n\t\tlong thuTucHanhChinhId, long danhMucGiayToId, int giaidoan,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator orderByComparator)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException,\n\t\t\torg.oep.cmon.dao.dvc.NoSuchThuTuc2GiayToException;\n\n\t/**\n\t* Returns the last thu tuc2 giay to in the ordered set where thuTucHanhChinhId = &#63; and danhMucGiayToId = &#63; and giaidoan = &#63;.\n\t*\n\t* <p>\n\t* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.\n\t* </p>\n\t*\n\t* @param thuTucHanhChinhId the thu tuc hanh chinh ID\n\t* @param danhMucGiayToId the danh muc giay to ID\n\t* @param giaidoan the giaidoan\n\t* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)\n\t* @return the last matching thu tuc2 giay to\n\t* @throws org.oep.cmon.dao.dvc.NoSuchThuTuc2GiayToException if a matching thu tuc2 giay to could not be found\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic org.oep.cmon.dao.dvc.model.ThuTuc2GiayTo findByThuTuc2GiayTo_Last(\n\t\tlong thuTucHanhChinhId, long danhMucGiayToId, int giaidoan,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator orderByComparator)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException,\n\t\t\torg.oep.cmon.dao.dvc.NoSuchThuTuc2GiayToException;\n\n\t/**\n\t* Returns the thu tuc2 giay tos before and after the current thu tuc2 giay to in the ordered set where thuTucHanhChinhId = &#63; and danhMucGiayToId = &#63; and giaidoan = &#63;.\n\t*\n\t* <p>\n\t* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.\n\t* </p>\n\t*\n\t* @param id the primary key of the current thu tuc2 giay to\n\t* @param thuTucHanhChinhId the thu tuc hanh chinh ID\n\t* @param danhMucGiayToId the danh muc giay to ID\n\t* @param giaidoan the giaidoan\n\t* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)\n\t* @return the previous, current, and next thu tuc2 giay to\n\t* @throws org.oep.cmon.dao.dvc.NoSuchThuTuc2GiayToException if a thu tuc2 giay to with the primary key could not be found\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic org.oep.cmon.dao.dvc.model.ThuTuc2GiayTo[] findByThuTuc2GiayTo_PrevAndNext(\n\t\tlong id, long thuTucHanhChinhId, long danhMucGiayToId, int giaidoan,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator orderByComparator)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException,\n\t\t\torg.oep.cmon.dao.dvc.NoSuchThuTuc2GiayToException;\n\n\t/**\n\t* Returns all the thu tuc2 giay tos.\n\t*\n\t* @return the thu tuc2 giay tos\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic java.util.List<org.oep.cmon.dao.dvc.model.ThuTuc2GiayTo> findAll()\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;\n\n\t/**\n\t* Returns a range of all the thu tuc2 giay tos.\n\t*\n\t* <p>\n\t* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.\n\t* </p>\n\t*\n\t* @param start the lower bound of the range of thu tuc2 giay tos\n\t* @param end the upper bound of the range of thu tuc2 giay tos (not inclusive)\n\t* @return the range of thu tuc2 giay tos\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic java.util.List<org.oep.cmon.dao.dvc.model.ThuTuc2GiayTo> findAll(\n\t\tint start, int end)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;\n\n\t/**\n\t* Returns an ordered range of all the thu tuc2 giay tos.\n\t*\n\t* <p>\n\t* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.\n\t* </p>\n\t*\n\t* @param start the lower bound of the range of thu tuc2 giay tos\n\t* @param end the upper bound of the range of thu tuc2 giay tos (not inclusive)\n\t* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)\n\t* @return the ordered range of thu tuc2 giay tos\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic java.util.List<org.oep.cmon.dao.dvc.model.ThuTuc2GiayTo> findAll(\n\t\tint start, int end,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator orderByComparator)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;\n\n\t/**\n\t* Removes all the thu tuc2 giay tos where daXoa = &#63; from the database.\n\t*\n\t* @param daXoa the da xoa\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic void removeByTrangThai(int daXoa)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;\n\n\t/**\n\t* Removes all the thu tuc2 giay tos where thuTucHanhChinhId = &#63; and daXoa = &#63; and giaidoan = &#63; from the database.\n\t*\n\t* @param thuTucHanhChinhId the thu tuc hanh chinh ID\n\t* @param daXoa the da xoa\n\t* @param giaidoan the giaidoan\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic void removeByThuTuchanhChinh(long thuTucHanhChinhId, int daXoa,\n\t\tint giaidoan)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;\n\n\t/**\n\t* Removes all the thu tuc2 giay tos where thuTucHanhChinhId = &#63; and danhMucGiayToId = &#63; and giaidoan = &#63; from the database.\n\t*\n\t* @param thuTucHanhChinhId the thu tuc hanh chinh ID\n\t* @param danhMucGiayToId the danh muc giay to ID\n\t* @param giaidoan the giaidoan\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic void removeByThuTuc2GiayTo(long thuTucHanhChinhId,\n\t\tlong danhMucGiayToId, int giaidoan)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;\n\n\t/**\n\t* Removes all the thu tuc2 giay tos from the database.\n\t*\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic void removeAll()\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;\n\n\t/**\n\t* Returns the number of thu tuc2 giay tos where daXoa = &#63;.\n\t*\n\t* @param daXoa the da xoa\n\t* @return the number of matching thu tuc2 giay tos\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic int countByTrangThai(int daXoa)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;\n\n\t/**\n\t* Returns the number of thu tuc2 giay tos where thuTucHanhChinhId = &#63; and daXoa = &#63; and giaidoan = &#63;.\n\t*\n\t* @param thuTucHanhChinhId the thu tuc hanh chinh ID\n\t* @param daXoa the da xoa\n\t* @param giaidoan the giaidoan\n\t* @return the number of matching thu tuc2 giay tos\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic int countByThuTuchanhChinh(long thuTucHanhChinhId, int daXoa,\n\t\tint giaidoan)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;\n\n\t/**\n\t* Returns the number of thu tuc2 giay tos where thuTucHanhChinhId = &#63; and danhMucGiayToId = &#63; and giaidoan = &#63;.\n\t*\n\t* @param thuTucHanhChinhId the thu tuc hanh chinh ID\n\t* @param danhMucGiayToId the danh muc giay to ID\n\t* @param giaidoan the giaidoan\n\t* @return the number of matching thu tuc2 giay tos\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic int countByThuTuc2GiayTo(long thuTucHanhChinhId,\n\t\tlong danhMucGiayToId, int giaidoan)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;\n\n\t/**\n\t* Returns the number of thu tuc2 giay tos.\n\t*\n\t* @return the number of thu tuc2 giay tos\n\t* @throws SystemException if a system exception occurred\n\t*/\n\tpublic int countAll()\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;\n}", "@PersistenceCapable\n@Inheritance(strategy=InheritanceStrategy.SUPERCLASS_TABLE)\npublic interface PIDSEmployee extends IEmployee, PIDSPerson {\n\n @Column(name=\"HIREDATE\")\n Date getHiredate();\n @Column(name=\"WEEKLYHOURS\")\n double getWeeklyhours();\n @Persistent(mappedBy=\"reviewers\")\n @Element(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIDSProject.class)\n Set getReviewedProjects();\n @Persistent(mappedBy=\"members\")\n @Element(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIDSProject.class)\n Set getProjects();\n @Persistent(mappedBy=\"employee\",types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIDSDentalInsurance.class)\n IDentalInsurance getDentalInsurance();\n @Persistent(mappedBy=\"employee\",types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIDSMedicalInsurance.class)\n IMedicalInsurance getMedicalInsurance();\n @Persistent(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIDSDepartment.class)\n @Column(name=\"DEPARTMENT\")\n IDepartment getDepartment();\n @Persistent(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIDSDepartment.class)\n @Column(name=\"FUNDINGDEPT\")\n IDepartment getFundingDept();\n @Persistent(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIDSEmployee.class)\n @Column(name=\"MANAGER\")\n IEmployee getManager();\n @Persistent(mappedBy=\"manager\")\n @Element(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIDSEmployee.class)\n Set getTeam();\n @Persistent(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIDSEmployee.class)\n @Column(name=\"MENTOR\")\n IEmployee getMentor();\n @Persistent(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIDSEmployee.class, mappedBy=\"mentor\")\n IEmployee getProtege();\n @Persistent(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIDSEmployee.class)\n @Column(name=\"HRADVISOR\")\n IEmployee getHradvisor();\n @Persistent(mappedBy=\"hradvisor\")\n @Element(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIDSEmployee.class)\n Set getHradvisees();\n \n void setHiredate(Date hiredate);\n void setWeeklyhours(double weeklyhours);\n void setReviewedProjects(Set reviewedProjects);\n void setProjects(Set projects);\n void setDentalInsurance(IDentalInsurance dentalInsurance);\n void setMedicalInsurance(IMedicalInsurance medicalInsurance);\n void setDepartment(IDepartment department);\n void setFundingDept(IDepartment department);\n void setManager(IEmployee manager);\n void setTeam(Set team);\n void setMentor(IEmployee mentor);\n void setProtege(IEmployee protege);\n void setHradvisor(IEmployee hradvisor);\n void setHradvisees(Set hradvisees);\n \n}", "public interface CProductoMapper {\r\n \r\n // <editor-fold defaultstate=\"collapsed\" desc=\"CONSULTAS DEFINIDAS\">\r\n \r\n static final String FIND_ALL = \"SELECT \"\r\n + \" productos.id as recid,\"\r\n + \" productos.codigo,\"\r\n + \" productos.descripcion,\"\r\n + \" productos.unidad_produccion as unidadProductiva, \"\r\n + \" unidades_productivas.codigo AS codigoUnidadProduccion \"\r\n + \"FROM productos \"\r\n + \"LEFT JOIN unidades_productivas ON \"\r\n + \"unidades_productivas.id = productos.unidad_produccion\";\r\n \r\n static final String FIND_BY_CODE = \"SELECT \"\r\n + \" productos.id \"\r\n + \"FROM productos WHERE productos.codigo = #{code}\";\r\n \r\n // </editor-fold>\r\n \r\n /**\r\n * Query que regresa todos los productos existentes\r\n * @return lista de productos\r\n */\r\n @Select(FIND_ALL)\r\n public List<CProducto> findAll(); \r\n \r\n /**\r\n * Query que me permite ubicar un registro de la tabla de productos a partir de\r\n * un código. \r\n * @param code el código bajo el cual se busca\r\n * @return el id del registro.\r\n */\r\n @Select(FIND_BY_CODE)\r\n public Long findByCode(String code);\r\n}", "@Override\n\tpublic OperadoraDAO getOperadoraDAO() {\n\t\treturn new JPAOperadoraDAO();\n\t}", "public BOEmpresa() {\r\n\t\tdaoEmpresa = new DAOEmpresaJPA();\r\n\t}", "protected JpaModule() {\n }", "public BookJPAImpl(TxDAOFactoryImpl factory) {\n\t\t//emf = Persistence.createEntityManagerFactory(\"sistemiDistribuitiLS\");\n\t\tthis.em = factory.getEntityManager();\n\t}", "private List<Produto> retornaProduto (Long cod){\n \n Query q = entityManager.createNamedQuery(\"Produto.findByCodigo\");\n q.setParameter(\"codigo\", cod);\n List <Produto> p = q.getResultList();\n return p; \n}", "@Override\n\tprotected EntityManager getEntityManager() {\n\t return em;\n\t}", "public BemPessoaDAOImpl() {\n\t\tsuper(\"PESQUISAR_BEM_PESSOA\");\n\t}", "public interface EntitlementPersistence extends BasePersistence<Entitlement> {\n /*\n * NOTE FOR DEVELOPERS:\n *\n * Never modify or reference this interface directly. Always use {@link EntitlementUtil} to access the entitlement persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface.\n */\n\n /**\n * Caches the entitlement in the entity cache if it is enabled.\n *\n * @param entitlement the entitlement\n */\n public void cacheResult(\n de.fraunhofer.fokus.movepla.model.Entitlement entitlement);\n\n /**\n * Caches the entitlements in the entity cache if it is enabled.\n *\n * @param entitlements the entitlements\n */\n public void cacheResult(\n java.util.List<de.fraunhofer.fokus.movepla.model.Entitlement> entitlements);\n\n /**\n * Creates a new entitlement with the primary key. Does not add the entitlement to the database.\n *\n * @param entitlementId the primary key for the new entitlement\n * @return the new entitlement\n */\n public de.fraunhofer.fokus.movepla.model.Entitlement create(\n long entitlementId);\n\n /**\n * Removes the entitlement with the primary key from the database. Also notifies the appropriate model listeners.\n *\n * @param entitlementId the primary key of the entitlement\n * @return the entitlement that was removed\n * @throws de.fraunhofer.fokus.movepla.NoSuchEntitlementException if a entitlement with the primary key could not be found\n * @throws SystemException if a system exception occurred\n */\n public de.fraunhofer.fokus.movepla.model.Entitlement remove(\n long entitlementId)\n throws com.liferay.portal.kernel.exception.SystemException,\n de.fraunhofer.fokus.movepla.NoSuchEntitlementException;\n\n public de.fraunhofer.fokus.movepla.model.Entitlement updateImpl(\n de.fraunhofer.fokus.movepla.model.Entitlement entitlement, boolean merge)\n throws com.liferay.portal.kernel.exception.SystemException;\n\n /**\n * Returns the entitlement with the primary key or throws a {@link de.fraunhofer.fokus.movepla.NoSuchEntitlementException} if it could not be found.\n *\n * @param entitlementId the primary key of the entitlement\n * @return the entitlement\n * @throws de.fraunhofer.fokus.movepla.NoSuchEntitlementException if a entitlement with the primary key could not be found\n * @throws SystemException if a system exception occurred\n */\n public de.fraunhofer.fokus.movepla.model.Entitlement findByPrimaryKey(\n long entitlementId)\n throws com.liferay.portal.kernel.exception.SystemException,\n de.fraunhofer.fokus.movepla.NoSuchEntitlementException;\n\n /**\n * Returns the entitlement with the primary key or returns <code>null</code> if it could not be found.\n *\n * @param entitlementId the primary key of the entitlement\n * @return the entitlement, or <code>null</code> if a entitlement with the primary key could not be found\n * @throws SystemException if a system exception occurred\n */\n public de.fraunhofer.fokus.movepla.model.Entitlement fetchByPrimaryKey(\n long entitlementId)\n throws com.liferay.portal.kernel.exception.SystemException;\n\n /**\n * Returns all the entitlements where companyId = &#63;.\n *\n * @param companyId the company ID\n * @return the matching entitlements\n * @throws SystemException if a system exception occurred\n */\n public java.util.List<de.fraunhofer.fokus.movepla.model.Entitlement> findByc(\n long companyId)\n throws com.liferay.portal.kernel.exception.SystemException;\n\n /**\n * Returns a range of all the entitlements where companyId = &#63;.\n *\n * <p>\n * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.\n * </p>\n *\n * @param companyId the company ID\n * @param start the lower bound of the range of entitlements\n * @param end the upper bound of the range of entitlements (not inclusive)\n * @return the range of matching entitlements\n * @throws SystemException if a system exception occurred\n */\n public java.util.List<de.fraunhofer.fokus.movepla.model.Entitlement> findByc(\n long companyId, int start, int end)\n throws com.liferay.portal.kernel.exception.SystemException;\n\n /**\n * Returns an ordered range of all the entitlements where companyId = &#63;.\n *\n * <p>\n * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.\n * </p>\n *\n * @param companyId the company ID\n * @param start the lower bound of the range of entitlements\n * @param end the upper bound of the range of entitlements (not inclusive)\n * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)\n * @return the ordered range of matching entitlements\n * @throws SystemException if a system exception occurred\n */\n public java.util.List<de.fraunhofer.fokus.movepla.model.Entitlement> findByc(\n long companyId, int start, int end,\n com.liferay.portal.kernel.util.OrderByComparator orderByComparator)\n throws com.liferay.portal.kernel.exception.SystemException;\n\n /**\n * Returns the first entitlement in the ordered set where companyId = &#63;.\n *\n * @param companyId the company ID\n * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)\n * @return the first matching entitlement\n * @throws de.fraunhofer.fokus.movepla.NoSuchEntitlementException if a matching entitlement could not be found\n * @throws SystemException if a system exception occurred\n */\n public de.fraunhofer.fokus.movepla.model.Entitlement findByc_First(\n long companyId,\n com.liferay.portal.kernel.util.OrderByComparator orderByComparator)\n throws com.liferay.portal.kernel.exception.SystemException,\n de.fraunhofer.fokus.movepla.NoSuchEntitlementException;\n\n /**\n * Returns the first entitlement in the ordered set where companyId = &#63;.\n *\n * @param companyId the company ID\n * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)\n * @return the first matching entitlement, or <code>null</code> if a matching entitlement could not be found\n * @throws SystemException if a system exception occurred\n */\n public de.fraunhofer.fokus.movepla.model.Entitlement fetchByc_First(\n long companyId,\n com.liferay.portal.kernel.util.OrderByComparator orderByComparator)\n throws com.liferay.portal.kernel.exception.SystemException;\n\n /**\n * Returns the last entitlement in the ordered set where companyId = &#63;.\n *\n * @param companyId the company ID\n * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)\n * @return the last matching entitlement\n * @throws de.fraunhofer.fokus.movepla.NoSuchEntitlementException if a matching entitlement could not be found\n * @throws SystemException if a system exception occurred\n */\n public de.fraunhofer.fokus.movepla.model.Entitlement findByc_Last(\n long companyId,\n com.liferay.portal.kernel.util.OrderByComparator orderByComparator)\n throws com.liferay.portal.kernel.exception.SystemException,\n de.fraunhofer.fokus.movepla.NoSuchEntitlementException;\n\n /**\n * Returns the last entitlement in the ordered set where companyId = &#63;.\n *\n * @param companyId the company ID\n * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)\n * @return the last matching entitlement, or <code>null</code> if a matching entitlement could not be found\n * @throws SystemException if a system exception occurred\n */\n public de.fraunhofer.fokus.movepla.model.Entitlement fetchByc_Last(\n long companyId,\n com.liferay.portal.kernel.util.OrderByComparator orderByComparator)\n throws com.liferay.portal.kernel.exception.SystemException;\n\n /**\n * Returns the entitlements before and after the current entitlement in the ordered set where companyId = &#63;.\n *\n * @param entitlementId the primary key of the current entitlement\n * @param companyId the company ID\n * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)\n * @return the previous, current, and next entitlement\n * @throws de.fraunhofer.fokus.movepla.NoSuchEntitlementException if a entitlement with the primary key could not be found\n * @throws SystemException if a system exception occurred\n */\n public de.fraunhofer.fokus.movepla.model.Entitlement[] findByc_PrevAndNext(\n long entitlementId, long companyId,\n com.liferay.portal.kernel.util.OrderByComparator orderByComparator)\n throws com.liferay.portal.kernel.exception.SystemException,\n de.fraunhofer.fokus.movepla.NoSuchEntitlementException;\n\n /**\n * Returns all the entitlements.\n *\n * @return the entitlements\n * @throws SystemException if a system exception occurred\n */\n public java.util.List<de.fraunhofer.fokus.movepla.model.Entitlement> findAll()\n throws com.liferay.portal.kernel.exception.SystemException;\n\n /**\n * Returns a range of all the entitlements.\n *\n * <p>\n * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.\n * </p>\n *\n * @param start the lower bound of the range of entitlements\n * @param end the upper bound of the range of entitlements (not inclusive)\n * @return the range of entitlements\n * @throws SystemException if a system exception occurred\n */\n public java.util.List<de.fraunhofer.fokus.movepla.model.Entitlement> findAll(\n int start, int end)\n throws com.liferay.portal.kernel.exception.SystemException;\n\n /**\n * Returns an ordered range of all the entitlements.\n *\n * <p>\n * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.\n * </p>\n *\n * @param start the lower bound of the range of entitlements\n * @param end the upper bound of the range of entitlements (not inclusive)\n * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)\n * @return the ordered range of entitlements\n * @throws SystemException if a system exception occurred\n */\n public java.util.List<de.fraunhofer.fokus.movepla.model.Entitlement> findAll(\n int start, int end,\n com.liferay.portal.kernel.util.OrderByComparator orderByComparator)\n throws com.liferay.portal.kernel.exception.SystemException;\n\n /**\n * Removes all the entitlements where companyId = &#63; from the database.\n *\n * @param companyId the company ID\n * @throws SystemException if a system exception occurred\n */\n public void removeByc(long companyId)\n throws com.liferay.portal.kernel.exception.SystemException;\n\n /**\n * Removes all the entitlements from the database.\n *\n * @throws SystemException if a system exception occurred\n */\n public void removeAll()\n throws com.liferay.portal.kernel.exception.SystemException;\n\n /**\n * Returns the number of entitlements where companyId = &#63;.\n *\n * @param companyId the company ID\n * @return the number of matching entitlements\n * @throws SystemException if a system exception occurred\n */\n public int countByc(long companyId)\n throws com.liferay.portal.kernel.exception.SystemException;\n\n /**\n * Returns the number of entitlements.\n *\n * @return the number of entitlements\n * @throws SystemException if a system exception occurred\n */\n public int countAll()\n throws com.liferay.portal.kernel.exception.SystemException;\n\n /**\n * Returns all the application_ entitlements associated with the entitlement.\n *\n * @param pk the primary key of the entitlement\n * @return the application_ entitlements associated with the entitlement\n * @throws SystemException if a system exception occurred\n */\n public java.util.List<de.fraunhofer.fokus.movepla.model.Application_Entitlement> getApplication_Entitlements(\n long pk) throws com.liferay.portal.kernel.exception.SystemException;\n\n /**\n * Returns a range of all the application_ entitlements associated with the entitlement.\n *\n * <p>\n * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.\n * </p>\n *\n * @param pk the primary key of the entitlement\n * @param start the lower bound of the range of entitlements\n * @param end the upper bound of the range of entitlements (not inclusive)\n * @return the range of application_ entitlements associated with the entitlement\n * @throws SystemException if a system exception occurred\n */\n public java.util.List<de.fraunhofer.fokus.movepla.model.Application_Entitlement> getApplication_Entitlements(\n long pk, int start, int end)\n throws com.liferay.portal.kernel.exception.SystemException;\n\n /**\n * Returns an ordered range of all the application_ entitlements associated with the entitlement.\n *\n * <p>\n * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.\n * </p>\n *\n * @param pk the primary key of the entitlement\n * @param start the lower bound of the range of entitlements\n * @param end the upper bound of the range of entitlements (not inclusive)\n * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)\n * @return the ordered range of application_ entitlements associated with the entitlement\n * @throws SystemException if a system exception occurred\n */\n public java.util.List<de.fraunhofer.fokus.movepla.model.Application_Entitlement> getApplication_Entitlements(\n long pk, int start, int end,\n com.liferay.portal.kernel.util.OrderByComparator orderByComparator)\n throws com.liferay.portal.kernel.exception.SystemException;\n\n /**\n * Returns the number of application_ entitlements associated with the entitlement.\n *\n * @param pk the primary key of the entitlement\n * @return the number of application_ entitlements associated with the entitlement\n * @throws SystemException if a system exception occurred\n */\n public int getApplication_EntitlementsSize(long pk)\n throws com.liferay.portal.kernel.exception.SystemException;\n\n /**\n * Returns <code>true</code> if the application_ entitlement is associated with the entitlement.\n *\n * @param pk the primary key of the entitlement\n * @param application_EntitlementPK the primary key of the application_ entitlement\n * @return <code>true</code> if the application_ entitlement is associated with the entitlement; <code>false</code> otherwise\n * @throws SystemException if a system exception occurred\n */\n public boolean containsApplication_Entitlement(long pk,\n long application_EntitlementPK)\n throws com.liferay.portal.kernel.exception.SystemException;\n\n /**\n * Returns <code>true</code> if the entitlement has any application_ entitlements associated with it.\n *\n * @param pk the primary key of the entitlement to check for associations with application_ entitlements\n * @return <code>true</code> if the entitlement has any application_ entitlements associated with it; <code>false</code> otherwise\n * @throws SystemException if a system exception occurred\n */\n public boolean containsApplication_Entitlements(long pk)\n throws com.liferay.portal.kernel.exception.SystemException;\n}", "public interface PersonLocal extends javax.ejb.EJBLocalObject {\r\n\t/**\r\n\t * Get accessor for persistent attribute: password\r\n\t */\r\n\tpublic java.lang.String getPassword();\r\n\t/**\r\n\t * Set accessor for persistent attribute: password\r\n\t */\r\n\tpublic void setPassword(java.lang.String newPassword);\r\n\t/**\r\n\t * Get accessor for persistent attribute: firstName\r\n\t */\r\n\tpublic java.lang.String getFirstName();\r\n\t/**\r\n\t * Set accessor for persistent attribute: firstName\r\n\t */\r\n\tpublic void setFirstName(java.lang.String newFirstName);\r\n\t/**\r\n\t * Get accessor for persistent attribute: lastName\r\n\t */\r\n\tpublic java.lang.String getLastName();\r\n\t/**\r\n\t * Set accessor for persistent attribute: lastName\r\n\t */\r\n\tpublic void setLastName(java.lang.String newLastName);\r\n\t/**\r\n\t * Get accessor for persistent attribute: emailAddress\r\n\t */\r\n\tpublic java.lang.String getEmailAddress();\r\n\t/**\r\n\t * Set accessor for persistent attribute: emailAddress\r\n\t */\r\n\tpublic void setEmailAddress(java.lang.String newEmailAddress);\r\n\t/**\r\n\t * This method was generated for supporting the relationship role named todo.\r\n\t * It will be deleted/edited when the relationship is deleted/edited.\r\n\t */\r\n\tpublic java.util.Collection getTodo();\r\n\t/**\r\n\t * This method was generated for supporting the relationship role named todo.\r\n\t * It will be deleted/edited when the relationship is deleted/edited.\r\n\t */\r\n\tpublic void setTodo(java.util.Collection aTodo);\r\n\t/**\r\n\t * This is our method to get all todos for one person\r\n\t */\r\n\tpublic java.util.Collection getTodos();\r\n\tpublic boolean isPasswordCorrect(String password);\r\n}", "public interface PartOfRelation\r\n{\r\n\r\n\t/**\r\n\t * Sets author\r\n\t * \r\n\t * @param author\r\n\t */\r\n\tvoid setAuthor(String author);\r\n\r\n\r\n\t/**\r\n\t * @return Author\r\n\t */\r\n\tString getAuthor();\r\n\r\n\t/**\r\n\t * Sets class type, one typical value is '300'\r\n\t * \r\n\t * @param classType\r\n\t */\r\n\tvoid setClassType(String classType);\r\n\r\n\t/**\r\n\t * @return class type\r\n\t */\r\n\tString getClassType();\r\n\r\n\t/**\r\n\t * Sets object key, for material items this is the product ID.\r\n\t * \r\n\t * @param objectKey\r\n\t */\r\n\tvoid setObjectKey(String objectKey);\r\n\r\n\t/**\r\n\t * @return Object key.\r\n\t */\r\n\tString getObjectKey();\r\n\r\n\t/**\r\n\t * Sets object type, product or an abstract product representative\r\n\t * \r\n\t * @param objectType\r\n\t */\r\n\tvoid setObjectType(String objectType);\r\n\r\n\t/**\r\n\t * @return Object type\r\n\t */\r\n\tString getObjectType();\r\n\r\n\t/**\r\n\t * Sets position in the BOM\r\n\t * \r\n\t * @param posNr\r\n\t */\r\n\tvoid setPosNr(String posNr);\r\n\r\n\t/**\r\n\t * @return Position number\r\n\t */\r\n\tString getPosNr();\r\n\r\n\t/**\r\n\t * Sets parent instance ID\r\n\t * \r\n\t * @param parentInstId\r\n\t */\r\n\tvoid setParentInstId(String parentInstId);\r\n\r\n\t/**\r\n\t * @return Parent instance ID\r\n\t */\r\n\tString getParentInstId();\r\n\r\n\t/**\r\n\t * Sets child instance ID\r\n\t * \r\n\t * @param instId\r\n\t */\r\n\tvoid setInstId(String instId);\r\n\r\n\t/**\r\n\t * @return Child instance ID\r\n\t */\r\n\tString getInstId();\r\n}", "@ProviderType\npublic interface PlanoSaudePersistence extends BasePersistence<PlanoSaude> {\n\n\t/*\n\t * NOTE FOR DEVELOPERS:\n\t *\n\t * Never modify or reference this interface directly. Always use {@link PlanoSaudeUtil} to access the plano saude persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface.\n\t */\n\n\t/**\n\t * Returns all the plano saudes where descricao = &#63;.\n\t *\n\t * @param descricao the descricao\n\t * @return the matching plano saudes\n\t */\n\tpublic java.util.List<PlanoSaude> findBydescricao(String descricao);\n\n\t/**\n\t * Returns a range of all the plano saudes where descricao = &#63;.\n\t *\n\t * <p>\n\t * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to <code>QueryUtil#ALL_POS</code> will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not <code>QueryUtil#ALL_POS</code>), then the query will include the default ORDER BY logic from <code>PlanoSaudeModelImpl</code>. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.\n\t * </p>\n\t *\n\t * @param descricao the descricao\n\t * @param start the lower bound of the range of plano saudes\n\t * @param end the upper bound of the range of plano saudes (not inclusive)\n\t * @return the range of matching plano saudes\n\t */\n\tpublic java.util.List<PlanoSaude> findBydescricao(\n\t\tString descricao, int start, int end);\n\n\t/**\n\t * Returns an ordered range of all the plano saudes where descricao = &#63;.\n\t *\n\t * <p>\n\t * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to <code>QueryUtil#ALL_POS</code> will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not <code>QueryUtil#ALL_POS</code>), then the query will include the default ORDER BY logic from <code>PlanoSaudeModelImpl</code>. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.\n\t * </p>\n\t *\n\t * @deprecated As of Mueller (7.2.x), replaced by {@link #findBydescricao(String, int, int, OrderByComparator)}\n\t * @param descricao the descricao\n\t * @param start the lower bound of the range of plano saudes\n\t * @param end the upper bound of the range of plano saudes (not inclusive)\n\t * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)\n\t * @param useFinderCache whether to use the finder cache\n\t * @return the ordered range of matching plano saudes\n\t */\n\t@Deprecated\n\tpublic java.util.List<PlanoSaude> findBydescricao(\n\t\tString descricao, int start, int end,\n\t\tOrderByComparator<PlanoSaude> orderByComparator,\n\t\tboolean useFinderCache);\n\n\t/**\n\t * Returns an ordered range of all the plano saudes where descricao = &#63;.\n\t *\n\t * <p>\n\t * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to <code>QueryUtil#ALL_POS</code> will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not <code>QueryUtil#ALL_POS</code>), then the query will include the default ORDER BY logic from <code>PlanoSaudeModelImpl</code>. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.\n\t * </p>\n\t *\n\t * @param descricao the descricao\n\t * @param start the lower bound of the range of plano saudes\n\t * @param end the upper bound of the range of plano saudes (not inclusive)\n\t * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)\n\t * @return the ordered range of matching plano saudes\n\t */\n\tpublic java.util.List<PlanoSaude> findBydescricao(\n\t\tString descricao, int start, int end,\n\t\tOrderByComparator<PlanoSaude> orderByComparator);\n\n\t/**\n\t * Returns the first plano saude in the ordered set where descricao = &#63;.\n\t *\n\t * @param descricao the descricao\n\t * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)\n\t * @return the first matching plano saude\n\t * @throws NoSuchPlanoSaudeException if a matching plano saude could not be found\n\t */\n\tpublic PlanoSaude findBydescricao_First(\n\t\t\tString descricao, OrderByComparator<PlanoSaude> orderByComparator)\n\t\tthrows NoSuchPlanoSaudeException;\n\n\t/**\n\t * Returns the first plano saude in the ordered set where descricao = &#63;.\n\t *\n\t * @param descricao the descricao\n\t * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)\n\t * @return the first matching plano saude, or <code>null</code> if a matching plano saude could not be found\n\t */\n\tpublic PlanoSaude fetchBydescricao_First(\n\t\tString descricao, OrderByComparator<PlanoSaude> orderByComparator);\n\n\t/**\n\t * Returns the last plano saude in the ordered set where descricao = &#63;.\n\t *\n\t * @param descricao the descricao\n\t * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)\n\t * @return the last matching plano saude\n\t * @throws NoSuchPlanoSaudeException if a matching plano saude could not be found\n\t */\n\tpublic PlanoSaude findBydescricao_Last(\n\t\t\tString descricao, OrderByComparator<PlanoSaude> orderByComparator)\n\t\tthrows NoSuchPlanoSaudeException;\n\n\t/**\n\t * Returns the last plano saude in the ordered set where descricao = &#63;.\n\t *\n\t * @param descricao the descricao\n\t * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)\n\t * @return the last matching plano saude, or <code>null</code> if a matching plano saude could not be found\n\t */\n\tpublic PlanoSaude fetchBydescricao_Last(\n\t\tString descricao, OrderByComparator<PlanoSaude> orderByComparator);\n\n\t/**\n\t * Returns the plano saudes before and after the current plano saude in the ordered set where descricao = &#63;.\n\t *\n\t * @param plano_id the primary key of the current plano saude\n\t * @param descricao the descricao\n\t * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)\n\t * @return the previous, current, and next plano saude\n\t * @throws NoSuchPlanoSaudeException if a plano saude with the primary key could not be found\n\t */\n\tpublic PlanoSaude[] findBydescricao_PrevAndNext(\n\t\t\tlong plano_id, String descricao,\n\t\t\tOrderByComparator<PlanoSaude> orderByComparator)\n\t\tthrows NoSuchPlanoSaudeException;\n\n\t/**\n\t * Removes all the plano saudes where descricao = &#63; from the database.\n\t *\n\t * @param descricao the descricao\n\t */\n\tpublic void removeBydescricao(String descricao);\n\n\t/**\n\t * Returns the number of plano saudes where descricao = &#63;.\n\t *\n\t * @param descricao the descricao\n\t * @return the number of matching plano saudes\n\t */\n\tpublic int countBydescricao(String descricao);\n\n\t/**\n\t * Caches the plano saude in the entity cache if it is enabled.\n\t *\n\t * @param planoSaude the plano saude\n\t */\n\tpublic void cacheResult(PlanoSaude planoSaude);\n\n\t/**\n\t * Caches the plano saudes in the entity cache if it is enabled.\n\t *\n\t * @param planoSaudes the plano saudes\n\t */\n\tpublic void cacheResult(java.util.List<PlanoSaude> planoSaudes);\n\n\t/**\n\t * Creates a new plano saude with the primary key. Does not add the plano saude to the database.\n\t *\n\t * @param plano_id the primary key for the new plano saude\n\t * @return the new plano saude\n\t */\n\tpublic PlanoSaude create(long plano_id);\n\n\t/**\n\t * Removes the plano saude with the primary key from the database. Also notifies the appropriate model listeners.\n\t *\n\t * @param plano_id the primary key of the plano saude\n\t * @return the plano saude that was removed\n\t * @throws NoSuchPlanoSaudeException if a plano saude with the primary key could not be found\n\t */\n\tpublic PlanoSaude remove(long plano_id) throws NoSuchPlanoSaudeException;\n\n\tpublic PlanoSaude updateImpl(PlanoSaude planoSaude);\n\n\t/**\n\t * Returns the plano saude with the primary key or throws a <code>NoSuchPlanoSaudeException</code> if it could not be found.\n\t *\n\t * @param plano_id the primary key of the plano saude\n\t * @return the plano saude\n\t * @throws NoSuchPlanoSaudeException if a plano saude with the primary key could not be found\n\t */\n\tpublic PlanoSaude findByPrimaryKey(long plano_id)\n\t\tthrows NoSuchPlanoSaudeException;\n\n\t/**\n\t * Returns the plano saude with the primary key or returns <code>null</code> if it could not be found.\n\t *\n\t * @param plano_id the primary key of the plano saude\n\t * @return the plano saude, or <code>null</code> if a plano saude with the primary key could not be found\n\t */\n\tpublic PlanoSaude fetchByPrimaryKey(long plano_id);\n\n\t/**\n\t * Returns all the plano saudes.\n\t *\n\t * @return the plano saudes\n\t */\n\tpublic java.util.List<PlanoSaude> findAll();\n\n\t/**\n\t * Returns a range of all the plano saudes.\n\t *\n\t * <p>\n\t * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to <code>QueryUtil#ALL_POS</code> will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not <code>QueryUtil#ALL_POS</code>), then the query will include the default ORDER BY logic from <code>PlanoSaudeModelImpl</code>. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.\n\t * </p>\n\t *\n\t * @param start the lower bound of the range of plano saudes\n\t * @param end the upper bound of the range of plano saudes (not inclusive)\n\t * @return the range of plano saudes\n\t */\n\tpublic java.util.List<PlanoSaude> findAll(int start, int end);\n\n\t/**\n\t * Returns an ordered range of all the plano saudes.\n\t *\n\t * <p>\n\t * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to <code>QueryUtil#ALL_POS</code> will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not <code>QueryUtil#ALL_POS</code>), then the query will include the default ORDER BY logic from <code>PlanoSaudeModelImpl</code>. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.\n\t * </p>\n\t *\n\t * @deprecated As of Mueller (7.2.x), replaced by {@link #findAll(int, int, OrderByComparator)}\n\t * @param start the lower bound of the range of plano saudes\n\t * @param end the upper bound of the range of plano saudes (not inclusive)\n\t * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)\n\t * @param useFinderCache whether to use the finder cache\n\t * @return the ordered range of plano saudes\n\t */\n\t@Deprecated\n\tpublic java.util.List<PlanoSaude> findAll(\n\t\tint start, int end, OrderByComparator<PlanoSaude> orderByComparator,\n\t\tboolean useFinderCache);\n\n\t/**\n\t * Returns an ordered range of all the plano saudes.\n\t *\n\t * <p>\n\t * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to <code>QueryUtil#ALL_POS</code> will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not <code>QueryUtil#ALL_POS</code>), then the query will include the default ORDER BY logic from <code>PlanoSaudeModelImpl</code>. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.\n\t * </p>\n\t *\n\t * @param start the lower bound of the range of plano saudes\n\t * @param end the upper bound of the range of plano saudes (not inclusive)\n\t * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)\n\t * @return the ordered range of plano saudes\n\t */\n\tpublic java.util.List<PlanoSaude> findAll(\n\t\tint start, int end, OrderByComparator<PlanoSaude> orderByComparator);\n\n\t/**\n\t * Removes all the plano saudes from the database.\n\t */\n\tpublic void removeAll();\n\n\t/**\n\t * Returns the number of plano saudes.\n\t *\n\t * @return the number of plano saudes\n\t */\n\tpublic int countAll();\n\n}", "@Test\n public void createQuejaEntityTest() {\n PodamFactory factory = new PodamFactoryImpl();\n QuejaEntity newEntity = factory.manufacturePojo(QuejaEntity.class);\n QuejaEntity result = quejaPersistence.create(newEntity);\n\n Assert.assertNotNull(result);\n QuejaEntity entity = em.find(QuejaEntity.class, result.getId());\n Assert.assertNotNull(entity);\n Assert.assertEquals(newEntity.getName(), entity.getName());\n}", "public ParametroPorParametroPK() {\r\n\t}", "public interface AnutaEntityManager {\n\n /**\n * Saves entity in database\n * @param entity the entity to be saved\n * @param <T> the type if target entity\n * @return saved entity\n */\n public <T> T save(T entity);\n\n /**\n * Loads the entity from data source using entity's id\n * @param entityClass the target entity class\n * @param id the id of entity lo load\n * @param <T> the type if target entity\n * @return Java object, representing the entity if object was found and null otherwise\n */\n public <T> T find(Class<T> entityClass, String id);\n\n\n /**\n * Loads entity without loading all inner collections\n * @param id the id of the entity\n * @return loaded entity, if exists and null otherwise\n */\n public <T> T getPlainEntity(Class<T> entityClass, String id);\n\n /**\n * Updates entity in database\n * @param <T> the type if target entity\n * @return updated entity\n */\n public <T> T update(T entity);\n\n /**\n * Deletes entity from database\n * @param entity the entity to be deleted\n * @param <T> the type if target entity\n * @return true if was removed and false otherwise\n */\n public <T> boolean delete(T entity);\n\n /**\n * Deletes entity from database\n * @param entityClass the class of entity to be deleted\n * @param id the id of entity to be removed\n * @param <T> the type if target entity\n * @return true if was removed and false otherwise\n */\n public <T> boolean delete(Class<T> entityClass, String id);\n\n /**\n * Finds all entities of the given type\n * @param <T> the type if target entity\n * @return list of found entities or empty list if nothing was found\n */\n public <T> List<T> findAll(Class<T> entityClass);\n\n /**\n * Finds all entities of the given type\n * @param <T> the type if target entity\n * @return list of found entities or empty list if nothing was found\n */\n public <T> List<T> findByQuery(AnutaQuery<T> query);\n\n /**\n * Saves all entities into database\n * @param <T> the type if target entity\n * @return collection of saved entities\n */\n public <T> Collection<T> saveAll(Collection<T> entities);\n\n /**\n * Updates all entities in database\n * @param <T> the type if target entity\n * @return collection of updated entities\n */\n public <T> Collection<T> updateAll(Collection<T> entities);\n\n /**\n * Deletes all entities in database\n * @param <T> the type if target entity\n * @return collection of updated entities\n */\n public <T> boolean deleteAll(Collection<T> entities);\n\n /**\n * Deletes all entities in database\n * @param ids collection of ids for entities to be deleted\n * @param <T> the type if target entity\n * @return collection of updated entities\n */\n public <T> boolean deleteAll(Class<T> entityClass, Collection<String> ids);\n\n /**\n * @return the instance of {@link AnutaQueryBuilder} which can be used to build query\n */\n public <T> AnutaQueryBuilder<T> getQueryBuilder(Class<T> cls);\n\n /**\n * Queries data from DB and coverts data from cursor to Java entity.\n * @param query the query to select objects\n * @param <T> type of target entity\n * @return an instance of {@link AnutaEntityCursor} which can be used to iterate objects from database\n */\n public <T> AnutaEntityCursor<T> getEntityCursor(AnutaQuery<T> query);\n\n /**\n * Executes query and returns true if query was executed successfully and false otherwise\n * @param query the query to be executed\n * @return {@code true} if query was executed successfully and {@code false} otherwise\n */\n public <T> boolean executeQuery(AnutaQuery<T> query);\n\n /**\n * Initializes all related collections and entities\n * @param entity the entity to be initialized\n * @return initialized entity. WARNING! The reference of returned object will differ from passed at params\n */\n public <T> T initialize(T entity);\n\n /**\n * Initializes all related collections and entities up to the given level\n * @param entity the entity to be initialized\n * @param level the level of initialization (greater then 0 or one of the following)\n * <ul>\n * <li>{@link DatabaseAccessSession#LEVEL_ENTITY_ONLY} - to load plain entity</li>\n * <li>{@link DatabaseAccessSession#LEVEL_ALL} - to load entity and all dependent collections</li>\n * <li>{@link DatabaseAccessSession#LEVEL_ANNOTATION_BASED} - to load entity and collections will be loaded accorging to annotation config</li>\n * </ul>\n * @return initialized entity. WARNING! The reference of returned object will differ from passed at params\n */\n public <T> T initialize(T entity, int level);\n\n /**\n * Initializes all related collections and entities for the given collection of entities\n * @param entities the collection of entities to be initialized\n * @return initialized entity. WARNING! The reference of returned object will differ from passed at params\n */\n public <T> Collection<T> initialize(Collection<T> entities);\n\n /**\n * Initializes all related collections and entities up to the given level\n * @param entities the collection of entities to be initialized\n * @param level the level of initialization (greater then 0 or one of the following)\n * <ul>\n * <li>{@link DatabaseAccessSession#LEVEL_ENTITY_ONLY} - to load plain entity</li>\n * <li>{@link DatabaseAccessSession#LEVEL_ALL} - to load entity and all dependent collections</li>\n * <li>{@link DatabaseAccessSession#LEVEL_ANNOTATION_BASED} - to load entity and collections will be loaded accorging to annotation config</li>\n * </ul>\n * @return initialized entity. WARNING! The reference of returned object will differ from passed at params\n */\n public <T> Collection<T> initialize(Collection<T> entities, int level);\n}", "public abstract co.com.telefonica.atiempo.ejb.eb.PeticionLocal getPeticion();", "@Test\n public void test3() throws Exception {\n String jpql = \"SELECT c FROM Course c where SQL('course_mapped ->> ''?'' = ''Second one''',c.name) \";\n Query q = em.createQuery(jpql, Course.class);\n List<Course> courses = q.getResultList();\n Assert.assertEquals(1, courses.size());\n Assert.assertEquals(\"Second one\", courses.get(0).getCourseMapped().getName());\n\n }", "public interface IQueryEntity extends IBaseQueryObject\r\n{\r\n\r\n /**\r\n\t * \r\n\t * @return The Dynamic Extension Entity reference corresponding to the QueryEntity.\r\n\t */\r\n\tEntityInterface getDynamicExtensionsEntity();\r\n\r\n}", "public interface CProjectPurposeDAO extends JpaDao<CProjectPurpose> {\n\n\t/**\n\t * JPQL Query - findCProjectPurposeByName\n\t *\n\t */\n\tpublic Set<CProjectPurpose> findCProjectPurposeByName(String name) throws DataAccessException;\n\n\t/**\n\t * JPQL Query - findCProjectPurposeByName\n\t *\n\t */\n\tpublic Set<CProjectPurpose> findCProjectPurposeByName(String name, int startResult, int maxRows) throws DataAccessException;\n\n\t/**\n\t * JPQL Query - findCProjectPurposeByPrimaryKey\n\t *\n\t */\n\tpublic CProjectPurpose findCProjectPurposeByPrimaryKey(Integer id) throws DataAccessException;\n\n\t/**\n\t * JPQL Query - findCProjectPurposeByPrimaryKey\n\t *\n\t */\n\tpublic CProjectPurpose findCProjectPurposeByPrimaryKey(Integer id, int startResult, int maxRows) throws DataAccessException;\n\n\t/**\n\t * JPQL Query - findCProjectPurposeById\n\t *\n\t */\n\tpublic CProjectPurpose findCProjectPurposeById(Integer id_1) throws DataAccessException;\n\n\t/**\n\t * JPQL Query - findCProjectPurposeById\n\t *\n\t */\n\tpublic CProjectPurpose findCProjectPurposeById(Integer id_1, int startResult, int maxRows) throws DataAccessException;\n\n\t/**\n\t * JPQL Query - findAllCProjectPurposes\n\t *\n\t */\n\tpublic Set<CProjectPurpose> findAllCProjectPurposes() throws DataAccessException;\n\n\t/**\n\t * JPQL Query - findAllCProjectPurposes\n\t *\n\t */\n\tpublic Set<CProjectPurpose> findAllCProjectPurposes(int startResult, int maxRows) throws DataAccessException;\n\n\t/**\n\t * JPQL Query - findCProjectPurposeByNameContaining\n\t *\n\t */\n\tpublic Set<CProjectPurpose> findCProjectPurposeByNameContaining(String name_1) throws DataAccessException;\n\n\t/**\n\t * JPQL Query - findCProjectPurposeByNameContaining\n\t *\n\t */\n\tpublic Set<CProjectPurpose> findCProjectPurposeByNameContaining(String name_1, int startResult, int maxRows) throws DataAccessException;\n\n}", "@Local\r\npublic interface ComercioNacionalEJBLocal {\r\n\r\n /**\r\n *\r\n * @param idCliente\r\n * @param idPuntoVenta\r\n * @return\r\n */\r\n List<ProductosXCliente> consultarProductosXCliente(Long idCliente, Long idPuntoVenta);\r\n\r\n /**\r\n *\r\n * @param solicitud\r\n * @param productosXDocumento\r\n * @param log\r\n * @return\r\n */\r\n Documento ingresarSolicitudComercioNacional(Documento solicitud, List<ProductosXDocumento> productosXDocumento, LogAuditoria log);\r\n}", "public DatasetParameterPK() {\n }", "public interface SfopEquiAlarEnviDAO extends CrudRepositoryEnvi<EnviSfopEquiAlar, EnviSfopEquiAlarPK> {\n\n\t\n}", "protected JPAQuery<T> createQuery() {\n\t\tJPAQuery<T> query = new JPAQuery<>(entityManager);\n\t\tquery.from(getDslRoot());\n\t\treturn query;\n\t}", "@Repository\npublic interface KontaktJpaRepository extends JpaRepository<Kontakte, Long> {\n\n}", "Product getPProducts();", "@Override\n protected EntityManager getEntityManager() {\n return em;\n }", "@Override\n\tpublic void baja(Integer pk) {\n\t\t\n\t}", "public interface IPersistentSet<T> extends IPersistent, IResource, Set<T>, ITable<T> \r\n{\r\n /**\r\n * Perform join of two sorted set. This method can be used to incrementally\r\n * join two or more inverse lists (represented using IPersistentSet collections).\r\n * For example, assume that we need to implement own primitive full text search engine\r\n * (please notice that Perst has builtin full text search engine).\r\n * So we have inverse index keyword-&gt;list of documents with occurrences of this keyword.\r\n * Given full text query (set of keywords) we need to locate all documents\r\n * which contains all specified keywords. It can be done in this way:\r\n * <code>\r\n * class FullTextSearchEngine extends PersistentResource {\r\n * Index&lt;IPersistentSet&lt;Document&gt;&gt; inverseIndex;\r\n * public FullTextSearchEngine(Storage storage) { \r\n * super(storage);\r\n * inverseIndex = storage.&lt;IPersistentSet&lt;Document&gt;&gt;createIndex(String.class, true);\r\n * }\r\n * public IterableIterator&lt;Document&gt; search(Collection&lt;String&gt; keywords) {\r\n * IterableIterator&lt;Document&lt; result = null;\r\n * for (String keyword : keywords) {\r\n * IPersistentSet&lt;Document&gt; occurrences = inverseIndex.get(keyword); \r\n * if (occurrences == null) {\r\n * return null;\r\n * }\r\n * result = occurrences.join(result);\r\n * }\r\n * return result;\r\n * }\r\n * }\r\n * </code>\r\n * \r\n * @param iterator set of object ordered by OID. Usually it is iterator of IPersistentSet class.\r\n * This parameter may be null, in this case iterator of the target persistent set is returned.\r\n * @return iterator through result of two sets join. Join is performed incrementally so join\r\n * of two large sets will not consume a lot of memory and first results of such join\r\n * can be obtains fast enough.\r\n */\r\n public IterableIterator<T> join(Iterator<T> iterator);\r\n}", "javax.management.ObjectName getPersistenceManager();", "@Local\npublic interface AdvertBundleDaoInterface extends DaoInterface<AdvertBundleEntity> {\n\n\tList<AdvertBundleEntity> findAllForPartner(PartnerEntity partner);\n\n\t/**\n\t * Hleda vsechny AdvertBundle, ke kterym je treba vystavit novou proforma-fakturu\n\t * @return\n\t */\n\tList<AdvertBundleEntity> findAllRequiredNewProforma();\n\n}", "@Override\n\tprotected EntityManager getEntityManager() {\n\t\treturn em;\n\t}", "@Override\n\tprotected EntityManager getEntityManager() {\n\t\treturn em;\n\t}", "public abstract P toEntity();", "public interface TAlgmntBussRuleDAO {\n\n\t/**\n\t * Stores a new TAlgmntBussRule entity object in to the persistent store\n\t * \n\t * @param tAlgmntBussRule\n\t * TAlgmntBussRule Entity object to be persisted\n\t * @return tAlgmntBussRule Persisted TAlgmntBussRule object\n\t */\n\tTAlgmntBussRule createTAlgmntBussRule(TAlgmntBussRule tAlgmntBussRule);\n\n\t/**\n\t * Deletes a TAlgmntBussRule entity object from the persistent store\n\t * \n\t * @param tAlgmntBussRule\n\t * TAlgmntBussRule Entity object to be deleted\n\t */\n\tvoid deleteTAlgmntBussRule(Integer ruleId);\n\n\t/**\n\t * Updates a TAlgmntBussRule entity object in to the persistent store\n\t * \n\t * @param tAlgmntBussRule\n\t * TAlgmntBussRule Entity object to be updated\n\t * @return tAlgmntBussRule Persisted TAlgmntBussRule object\n\t */\n\tTAlgmntBussRule updateTAlgmntBussRule(TAlgmntBussRule tAlgmntBussRule);\n\n\t/**\n\t * Retrieve an TAlgmntBussRule object based on given ruleId.\n\t * \n\t * @param ruleId\n\t * the primary key value of the TAlgmntBussRule Entity.\n\t * @return an Object if it exists against given primary key. Returns null of\n\t * not found\n\t */\n\tTAlgmntBussRule findTAlgmntBussRuleById(Integer ruleId);\n\n\t/**\n\t * Retrieve TAlgmntBussRule based on given search criteria using Dynamic JPAQL.\n\t * \n\t * @param searchFilter\n\t * The query criteria and search filter conditions are set\n\t * @return List<TAlgmntBussRule> list of TAlgmntBussRules if it exists against given\n\t * criteria. Returns null if not found\n\t */\n\tList<TAlgmntBussRule> findTAlgmntBussRules(SearchFilter<TAlgmntBussRule> searchFilter);\n\n\t/**\n\t * Count TAlgmntBussRule based on given search criteria using Dynamic JPAQL.\n\t * \n\t * @param searchFilter\n\t * The query criteria and search filter conditions are set\n\t * @return a Object indicating the count\n\t */\n\tObject countTAlgmntBussRules(SearchFilter<TAlgmntBussRule> searchFilter);\n\n\t/**\n\t * Retrieve TAlgmntBussRule based on given search criteria using JPA named Query.\n\t * The search criteria is of TBussRuleConfig type.\n\t * \n\t * @param searchFilter\n\t * The query criteria and search filter conditions are set\n\t * @return List<TAlgmntBussRule> list of TAlgmntBussRules if it exists against given\n\t * criteria. Returns null if not found\n\t */\n\tList<TAlgmntBussRule> getTAlgmntBussRulesByTBussRuleConfig(SearchFilter<TBussRuleConfig> searchFilter);\n\n\t/**\n\t * Count TAlgmntBussRule based on given search criteria using JPA named Query.\n\t * The search criteria is of TBussRuleConfig type.\n\t * \n\t * @param searchFilter\n\t * The query criteria and search filter conditions are set\n\t * @return a Object indicating the count\n\t */\n\tObject countTAlgmntBussRulesByTBussRuleConfig(SearchFilter<TBussRuleConfig> searchFilter);\n\n\t/**\n\t * Retrieve TAlgmntBussRule based on given search criteria using JPA named Query.\n\t * The search criteria is of TAlgmntSalesTeam type.\n\t * \n\t * @param searchFilter\n\t * The query criteria and search filter conditions are set\n\t * @return List<TAlgmntBussRule> list of TAlgmntBussRules if it exists against given\n\t * criteria. Returns null if not found\n\t */\n\tList<TAlgmntBussRule> getTAlgmntBussRulesByTAlgmntSalesTeam(SearchFilter<TAlgmntSalesTeam> searchFilter);\n\n\t/**\n\t * Count TAlgmntBussRule based on given search criteria using JPA named Query.\n\t * The search criteria is of TAlgmntSalesTeam type.\n\t * \n\t * @param searchFilter\n\t * The query criteria and search filter conditions are set\n\t * @return a Object indicating the count\n\t */\n\tObject countTAlgmntBussRulesByTAlgmntSalesTeam(SearchFilter<TAlgmntSalesTeam> searchFilter);\n\n\t\n\t/**\n\t * Gets the t algmnt buss rules by t algmnt sales team rule config id.\n\t *\n\t * @param searchFilter the search filter\n\t * @return the t algmnt buss rules by t algmnt sales team rule config id\n\t */\n\tList<TAlgmntBussRule> getTAlgmntBussRulesByTAlgmntSalesTeamRuleConfigId(SearchFilter<TAlgmntBussRule> searchFilter);\n\t\n\t /**\n \t * Search customer share rule.\n \t *\n \t * @param algmntId the algmnt id\n \t * @param bussUnitId the buss unit id\n \t * @param salesTeamId the sales team id\n \t * @param tenantId the tenant id\n \t * @return the list\n \t */\n \tList <TAlgmntBussRule> searchCustomerShareRule(String algmntId,String bussUnitId,String salesTeamId,String tenantId);\n\t \n\t /**\n \t * Find valueby align info and rule name.\n \t *\n \t * @param algmntId the algmnt id\n \t * @param bussUnitId the buss unit id\n \t * @param salesTeamId the sales team id\n \t * @param BussRuleName the buss rule name\n \t * @return the list\n \t */\n \tList<Object[]> findValuebyAlignInfoAndRuleName(Long algmntId,Long bussUnitId,Long salesTeamId,String BussRuleName);\n\n\t /**\n \t * Gets the all t algmnt buss rule.\n \t *\n \t * @param tenantId the tenant id\n \t * @return the all t algmnt buss rule\n \t */\n \tList<TAlgmntBussRule> getAllTAlgmntBussRule(Short tenantId);\n\n\t/**\n\t * Gets the all t algmnt buss rule by id.\n\t *\n\t * @param tenantId the tenant id\n\t * @param alignId the align id\n\t * @param bussUnitId the buss unit id\n\t * @param salesTeamId the sales team id\n\t * @return the all t algmnt buss rule by id\n\t */\n\tList<TAlgmntBussRule> getAllTAlgmntBussRuleById(Short tenantId, Long alignId,Long bussUnitId,Long salesTeamId);\n\t\n\t/**\n\t * Gets the rule by albust rule id.\n\t *\n\t * @param alignId the align id\n\t * @param bussUnitId the buss unit id\n\t * @param salesTeamId the sales team id\n\t * @param bussRuleId the buss rule id\n\t * @param tenantId the tenant id\n\t * @return the rule by albust rule id\n\t */\n\tList<TAlgmntBussRule> getRuleByALBUSTRuleID(Long alignId,Long bussUnitId,Long salesTeamId,Integer bussRuleId,Short tenantId);\n\n\t/**\n\t * Find valueby align info and rule config id.\n\t *\n\t * @param algmntId the algmnt id\n\t * @param bussUnitId the buss unit id\n\t * @param salesTeamId the sales team id\n\t * @param ruleId the rule id\n\t * @param tenantId the tenant id\n\t * @return the list\n\t */\n\tList<Object[]> findValuebyAlignInfoAndRuleConfigId(Long algmntId,\n\t\t\tLong bussUnitId, Long salesTeamId, Integer ruleId, Short tenantId);\n\t\t\t\n\t\t\t\t// newly added for secondary address validation\t\n\t/**\n\t * Find flag valueby align info and rule config id.\n\t *\n\t * @param algmntId the algmnt id\n\t * @param bussUnitId the buss unit id\n\t * @param salesTeamId the sales team id\n\t * @param ruleId the rule id\n\t * @param tenantId the tenant id\n\t * @return the string\n\t */\n\tString findFlagValuebyAlignInfoAndRuleConfigId(Long algmntId,\n\t\t\tLong bussUnitId, Long salesTeamId, Integer ruleId, Short tenantId);\n\t\n\t/**\n\t * Find valueby align info and rule config id fr bricks.\n\t *\n\t * @param algmntId the algmnt id\n\t * @param bussUnitId the buss unit id\n\t * @param salesTeamId the sales team id\n\t * @param ruleId the rule id\n\t * @param tenantId the tenant id\n\t * @return the list\n\t */\n\tList<String> FindValuebyAlignInfoAndRuleConfigIdFrBricks(Long algmntId,\n\t\t\tLong bussUnitId, Long salesTeamId, Integer ruleId, Short tenantId);\n\t\t\t\n\t\t\t\n\t/**\n\t * Feth secondary address flag.\n\t *\n\t * @param algmntId the algmnt id\n\t * @param bussUnitId the buss unit id\n\t * @param salesTeamId the sales team id\n\t * @param bussRuleConfId the buss rule conf id\n\t * @param tenantId the tenant id\n\t * @return the list\n\t */\n\tList<String> fethSecondaryAddressFlag(Long algmntId,\n\t\t\tLong bussUnitId, Long salesTeamId,Integer bussRuleConfId,Short tenantId);\n\t\n\t/**\n\t * Gets the all t algmnt buss rule by albust.\n\t *\n\t * @param tenantId the tenant id\n\t * @param alignId the align id\n\t * @param bussUnitId the buss unit id\n\t * @param salesTeamId the sales team id\n\t * @return the all t algmnt buss rule by albust\n\t */\n\tList<TAlgmntBussRule> getAllTAlgmntBussRuleByALBUST(Short tenantId, Long alignId,Long bussUnitId,Long salesTeamId);\n\t\n\t/**\n\t * Gets the customer movement flag.\n\t *\n\t * @param alignmentId the alignment id\n\t * @param businessUnitId the business unit id\n\t * @param salesTeamId the sales team id\n\t * @param tenantId the tenant id\n\t * @return the customer movement flag\n\t */\n\tList<TAlgmntBussRule> getBusinessRuleValue(Long alignmentId, Long businessUnitId, Long salesTeamId, String ruleName, Short tenantId);\n}", "public interface Expedition extends com.hps.july.persistence.StoragePlace, com.ibm.ivj.ejb.runtime.CopyHelper {\n/**\n * This method was generated for supporting the association named Expedition2Expeditor. \n * \tIt will be deleted/edited when the association is deleted/edited.\n */\n/* WARNING: THIS METHOD WILL BE REGENERATED. */\npublic com.hps.july.persistence.Worker getExpeditor() throws java.rmi.RemoteException, javax.ejb.FinderException;\n/**\n * This method was generated for supporting the association named Expedition2Expeditor. \n * \tIt will be deleted/edited when the association is deleted/edited.\n */\n/* WARNING: THIS METHOD WILL BE REGENERATED. */\ncom.hps.july.persistence.WorkerKey getExpeditorKey() throws java.rmi.RemoteException;\n/**\n * This method was generated for supporting the association named Expedition2ExpeditionOrg. \n * \tIt will be deleted/edited when the association is deleted/edited.\n */\n/* WARNING: THIS METHOD WILL BE REGENERATED. */\npublic com.hps.july.persistence.Organization getOrganization() throws java.rmi.RemoteException, javax.ejb.FinderException;\n/**\n * This method was generated for supporting the association named Expedition2Organization. \n * \tIt will be deleted/edited when the association is deleted/edited.\n */\n/* WARNING: THIS METHOD WILL BE REGENERATED. */\ncom.hps.july.persistence.OrganizationKey getOrganizationKey() throws java.rmi.RemoteException;\n/**\n * This method was generated for supporting the association named Expedition2Expeditor. \n * \tIt will be deleted/edited when the association is deleted/edited.\n */\n/* WARNING: THIS METHOD WILL BE REGENERATED. */\nvoid privateSetExpeditorKey(com.hps.july.persistence.WorkerKey inKey) throws java.rmi.RemoteException;\n/**\n * This method was generated for supporting the association named Expedition2Organization. \n * \tIt will be deleted/edited when the association is deleted/edited.\n */\n/* WARNING: THIS METHOD WILL BE REGENERATED. */\nvoid privateSetOrganizationKey(com.hps.july.persistence.OrganizationKey inKey) throws java.rmi.RemoteException;\n/**\n * This method was generated for supporting the association named Expedition2Expeditor. \n * \tIt will be deleted/edited when the association is deleted/edited.\n */\n/* WARNING: THIS METHOD WILL BE REGENERATED. */\npublic void secondarySetExpeditor(com.hps.july.persistence.Worker anExpeditor) throws java.rmi.RemoteException;\n/**\n * This method was generated for supporting the association named Expedition2ExpeditionOrg. \n * \tIt will be deleted/edited when the association is deleted/edited.\n */\n/* WARNING: THIS METHOD WILL BE REGENERATED. */\npublic void secondarySetOrganization(com.hps.july.persistence.Organization anOrganization) throws java.rmi.RemoteException;\n/**\n * This method was generated for supporting the association named Expedition2Expeditor. \n * \tIt will be deleted/edited when the association is deleted/edited.\n */\n/* WARNING: THIS METHOD WILL BE REGENERATED. */\npublic void setExpeditor(com.hps.july.persistence.Worker anExpeditor) throws java.rmi.RemoteException;\n/**\n * This method was generated for supporting the association named Expedition2ExpeditionOrg. \n * \tIt will be deleted/edited when the association is deleted/edited.\n */\n/* WARNING: THIS METHOD WILL BE REGENERATED. */\npublic void setOrganization(com.hps.july.persistence.Organization anOrganization) throws java.rmi.RemoteException;\n}", "public Empresa getEmpresa()\r\n/* 84: */ {\r\n/* 85:131 */ return this.empresa;\r\n/* 86: */ }", "public interface PCDao extends JpaRepository<PC, Integer> {\n}", "abstract E getEntityManager();", "private DAOJPAFactory() {\r\n }", "private void reposicionarPersonajes() {\n // TODO implement here\n }", "public interface DAO<PK extends Serializable, T> {\n\t/**\n\t * Enumerate para saber de que forma ordenar los resultados ASC o DESC\n\t * \n\t * @author Victor Huerta\n\t * \n\t */\n\tpublic enum Ord {\n\t\tASCENDING(\"ASC\"), DESCENDING(\"DESC\"), UNSORTED(\"\");\n\t\tprivate final String ord;\n\n\t\tprivate Ord(String ord) {\n\t\t\tthis.ord = ord;\n\t\t}\n\n\t\tpublic String getOrd() {\n\t\t\treturn ord;\n\t\t}\n\t}\n\n\t/**\n\t * Metodo para recuperar la session actual\n\t * \n\t * @return la session actual\n\t */\n\tSession getCurrentSession();\n\n\t/**\n\t * Metodo para guardar un registro\n\t * \n\t * @param entity\n\t * Entidad a guardar\n\t * @return true si se guardo correctamente false en otro caso\n\t */\n\tBoolean save(T entity);\n\n\t/**\n\t * Metodo para eliminar un registro\n\t * \n\t * @param entity\n\t * Registro a borrar\n\t * @return true si se elimino correctamente false en otro caso\n\t */\n\tBoolean delete(T entity);\n\n\t/**\n\t * Metodo para recuperar todos los objetos de la tabla\n\t * \n\t * @return lista con todos los objetos de la tabla\n\t */\n\tList<T> getAll();\n\n\t/**\n\t * Metodo para recuberar un objeto por el id, este metodo esta destinado a\n\t * los objetos que ya tienen definido el tipo T\n\t * \n\t * @param id\n\t * El id el objeto que se busca\n\t * @return El objeto encontrado\n\t */\n\tT getById(PK id);\n\n\t/**\n\t * Con este metodo se pueden buscar registros con propiedades similares a\n\t * las del objeto que se pasa, no sirve para buscaquedas por id.\n\t * \n\t * @param entity\n\t * Entidad con propiedades que se van a buscar\n\t * @return Lista de entidades encontradas\n\t */\n\tList<T> searchByExample(T entity);\n\n\t/**\n\t * Metodo para buscar registros con propiedades similares a la del objeto\n\t * que recibe, ordenarlos por el campo que manda con el limite y paginas\n\t * dadas\n\t * \n\t * @param entity\n\t * Ejemplo para la busqueda\n\t * @param sortBy\n\t * Campor por el que se desea ordenar\n\t * @param limit\n\t * Numero maximo de registros\n\t * @param page\n\t * Numero de pagina\n\t * @return\n\t */\n\tList<T> searchByExamplePages(T entity, String sortBy, Ord ord,\n\t\t\tInteger limit, Integer page);\n\n\t/**\n\t *\n\t * Metodo para buscar registros con propiedades similares a la del objeto\n\t * que recibe, ordenarlos por el campo que manda con el limite y paginas\n\t * dadas.\n\t * \n\t * @param entity\n\t * Ejemplo para la busqueda\n\t * @param sortBy\n\t * Campor por el que se desea ordenar\n\t * @param limit\n\t * Numero maximo de registros\n\t * @param page\n\t * Numero de pagina\n\t * @param associations\n\t * \t\t\t Mapa propiedad objeto\n\t * \n\t * @return List<T>\n\t */\n\n\tList<T> searchByExamplePages(T entity, String sortBy, Ord ord,\n\t\t\tInteger limit, Integer page, Map<String, Object> associations);\n\n\t/**\n\t * Cuenta todos los registros de la tabla\n\t * \n\t * @return Numero de registros en la tabla\n\t */\n\tInteger countAll();\n\n\t/**\n\t * Cuenta todos los resultados que coinciden con un ejemplo\n\t * \n\t * @param entity\n\t * Entidad de ejemplo para la busqueda\n\t * @return Numero de registros encontrados\n\t */\n\tInteger countByExample(T entity);\n\n\t/**\n\t * Numero de paginas que se obtendran buscando con el ejemplo dado y usando\n\t * un limite\n\t * \n\t * @param entity\n\t * Entidad de ejemplo para la busqueda\n\t * @param limit\n\t * Limite de registros por pagina\n\t * @return\n\t */\n\tInteger countByExamplePages(T entity, Integer limit);\n\n\t/**\n\t * Retorna la clase del tipo generico, la clase de la entidad. Destinada a\n\t * solo funcionar cuando se implemente esta interfaz definiendo el tipo T\n\t * \n\t * @return Clase del tipo generico\n\t */\n\tClass<?> getEntityClass();\n}", "public abstract List<Subproducto> listarSubproducto(EntityManager sesion, Subproducto subproducto);", "public interface IEntry extends IRelation {\r\n\r\n String getJoinColumnName();\r\n\r\n\r\n void setJoinColumnName(String joinColumnName);\r\n\r\n\r\n String getJoinAttributeName();\r\n\r\n\r\n void setJoinAttributeName(String joinAttributeName);\r\n\r\n\r\n String getJoinEntityIdentifier();\r\n\r\n\r\n void setJoinEntityIdentifier(String joinEntityIdentifier);\r\n\r\n \r\n Entity getJoinEntity();\r\n}", "@ProviderType\npublic interface ProductSpecificationMappingPersistence\n\textends BasePersistence<ProductSpecificationMapping> {\n\n\t/*\n\t * NOTE FOR DEVELOPERS:\n\t *\n\t * Never modify or reference this interface directly. Always use {@link ProductSpecificationMappingUtil} to access the product specification mapping persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface.\n\t */\n\n\t/**\n\t * Returns all the product specification mappings where uuid = &#63;.\n\t *\n\t * @param uuid the uuid\n\t * @return the matching product specification mappings\n\t */\n\tpublic java.util.List<ProductSpecificationMapping> findByUuid(String uuid);\n\n\t/**\n\t * Returns a range of all the product specification mappings where uuid = &#63;.\n\t *\n\t * <p>\n\t * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to <code>QueryUtil#ALL_POS</code> will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent, then the query will include the default ORDER BY logic from <code>ProductSpecificationMappingModelImpl</code>.\n\t * </p>\n\t *\n\t * @param uuid the uuid\n\t * @param start the lower bound of the range of product specification mappings\n\t * @param end the upper bound of the range of product specification mappings (not inclusive)\n\t * @return the range of matching product specification mappings\n\t */\n\tpublic java.util.List<ProductSpecificationMapping> findByUuid(\n\t\tString uuid, int start, int end);\n\n\t/**\n\t * Returns an ordered range of all the product specification mappings where uuid = &#63;.\n\t *\n\t * <p>\n\t * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to <code>QueryUtil#ALL_POS</code> will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent, then the query will include the default ORDER BY logic from <code>ProductSpecificationMappingModelImpl</code>.\n\t * </p>\n\t *\n\t * @param uuid the uuid\n\t * @param start the lower bound of the range of product specification mappings\n\t * @param end the upper bound of the range of product specification mappings (not inclusive)\n\t * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)\n\t * @return the ordered range of matching product specification mappings\n\t */\n\tpublic java.util.List<ProductSpecificationMapping> findByUuid(\n\t\tString uuid, int start, int end,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator\n\t\t\t<ProductSpecificationMapping> orderByComparator);\n\n\t/**\n\t * Returns an ordered range of all the product specification mappings where uuid = &#63;.\n\t *\n\t * <p>\n\t * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to <code>QueryUtil#ALL_POS</code> will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent, then the query will include the default ORDER BY logic from <code>ProductSpecificationMappingModelImpl</code>.\n\t * </p>\n\t *\n\t * @param uuid the uuid\n\t * @param start the lower bound of the range of product specification mappings\n\t * @param end the upper bound of the range of product specification mappings (not inclusive)\n\t * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)\n\t * @param useFinderCache whether to use the finder cache\n\t * @return the ordered range of matching product specification mappings\n\t */\n\tpublic java.util.List<ProductSpecificationMapping> findByUuid(\n\t\tString uuid, int start, int end,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator\n\t\t\t<ProductSpecificationMapping> orderByComparator,\n\t\tboolean useFinderCache);\n\n\t/**\n\t * Returns the first product specification mapping in the ordered set where uuid = &#63;.\n\t *\n\t * @param uuid the uuid\n\t * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)\n\t * @return the first matching product specification mapping\n\t * @throws NoSuchProductSpecificationMappingException if a matching product specification mapping could not be found\n\t */\n\tpublic ProductSpecificationMapping findByUuid_First(\n\t\t\tString uuid,\n\t\t\tcom.liferay.portal.kernel.util.OrderByComparator\n\t\t\t\t<ProductSpecificationMapping> orderByComparator)\n\t\tthrows NoSuchProductSpecificationMappingException;\n\n\t/**\n\t * Returns the first product specification mapping in the ordered set where uuid = &#63;.\n\t *\n\t * @param uuid the uuid\n\t * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)\n\t * @return the first matching product specification mapping, or <code>null</code> if a matching product specification mapping could not be found\n\t */\n\tpublic ProductSpecificationMapping fetchByUuid_First(\n\t\tString uuid,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator\n\t\t\t<ProductSpecificationMapping> orderByComparator);\n\n\t/**\n\t * Returns the last product specification mapping in the ordered set where uuid = &#63;.\n\t *\n\t * @param uuid the uuid\n\t * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)\n\t * @return the last matching product specification mapping\n\t * @throws NoSuchProductSpecificationMappingException if a matching product specification mapping could not be found\n\t */\n\tpublic ProductSpecificationMapping findByUuid_Last(\n\t\t\tString uuid,\n\t\t\tcom.liferay.portal.kernel.util.OrderByComparator\n\t\t\t\t<ProductSpecificationMapping> orderByComparator)\n\t\tthrows NoSuchProductSpecificationMappingException;\n\n\t/**\n\t * Returns the last product specification mapping in the ordered set where uuid = &#63;.\n\t *\n\t * @param uuid the uuid\n\t * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)\n\t * @return the last matching product specification mapping, or <code>null</code> if a matching product specification mapping could not be found\n\t */\n\tpublic ProductSpecificationMapping fetchByUuid_Last(\n\t\tString uuid,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator\n\t\t\t<ProductSpecificationMapping> orderByComparator);\n\n\t/**\n\t * Returns the product specification mappings before and after the current product specification mapping in the ordered set where uuid = &#63;.\n\t *\n\t * @param productSpecificationMappingId the primary key of the current product specification mapping\n\t * @param uuid the uuid\n\t * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)\n\t * @return the previous, current, and next product specification mapping\n\t * @throws NoSuchProductSpecificationMappingException if a product specification mapping with the primary key could not be found\n\t */\n\tpublic ProductSpecificationMapping[] findByUuid_PrevAndNext(\n\t\t\tlong productSpecificationMappingId, String uuid,\n\t\t\tcom.liferay.portal.kernel.util.OrderByComparator\n\t\t\t\t<ProductSpecificationMapping> orderByComparator)\n\t\tthrows NoSuchProductSpecificationMappingException;\n\n\t/**\n\t * Removes all the product specification mappings where uuid = &#63; from the database.\n\t *\n\t * @param uuid the uuid\n\t */\n\tpublic void removeByUuid(String uuid);\n\n\t/**\n\t * Returns the number of product specification mappings where uuid = &#63;.\n\t *\n\t * @param uuid the uuid\n\t * @return the number of matching product specification mappings\n\t */\n\tpublic int countByUuid(String uuid);\n\n\t/**\n\t * Returns all the product specification mappings where uuid = &#63; and companyId = &#63;.\n\t *\n\t * @param uuid the uuid\n\t * @param companyId the company ID\n\t * @return the matching product specification mappings\n\t */\n\tpublic java.util.List<ProductSpecificationMapping> findByUuid_C(\n\t\tString uuid, long companyId);\n\n\t/**\n\t * Returns a range of all the product specification mappings where uuid = &#63; and companyId = &#63;.\n\t *\n\t * <p>\n\t * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to <code>QueryUtil#ALL_POS</code> will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent, then the query will include the default ORDER BY logic from <code>ProductSpecificationMappingModelImpl</code>.\n\t * </p>\n\t *\n\t * @param uuid the uuid\n\t * @param companyId the company ID\n\t * @param start the lower bound of the range of product specification mappings\n\t * @param end the upper bound of the range of product specification mappings (not inclusive)\n\t * @return the range of matching product specification mappings\n\t */\n\tpublic java.util.List<ProductSpecificationMapping> findByUuid_C(\n\t\tString uuid, long companyId, int start, int end);\n\n\t/**\n\t * Returns an ordered range of all the product specification mappings where uuid = &#63; and companyId = &#63;.\n\t *\n\t * <p>\n\t * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to <code>QueryUtil#ALL_POS</code> will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent, then the query will include the default ORDER BY logic from <code>ProductSpecificationMappingModelImpl</code>.\n\t * </p>\n\t *\n\t * @param uuid the uuid\n\t * @param companyId the company ID\n\t * @param start the lower bound of the range of product specification mappings\n\t * @param end the upper bound of the range of product specification mappings (not inclusive)\n\t * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)\n\t * @return the ordered range of matching product specification mappings\n\t */\n\tpublic java.util.List<ProductSpecificationMapping> findByUuid_C(\n\t\tString uuid, long companyId, int start, int end,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator\n\t\t\t<ProductSpecificationMapping> orderByComparator);\n\n\t/**\n\t * Returns an ordered range of all the product specification mappings where uuid = &#63; and companyId = &#63;.\n\t *\n\t * <p>\n\t * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to <code>QueryUtil#ALL_POS</code> will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent, then the query will include the default ORDER BY logic from <code>ProductSpecificationMappingModelImpl</code>.\n\t * </p>\n\t *\n\t * @param uuid the uuid\n\t * @param companyId the company ID\n\t * @param start the lower bound of the range of product specification mappings\n\t * @param end the upper bound of the range of product specification mappings (not inclusive)\n\t * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)\n\t * @param useFinderCache whether to use the finder cache\n\t * @return the ordered range of matching product specification mappings\n\t */\n\tpublic java.util.List<ProductSpecificationMapping> findByUuid_C(\n\t\tString uuid, long companyId, int start, int end,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator\n\t\t\t<ProductSpecificationMapping> orderByComparator,\n\t\tboolean useFinderCache);\n\n\t/**\n\t * Returns the first product specification mapping in the ordered set where uuid = &#63; and companyId = &#63;.\n\t *\n\t * @param uuid the uuid\n\t * @param companyId the company ID\n\t * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)\n\t * @return the first matching product specification mapping\n\t * @throws NoSuchProductSpecificationMappingException if a matching product specification mapping could not be found\n\t */\n\tpublic ProductSpecificationMapping findByUuid_C_First(\n\t\t\tString uuid, long companyId,\n\t\t\tcom.liferay.portal.kernel.util.OrderByComparator\n\t\t\t\t<ProductSpecificationMapping> orderByComparator)\n\t\tthrows NoSuchProductSpecificationMappingException;\n\n\t/**\n\t * Returns the first product specification mapping in the ordered set where uuid = &#63; and companyId = &#63;.\n\t *\n\t * @param uuid the uuid\n\t * @param companyId the company ID\n\t * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)\n\t * @return the first matching product specification mapping, or <code>null</code> if a matching product specification mapping could not be found\n\t */\n\tpublic ProductSpecificationMapping fetchByUuid_C_First(\n\t\tString uuid, long companyId,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator\n\t\t\t<ProductSpecificationMapping> orderByComparator);\n\n\t/**\n\t * Returns the last product specification mapping in the ordered set where uuid = &#63; and companyId = &#63;.\n\t *\n\t * @param uuid the uuid\n\t * @param companyId the company ID\n\t * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)\n\t * @return the last matching product specification mapping\n\t * @throws NoSuchProductSpecificationMappingException if a matching product specification mapping could not be found\n\t */\n\tpublic ProductSpecificationMapping findByUuid_C_Last(\n\t\t\tString uuid, long companyId,\n\t\t\tcom.liferay.portal.kernel.util.OrderByComparator\n\t\t\t\t<ProductSpecificationMapping> orderByComparator)\n\t\tthrows NoSuchProductSpecificationMappingException;\n\n\t/**\n\t * Returns the last product specification mapping in the ordered set where uuid = &#63; and companyId = &#63;.\n\t *\n\t * @param uuid the uuid\n\t * @param companyId the company ID\n\t * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)\n\t * @return the last matching product specification mapping, or <code>null</code> if a matching product specification mapping could not be found\n\t */\n\tpublic ProductSpecificationMapping fetchByUuid_C_Last(\n\t\tString uuid, long companyId,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator\n\t\t\t<ProductSpecificationMapping> orderByComparator);\n\n\t/**\n\t * Returns the product specification mappings before and after the current product specification mapping in the ordered set where uuid = &#63; and companyId = &#63;.\n\t *\n\t * @param productSpecificationMappingId the primary key of the current product specification mapping\n\t * @param uuid the uuid\n\t * @param companyId the company ID\n\t * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)\n\t * @return the previous, current, and next product specification mapping\n\t * @throws NoSuchProductSpecificationMappingException if a product specification mapping with the primary key could not be found\n\t */\n\tpublic ProductSpecificationMapping[] findByUuid_C_PrevAndNext(\n\t\t\tlong productSpecificationMappingId, String uuid, long companyId,\n\t\t\tcom.liferay.portal.kernel.util.OrderByComparator\n\t\t\t\t<ProductSpecificationMapping> orderByComparator)\n\t\tthrows NoSuchProductSpecificationMappingException;\n\n\t/**\n\t * Removes all the product specification mappings where uuid = &#63; and companyId = &#63; from the database.\n\t *\n\t * @param uuid the uuid\n\t * @param companyId the company ID\n\t */\n\tpublic void removeByUuid_C(String uuid, long companyId);\n\n\t/**\n\t * Returns the number of product specification mappings where uuid = &#63; and companyId = &#63;.\n\t *\n\t * @param uuid the uuid\n\t * @param companyId the company ID\n\t * @return the number of matching product specification mappings\n\t */\n\tpublic int countByUuid_C(String uuid, long companyId);\n\n\t/**\n\t * Returns all the product specification mappings where productType = &#63;.\n\t *\n\t * @param productType the product type\n\t * @return the matching product specification mappings\n\t */\n\tpublic java.util.List<ProductSpecificationMapping> findByProductType(\n\t\tString productType);\n\n\t/**\n\t * Returns a range of all the product specification mappings where productType = &#63;.\n\t *\n\t * <p>\n\t * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to <code>QueryUtil#ALL_POS</code> will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent, then the query will include the default ORDER BY logic from <code>ProductSpecificationMappingModelImpl</code>.\n\t * </p>\n\t *\n\t * @param productType the product type\n\t * @param start the lower bound of the range of product specification mappings\n\t * @param end the upper bound of the range of product specification mappings (not inclusive)\n\t * @return the range of matching product specification mappings\n\t */\n\tpublic java.util.List<ProductSpecificationMapping> findByProductType(\n\t\tString productType, int start, int end);\n\n\t/**\n\t * Returns an ordered range of all the product specification mappings where productType = &#63;.\n\t *\n\t * <p>\n\t * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to <code>QueryUtil#ALL_POS</code> will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent, then the query will include the default ORDER BY logic from <code>ProductSpecificationMappingModelImpl</code>.\n\t * </p>\n\t *\n\t * @param productType the product type\n\t * @param start the lower bound of the range of product specification mappings\n\t * @param end the upper bound of the range of product specification mappings (not inclusive)\n\t * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)\n\t * @return the ordered range of matching product specification mappings\n\t */\n\tpublic java.util.List<ProductSpecificationMapping> findByProductType(\n\t\tString productType, int start, int end,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator\n\t\t\t<ProductSpecificationMapping> orderByComparator);\n\n\t/**\n\t * Returns an ordered range of all the product specification mappings where productType = &#63;.\n\t *\n\t * <p>\n\t * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to <code>QueryUtil#ALL_POS</code> will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent, then the query will include the default ORDER BY logic from <code>ProductSpecificationMappingModelImpl</code>.\n\t * </p>\n\t *\n\t * @param productType the product type\n\t * @param start the lower bound of the range of product specification mappings\n\t * @param end the upper bound of the range of product specification mappings (not inclusive)\n\t * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)\n\t * @param useFinderCache whether to use the finder cache\n\t * @return the ordered range of matching product specification mappings\n\t */\n\tpublic java.util.List<ProductSpecificationMapping> findByProductType(\n\t\tString productType, int start, int end,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator\n\t\t\t<ProductSpecificationMapping> orderByComparator,\n\t\tboolean useFinderCache);\n\n\t/**\n\t * Returns the first product specification mapping in the ordered set where productType = &#63;.\n\t *\n\t * @param productType the product type\n\t * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)\n\t * @return the first matching product specification mapping\n\t * @throws NoSuchProductSpecificationMappingException if a matching product specification mapping could not be found\n\t */\n\tpublic ProductSpecificationMapping findByProductType_First(\n\t\t\tString productType,\n\t\t\tcom.liferay.portal.kernel.util.OrderByComparator\n\t\t\t\t<ProductSpecificationMapping> orderByComparator)\n\t\tthrows NoSuchProductSpecificationMappingException;\n\n\t/**\n\t * Returns the first product specification mapping in the ordered set where productType = &#63;.\n\t *\n\t * @param productType the product type\n\t * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)\n\t * @return the first matching product specification mapping, or <code>null</code> if a matching product specification mapping could not be found\n\t */\n\tpublic ProductSpecificationMapping fetchByProductType_First(\n\t\tString productType,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator\n\t\t\t<ProductSpecificationMapping> orderByComparator);\n\n\t/**\n\t * Returns the last product specification mapping in the ordered set where productType = &#63;.\n\t *\n\t * @param productType the product type\n\t * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)\n\t * @return the last matching product specification mapping\n\t * @throws NoSuchProductSpecificationMappingException if a matching product specification mapping could not be found\n\t */\n\tpublic ProductSpecificationMapping findByProductType_Last(\n\t\t\tString productType,\n\t\t\tcom.liferay.portal.kernel.util.OrderByComparator\n\t\t\t\t<ProductSpecificationMapping> orderByComparator)\n\t\tthrows NoSuchProductSpecificationMappingException;\n\n\t/**\n\t * Returns the last product specification mapping in the ordered set where productType = &#63;.\n\t *\n\t * @param productType the product type\n\t * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)\n\t * @return the last matching product specification mapping, or <code>null</code> if a matching product specification mapping could not be found\n\t */\n\tpublic ProductSpecificationMapping fetchByProductType_Last(\n\t\tString productType,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator\n\t\t\t<ProductSpecificationMapping> orderByComparator);\n\n\t/**\n\t * Returns the product specification mappings before and after the current product specification mapping in the ordered set where productType = &#63;.\n\t *\n\t * @param productSpecificationMappingId the primary key of the current product specification mapping\n\t * @param productType the product type\n\t * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)\n\t * @return the previous, current, and next product specification mapping\n\t * @throws NoSuchProductSpecificationMappingException if a product specification mapping with the primary key could not be found\n\t */\n\tpublic ProductSpecificationMapping[] findByProductType_PrevAndNext(\n\t\t\tlong productSpecificationMappingId, String productType,\n\t\t\tcom.liferay.portal.kernel.util.OrderByComparator\n\t\t\t\t<ProductSpecificationMapping> orderByComparator)\n\t\tthrows NoSuchProductSpecificationMappingException;\n\n\t/**\n\t * Removes all the product specification mappings where productType = &#63; from the database.\n\t *\n\t * @param productType the product type\n\t */\n\tpublic void removeByProductType(String productType);\n\n\t/**\n\t * Returns the number of product specification mappings where productType = &#63;.\n\t *\n\t * @param productType the product type\n\t * @return the number of matching product specification mappings\n\t */\n\tpublic int countByProductType(String productType);\n\n\t/**\n\t * Caches the product specification mapping in the entity cache if it is enabled.\n\t *\n\t * @param productSpecificationMapping the product specification mapping\n\t */\n\tpublic void cacheResult(\n\t\tProductSpecificationMapping productSpecificationMapping);\n\n\t/**\n\t * Caches the product specification mappings in the entity cache if it is enabled.\n\t *\n\t * @param productSpecificationMappings the product specification mappings\n\t */\n\tpublic void cacheResult(\n\t\tjava.util.List<ProductSpecificationMapping>\n\t\t\tproductSpecificationMappings);\n\n\t/**\n\t * Creates a new product specification mapping with the primary key. Does not add the product specification mapping to the database.\n\t *\n\t * @param productSpecificationMappingId the primary key for the new product specification mapping\n\t * @return the new product specification mapping\n\t */\n\tpublic ProductSpecificationMapping create(\n\t\tlong productSpecificationMappingId);\n\n\t/**\n\t * Removes the product specification mapping with the primary key from the database. Also notifies the appropriate model listeners.\n\t *\n\t * @param productSpecificationMappingId the primary key of the product specification mapping\n\t * @return the product specification mapping that was removed\n\t * @throws NoSuchProductSpecificationMappingException if a product specification mapping with the primary key could not be found\n\t */\n\tpublic ProductSpecificationMapping remove(\n\t\t\tlong productSpecificationMappingId)\n\t\tthrows NoSuchProductSpecificationMappingException;\n\n\tpublic ProductSpecificationMapping updateImpl(\n\t\tProductSpecificationMapping productSpecificationMapping);\n\n\t/**\n\t * Returns the product specification mapping with the primary key or throws a <code>NoSuchProductSpecificationMappingException</code> if it could not be found.\n\t *\n\t * @param productSpecificationMappingId the primary key of the product specification mapping\n\t * @return the product specification mapping\n\t * @throws NoSuchProductSpecificationMappingException if a product specification mapping with the primary key could not be found\n\t */\n\tpublic ProductSpecificationMapping findByPrimaryKey(\n\t\t\tlong productSpecificationMappingId)\n\t\tthrows NoSuchProductSpecificationMappingException;\n\n\t/**\n\t * Returns the product specification mapping with the primary key or returns <code>null</code> if it could not be found.\n\t *\n\t * @param productSpecificationMappingId the primary key of the product specification mapping\n\t * @return the product specification mapping, or <code>null</code> if a product specification mapping with the primary key could not be found\n\t */\n\tpublic ProductSpecificationMapping fetchByPrimaryKey(\n\t\tlong productSpecificationMappingId);\n\n\t/**\n\t * Returns all the product specification mappings.\n\t *\n\t * @return the product specification mappings\n\t */\n\tpublic java.util.List<ProductSpecificationMapping> findAll();\n\n\t/**\n\t * Returns a range of all the product specification mappings.\n\t *\n\t * <p>\n\t * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to <code>QueryUtil#ALL_POS</code> will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent, then the query will include the default ORDER BY logic from <code>ProductSpecificationMappingModelImpl</code>.\n\t * </p>\n\t *\n\t * @param start the lower bound of the range of product specification mappings\n\t * @param end the upper bound of the range of product specification mappings (not inclusive)\n\t * @return the range of product specification mappings\n\t */\n\tpublic java.util.List<ProductSpecificationMapping> findAll(\n\t\tint start, int end);\n\n\t/**\n\t * Returns an ordered range of all the product specification mappings.\n\t *\n\t * <p>\n\t * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to <code>QueryUtil#ALL_POS</code> will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent, then the query will include the default ORDER BY logic from <code>ProductSpecificationMappingModelImpl</code>.\n\t * </p>\n\t *\n\t * @param start the lower bound of the range of product specification mappings\n\t * @param end the upper bound of the range of product specification mappings (not inclusive)\n\t * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)\n\t * @return the ordered range of product specification mappings\n\t */\n\tpublic java.util.List<ProductSpecificationMapping> findAll(\n\t\tint start, int end,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator\n\t\t\t<ProductSpecificationMapping> orderByComparator);\n\n\t/**\n\t * Returns an ordered range of all the product specification mappings.\n\t *\n\t * <p>\n\t * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to <code>QueryUtil#ALL_POS</code> will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent, then the query will include the default ORDER BY logic from <code>ProductSpecificationMappingModelImpl</code>.\n\t * </p>\n\t *\n\t * @param start the lower bound of the range of product specification mappings\n\t * @param end the upper bound of the range of product specification mappings (not inclusive)\n\t * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)\n\t * @param useFinderCache whether to use the finder cache\n\t * @return the ordered range of product specification mappings\n\t */\n\tpublic java.util.List<ProductSpecificationMapping> findAll(\n\t\tint start, int end,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator\n\t\t\t<ProductSpecificationMapping> orderByComparator,\n\t\tboolean useFinderCache);\n\n\t/**\n\t * Removes all the product specification mappings from the database.\n\t */\n\tpublic void removeAll();\n\n\t/**\n\t * Returns the number of product specification mappings.\n\t *\n\t * @return the number of product specification mappings\n\t */\n\tpublic int countAll();\n\n}", "public interface ICampaniaDAO {\n\t/**\n\t * Crear la campania en el repositorio\n\t * @param campania\n\t */\n\tvoid crearCampania(GestionPrecioDTO campania);\n\t\n\t\n\t/**\n\t * Actualizar la campania en el repositorio\n\t * @param campania\n\t */\n\tvoid actualizarCampania(GestionPrecioDTO campania, UserDto user);\n\t\n\t/** Metodo actualizarCampania, utilizado para actualizar una campania\n\t * @author srodriguez\n\t * 27/2/2015\n\t * @param campania\n\t * @param user\n\t * @return void\n\t */\n\tvoid actualizarCampania(GestionPrecioDTO campania, String user);\n\t\n\t/**\n\t * Buscar la campania por el c&oacute;digo de referencia\n\t * de Loyalty\n\t * @param codigoCampaniaReferencia C&oacute;digo de Loyalty\n\t * @return\n\t */\n\tGestionPrecioDTO findCampania(String codigoCampaniaReferencia);\n /**\n * Verifica si una campania existe dado su clave primaria como\n * par&aacute;metro de b&uacute;squeda\n * @param id\n * @returnS\n */\n Boolean findExistsCampania(GestionPrecioID id) ;\n /**\n * Obtener todas las campanias existentes en el repositorio\n * @return\n */\n Collection<GestionPrecioDTO> findCampaniasPendientes() ;\n /**\n * Buscar un listado de campanias dado una plantilla de b&uacute;squeda y el\n * estado de cobro\n * @param gestionPrecio Plantilla de b&uacute;squeda\n * @param estadoCobro Estado de cobro. Ej: PENDIENTE, CONFIGURADA, COBRADA, EN CURSO, etc.\n * @return\n */\n Collection<GestionPrecioDTO> findCampaniasFiltros (GestionPrecioDTO gestionPrecio,String estadoCobro);\n \n /**\n * @author cbarahona\n * @param campania\n */\n void actualizarCampaniaLoyalty (GestionPrecioDTO campania);\n \n SearchResultDTO<GestionPrecioDTO> findCampaniasPendientesLazy (Integer firstResult, Integer pageSize, Boolean countAgain);\n \n SearchResultDTO<GestionPrecioDTO> findCampaniasFiltrosLazy (GestionPrecioDTO gestionPrecio, String estadoCobro,Integer firstResult, Integer pageSize, Boolean countAgain);\n \n GestionPrecioDTO findCampania(final String codigoReferencia, final Integer codigoCompania) throws SICException;\n \n void actualizarCampania(GestionPrecioDTO campania) throws SICException;\n \n /**\n * Metodo que valida si una campaña tiene participantes\n * @param codigoReferencia\n * @return\n * @throws SICException\n */\n Boolean tieneParticipantesCampania(String codigoReferencia) throws SICException;\n}", "public interface SubGeneroDAO {\n /**\n * Método que permite guardar un subgénero.\n * @param subGenero {@link SubGenero} objeto a guardar.\n */\n void guardar(SubGenero subGenero);\n\n /**\n * Método que permite actualizar un subgénero.\n * @param subGenero {@link SubGenero} objeto a actualizar.\n */\n void actualizar(SubGenero subGenero);\n\n /**\n * Método que permite eliminar un subgénero por su identificador.\n * @param id {@link Long} identificador del subgénero a eliminar.\n */\n void eliminiar(Long id);\n\n /**\n * Método que permite consultar la lista de subgéneros.\n * @return {@link List} lista de subgéneros consultados.\n */\n List<SubGenero> consultar();\n\n /**\n * Método que permite consultar un SubGenero a partir de su identificador.\n * @param id {@link Long} identificador del subgénero a consultar.\n * @return {@link SubGenero} un objeto subgénero consultado.\n */\n SubGenero consultarById(Long id);\n\n\n}", "DAOClienteJPA(EntityManager entity) {\r\n this.entity = entity;\r\n }", "public interface AvanceSalaireManager\r\n extends GenericManager<AvanceSalaire, Long>\r\n{\r\n\r\n public final static String SERVICE_NAME = \"AvanceSalaireManager\";\r\n \r\n public AvanceSalaire generereglement(AvanceSalaire entity);\r\n \r\n public AvanceSalaire confirme(AvanceSalaire entity);\r\n \r\n public AvanceSalaire annule(AvanceSalaire entity);\r\n\r\n}", "public interface ProcesoMAEClasificacionClientesDAO extends DAO {\n\n\t/**\n\t * Proceso que realiza la actualizacin de clasificacion de Clientes\n\t * \n\t * @param criteria\n\t */\n\tpublic void executeProcesarClasificacion(Map criteria);\n\n\t/**\n\t * Proceso que realiza la actualizacin de clasificacion LOVE de Clientes\n\t * \n\t * @param criteria\n\t */\n\tpublic void executeProcesarClasificacionLove(Map criteria);\n\n\t/**\n\t * Proceso que realiza la actualizacin de datos de Clientes\n\t * \n\t * @param criteria\n\t */\n\tpublic void executeActualizarDatosClientes(Map criteria);\n\n\t/**Proceso q se encarga de ejecutar las validaciones de MAE\n\t * @param criteria\n\t */\n\tpublic void executeValidacionClientes(Map criteria);\n\n\t/**\n\t * Proceso que realiza la Inactivación de conultoras registradas \n\t * despues de dos capañasde creadas en el maestro\n\t * \n\t * @param criteria\n\t */\n\tpublic void executeInactivarConsultora2campanas(Map criteria);\n}", "public aql k()\r\n/* 114: */ {\r\n/* 115:126 */ return aql.b;\r\n/* 116: */ }", "public abstract co.com.telefonica.atiempo.ejb.eb.EmpresaLocal getEmpresa();", "public IProduto getCodProd();", "public Object getTablePelanggan() {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }", "@Override\n public URL getPersistenceUnitRootUrl() {\n return HibernatePersistenceProvider.class.getResource(\"/org/hibernate/jpa/persistence_1_0.xsd\");\n }", "public interface HrDeptRescindDao extends GenericDao<HrDeptRescind, String> {\n\tpublic JQueryPager getHrDeptRescindCriteria(final JQueryPager paginatedList,List<PropertyFilter> filters);\n\n}", "private EntityManagerProvider(){}", "public interface PreguntaDao {\n\n\t/** Devuelve las preguntas mas recientes, ordenadas desde la mas reciente hacia la mas antigua.\n\t * @param page La pagina de preguntas (comienza de la 1)\n\t * @param pageSize El numero de resultados a devolver por pagina. */\n\tpublic List<Pregunta> getPreguntasRecientes(int page, int pageSize);\n\n\t/** Devuelve las preguntas hechas por el usuario indicado. */\n\tpublic List<Pregunta> getPreguntasUsuario(Usuario user);\n\n\t/** Devuelve las preguntas que contienen el tag especificado. */\n\tpublic List<Pregunta> getPreguntasConTag(TagPregunta tag);\n\n\t/** Devuelve todas las preguntas que tengan al menos uno de los tags especificados. */\n\tpublic List<Pregunta> getPreguntasConTags(Set<TagPregunta> tags);\n\n\t/** Devuelve las preguntas que contienen el tag especificado. */\n\tpublic List<Pregunta> getPreguntasConTag(String tag);\n\n\t/** Devuelve los tags mas utilizados en preguntas.\n\t * @param limit El numero maximo de tags a devolver. */\n\tpublic List<TagPregunta> getTagsPopulares(int limit);\n\n\t/** Devuelve la pregunta con el id especificado. */\n\tpublic Pregunta getPregunta(int id);\n\n\t/** Devuelve las respuestas a la pregunta especificada.\n\t * @param pageSize El numero maximo de preguntas a devolver.\n\t * @param page El numero de pagina a devolver (la primera pagina es 1)\n\t * @param crono Indica si se deben ordenar las respuestas en orden cronologico, en vez de por votos\n\t * (default es por votos). */\n\tpublic List<Respuesta> getRespuestas(Pregunta q, int pageSize, int page, boolean crono);\n\n\t/** Devuelve la lista de preguntas con mas votos positivos.\n\t * @param limit El numero maximo de preguntas a devolver. */\n\tpublic List<Pregunta> getPreguntasMasVotadas(int limit);\n\n\t/** Devuelve la lista de preguntas que no tienen ni una sola respuesta. */\n\tpublic List<Pregunta> getPreguntasSinResponder(int limit);\n\n\t/** Devuelve la lista de preguntas cuyo autor no ha elegido una respuesta. */\n\tpublic List<Pregunta> getPreguntasSinResolver(int limit);\n\n\t/** Registra un voto que un usuario hace a una pregunta.\n\t * @param user El usuario que hace el voto\n\t * @param pregunta La pregunta a la cual se aplica el voto\n\t * @param up Indica si el voto es positivo (true) o negativo (false).\n\t * @throws PrivilegioInsuficienteException si el usuario no tiene reputacion suficiente para dar un voto negativo. */\n\tpublic VotoPregunta vota(Usuario user, Pregunta pregunta, boolean up) throws PrivilegioInsuficienteException;\n\n\t/** Registra un voto que un usuario hace a una respuesta que se hizo a una pregunta.\n\t * @param user El usuario que hace el voto.\n\t * @param resp La respuesta a la cual se aplica el voto.\n\t * @param up Indica si el voto es positivo (true) o negativo (false).\n\t * @throws PrivilegioInsuficienteException si el usuario no tiene reputacion suficiente para dar un voto negativo. */\n\tpublic VotoRespuesta vota(Usuario user, Respuesta resp, boolean up) throws PrivilegioInsuficienteException;\n\n\t/** Busca y devuelve el voto realizado por el usuario indicado a la pregunta especificada, si es que existe. */\n\tpublic VotoPregunta findVoto(Usuario user, Pregunta pregunta);\n\n\t/** Busca y devuelve el voto hecho por el usuario indicado a la respuesta especificada, si es que existe. */\n\tpublic VotoRespuesta findVoto(Usuario user, Respuesta respuesta);\n\n\tpublic void insert(Pregunta p);\n\n\tpublic void update(Pregunta p);\n\n\tpublic void delete(Pregunta p);\n\n\t/** Crea una respuesta con el texto especificado, para la pregunta especificada, por el autor especificado.\n\t * @return La respuesta recien creada. */\n\tpublic Respuesta addRespuesta(String resp, Pregunta p, Usuario autor);\n\n\t/** Agrega un comentario a la pregunta especificada, a nombre del usuario especificado. */\n\tpublic ComentPregunta addComentario(String c, Pregunta p, Usuario autor);\n\n\t/** Agrega un comentario a la respuesta especificada, a nombre del usuario especificado. */\n\tpublic ComentRespuesta addComentario(String c, Respuesta r, Usuario autor);\n\n\t/** Agrega el tag especificado a la pregunta. Primero se busca el tag existente para relacionarlo con la\n\t * pregunta, pero si no existe, se crea uno nuevo. */\n\tpublic void addTag(String tag, Pregunta p);\n\n\t/** Devuelve una lista con tags que contengan el texto parcial especificado. */\n\tpublic List<TagPregunta> findMatchingTags(String parcial);\n\n}", "public interface AlmacenMapper {\n @Select(value = \"select tipo,descripcion from tipoproducto\")\n @Results(value = {\n @Result(javaType = Producto.class),\n @Result(property = \"tipo\",column = \"tipo\"),\n @Result(property = \"descripcion\",column = \"descripcion\"),\n })\n List<Producto> listarTipoProducto();\n\n @Insert(value = \"INSERT \" +\n \"INTO producto \" +\n \" ( \" +\n \" codigo, \" +\n \" nombre, \" +\n \" tipo, \" +\n \" porc_precio, \" +\n \" uni_medida, \" +\n \" cantidad \" +\n \" ) \" +\n \" VALUES \" +\n \" ( \" +\n \" producto_seq.nextval, \" +\n \" #{produ.nombre}, \" +\n \" #{produ.tipo}, \" +\n \" #{produ.porc_precio}, \" +\n \" #{produ.uni_medida}, \" +\n \" #{produ.cantidad} \" +\n \" )\")\n void GuardarProducto(@Param(\"produ\") Producto producto);\n\n @Select(value = \"SELECT codigo, \" +\n \" nombre, \" +\n \" p.tipo, \" +\n \" tp.descripcion, \" +\n \" porc_precio, \" +\n \" uni_medida, \" +\n \" cantidad \" +\n \"FROM producto p \" +\n \"INNER JOIN tipoproducto tp \" +\n \"ON(p.tipo=tp.tipo)\")\n @Results(value = {\n @Result(javaType = Producto.class),\n @Result(property = \"codigo\",column = \"codigo\"),\n @Result(property = \"nombre\",column = \"nombre\"),\n @Result(property = \"tipo\",column = \"tipo\"),\n @Result(property = \"descripcion\",column = \"descripcion\"),\n @Result(property = \"porc_precio\",column = \"porc_precio\"),\n @Result(property = \"uni_medida\",column = \"uni_medida\"),\n @Result(property = \"cantidad\",column = \"cantidad\"),\n })\n List<Producto> listarProductos();\n\n @Update(value =\"UPDATE producto \" +\n \"SET nombre =#{produ.nombre}, \" +\n \" porc_precio=#{produ.porc_precio}, \" +\n \" tipo= \" +\n \" #{produ.tipo} \" +\n \"WHERE codigo=#{produ.codigo}\" )\n void ActualizarProducto(@Param(\"produ\") Producto producto);\n\n @Delete(value=\"DELETE FROM PRODUCTO WHERE codigo=#{id}\")\n void EliminarProducto(@Param(\"id\") Integer id);\n\n @Select(value = \"SELECT codigo, \" +\n \" nombre \" +\n \"FROM producto p where tipo=#{id} \")\n @Results(value = {\n @Result(javaType = Producto.class),\n @Result(property = \"codigo\",column = \"codigo\"),\n @Result(property = \"nombre\",column = \"nombre\"),\n })\n List<Producto> ListarProductosxCategoria(@Param(\"id\") Integer id);\n\n @Insert(value = \"INSERT \" +\n \"INTO entrada_productos \" +\n \" ( \" +\n \" n_entrada, \" +\n \" fecha, \" +\n \" costo_total \" +\n \" ) \" +\n \" VALUES \" +\n \" ( \" +\n \" entrada_seq.nextval , \" +\n \" sysdate, \" +\n \" #{entrada.costo_total} \" +\n \" )\")\n void insertEntradaProducto(@Param(\"entrada\") EntradaProducto entrada);\n\n @Insert(value = \"INSERT \" +\n \"INTO detalle_entrada_productos \" +\n \" ( \" +\n \" N_ENTRADA, \" +\n \" COD_PRODUCTO, \" +\n \" COD_PROVEEDOR, \" +\n \" CANTIDAD, \" +\n \" PRECIO_COMPRA, \" +\n \" COSTO_TOTAL_PRODUCTO \" +\n \" ) \" +\n \" VALUES \" +\n \" ( \" +\n \" (select max(n_entrada) from entrada_productos), \" +\n \" #{entrada.cod_producto}, \" +\n \" #{entrada.cod_proveedor}, \" +\n \" #{entrada.cantidad}, \" +\n \" #{entrada.precio_compra}, \" +\n \" #{entrada.costo_total_producto} \" +\n \" )\")\n void inserDetalleEntradaProductos(@Param(\"entrada\") EntradaProducto entrada);\n\n @Update(value =\"UPDATE producto \" +\n \"SET cantidad=(select cantidad+#{entrada.cantidad} from producto where codigo=#{entrada.cod_producto}) \"+\n \"WHERE codigo=#{entrada.cod_producto}\" )\n void updateStockProducto(@Param(\"entrada\")EntradaProducto entrada);\n}", "public void listarProvincia() {\n provincias = JPAFactoryDAO.getFactory().getProvinciaDAO().find();\n// for(int i=0;i<provincias.size();i++ ){\n// System.out.println(\"lista:\"+provincias.get(i).getNombreprovincia());\n// }\n }", "public interface AdCodeDetailRepository extends AXBootJPAQueryDSLRepository<AdCodeDetail, AdCodeDetail.AdCodeDetailId>\n{\n}", "public interface QuestionVoDao extends JpaRepository<QuestionVo, Long>, JpaSpecificationExecutor<QuestionVo> {\n}", "public CountryAccessor(PersistenceManagerFactory pmfProxy)\n {\n super(pmfProxy);\n }", "public interface CuentaJugadorIF {\n\n\t/**\n\t * @return Returns the idCuenta.\n\t */\n\tpublic String getIdCuenta();\n\n\t/**\n\t * @param idCuenta\n\t * The idCuenta to set.\n\t */\n\tpublic void setIdCuenta(String idCuenta);\n\n\t/**\n\t * @return Returns the fechaSis.\n\t */\n\tpublic String getFechaSis();\n\n\t/**\n\t * @param fechaSis\n\t * The fechaSis to set.\n\t */\n\tpublic void setFechaSis(String fechaSis);\n\n\t/**\n\t * @return Returns the referencia.\n\t */\n\tpublic String getReferencia();\n\n\t/**\n\t * @param referencia\n\t * The referencia to set.\n\t */\n\tpublic void setReferencia(String referencia);\n\n\t/**\n\t * @return Returns the operacion.\n\t */\n\tpublic String getOperacion();\n\n\t/**\n\t * @param operacion\n\t * The operacion to set.\n\t */\n\tpublic void setOperacion(String operacion);\n\n\t/**\n\t * @return Returns the monto.\n\t */\n\tpublic String getMonto();\n\n\t/**\n\t * @param monto\n\t * The monto to set.\n\t */\n\tpublic void setMonto(String monto);\n\n\t/**\n\t * @return Returns the concepto.\n\t */\n\tpublic String getConcepto();\n\n\t/**\n\t * @param concepto\n\t * The concepto to set.\n\t */\n\tpublic void setConcepto(String concepto);\n\n\t/**\n\t * @return Returns the idUsuario.\n\t */\n\tpublic String getIdJugador();\n\n\t/**\n\t * @param idUsuario\n\t * The idUsuario to set.\n\t */\n\tpublic void setIdJugador(String idJugador);\n\n\t/**\n\t * @return Returns the idUsuario.\n\t */\n\tpublic String getIdUsuario();\n\n\t/**\n\t * @param idUsuario\n\t * The idUsuario to set.\n\t */\n\tpublic void setIdUsuario(String idUsuario);\n\n\tpublic String getNombreJugador();\n\t\n\tpublic void setNombreJugador(String nombreJugador);\n\t\n\tpublic String getTipo();\n\t\n\tpublic void setTipo(String tipo);\n\n}", "@Generated(hash = 1206448991)\npublic Ocorrencia getOcorrencia() {\n Long __key = this.codigoOcorrencia;\n if (ocorrencia__resolvedKey == null\n || !ocorrencia__resolvedKey.equals(__key)) {\n final DaoSession daoSession = this.daoSession;\n if (daoSession == null) {\n throw new DaoException(\"Entity is detached from DAO context\");\n }\n OcorrenciaDao targetDao = daoSession.getOcorrenciaDao();\n Ocorrencia ocorrenciaNew = targetDao.load(__key);\n synchronized (this) {\n ocorrencia = ocorrenciaNew;\n ocorrencia__resolvedKey = __key;\n }\n }\n return ocorrencia;\n}", "public PonenciaBean() {\r\n controlador= new PonenciaAutorJpaController(JPAUtil.getEntityManagerFactory());\r\n controladorPonencia= new PonenciaJpaController(JPAUtil.getEntityManagerFactory());\r\n controladorEvento= new EventoJpaController(JPAUtil.getEntityManagerFactory());\r\n controladorTrabajoInvestigacion= new TrabajoInvestigacionJpaController(JPAUtil.getEntityManagerFactory());\r\n \r\n ponenciaModificar= new Ponencia(0, \"\", new Date());\r\n ponenciaAgregar= new Ponencia(0, \"\", new Date());\r\n ponencias= new ArrayList<>();\r\n eventos= new ArrayList<>();\r\n trabajos= new ArrayList<>();\r\n String temp = ((HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest()).getParameter(\"identificacion\");\r\n identificacionInvestigador=Integer.parseInt(temp);\r\n \r\n eventos= controladorEvento.findEventoEntities();\r\n trabajos=controladorTrabajoInvestigacion.findTrabajoInvestigacionEntities();\r\n List<PonenciaAutor> listaPonenciaAutor = controlador.findPonenciaAutorEntities();\r\n for(PonenciaAutor pa: listaPonenciaAutor){\r\n if(pa.getInvestigadorIdentificacion().getIdentificacion()== identificacionInvestigador){\r\n ponencias.add(pa.getPonenciaId());\r\n }\r\n }\r\n }", "@Override\r\n\tprotected PO wrapperPO(ResultSet rs, int idx) {\n\t\treturn null;\r\n\t}", "@Override\r\n\tprotected PO wrapperPO(ResultSet rs, int idx) {\n\t\treturn null;\r\n\t}", "@Override\r\n\tprotected PO wrapperPO(ResultSet rs, int idx) {\n\t\treturn null;\r\n\t}", "@Override\r\n\tprotected PO wrapperPO(ResultSet rs, int idx) {\n\t\treturn null;\r\n\t}", "@Override\r\n\tprotected PO wrapperPO(ResultSet rs, int idx) {\n\t\treturn null;\r\n\t}", "@Override\r\n\tprotected PO wrapperPO(ResultSet rs, int idx) {\n\t\treturn null;\r\n\t}", "@Override\r\n\tprotected PO wrapperPO(ResultSet rs, int idx) {\n\t\treturn null;\r\n\t}", "@Override\n\tprotected EntityManager getEntityManager() {\n\t\treturn entityManager;\n\t}", "@Repository\npublic interface JobMapper {\n @Select(\"SELECT * FROM \" + JOBTABLE + \" WHERE id=#{id}\")\n Job select(Integer id);\n\n @SelectProvider(type = JobMapperDynaSqlProvider.class, method = \"selectByParamWithPage\")\n List<Job> selectByParamWithPage(Map<String, Object> params);\n\n @Select(\"SELECT * FROM \" + JOBTABLE)\n List<Job> selectAll();\n\n @Select(\"SELECT COUNT(*) FROM \" + JOBTABLE)\n Integer countAll();\n\n @SelectProvider(type = JobMapperDynaSqlProvider.class, method = \"count\")\n Integer count(Map<String, Object> params);\n\n @InsertProvider(type = JobMapperDynaSqlProvider.class, method = \"save\")\n Integer save(Job job);\n\n @Delete(\"delete from \" + JOBTABLE + \" WHERE id=#{id}\")\n int delete(Integer id);\n\n @UpdateProvider(type = JobMapperDynaSqlProvider.class, method = \"update\")\n void update(Job job);\n}", "public interface ModeloProdutoProduto extends DCIObjetoDominio , ModeloProdutoProdutoAgregadoI , ModeloProdutoProdutoDerivadaI\n{\n\n\t\n\tpublic long getIdModeloProdutoProduto();\n\tpublic void setIdModeloProdutoProduto(long valor);\n\t\n\t\n\tpublic long getIdModeloProdutoRa();\n\tpublic void setIdModeloProdutoRa(long valor);\n\t\n\t\n\tpublic long getIdProdutoRa();\n\tpublic void setIdProdutoRa(long valor);\n\t\n\t\n}", "public IPersistence<T> getPersistence();", "public interface IProvinciaDAO {\r\n\r\n\tpublic abstract Provincia findById(Integer id);\r\n\r\n\tpublic abstract Provincia save(Provincia p);\r\n\r\n\tpublic abstract List<Provincia> findByName(String name);\r\n\r\n}", "public interface PersistenciaSoausentismosInterface {\n /**\n * Método encargado de insertar un Soausentismo en la base de datos.\n * @param soausentismos Soausentismo que se quiere crear.\n */\n public void crear(EntityManager em, Soausentismos soausentismos);\n /**\n * Método encargado de modificar un Soausentismo de la base de datos.\n * Este método recibe la información del parámetro para hacer un 'merge' con la \n * información de la base de datos.\n * @param soausentismos Soausentismo con los cambios que se van a realizar.\n */\n public void editar(EntityManager em, Soausentismos soausentismos);\n /**\n * Método encargado de eliminar de la base de datos el Soausentismo que entra por parámetro.\n * @param soausentismos Soausentismo que se quiere eliminar.\n */\n public void borrar(EntityManager em, Soausentismos soausentismos);\n /**\n * Método encargado de buscar los Soausentismos (EntityManager em, ausentismos) asociados a un empleado específico.\n * @param secuenciaEmpleado Secuencia del empleado para el cual se quieren saber los Soausentismos.\n * @return Retorna una lista de Soausentismos.\n */\n public List<Soausentismos> ausentismosEmpleado (EntityManager em, BigInteger secuenciaEmpleado);\n /**\n * Método encargado de generar un String en formato NUMERO_CERTIFICADO: FECHA_INICIO_AUSENTISMO -> FECHA_FIN_AUSENTISMO\n * con la información del ausentismo cuya secuencia coincide con la del parámetro.\n * @param secuenciaProrroga Secuencia del Ausentismo.\n * @return Retorna un String con el formato descrito y la información del Ausentismo especificado.\n */\n public String prorrogaMostrar(EntityManager em, BigInteger secuenciaProrroga);\n /**\n * Método encargado de buscar los Soausentismos para una lista de valores en la columna prorroga\n * de la tabla Soausentismos. Los Soausentismos que conforman esta lista de valores dependen del\n * empleado, de la causa del ausentismo y del ausentismo asociado a la prorroga.\n * (EntityManager em, Prorroga: ausentismo asociado a un ausentismo específico).\n * @param secuenciaEmpleado Secuencia del empleado\n * @param secuenciaCausa Secuencia de la causa del ausentismo.\n * @param secuenciaAusentismo Secuencia del ausentismo asociado a la prorroga.\n * @return Retorna una lista de los Soausentismos que cumplen con las condiciones anteriores.\n */\n public List<Soausentismos> prorrogas(EntityManager em, BigInteger secuenciaEmpleado, BigInteger secuenciaCausa, BigInteger secuenciaAusentismo);\n \n}", "public List<KodtvaDao> getKoder();", "public interface ProducerDAO\n{\n public List<Producer> getAllProducersNoFiltering();\n\n // get a Producer\n public Producer getProducerByEmailOnlyFromProducersTable(String producerEmail);\n\n public Producer getProducerByProducerIDOnlyFromProducersTable(String producerID);\n\n // get a Producer Fetching Profile\n public Producer getProducerByProducerEmailFetchingProfile(String producerEmail);\n\n // get Producer Addresses fetching also Profile\n public Producer getProducerByEmailFetchingAddressFetchingProfile(String producerEmail);\n\n // get a Producer Fetching Profile Fetching UserAuthorities\n public Producer getProducerByEmailFetchingProfileFetchingAuthoritiesFetchingAddress(String producerEmail);\n\n\n // get a Producer Entity by ProducerID Fetching Products\n public Producer getProducerByProducerIDFetchingAddressFetchingProducts(String producerID);\n\n\n // create a new Producer\n public String registerNewProducer(Producer producer);\n\n // delete a Producer\n public String deleteProducer(Producer producer);\n\n // delete Producer ProducerAuthority\n public String deleteProducerHasAuthority(ProducerHasAuthority producerHasAuthority);\n\n // delete Producer Address\n public String deleteProducerAddress(ProducerAddress producerAddress);\n\n\n // add Producer ProducerAuthority\n public String addProducerHasAuthority(ProducerHasAuthority producerHasAuthority);\n\n // add Producer ProducerAddress\n public String addProducerAddress(ProducerAddress producerAddress);\n\n // update Producer ProducerAddress\n public String updateProducerAddress(ProducerAddress producerAddress);\n\n // update a Producer\n public String updateProducer(Producer producer);\n\n}", "KdmRelationsFactory getKdmRelationsFactory();", "@Test\n public void test4() throws Exception {\n String jpql = \"SELECT c FROM Course c where SQL('course_mapped ->> ''?'' LIKE ''%i%''', c.name) AND \" +\n \"SQL('json_array_length(course_mapped #> ''{levels}'') > 0')\";\n Query q = em.createQuery(jpql, Course.class);\n List<Course> courses = q.getResultList();\n Assert.assertEquals(1,courses.size());\n Assert.assertEquals(\"First one\", courses.get(0).getCourseMapped().getName());\n }", "public interface Projetos extends JpaRepository<Projeto,Long> {\n}", "@Bean(name = \"jpaServiceVendorAdapter\")\n public HibernateJpaVendorAdapter jpaServiceVendorAdapter() {\n final HibernateJpaVendorAdapter jpaEventVendorAdapter = new HibernateJpaVendorAdapter();\n jpaEventVendorAdapter.setGenerateDdl(this.generateDdl);\n jpaEventVendorAdapter.setShowSql(this.showSql);\n return jpaEventVendorAdapter;\n }", "@Override\n\tprotected PO wrapperPO(ResultSet rs, int idx) {\n\t\treturn null;\n\t}", "public interface AEntityProperty {\n}", "protected abstract EntityManager getEntityManager();", "@Override\npublic List<Department> queryForEmp() {\n\treturn departmentMapper.queryForEmp();\n}", "@WebService(targetNamespace = \"http://www.talend.org/jpa\", name = \"JPAService\")\n@XmlSeeAlso({ObjectFactory.class})\n@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)\npublic interface JPAService {\n\n @WebResult(name = \"deleteResponse\", targetNamespace = \"http://www.talend.org/jpa\", partName = \"parameters\")\n @WebMethod(action = \"http://www.talend.org/jpa/delete\")\n public java.lang.String delete(\n @WebParam(partName = \"parameters\", name = \"deleteRequest\", targetNamespace = \"http://www.talend.org/jpa\")\n IdType parameters\n );\n\n @WebResult(name = \"persistResponse\", targetNamespace = \"http://www.talend.org/jpa\", partName = \"parameters\")\n @WebMethod(action = \"http://www.talend.org/jpa/persist\")\n public java.lang.String persist(\n @WebParam(partName = \"parameters\", name = \"persistRequest\", targetNamespace = \"http://www.talend.org/jpa\")\n PersonType parameters\n );\n}", "ProductoO getIzq();", "public interface FornecedorDao {\n Set<Fornecedor> getFornecedor() throws IOException, ClassNotFoundException;\n boolean salvar(Fornecedor fornecedor) throws IOException, ClassNotFoundException;\n boolean deletar(Fornecedor fornecedor) throws IOException, ClassNotFoundException;\n Fornecedor buscar(String cnpj) throws IOException, ClassNotFoundException;\n boolean atualizarDadosFornecedor(Fornecedor fornecedor) throws IOException, ClassNotFoundException;\n}" ]
[ "0.5919937", "0.57305616", "0.5694423", "0.5647061", "0.56141484", "0.55499125", "0.5538016", "0.54822373", "0.5449933", "0.54077375", "0.5357472", "0.5318632", "0.52990013", "0.5297913", "0.5284497", "0.52779067", "0.5276277", "0.52761495", "0.5249884", "0.52484286", "0.5242356", "0.5241639", "0.5240271", "0.522972", "0.52277935", "0.5226535", "0.52184075", "0.5214588", "0.5210579", "0.52058566", "0.51891273", "0.51795876", "0.5178014", "0.5167822", "0.5151824", "0.512543", "0.5124495", "0.51037043", "0.5101188", "0.5100283", "0.5097188", "0.5097188", "0.5095743", "0.5092387", "0.5088482", "0.5088252", "0.5087803", "0.5081982", "0.50706166", "0.50670004", "0.50549746", "0.50472665", "0.5040126", "0.5036682", "0.503074", "0.5024043", "0.5018401", "0.50170326", "0.50164634", "0.5010478", "0.50036645", "0.50022846", "0.4992264", "0.49883848", "0.4985229", "0.4983501", "0.49767736", "0.4973085", "0.4967528", "0.49631625", "0.49576813", "0.49541035", "0.49518627", "0.49489057", "0.4947905", "0.4945963", "0.4945963", "0.4945963", "0.4945963", "0.4945963", "0.4945963", "0.4945963", "0.49457467", "0.49452263", "0.4944245", "0.49391004", "0.49389353", "0.49382037", "0.49334326", "0.4929175", "0.49283108", "0.49251777", "0.49164987", "0.49160042", "0.49130297", "0.49085373", "0.4902653", "0.49019313", "0.48997667", "0.48964357", "0.48950866" ]
0.0
-1
Inflate the menu; this adds items to the action bar if it is present.
@Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.main, menu); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tMenuInflater inflater = getMenuInflater();\n \tinflater.inflate(R.menu.main_activity_actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.actions, menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tgetMenuInflater().inflate(R.menu.actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.actions_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main_actions, menu);\n\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n\t\tinflater.inflate(R.menu.action_bar_menu, menu);\r\n\t\tmMenu = menu;\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.act_bar_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_actions, menu);\r\n\t\treturn true;\r\n //return super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\r\n\t inflater.inflate(R.menu.action_bar_all, menu);\r\n\t return super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\t super.onCreateOptionsMenu(menu);\n\t\tMenuInflater muu= getMenuInflater();\n\t\tmuu.inflate(R.menu.cool_menu, menu);\n\t\treturn true;\n\t\t\n\t\t\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.adventure_archive, menu);\r\n\t\treturn true;\r\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.archive_menu, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n \tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n \t\tinflater.inflate(R.menu.main, menu);\n \t\tsuper.onCreateOptionsMenu(menu, inflater);\n \t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.action_menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater bow=getMenuInflater();\n\t\tbow.inflate(R.menu.menu, menu);\n\t\treturn true;\n\t\t}", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.action_menu, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\t\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\t\t\n\t\t/* Inflate the menu; this adds items to the action bar if it is present */\n\t\tgetMenuInflater().inflate(R.menu.act_main, menu);\t\t\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflate = getMenuInflater();\n inflate.inflate(R.menu.menu, ApplicationData.amvMenu.getMenu());\n return true;\n }", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.menu, menu);\n\t\t\treturn true; \n\t\t\t\t\t\n\t\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.main, menu);\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) \n {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_bar, menu);\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_item, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.menu, menu);\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t \n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\t//menu.clear();\n\t\tinflater.inflate(R.menu.soon_to_be, menu);\n\t\t//getActivity().getActionBar().show();\n\t\t//getActivity().getActionBar().setBackgroundDrawable(\n\t\t\t\t//new ColorDrawable(Color.rgb(223, 160, 23)));\n\t\t//return true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n this.getMenuInflater().inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.main, menu);\n }", "@Override\n\tpublic void onCreateOptionsMenu( Menu menu, MenuInflater inflater )\n\t{\n\t\tsuper.onCreateOptionsMenu( menu, inflater );\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\r\n \t// We must call through to the base implementation.\r\n \tsuper.onCreateOptionsMenu(menu);\r\n \t\r\n MenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_menu, menu);\r\n\r\n return true;\r\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.inter_main, menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.action, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu (Menu menu){\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.custom_action_bar, menu);\n\t\treturn true;\n\t}", "public void initMenubar() {\n\t\tremoveAll();\n\n\t\t// \"File\"\n\t\tfileMenu = new FileMenuD(app);\n\t\tadd(fileMenu);\n\n\t\t// \"Edit\"\n\t\teditMenu = new EditMenuD(app);\n\t\tadd(editMenu);\n\n\t\t// \"View\"\n\t\t// #3711 viewMenu = app.isApplet()? new ViewMenu(app, layout) : new\n\t\t// ViewMenuApplicationD(app, layout);\n\t\tviewMenu = new ViewMenuApplicationD(app, layout);\n\t\tadd(viewMenu);\n\n\t\t// \"Perspectives\"\n\t\t// if(!app.isApplet()) {\n\t\t// perspectivesMenu = new PerspectivesMenu(app, layout);\n\t\t// add(perspectivesMenu);\n\t\t// }\n\n\t\t// \"Options\"\n\t\toptionsMenu = new OptionsMenuD(app);\n\t\tadd(optionsMenu);\n\n\t\t// \"Tools\"\n\t\ttoolsMenu = new ToolsMenuD(app);\n\t\tadd(toolsMenu);\n\n\t\t// \"Window\"\n\t\twindowMenu = new WindowMenuD(app);\n\n\t\tadd(windowMenu);\n\n\t\t// \"Help\"\n\t\thelpMenu = new HelpMenuD(app);\n\t\tadd(helpMenu);\n\n\t\t// support for right-to-left languages\n\t\tapp.setComponentOrientation(this);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp=getMenuInflater();\n\t\tblowUp.inflate(R.menu.welcome_menu, menu);\n\t\treturn true;\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.listing, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.item, menu);\n return true;\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.resource, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu,menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.home_action_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.template, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n Log.d(\"onCreateOptionsMenu\", \"create menu\");\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.socket_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_menu, menu);//Menu Resource, Menu\n\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actionbar, menu);\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(toolbar_res, menu);\n updateMenuItemsVisibility(menu);\n return true;\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t// \n\t\tMenuInflater mi = getMenuInflater();\n\t\tmi.inflate(R.menu.thumb_actv_menu, menu);\n\t\t\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.swag_list_activity_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\n\t\treturn true;\n\t}", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.jarvi, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "public void onCreateOptionsMenu(Menu menu, MenuInflater inflater){\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) {\n menuInflater.inflate(R.menu.main, menu);\n\n }", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.add__listing, menu);\r\n\t\treturn true;\r\n\t}", "@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actmain, menu);\r\n return true;\r\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.buat_menu, menu);\n\t\treturn true;\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.layout.menu, menu);\n\t\treturn true;\n\t}", "@Override\npublic boolean onCreateOptionsMenu(Menu menu) {\n\n\t\n\t\n\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\n\treturn super.onCreateOptionsMenu(menu);\n}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ichat, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater)\n\t{\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\tinflater.inflate(R.menu.expenses_menu, menu);\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.action_bar, menu);\n return true;\n }", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp = getMenuInflater();\n\t\tblowUp.inflate(R.menu.status, menu);\n\t\treturn true;\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.menu, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn true;\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ui_main, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_activity_actions, menu);\n return true;\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.menu_main, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.menu_main, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }" ]
[ "0.72473437", "0.7202402", "0.71960324", "0.7177793", "0.7108265", "0.7040525", "0.70388484", "0.70126176", "0.70101976", "0.6981143", "0.69461405", "0.694", "0.69346833", "0.69183874", "0.69183874", "0.6891571", "0.6884306", "0.68758994", "0.687534", "0.68627334", "0.68627334", "0.68627334", "0.68627334", "0.6853258", "0.6847784", "0.6820167", "0.68177783", "0.68134266", "0.68132955", "0.68132955", "0.6806282", "0.68011856", "0.6798178", "0.67916524", "0.67897713", "0.6788724", "0.6783952", "0.6759952", "0.6757919", "0.6748738", "0.67445415", "0.67445415", "0.6741439", "0.67401767", "0.6726359", "0.6724678", "0.6723058", "0.6723058", "0.6721303", "0.67123276", "0.670777", "0.67050874", "0.670039", "0.66992784", "0.6697299", "0.6695259", "0.6686728", "0.668404", "0.668404", "0.6683142", "0.668091", "0.66799283", "0.6677784", "0.6669004", "0.66677624", "0.66630834", "0.66577506", "0.66577506", "0.66577506", "0.6656902", "0.66553235", "0.66553235", "0.66553235", "0.66530025", "0.66522014", "0.6650771", "0.66497517", "0.6647805", "0.66470283", "0.66469866", "0.6646818", "0.6645723", "0.66454786", "0.66439635", "0.66434425", "0.6642393", "0.6639529", "0.6635146", "0.6634077", "0.6632954", "0.66327274", "0.66327274", "0.66327274", "0.66297686", "0.66288346", "0.66275346", "0.66271275", "0.6625066", "0.6621276", "0.6619167", "0.6619167" ]
0.0
-1
Handle action bar item clicks here. The action bar will automatically handle clicks on the Home/Up button, so long as you specify a parent activity in AndroidManifest.xml.
@Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onOptionsItemSelected(MenuItem item) { Handle action bar item clicks here. The action bar will\n // automatically handle clicks on the Home/Up button, so long\n // as you specify a parent activity in AndroidManifest.xml.\n\n //\n // HANDLE BACK BUTTON\n //\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // Back button clicked\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // app icon in action bar clicked; goto parent activity.\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n switch (id) {\r\n case android.R.id.home:\r\n // app icon in action bar clicked; go home\r\n this.finish();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // app icon in action bar clicked; go home\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n Log.e(\"clik\", \"action bar clicked\");\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n\t public boolean onOptionsItemSelected(MenuItem item) {\n\t int id = item.getItemId();\n\t \n\t\t\tif (id == android.R.id.home) {\n\t\t\t\t// Respond to the action bar's Up/Home button\n\t\t\t\t// NavUtils.navigateUpFromSameTask(this);\n\t\t\t\tonBackPressed();\n\t\t\t\treturn true;\n\t\t\t}\n\t \n\t \n\t return super.onOptionsItemSelected(item);\n\t }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n switch (item.getItemId()) {\r\n // Respond to the action bar's Up/Home button\r\n case android.R.id.home:\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n\n switch (item.getItemId()) {\n case android.R.id.home:\n\n // app icon in action bar clicked; goto parent activity.\n this.finish();\n return true;\n default:\n\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n\n switch (item.getItemId()) {\n case android.R.id.home:\n\n // app icon in action bar clicked; goto parent activity.\n this.finish();\n return true;\n default:\n\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tonBackPressed();\n\t\t\treturn true;\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Handle presses on the action bar items\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n case R.id.action_clear:\n return true;\n case R.id.action_done:\n\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n onActionHomePressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n switch (item.getItemId())\n {\n case android.R.id.home :\n super.onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId ()) {\n case android.R.id.home:\n onBackPressed ();\n return true;\n\n default:\n break;\n }\n return super.onOptionsItemSelected ( item );\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t switch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\t// app icon in action bar clicked; go home \n\t\t\tIntent intent = new Intent(this, Kelutral.class); \n\t\t\tintent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); \n\t\t\tstartActivity(intent); \n\t\t\treturn true;\t\t\n\t case R.id.Search:\n\t \treturn onSearchRequested();\n\t\tcase R.id.AppInfo:\n\t\t\t// Place holder menu item\n\t\t\tIntent newIntent = new Intent(Intent.ACTION_VIEW,\n\t\t\t\t\tUri.parse(\"http://forum.learnnavi.org/mobile-apps/\"));\n\t\t\tstartActivity(newIntent);\n\t\t\treturn true;\n\t\tcase R.id.Preferences:\n\t\t\tnewIntent = new Intent(getBaseContext(), Preferences.class);\n\t\t\tstartActivity(newIntent);\n\t\t\treturn true;\t\n\t }\n\t return false;\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n\n case android.R.id.home:\n onBackPressed();\n return true;\n\n }\n return super.onOptionsItemSelected(item);\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // Intent homeIntent = new Intent(this, MainActivity.class);\n // homeIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n // startActivity(homeIntent);\n finish();\n return true;\n default:\n return (super.onOptionsItemSelected(item));\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // setResult and close the activity when Action Bar Up Button clicked.\n if (item.getItemId() == android.R.id.home) {\n setResult(RESULT_CANCELED);\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // This ID represents the Home or Up button. In the case of this\n // activity, the Up button is shown. Use NavUtils to allow users\n // to navigate up one level in the application structure. For\n // more details, see the Navigation pattern on Android Design:\n //\n // http://developer.android.com/design/patterns/navigation.html#up-vs-back\n //\n \tgetActionBar().setDisplayHomeAsUpEnabled(false);\n \tgetFragmentManager().popBackStack();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n switch (item.getItemId()) {\n case android.R.id.home:\n super.onBackPressed();\n return true;\n\n default:\n // If we got here, the user's action was not recognized.\n // Invoke the superclass to handle it.\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if(id == android.R.id.home){\n onBackPressed();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@RequiresApi(api = Build.VERSION_CODES.M)\n @Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tif(item.getItemId()==android.R.id.home)\r\n\t\t{\r\n\t\t\tgetActivity().onBackPressed();\r\n\t\t}\r\n\t\treturn super.onOptionsItemSelected(item);\r\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n if(item.getItemId()==android.R.id.home){\n super.onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n return false;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n //Back arrow\n case android.R.id.home:\n onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // android.R.id.home是Android内置home按钮的id\n finish();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n super.onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n this.onBackPressed();\n return false;\n }\n return false;\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Handle action bar item clicks here. The action bar will\n // automatically handle clicks on the Home/Up button, so long\n // as you specify a parent activity in AndroidManifest.xml.\n int id = item.getItemId();\n\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n switch (item.getItemId()) {\r\n\r\n case android.R.id.home:\r\n /*Intent i= new Intent(getApplication(), MainActivity.class);\r\n i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);\r\n startActivity(i);*/\r\n onBackPressed();\r\n finish();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id){\n case android.R.id.home:\n this.finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n NavUtils.navigateUpFromSameTask(getActivity());\n return true;\n case R.id.action_settings:\n Intent i = new Intent(getActivity(), SettingsActivity.class);\n startActivity(i);\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Pass the event to ActionBarDrawerToggle, if it returns\n // true, then it has handled the app icon touch event\n if (mDrawerToggle.onOptionsItemSelected(item)) {\n return true;\n }\n\n // Handle your other action bar items...\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n //Fixes the Up Button\n if(id == android.R.id.home) {\n BuildRoute.this.finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()){\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return true;\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n\n if (id == android.R.id.home) {\n NavUtils.navigateUpFromSameTask(this);\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\r\n case android.R.id.home:\r\n onBackPressed();\r\n break;\r\n }\r\n return true;\r\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tif (item.getItemId() == android.R.id.home) {\n\t\t\tfinish();\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n onBackPressed();\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n if ( id == android.R.id.home ) {\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.home) {\r\n NavUtils.navigateUpFromSameTask(this);\r\n return true;\r\n }\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.action_about) {\r\n AboutDialog();\r\n return true;\r\n }\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.action_exit) {\r\n finish();\r\n return true;\r\n }\r\n\r\n\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n//noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n// finish the activity\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item)\n {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if( id == android.R.id.home ) // Back button of the actionbar\n {\n finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n\t\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\t\tswitch (item.getItemId()) {\r\n\t\t\tcase android.R.id.home:\r\n\t\t\t\tfinish();\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\treturn super.onOptionsItemSelected(item);\r\n\t\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n if (item.getItemId() == android.R.id.home) {\n onBackPressed();\n return true;\n }\n return false;\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n\n this.finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n\n if(id == android.R.id.home){\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n if (item.getItemId() == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\r\n\t\tcase android.R.id.home:\r\n\t\t\tsetResult(RESULT_OK, getIntent());\r\n\t\t\tfinish();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n finish();\n return true;\n default:\n // If we got here, the user's action was not recognized.\n // Invoke the superclass to handle it.\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\tbreak;\n\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n\n case android.R.id.home:\n this.finish();\n return true;\n }\n return true;\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tint id = item.getItemId();\n\t\tif (id == android.R.id.home) {\n\t\t\tfinish();\n\t\t\treturn true;\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n if (id == android.R.id.home) {\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n //NavUtils.navigateUpFromSameTask(this);\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // todo: goto back activity from here\n finish();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n // Handle item selection\r\n switch (item.getItemId()) {\r\n case android.R.id.home:\r\n onBackPressed();\r\n return true;\r\n\r\n case me.cchiang.lookforthings.R.id.action_sample:\r\n// Snackbar.make(parent_view, item.getTitle() + \" Clicked \", Snackbar.LENGTH_SHORT).show();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n\n\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tonBackPressed();\n\t\t\treturn true;\n\t\tcase R.id.scan_menu:\n\t\t\tonScan();\n\t\t\tbreak;\n\t\tcase R.id.opt_about:\n\t\t\t//onAbout();\n\t\t\tbreak;\n\t\tcase R.id.opt_exit:\n\t\t\tfinish();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t\treturn true;\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n super.onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n this.finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(@NonNull MenuItem item) {\n if (item.getItemId() == android.R.id.home) {\n onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n\n case android.R.id.home:\n finish();\n return true;\n\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\r\n\t switch (item.getItemId()) {\r\n\t \t// back to previous page\r\n\t case android.R.id.home:\r\n\t finish();\r\n\t return true;\r\n\t }\r\n\t return super.onOptionsItemSelected(item);\r\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if(id==android.R.id.home){\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == android.R.id.home) {\r\n // finish the activity\r\n onBackPressed();\r\n return true;\r\n }\r\n\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == android.R.id.home) {\r\n // finish the activity\r\n onBackPressed();\r\n return true;\r\n }\r\n\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId())\n {\n case android.R.id.home:\n this.finish();\n return (true);\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id){\n case R.id.home:{\n NavUtils.navigateUpFromSameTask(this);\n return true;\n }\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n switch(item.getItemId())\n {\n case android.R.id.home:\n super.onBackPressed();\n break;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\treturn true;\n\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t}", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n\r\n int id = item.getItemId();\r\n if(id==android.R.id.home){\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }" ]
[ "0.79052806", "0.7806316", "0.7767438", "0.772778", "0.76324606", "0.7622031", "0.758556", "0.7531728", "0.7489057", "0.74576724", "0.74576724", "0.743964", "0.7422121", "0.74037784", "0.73926556", "0.7387903", "0.73803806", "0.73715395", "0.7362778", "0.7357048", "0.7346653", "0.73422706", "0.7331221", "0.7329421", "0.7326524", "0.73197514", "0.73175013", "0.7314632", "0.7305193", "0.7305193", "0.73030055", "0.72992206", "0.7294402", "0.7287853", "0.7284157", "0.72821075", "0.72797185", "0.7260893", "0.7260893", "0.7260893", "0.7260798", "0.72604334", "0.7250995", "0.72243106", "0.72205526", "0.7217967", "0.72052115", "0.72008896", "0.7200226", "0.71938485", "0.7186533", "0.7178549", "0.71698415", "0.7168567", "0.7154602", "0.7154338", "0.71365875", "0.71357495", "0.71357495", "0.71302795", "0.7129606", "0.7125107", "0.7124433", "0.71243066", "0.7122874", "0.7118138", "0.71181303", "0.71180034", "0.71180034", "0.71180034", "0.71180034", "0.7117241", "0.71159554", "0.7113099", "0.7110779", "0.71097904", "0.71062744", "0.710078", "0.7099281", "0.70957214", "0.7094494", "0.7094494", "0.7087356", "0.70834076", "0.7081747", "0.70809853", "0.70746684", "0.70691484", "0.70627403", "0.70616937", "0.7060999", "0.7052165", "0.70382303", "0.70382303", "0.7036847", "0.7036218", "0.7036218", "0.70333946", "0.7031289", "0.7030542", "0.70198953" ]
0.0
-1
FeignClient abstraction for calling REST, that native integrated with Ribbon and automatically convert into java objects name calling certain service if it registered in Eureka, url if external fallback in case if service or DB is unavailable
@FeignClient(name = "gallery-service", url = "http://localhost:8081/", fallback = StatisticFallbackFactory.class) public interface ServiceFeignClient { // Request. contain way that identical in gallery-service (same signature) @RequestLine("GET /show") List<Bucket> getAllEmployeesList(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@FeignClient(name = \"demo-service1\"\n// , fallback= DemoService1Fallback.class\n ,fallbackFactory=DemoService1FallBackFactory.class\n)\npublic interface DemoService1Client {\n\n @GetMapping(value = \"/test/test1\")\n String test1();\n}", "@FeignClient(value = \"SERVICE-A\", fallback = BaseClientHystrix.class)\npublic interface BaseClient {\n @RequestMapping(method = RequestMethod.GET, value = \"/list\")\n String list();\n}", "@RibbonClient(value = \"user-client\") // load balancer\n@FeignClient(value = \"user-client\", fallback = UserClientFallback.class)\npublic interface UserClient {\n\n @GetMapping(\"/user\")\n User getUser();\n\n}", "@FeignClient(value = UserUrl.SERVICE_NAME, fallback = UserHystrix.class)\npublic interface UserClient {\n\n @RequestMapping(value = UserUrl.USER_V1, method = RequestMethod.GET)\n String findUser(@RequestParam Map<String, Object> map);\n\n @RequestMapping(value = UserUrl.USER_INFO_V1, method = RequestMethod.GET)\n ResponseEntity<UserDto> findUserById(@PathVariable(\"userId\") Integer userId);\n}", "@FeignClient(value = \"eureka-client\", fallback = ServiceHelloHystrix.class)\npublic interface ServiceHello {\n\n @RequestMapping(value = \"/hello\", method = RequestMethod.GET)\n public String sayHello(@RequestParam(value = \"name\") String name);\n}", "@FeignClient(name = \"user-service\",fallback = UserClientHystrix.class)\npublic interface UserClient {\n @GetMapping(\"/user/test\")\n Object test(@RequestParam(\"name\") String name);\n}", "@FeignClient(value = \"${config.eureka.provider}\")\npublic interface FeignTestFacade {\n @RequestMapping(value = \"/name\" ,method = RequestMethod.GET)\n String getName();\n}", "@FeignClient(name = \"account-service\", value = \"account-service\", fallback = AccountClientFallback.class)\npublic interface AccountClient {\n\n @GetMapping(value = \"/accounts/customer/{customerId}\")\n List<Account> getAccounts(@PathVariable(\"customerId\") Integer customerId);\n\n}", "@FeignClient(value = \"EUREKA-CLIENT-01\")\npublic interface HelloService {\n @RequestMapping(value = \"/hello\",method = RequestMethod.GET)\n String hello(@RequestParam(value = \"name\") String name);\n}", "@FeignClient(value = \"monetary-market-service\",fallback = RateServiceImpl.class)\npublic interface RateService{\n\n @RequestMapping(\"/rate/uplan\")\n Map uplan(int number);\n}", "@FeignClient(\"vm-eureka-server-ad\")\npublic interface AdFeignClient {\n\n @RequestMapping(value = \"test\", method = RequestMethod.GET)\n String test();\n}", "@FeignClient(\"spring-feign-provider\")\npublic interface AuthorClient {\n @GetMapping(\"/author\")\n public String author();\n\n @MyUrl(method = \"GET\", url = \"/author\")\n public String myAuthor();\n}", "@FeignClient(name = \"product-server\",path = \"/product\")\n@Component\npublic interface ProductService {\n @RequestMapping(value = \"getProduct\")\n String getProduct();\n}", "@FeignClient(name=\"netflix-zuul-api-gateway-server\") // feign will interact with the zuul server and get the api from naming server\n@RibbonClient(name=\"currency-exchange-service\")\npublic interface CurrencyExchangeServiceProxy {\n\t//@GetMapping(\"/currency-exchange/from/{from}/to/{to}\")\n\t@GetMapping(\"/currency-exchange-service/currency-exchange/from/{from}/to/{to}\")\n\tpublic CurrencyConversionBean retrieveExchangeValue(@PathVariable(\"from\") String from, @PathVariable(\"to\") String to);\n}", "@FeignClient(\"${biz.feign.name}\")\npublic interface FinancingUserRemittanceClient {\n\n @RequestMapping(\"/financingUserRemittance/listPageByCondition\")\n Pagination<FinancingUserRemittanceDto> listPageByCondition(@RequestBody FinancingUserRemittanceQuery query);\n\n}", "@FeignClient(name = \"biblioc-bibliotheque\", url = \"localhost:9002\")\npublic interface BibliocBibliothequeProxy {\n\n @GetMapping(value = \"/Titre/{id}\")\n String getTitreLivre(@PathVariable(\"id\") int id);\n\n}", "@FeignClient(name = \"rest-service-1\", configuration = FeignConfiguration.class)\npublic interface UserRestClient {\n\n @RequestMapping(method = RequestMethod.GET, value = \"/demo/users/{id}\")\n User findUserById(@PathVariable(\"id\") String id);\n\n @RequestMapping(method = RequestMethod.POST, value = \"/demo/users\")\n ResponseEntity create(User user);\n\n @RequestMapping(method = RequestMethod.PUT, value = \"/demo/users\")\n ResponseEntity update(User user);\n\n @RequestMapping(method = RequestMethod.DELETE, value = \"/demo/users/{id}\", consumes = \"application/json\")\n ResponseEntity delete(@PathVariable(\"id\") String id);\n\n}", "@FeignClient(value = \"user-service\",fallback = UserFallbackService.class)\npublic interface UserService {\n @PostMapping(\"/user/create\")\n Object create(@RequestBody User user);\n\n @GetMapping(\"/user/{id}\")\n Object getUser(@PathVariable Long id);\n\n @GetMapping(\"/user/getByUsername\")\n Object getByUsername(@RequestParam String username);\n\n @PostMapping(\"/user/update\")\n Object update(@RequestBody User user);\n\n @PostMapping(\"/user/delete/{id}\")\n Object delete(@PathVariable Long id);\n}", "@FeignClient(\"microservice-provider-user\")\npublic interface UserFeignClient {\n\n @RequestMapping(value=\"/simple/findById\", method = {RequestMethod.POST })\n public User findById(@RequestParam(value = \"id\", required = true)Long id);\n\n @RequestMapping(value=\"/postUser\", method = {RequestMethod.POST })\n public User postUser(@RequestBody User user);\n\n}", "@FeignClient(\n name = \"beispiel-hystrix-service\",\n url = \"http://localhost:8081\",\n fallback = RemoteRandomFallback.class\n)\npublic interface RemoteRandomProxy {\n\n @GetMapping(\"/random\")\n List<Integer> getRandomNumbers();\n\n}", "@FeignClient(value = \"BINGO-CMDB\")\r\npublic interface FeignService {\r\n\r\n @RequestMapping(value = \"/api/hello\",method = RequestMethod.GET)\r\n String sayHello();\r\n}", "@FeignClient(\"customer-service\")\npublic interface CustomerClient {\n}", "@FeignClient(value=\"contact-provider8081\")\n@Repository\npublic interface ContactClient {\n @RequestMapping(value = \"selectByName\",method = RequestMethod.GET)\n public PageInfo<Contact> selectByName(@RequestParam(value = \"cname\",required =false)String cname, @RequestParam(value = \"pageNum\",required =false)Integer pageNum, @RequestParam(value = \"pageSize\",required =false)Integer pageSize);\n @RequestMapping(value =\"selectById\",method = RequestMethod.GET)\n public Contact selectById(@RequestParam(\"id\") Integer id);\n @RequestMapping(value = \"save\",method = RequestMethod.POST)\n public String save(@RequestBody Contact contact);\n @RequestMapping(value = \"updateById\",method = RequestMethod.POST)\n public String updateById(@RequestBody Contact contact);\n\n}", "public interface UserFeignClient {\n @RequestMapping(value=\"/{id}\",method= RequestMethod.GET)\n public User findById(@PathVariable(\"id\") Long id);\n}", "@FeignClient(\"greetings-service\")\ninterface GreetingsClient {\n\n\t@RequestMapping(method = RequestMethod.GET, value = \"/greetings/{name}\")\n\tGreeting greet(@PathVariable(\"name\") String name);\n}", "@FeignClient(value = \"jec-service-job\")\npublic interface IIndexApi {\n\n @RequestMapping(value = \"/\", method = RequestMethod.GET)\n RetObject index();\n\n}", "@FeignClient(value = \"${noun-id}\", fallback = NounFallback.class)\n@Order(5)\npublic interface NounClient extends WordServicesClient {\n @Override\n default ServiceNameOrder getServiceName(){\n return ServiceNameOrder.noun;\n }\n}", "@FeignClient(value = \"supos-cloud-provider-omc\", configuration = OAuth2FeignAutoConfiguration.class, fallback = OmcOrderDetailFeignHystrix.class)\npublic interface OmcOrderDetailFeignApi {\n}", "@FeignClient(value = \"provider\",fallback = FeginProviderError.class)\npublic interface FeiginProvider {\n @GetMapping(\"/queryAll\")\n public List<Student> queryAll();\n @GetMapping(\"/index\")\n public String index();\n}", "@FeignClient(value = \"HELLO-SERVICE\")\npublic interface RefactorHelloService extends online.wangxuan.helloserviceapi.service.HelloService {\n}", "@FeignClient(name = \"stock-data\")\r\npublic interface QuotesControllerProxy {\r\n @RequestMapping(value = \"/quotes\", method = RequestMethod.GET)\r\n ResponseEntity<List<Quote>> getBySymbol(@RequestParam(name = \"symbol\") String symbol);\r\n}", "@FeignClient(value = \"DsInterfaceService\")\r\npublic interface ProductAnalyService {\r\n\r\n @RequestMapping(\"/product/listProductAnaly\")\r\n public ProductAnaly listProductAnaly(@RequestParam(value = \"productid\") long productid, @RequestParam(value = \"timedate\") String timedate);\r\n}", "@FeignClient(name = \"user-server\", fallback = UserFeignHystrix.class)\npublic interface UserFeignClient {\n /**\n * 校验用户是否存在\n *\n * @param username 用户名\n * @param password 密码\n * @return 查询结果\n */\n @RequestMapping(value = \"/user/check\", method = RequestMethod.POST)\n ResultModel loginCheck(@RequestParam(\"username\") String username, @RequestParam(\"password\")String password);\n}", "@FeignClient(url = \"https://ics4-2018.now.sh/\",name = \"yi\")\npublic interface StudentFeignClient {\n\n @RequestMapping(value = \"/groups\",method = RequestMethod.POST)\n Group createGroup(@RequestBody Group group);\n\n @RequestMapping(value = \"{id}/jokes\",method = RequestMethod.POST)\n Joke createJoke(@RequestBody Joke joke);\n}", "@FeignClient(name = \"pc-cloud-client\",\n fallback = ProductSpecificationRepository.ProductSpecificationRepositoryFallback.class)\npublic interface ProductSpecificationRepository {\n\n @RequestMapping(method = RequestMethod.GET, path = \"/catalog/{specificationId}\")\n Object existsById(@PathVariable(\"specificationId\") String specificationId);\n\n @GetMapping(\"/catalog\")\n String getCatalog();\n\n @Component\n class ProductSpecificationRepositoryFallback implements ProductSpecificationRepository {\n @Override\n public Object existsById(String specificationId) {\n return null;\n }\n\n @Override\n public String getCatalog() {\n return \"Fallback catalog\";\n }\n }\n}", "@FeignClient(name=\"amsapi\", url=\"localhost:9090\")\n@RequestMapping(\"/api\")\npublic interface AmsApiProxy {\n \n @GetMapping(\"/serieses/{id}\")\n public SeriesDTO getSeries(@PathVariable(\"id\") long id);\n \n @GetMapping(\"/episodes/{id}\")\n public EpisodeDTO getEpisode(@PathVariable(\"id\") long id);\n \n @GetMapping(\"/episodes/{id}/series\")\n public SeriesDTO getEpisodeSeries(@PathVariable(\"id\") long id);\n \n}", "@FeignClient(name = \"zh-order-provider\", fallback = ZhMessageClientFallBack.class)\npublic interface RestZhMessageClient {\n@RequestMapping(value = \"/getZhMessageById\",method = RequestMethod.POST)\npublic ZhMessage getZhMessageById(@RequestParam(\"id\") Long id)throws Exception;\n\n@RequestMapping(value = \"/getZhMessageListByMap\",method = RequestMethod.POST)\npublic List<ZhMessage>\tgetZhMessageListByMap(@RequestParam Map<String,Object> param)throws Exception;\n\n@RequestMapping(value = \"/getZhMessageCountByMap\",method = RequestMethod.POST)\npublic Integer getZhMessageCountByMap(@RequestParam Map<String,Object> param)throws Exception;\n\n@RequestMapping(value = \"/qdtxAddZhMessage\",method = RequestMethod.POST)\npublic Integer qdtxAddZhMessage(@RequestBody ZhMessage zhMessage)throws Exception;\n\n@RequestMapping(value = \"/qdtxModifyZhMessage\",method = RequestMethod.POST)\npublic Integer qdtxModifyZhMessage(@RequestBody ZhMessage zhMessage)throws Exception;\n}", "@FeignClient(value=\"product-service\")\npublic interface IProductService {\n\n @RequestMapping(value = \"/getById\")\n Product getById(@RequestParam(value = \"id\") Integer id);\n\n @RequestMapping(value = \"/updateById\")\n Boolean updateById(@RequestBody Product product);\n}", "@FeignClient(value = \"orange-user\", fallbackFactory = UserFeignClientFallbackFactory.class)\npublic interface UserFeignClient {\n /**\n * 新增用户\n *\n * @param user User\n * @return Result<String>\n */\n @RequestMapping(value = \"/addUser\", method = RequestMethod.POST)\n Result<String> addUser(@RequestBody User user,\n @RequestHeader(SessionConstants.SESSION_ID_HEADER) String sessionId);\n\n /**\n * 查询用户\n *\n * @param user (password+(userid | phone | email))\n * @return Result<User>\n */\n @RequestMapping(value = \"/getUser\", method = RequestMethod.POST)\n Result<User> getUser(@RequestBody User user,\n @RequestHeader(SessionConstants.SESSION_ID_HEADER) String sessionId);\n\n /**\n * 判断邮箱是否可用\n *\n * @param email 邮箱\n * @return 200:可用,邮箱不存在 400:不可用,邮箱已存在\n */\n @RequestMapping(value = \"/checkEmail\", method = RequestMethod.POST)\n Result<String> checkEmail(@RequestParam(\"email\") String email,\n @RequestHeader(SessionConstants.SESSION_ID_HEADER) String sessionId);\n\n /**\n * 判断手机号码是否可用\n *\n * @param phone 手机号码\n * @return 200:可用,手机不存在 400:不可用,手机已存在\n */\n @RequestMapping(value = \"/checkPhone\", method = RequestMethod.POST)\n Result<String> checkPhone(@RequestParam(\"phone\") String phone,\n @RequestHeader(SessionConstants.SESSION_ID_HEADER) String sessionId);\n}", "@FeignClient(name = ServiceConstants.ServiceName)\npublic interface DayLogFeignClient {\n @RequestMapping(value = DayLogServiceHTTPConstants.RequestMapping_listDayLog,method = RequestMethod.POST)\n public Map getDayLogList(@RequestParam(\"queryMap\") String queryMap, @RequestParam(\"len\") Integer len, @RequestParam(\"page\") Integer page, @RequestBody TcUser user) ;\n\n @RequestMapping(value = DayLogServiceHTTPConstants.RequestMapping_getWorkOperateLog,method = RequestMethod.POST)\n public Map getWorkOperateLog(@RequestParam(\"queryMap\") String queryMap, @RequestParam(\"len\") Integer len, @RequestParam(\"page\") Integer page, @RequestBody TcUser user) ;\n\n\n @RequestMapping(value = DayLogServiceHTTPConstants.RequestMapping_getDayLogInfoById,method = RequestMethod.GET)\n public DayLog getDayLogInfoById(@RequestParam(\"id\") Integer id);\n\n\n @RequestMapping(value = DayLogServiceHTTPConstants.RequestMapping_getDayLogContentListById,method = RequestMethod.GET)\n public Map getDayLogContentListById(@RequestParam(\"id\") Integer id);\n\n\n @RequestMapping(value = DayLogServiceHTTPConstants.RequestMapping_saveDayLog,method = RequestMethod.POST)\n public Map saveDayLog(@RequestBody DayLog dayLog,@RequestParam(\"userId\") Integer userId,@RequestParam(\"userName\") String userName) ;\n\n\n @RequestMapping(value = DayLogServiceHTTPConstants.RequestMapping_delDayLog,method = RequestMethod.DELETE)\n public ReturnMsg delDayLog(@RequestParam(\"id\") Integer id,@RequestParam(\"userId\") Integer userId,@RequestParam(\"userName\") String userName);\n\n @RequestMapping(value = DayLogServiceHTTPConstants.RequestMapping_getNewDayLogNumbers,method = RequestMethod.GET)\n public Integer getNewDayLogNumbers();\n\n @RequestMapping(value = DayLogServiceHTTPConstants.RequestMapping_checkWorkLogRepeat,method = RequestMethod.GET)\n public Integer checkWorkLogRepeat(@RequestParam(\"workDate\") String workDate, @RequestParam(\"userId\") Integer userId);\n}", "@FeignClient(value = \"springcloud-server\")\npublic interface TestService {\n\n\t@RequestMapping(\"/test\")\n\tpublic String test();\n\n}", "@Component\n@FeignClient(name = \"patientInformation-api\", url = \"http://patientInformation-api:8081/patient\")\npublic interface PatientProxy {\n\n /**\n * Insert a new Patient in the database\n * @param patient : patient to insert in the database\n */\n @PostMapping(value = \"/insert\", produces = \"application/json\")\n void insert(@RequestBody Patient patient);\n\n /**\n * Select a Patient in the database\n * @param id : id of the patient to select\n * @return The selected patient\n */\n @GetMapping(value = \"/selectById\", produces = \"application/json\")\n Patient selectById(@RequestParam int id);\n\n /**\n * Select the Patient list in the database\n * @return The selected patient list\n */\n @GetMapping(value = \"/list\", produces = \"application/json\")\n List<Patient> list();\n\n /**\n * Update the Patient in the database\n * @param id : id of the patient to update\n * @param patient : data of the patient to update\n */\n @PutMapping(value = \"/update\", produces = \"application/json\")\n void update(@RequestParam int id, @RequestBody Patient patient);\n\n /**\n * Delete the Patient in the database\n * @param id : id of the patient to delete\n */\n @DeleteMapping(value = \"/delete\", produces = \"application/json\")\n void delete(@RequestParam int id);\n}", "@FeignClient(name = \"bnsUserClient\", url = \"${project.service-man-url}\")\npublic interface UserService {\n\n String USERS_MAPPING_PREFIX = \"users\";\n String NAME_PATH = \"/{\" + NAME + \"}\";\n\n /**\n * Search users operation.\n *\n * @param queryMap query param map\n * @return user page\n */\n @RequestLine(V1_GET + USERS_MAPPING_PREFIX)\n BaseResponse<PageData<MergedUser>> search(@QueryMap Map<String, List<String>> queryMap);\n\n /**\n * Create user operation.\n *\n * @param user user\n * @return create user\n */\n @RequestLine(V1_POST + USERS_MAPPING_PREFIX)\n BaseResponse<MergedUser> create(MergedUser user);\n\n /**\n * Find user operation.\n *\n * @param username user name\n * @return user\n */\n @RequestLine(V1_GET + USERS_MAPPING_PREFIX + NAME_PATH)\n BaseResponse<MergedUser> find(@Param(NAME) String username);\n\n /**\n * Find user operation.\n *\n * @param username user name\n * @return user\n */\n @RequestLine(V1_GET + USERS_MAPPING_PREFIX + NAME_PATH + \"?plat={platform}\")\n BaseResponse<AppUserDetails> me(@Param(NAME) String username, @Param(\"platform\") String platform);\n\n\n /**\n * Update user operation.\n *\n * @param username user name\n * @param user user\n * @return updated user\n */\n @RequestLine(V1_PUT + USERS_MAPPING_PREFIX + NAME_PATH)\n BaseResponse<MergedUser> update(@Param(NAME) String username, MergedUser user);\n\n /**\n * Delete user operation.\n *\n * @param username user name\n * @return deleted user\n */\n @RequestLine(V1_DELETE + USERS_MAPPING_PREFIX + NAME_PATH)\n BaseResponse<MergedUser> delete(@Param(NAME) String username);\n}", "@FeignClient(name = \"code-service\", fallback = CodeApiFallback.class)\npublic interface ICodeApi {\n\n /**\n * 生成 编码\n * @param prefix 前缀\n * @return\n */\n @RequestMapping(value = \"/codeApi/generateCode\",method = RequestMethod.POST)\n public String generateCode(@RequestParam(\"prefix\") String prefix);\n}", "@FeignClient(name = \"feign-service\",url = \"http://wthrcdn.etouch.cn\")\npublic interface FeignService {\n\n @GetMapping(value = \"/weather_mini\")\n ResponseEntity<Byte[]> getWeatherData(@RequestParam(\"citykey\") String citykey); // ?citykey=101280601\n}", "@FeignClient(name = \"service-provider-user\", fallback = UserAuthFallBack.class)\npublic interface IUserAuthFeign {\n\n /**\n * 根据用户微博openId查找用户\n * @param uid\n * @return\n */\n @RequestMapping(value = \"/binding/selecetByWiboOpenId\",method = RequestMethod.POST)\n UserAuthInfo selecetByWiboOpenId(@RequestParam(\"uid\") String uid,\n @RequestParam(\"access_token\") String access_token);\n\n /**\n * 根据用户微信openId查找用户\n * @param openid\n * @return\n */\n @RequestMapping(value = \"/binding/selecetByWechatOpenId\",method = RequestMethod.POST)\n UserAuthInfo selecetByWechatOpenId( @RequestParam(\"openid\") String openid,\n @RequestParam(\"access_token\") String access_token);\n\n @RequestMapping(value = \"/binding/wechatLogin\",method = RequestMethod.POST)\n UserAuthInfo wechatLogin( @RequestBody UserAuthInfo user);\n\n /**\n * 根据用户QQ openId查找用户\n * @return\n */\n @RequestMapping(value = \"/binding/selecetByQQOpenId\",method = RequestMethod.POST)\n UserAuthInfo selecetByQQOpenId( @RequestParam(\"openId\") String openId,\n @RequestParam(\"accessToken\") String accessToken,\n @RequestParam(\"qclient_id\") String qclient_id);\n\n\n}", "public interface DynamicFeignClient {\n\n @RequestLine(\"POST \")\n @Headers(\"Content-Type: application/json\")\n public ResponseModel callback(@RequestBody RequestModel requestModel);\n}", "@FeignClient(value = \"inventory-service\")\npublic interface InventoryClient {\n\n /**\n * 库存扣减.\n *\n * @param inventoryDTO 实体对象\n * @return true 成功\n */\n @RequestMapping(\"/inventory-service/inventory/decrease\")\n @Hmily\n Boolean decrease(@RequestBody InventoryDTO inventoryDTO);\n\n\n /**\n * 获取商品库存.\n *\n * @param productId 商品id\n * @return InventoryDO integer\n */\n @RequestMapping(\"/inventory-service/inventory/findByProductId\")\n Integer findByProductId(@RequestParam(\"productId\") String productId);\n\n\n /**\n * 模拟库存扣减异常.\n *\n * @param inventoryDTO 实体对象\n * @return true 成功\n */\n @Hmily\n @RequestMapping(\"/inventory-service/inventory/mockWithTryException\")\n Boolean mockWithTryException(@RequestBody InventoryDTO inventoryDTO);\n\n\n /**\n * 模拟库存扣减超时.\n *\n * @param inventoryDTO 实体对象\n * @return true 成功\n */\n @Hmily\n @RequestMapping(\"/inventory-service/inventory/mockWithTryTimeout\")\n Boolean mockWithTryTimeout(@RequestBody InventoryDTO inventoryDTO);\n\n /**\n * 测试 TCC 事务\n *\n * @param params 请求参数\n * @return true 成功\n */\n @RequestMapping(\"/inventory-service/inventory/testTcc\")\n @Hmily\n Boolean testTcc(@RequestBody Map<String, Object> params);\n\n /**\n * 测试 TCC 事务\n *\n * @param params 请求参数\n * @return true 成功\n */\n @RequestMapping(\"/inventory-service/inventory/testTCCFeginInventoryTryException\")\n @Hmily\n Boolean testTCCFeginInventoryTryException(@RequestBody Map<String, Object> params);\n\n}", "public interface ProductService {\n\n\t/**\n\t * Returns the product details\n\t * \n\t * @param productId\n\t * unique id of the product\n\t * @return Product Detail\n\t */\n\tpublic Optional<Product> getProduct(String productId);\n\t\n\tpublic Optional<Product> getProductUsingFeignClient(String productId);\n\n}", "@FeignClient(value = \"gateway\")\n@RequestMapping(path = \"/api/v1\")\npublic interface ApiGatewayFeignClient {\n\n /**\n * Get all products\n *\n * @param token User bearer token\n *\n * @return The list of products\n */\n @GetMapping(path = \"/products\")\n List<Product> getAllProducts(@RequestHeader(HttpHeaders.AUTHORIZATION) String token);\n\n /**\n * Get a product by id\n *\n * @param token User bearer token\n * @param id The product id\n *\n * @return The product\n */\n @GetMapping(path = \"/products/{id}\")\n Product getProductById(@RequestHeader(HttpHeaders.AUTHORIZATION) String token, @PathVariable Long id);\n\n /**\n * Add a product\n *\n * @param token User bearer token\n * @param product The product to register\n *\n * @return The registered product\n */\n @PostMapping(path = \"/products\")\n Product postProduct(@RequestHeader(HttpHeaders.AUTHORIZATION) String token, @RequestBody Product product);\n\n /**\n * Update a product\n *\n * @param token User bearer token\n * @param product The new product data\n * @param id The id of the product to update\n *\n * @return The updated product\n */\n @PutMapping(path = \"/products/{id}\")\n Product putProduct(@RequestHeader(HttpHeaders.AUTHORIZATION) String token, @RequestBody Product product, @PathVariable Long id);\n\n /**\n * Delete a product\n *\n * @param token User bearer token\n * @param id The id of the product to delete\n */\n @DeleteMapping(path = \"/products/{id}\")\n void deleteProduct(@RequestHeader(HttpHeaders.AUTHORIZATION) String token, @PathVariable Long id);\n\n /**\n * Get the cart of the connected user\n *\n * @param token User bearer token\n *\n * @return The shopping cart of the user or null if he doesn't already have a cart (i.e. no product in the cart)\n */\n @GetMapping(path = \"cart\")\n Optional<ShoppingCart> getShoppingCart(@RequestHeader(HttpHeaders.AUTHORIZATION) String token);\n\n /**\n * Add product to the connected user's cart\n *\n * @param token User bearer token\n * @param entry The line to add (product + quantity)\n *\n * @return The updated shopping cart\n */\n @PostMapping(path = \"cart\")\n ShoppingCart addProductToCart(@RequestHeader(HttpHeaders.AUTHORIZATION) String token, @RequestBody ShoppingCartEntry entry);\n\n /**\n * Delete the connected user cart\n *\n * @param token User bearer token\n */\n @DeleteMapping(path = \"cart\")\n void deleteShoppingCart(@RequestHeader(HttpHeaders.AUTHORIZATION) String token);\n\n /**\n * Get orders of the connected user\n *\n * @param token User bearer token\n *\n * @return The list of orders\n */\n @GetMapping(path = \"/orders\")\n Iterable<ShopOrder> getOrdersByUser(@RequestHeader(HttpHeaders.AUTHORIZATION) String token);\n\n /**\n * Get all orders\n *\n * @param token User bearer token\n *\n * @return The list of orders\n */\n @GetMapping(path = \"/orders/all\")\n Iterable<ShopOrder> getAllOrders(@RequestHeader(HttpHeaders.AUTHORIZATION) String token);\n\n /**\n * Get all orders which are not already assigned to a delivery man for the delivery\n *\n * @param token User bearer token\n *\n * @return The list of orders\n */\n @GetMapping(path = \"/orders/unassigned\")\n Iterable<ShopOrder> getUnassignedOrders(@RequestHeader(HttpHeaders.AUTHORIZATION) String token);\n\n\n /**\n * Get all orders assigned to the connected delivery man but not delivered for the moment\n *\n * @param token User bearer token\n *\n * @return The list of orders\n */\n @GetMapping(path = \"/orders/assigned\")\n Iterable<ShopOrder> getOrdersToDeliver(@RequestHeader(HttpHeaders.AUTHORIZATION) String token);\n\n /**\n * Add an order\n *\n * @param token User bearer token\n * @param order The order to register\n *\n * @return The registered order\n */\n @PostMapping(path = \"/orders\")\n ShopOrder postOrder(@RequestHeader(HttpHeaders.AUTHORIZATION) String token, @RequestBody ShopOrder order);\n\n /**\n * Assign the connected delivery man to an order\n *\n * @param token User bearer token\n * @param id Id of the order\n *\n * @return The updated order\n */\n @PutMapping(path = \"/orders/{id}/assign\")\n ShopOrder assign(@RequestHeader(HttpHeaders.AUTHORIZATION) String token, @PathVariable Long id);\n\n /**\n * Set an order as delivered\n *\n * @param token User bearer token\n * @param id Id of the order\n *\n * @return The updated order\n */\n @PutMapping(path = \"/orders/{id}/delivered\")\n ShopOrder markAsDelivered(@RequestHeader(HttpHeaders.AUTHORIZATION) String token, @PathVariable Long id);\n}", "@FeignClient(ZoneConstants.FEIGN_URL)\npublic interface PositionLinkFeign {\n @RequestMapping(value = \"/position/queryPositionLink\",method = RequestMethod.POST)\n RequestResult<List<PositionLinkModel>> queryPositionLinkList(PositionLinkQueryForm form);\n\n @RequestMapping(value = \"/position/savePositionLink\",method = RequestMethod.POST)\n RequestResult savePositionLink(PositionLinkSaveForm form);\n\n @RequestMapping(value = \"/position/deletePositionLink\",method = RequestMethod.POST)\n RequestResult deleteById(IdForm form);\n}", "@FeignClient(name = \"store-product-service/productAttributeService\")\npublic interface IProductAttributeService {\n\n @PostMapping(\"/getProductAttrVO\")\n ProductAttributeVO getProductAttrVO(@RequestParam(\"productId\") Long productId);\n\n}", "@FeignClient(name = \"service-provider-news\")\npublic interface IContentBroadcastServiceFeign {\n\n /**\n * aliyun列表分页查询\n * @param entity\n * @return\n */\n @RequestMapping(value = \"/contentBroadcast/getPage\",method = RequestMethod.POST)\n TableResultResponse<ContentBroadcastInfo> getPage(@RequestBody ContentBroadcastInfo entity);\n\n /**\n * 得到aliyun列表的详尽信息\n * @param\n * @return\n */\n @RequestMapping(value = \"/contentBroadcast/{id}\", method = RequestMethod.GET)\n @ResponseBody\n ObjectRestResponse<ContentBroadcast> get(@PathVariable(\"id\") int id);\n\n /**\n * 修改aliyun\n * @param\n * @return\n */\n @RequestMapping(value = \"/contentBroadcast/{id}\", method = RequestMethod.PUT)\n @ResponseBody\n ObjectRestResponse<ContentBroadcast> update(@PathVariable(\"id\") Integer id, @RequestBody ContentBroadcast entity);\n\n\n /**\n * 新增aliyun\n * @param\n * @return\n */\n @RequestMapping(value = \"/contentBroadcast\", method = RequestMethod.POST)\n ObjectRestResponse<ContentBroadcast> add(@RequestBody ContentBroadcast entity);\n\n\n}", "@HystrixCommand(fallbackMethod = \"fallback\")\n\tpublic String hiService(String name) {\n\t\t// 直接用的应用名替代了具体的uri地址,在ribbon中它会根据服务名来选择具体的服务实例,根据服务实例在请求的时候会用具体的url替换掉服务名。\n\t\treturn restTemplate.getForObject(\"http://service-hi/hi?name=\" + name, String.class);\n\t}", "public interface TwilioService {\n @GET(\"PhoneNumbers/{phoneNumber}?Type=carrier\")\n Call<TwilioLookupResponse> lookup(@Path(\"phoneNumber\") String phoneNumber);\n}", "@RequestMapping(\"/resources_onecb\")\n public ResponseEntity<List<Resource>> request_onecb() {\n IService1 service1 = Feign.builder()\n .decoder(new JacksonDecoder())\n .target(IService1.class, \"http://\"+service1host+\":\"+service1port);\n\n // Fetch and print a list of the contributors to this library.\n List<Resource> resources = service1.resources();\n\n return new ResponseEntity<List<Resource>>(resources, HttpStatus.OK);\n }", "@FeignClient(name=\"service-ribbon\")\npublic interface ConsumerController {\n\n\t@PostMapping(value = \"/registerTeacher\")\n\tString hello(@RequestParam(value = \"name\") String name);\n}", "@FeignClient(name = \"my-lawyer-user-service\",configuration=FeignConfiguration.class, fallback = UserRemoteHystrix.class)\npublic interface UserRemote {\n\t\n\n\t// 用户注册\n\t@PostMapping(\"user/api/regist\")\n\tpublic AppMsgResult regist(@RequestParam(value = \"userPhone\", required = true) String userPhone,\n\t\t\t@RequestParam(value = \"userPassword\", required = true) String userPassword,\n\t\t\t@RequestParam(value = \"code\", required = true) String code);\n\n\t// 获取手机验证码\n\t@GetMapping(\"user/api/getUserPhoneCode\")\n\tpublic AppMsgResult getUserPhoneCode(@RequestParam(value = \"userPhone\", required = true) String userPhone,\n\t\t\t@RequestParam(value = \"type\", required = false) String type);\n\n\t// 忘记找回密码\n\t@PostMapping(\"user/api/forgetPassWord\")\n\tpublic AppMsgResult forgetPassWord(@RequestParam(value = \"userPhone\", required = true) String userPhone,\n\t\t\t@RequestParam(value = \"userPassword\", required = true) String userPassword,\n\t\t\t@RequestParam(value = \"code\", required = true) String code);\n\n\t// 用户登录\n\t@PostMapping(\"user/api/login\")\n\tpublic AppMsgResult login(@RequestParam(value = \"userPhone\", required = true) String userPhone,\n\t\t\t@RequestParam(value = \"userPassword\", required = true) String userPassword,\n\t\t\t@RequestParam(value = \"userType\", required = true) String userType);\n\n\t// 用户修改密码\n\t@PostMapping(\"user/api/updatePassWord\")\n\tpublic AppMsgResult updatePassWord(@RequestParam(value = \"userId\", required = true) String userId,\n\t\t\t@RequestParam(value = \"oldUserPassword\", required = true) String oldUserPassword,\n\t\t\t@RequestParam(value = \"userPassword\", required = true) String userPassword,\n\t\t\t@RequestParam(value = \"token\", required = true) String token);\n\n\t// 个人用户修改资料\n\t@PostMapping(\"user/api/updateUser\")\n\tpublic AppMsgResult updateUser(@RequestParam(value = \"userId\", required = true) String userId,\n\t\t\t@RequestParam(value = \"token\", required = true) String token,\n\t\t\t@RequestParam(value = \"userNick\", required = false) String userNick,\n\t\t\t@RequestParam(value = \"userGender\", required = false) Integer userGender,\n\t\t\t@RequestParam(value = \"userEmail\", required = false) String userEmail);\n\t\n\t// 切换身份\n\t@PostMapping(\"user/api/switchUser\")\n\tpublic AppMsgResult switchUser(@RequestParam(value = \"userId\", required = true) String userId,\n\t\t\t@RequestParam(value = \"token\", required = true) String token,\n\t\t\t@RequestParam(value = \"userPhone\", required = true) String userPhone,\n\t\t\t@RequestParam(value = \"currentType\", required = true) String currentType,\n\t\t\t@RequestParam(value = \"type\", required = true) String type);\n\t// 律师账户提现\n @PostMapping(\"user/api/showMoney\")\n\tpublic AppMsgResult showMoney(ZaUserPurchaseRecord userPurchaseRecord,\n\t\t\t@RequestParam(value = \"token\",required = true) String token, @RequestParam(value = \"userPassword\",required = true) String userPassword);\n \n\t// 更新用户信息\n\t@PostMapping(\"user/api/getNewUserinfo\")\n\tpublic AppMsgResult getNewUserinfo(@RequestParam(value = \"userId\", required = true) String userId,\n\t\t\t@RequestParam(value = \"token\", required = true) String token,\n\t\t\t@RequestParam(value = \"userType\", required = true) String userType);\n\t\t\t\n}", "public interface BeaconQuestService {\n\n @GET(\"/beaconQuest/index/takeChallenge/{accountId}/{beaconId}\")\n Call<ResponseBody> takeChallenge (@Path(\"accountId\") String accountId,\n @Path(\"beaconId\") String beaconId\n );\n\n @GET(\"beaconQuest/index/challengeAnswer/{accountId}/{beaconId}/{answer}\")\n Call<ResponseBody> challengeAnswer(@Path(\"accountId\") String userid,\n @Path(\"beaconId\") String beaconid,\n @Path(\"answer\") String answer\n );\n\n @GET(\"beaconQuest/index//challengeCancel/{accountId}/{beaconId}\")\n Call<ResponseBody> challengeAnswer(@Path(\"accountId\") String userid,\n @Path(\"beaconId\") String beaconid\n );\n\n @GET(\"beaconQuest/index//register/{username}/{password}\")\n Call<ResponseBody> registerAccount(@Path(\"username\") String username,\n @Path(\"password\") String password\n );\n\n @GET(\"beaconQuest/index//login/{username}/{password}/\")\n Call<ResponseBody> login(@Path(\"username\") String username,\n @Path(\"password\") String password\n );\n}", "public interface RestInterface {\n\n @GET(\"{currency}/\")\n Call<List<ResponseModel>> geCurrency(@Path(\"currency\") String currency);\n}", "public interface OperationsClient {\n /**\n * Lists all the operations supported by Microsoft.ProviderHub.\n *\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n * @return the paginated response with {@link PagedIterable}.\n */\n @ServiceMethod(returns = ReturnType.COLLECTION)\n PagedIterable<OperationsDefinitionInner> list();\n\n /**\n * Lists all the operations supported by Microsoft.ProviderHub.\n *\n * @param context The context to associate with this operation.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n * @return the paginated response with {@link PagedIterable}.\n */\n @ServiceMethod(returns = ReturnType.COLLECTION)\n PagedIterable<OperationsDefinitionInner> list(Context context);\n\n /**\n * Gets the operations supported by the given provider.\n *\n * @param providerNamespace The name of the resource provider hosted within ProviderHub.\n * @param context The context to associate with this operation.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n * @return the operations supported by the given provider along with {@link Response}.\n */\n @ServiceMethod(returns = ReturnType.SINGLE)\n Response<List<OperationsDefinitionInner>> listByProviderRegistrationWithResponse(\n String providerNamespace, Context context);\n\n /**\n * Gets the operations supported by the given provider.\n *\n * @param providerNamespace The name of the resource provider hosted within ProviderHub.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n * @return the operations supported by the given provider.\n */\n @ServiceMethod(returns = ReturnType.SINGLE)\n List<OperationsDefinitionInner> listByProviderRegistration(String providerNamespace);\n\n /**\n * Creates or updates the operation supported by the given provider.\n *\n * @param providerNamespace The name of the resource provider hosted within ProviderHub.\n * @param operationsPutContent The operations content properties supplied to the CreateOrUpdate operation.\n * @param context The context to associate with this operation.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n * @return the response body along with {@link Response}.\n */\n @ServiceMethod(returns = ReturnType.SINGLE)\n Response<OperationsContentInner> createOrUpdateWithResponse(\n String providerNamespace, OperationsPutContent operationsPutContent, Context context);\n\n /**\n * Creates or updates the operation supported by the given provider.\n *\n * @param providerNamespace The name of the resource provider hosted within ProviderHub.\n * @param operationsPutContent The operations content properties supplied to the CreateOrUpdate operation.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n * @return the response.\n */\n @ServiceMethod(returns = ReturnType.SINGLE)\n OperationsContentInner createOrUpdate(String providerNamespace, OperationsPutContent operationsPutContent);\n\n /**\n * Deletes an operation.\n *\n * @param providerNamespace The name of the resource provider hosted within ProviderHub.\n * @param context The context to associate with this operation.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n * @return the {@link Response}.\n */\n @ServiceMethod(returns = ReturnType.SINGLE)\n Response<Void> deleteWithResponse(String providerNamespace, Context context);\n\n /**\n * Deletes an operation.\n *\n * @param providerNamespace The name of the resource provider hosted within ProviderHub.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n */\n @ServiceMethod(returns = ReturnType.SINGLE)\n void delete(String providerNamespace);\n}", "public interface ActorAPI {\n @GET(\"EJP8Q22E-\")\n Call<Actor> getActorImageUrl(String actorName);\n\n @GET(\"EJP8Q22E-\")\n Call<Actor> getTestActorImageUrl();\n}", "public interface PIService {\n @POST(\"learningrace1/rest/participante\")\n Call<List<Participante>> getParticipante(@Body Participante participante);\n\n @GET(\"learningrace1/rest/evento/{identificador}\")\n Call<List<Evento>> getEvento(@Path(\"identificador\") String identificador);\n\n}", "public interface MyServiceTwo {\n\n @GET(\"kehuduan/PAGE14503485387528442/index.json\")\n Call<XiongMao> getTwoImg();\n\n @GET(\"http://api.cntv.cn/apicommon/index?path=iphoneInterface/general/getArticleAndVideoListInfo.json&primary_id=PAGE1449807494852603,PAGE1451473625420136,PAGE1449807502866458,PAGE1451473627439140,PAGE1451473547108278,PAGE1451473628934144&serviceId=panda\")\n Call<Todal> getTwoTodal();\n}", "@FeignClient(value = \"item-catalog-service\", url = \"http://item-catalog-service:8763\")\ninterface ItemClient {\n\n\t@GetMapping(\"/items\")\n\tCollectionModel<Item> readItems();\n}", "@FeignClient(UserServiceConstants.SERVER_NAME)//服务名\n@RequestMapping(UserServiceConstants.SERVER_PRIFEX)//内部服务前缀\n@Api(tags = \" 红包服务server层接口\")\npublic interface ImRedService {\n\n @ApiOperation(\"发送红包\")\n @PostMapping(\"/add\")\n ImRed add(@RequestBody ImRedDto imRedDto);\n\n @ApiOperation(\"加入红包\")\n @PostMapping(\"/join\")\n void join(@RequestParam(\"id\") Long id,@RequestParam(\"address\")String address);\n\n\n @ApiOperation(\"红包详情\")\n @GetMapping(\"/findById\")\n ImRedDetailDto findById(@RequestParam(\"id\") Long id,@RequestParam(\"userAddress\")String userAddress);\n\n @ApiOperation(\"我发送的红包\")\n @GetMapping(\"/findMySendRed\")\n ImRedMyDetailDto findMySendRed(@RequestParam(\"userAddress\")String userAddress,@RequestParam(\"year\")Integer year);\n\n\n @ApiOperation(\"我接收的红包\")\n @GetMapping(\"/findMyReceiveRed\")\n ImRedMyDetailDto findMyReceiveRed(@RequestParam(\"userAddress\")String userAddress,@RequestParam(\"year\")Integer date);\n\n\n @ApiOperation(\"我待支付红包\")\n @GetMapping(\"/findMyPaidRed\")\n List<ImRedList> findMyPaidRed(@RequestParam(\"userAddress\")String userAddress);\n\n\n @ApiOperation(\"修改红包状态\")\n @PostMapping(\"/updateRed\")\n void updateRed(@RequestParam(\"id\") Long id);\n\n\n\n @ApiOperation(\"修改红包领取状态\")\n @PostMapping(\"/updateRedReceive\")\n void updateRedReceive(@RequestParam(\"redId\") Long redId,@RequestParam(\"address\") String address,@RequestParam(\"hash\")String hash);\n\n\n\n\n}", "public interface ApiService {\n\n @GET(\"products.json\")\n Call<Product> loadProduct();\n\n}", "public interface ILablePrintRestService {\n String getContainerCode(Integer number,String containerCode) throws BizCheckedException;\n String getMergeLable(@QueryParam(\"number\") Integer number);\n\n\n }", "public interface PreconfiguredEndpoint {\n /**\n * Gets the id property: Fully qualified resource Id for the resource.\n *\n * @return the id value.\n */\n String id();\n\n /**\n * Gets the name property: The name of the resource.\n *\n * @return the name value.\n */\n String name();\n\n /**\n * Gets the type property: The type of the resource.\n *\n * @return the type value.\n */\n String type();\n\n /**\n * Gets the location property: The geo-location where the resource lives.\n *\n * @return the location value.\n */\n String location();\n\n /**\n * Gets the tags property: Resource tags.\n *\n * @return the tags value.\n */\n Map<String, String> tags();\n\n /**\n * Gets the description property: The description of the endpoint.\n *\n * @return the description value.\n */\n String description();\n\n /**\n * Gets the endpoint property: The endpoint that is preconfigured.\n *\n * @return the endpoint value.\n */\n String endpoint();\n\n /**\n * Gets the endpointType property: The type of endpoint.\n *\n * @return the endpointType value.\n */\n EndpointType endpointType();\n\n /**\n * Gets the backend property: The preconfigured endpoint backend.\n *\n * @return the backend value.\n */\n String backend();\n\n /**\n * Gets the inner com.azure.resourcemanager.frontdoor.fluent.models.PreconfiguredEndpointInner object.\n *\n * @return the inner object.\n */\n PreconfiguredEndpointInner innerModel();\n}", "public interface NewsService {\n @GET(\"v1/sources?language=en\")\n Call<WebSite> getSources();\n}", "public interface GatewayInfo {\n\n /**\n * Return Pipeline ID of the Microservice Pipeline\n *\n * @return the Pipeline ID\n */\n String getPipelineId();\n\n /**\n * Return the service name for the API Gateway, used in the gateway rest point URL.\n * http://localhost:18630/rest/v1/gateway/<ServiceName>\n *\n * @return the Gateway Service name\n */\n String getServiceName();\n\n /**\n * Return the REST Service API Endpoint.\n *\n * @return the REST Service HTTP URL\n */\n String getServiceUrl();\n\n /**\n * Return true to use protected Data Collector URL\n * \"http://localhost:18630/rest/v1/gateway/<service name>.\".\n *\n * Otherwise, Gateway URL is an unprotected Data Collector URL -\n * \"http://localhost:18630/public-rest/v1/gateway/<service name>.\"\n *\n * @return Return true to use protected Gateway Endpoint\n */\n boolean getNeedGatewayAuth();\n\n /**\n * Return the Gateway secret to use in the HTTP request header.\n *\n * To avoid users calling REST Service URL directly instead of going through gateway URL,\n * we use GATEWAY_SECRET header, and REST Service will process requests only if secret matches.\n *\n * @return the gateway secret\n */\n String getSecret();\n\n}", "public interface RecipeService {\n\n @GET(\"recipes\")\n Call<List<Recipe>> getRecipes();\n}", "public interface RESTService {\n\n /**\n * Check Voter Services\n **/\n\n //TODO to check this is work or not\n //@GET(Config.REGISTER) Call<User> registerUser(@Header(\"uuid\") String uuid,\n // @QueryMap Map<String, String> body);\n\n @GET(Config.REGISTER) Call<User> registerUser(@QueryMap Map<String, String> body);\n\n /**\n * Maepaysoh services\n **/\n\n //candidate\n @GET(Config.CANDIDATE_LIST_URL) Call<CandidateListReturnObject> getCandidateList(\n @QueryMap Map<String, String> optionalQueries);\n\n @GET(Config.CANDIDATE_URL + \"/{id}\") Call<JsonObject> getCandidate(@Path(\"id\") String id,\n @QueryMap Map<String, String> optionalQueries);\n\n //geo location\n @GET(Config.GEO_LOCATION_URL) Call<GeoReturnObject> getLocationList(\n @QueryMap Map<String, String> optionalQueries);\n\n @GET(Config.GEO_LOCATION_SEARCH) Call<JsonObject> searchLocation(\n @QueryMap Map<String, String> optionalQueries);\n\n //party\n @GET(Config.PARTY_LIST_URL) Call<PartyReturnObject> getPartyList(\n @QueryMap Map<String, String> optionalQueries);\n\n @GET(Config.PARTY_LIST_URL + \"/{id}\") Call<JsonObject> getPartyDetail(@Path(\"id\") String id);\n\n //OMI service\n @GET(Config.MOTION_DETAIL_URL) Call<JsonObject> getMotionDetail(@Query(\"mpid\") String mpId);\n\n @GET(Config.MOTION_COUNT) Call<JsonObject> getMotionCount(@Query(\"mpid\") String mpId);\n\n @GET(Config.QUESTION_DETAIL_URL) Call<JsonObject> getQuestionDetail(@Query(\"mpid\") String mpId);\n\n @GET(Config.QUESTION_COUNT) Call<JsonObject> getQuestionCount(@Query(\"mpid\") String mpId);\n\n @GET(Config.QUESTION_MOTION) Call<JsonObject> getQuestionAndMotion(@Query(\"mpid\") String mpId);\n\n @GET(Config.COMPARE_QUESTION) Call<JsonElement> getCompareQuestion(\n @Query(\"first\") String first_candidate_id, @Query(\"second\") String second_candidate_id);\n\n @GET(Config.CANDIDTE_AUTO_SEARCH) Call<ArrayList<CandidateSearchResult>> searchCandidate(\n @Query(\"q\") String keyWord, @QueryMap Map<String, Integer> options);\n\n @GET(Config.CANDIDATE_COUNT) Call<JsonObject> getCandidateCount(@Query(\"party\") String party_id);\n\n @GET(Config.CURRENT_COUNT) Call<JsonObject> getCurrentCount();\n\n @GET(Config.FAQ_LIST_URL) Call<FAQListReturnObject> listFaqs(\n @QueryMap Map<String, String> options);\n\n @GET(Config.FAQ_SEARCH) Call<FAQListReturnObject> searchFaq(@Query(\"q\") String keyWord,\n @QueryMap Map<String, String> options);\n\n @GET(\"/faq/{faq_id}\") Call<FAQDetailReturnObject> searchFaqById(@Path(\"faq_id\") String faqId,\n @QueryMap Map<String, String> options);\n\n @GET(Config.APP_VERSIONS) Call<JsonObject> checkUpdate();\n}", "@HystrixCommand(fallbackMethod = \"addServiceFallback\")\n public String addService() {\n UserInfoPOJO UserInfoPOJO =new UserInfoPOJO();\n UserInfoPOJO.setUsername(\"张萨姆\");\n UserInfoPOJO.setPwd(\"11111\");\n UserInfoPOJO.setText1(\"wocacac\");\n// String jsonObj = JSONObject.toJSONString(UserInfoPOJO);\n// HttpEntity<String> formEntity = new HttpEntity<String>(jsonObj, headers);\n// Map map =new HashMap<Integer,UserInfoPOJO>();\n// map.put(1,UserInfoPOJO);\n// String Mes = JSONObject.toJSONString(map);\n // String url =;\n\n MultiValueMap<String, String> paramMap = new LinkedMultiValueMap<String, String>();\n paramMap.add(\"data\", JSONObject.toJSONString(UserInfoPOJO));\n\n String aa= restTemplate.postForObject(\"http://COMPUTE-SERVICEA/add\", paramMap, String.class);\n JSONArray mapreturn = JSONObject.parseArray(aa);\n String strreturn = (String)mapreturn.get(0);\n UserInfoPOJO aaa = JSON.parseObject(strreturn,UserInfoPOJO.getClass());\nreturn aa;\n\n // return restTemplate.getForEntity(\"http://COMPUTE-SERVICEA/add?a=10&b=20&c=\"+Mes, String.class).getBody();\n }", "public interface Service {\n @GET(\"/orama-media/json/fund_detail_full.json?limit=1000&offset=0&serializer=fund_detail_full\")\n Call<List<Example>> getExample();\n\n}", "public interface Apiservice {\n\n @POST(\"mobile/login\")\n Call<UsuarioIngreso> postusuaruio(@Body Usuario usuario);\n\n @POST(\"mobile/FetchEBCDS\")\n Call<EBCD> getEBCD(@Body Codigo codigo);\n\n @POST(\"mobile/FetchInvoiceData\")\n Call<List<FetchInvoiceData>> fetchInvoiceData(@Body Codigo codigo);\n}", "public interface BusinessActionsRestClient {\n}", "public interface GitHubService {\n// @GET(\"article/list/1/15/1\")\n// Call<JinXuanBean> getQuamZiData();\n @GET(\"article/list/{page}/15/{type}\")\n Call<JinXuanBean> getQuamZiData(@Path(\"page\") int page, @Path(\"type\") int type);\n\n @GET(\"article/{articleId}\")\n Call<ArticleBean> getArticle(@Path(\"articleId\") int articleId);\n @GET(\"review/article/content/{page}/15/{articleId}\")\n Call<Comment> getComment(@Path(\"page\") int page, @Path(\"articleId\") int articleId);\n}", "public interface ServiceApi\n{\n @GET(\"{list}\")\n Call<ResponseBody> request(@Path(\"list\") String postfix, @QueryMap HashMap<String, Object> params);\n}", "public interface ShortUrlApi {\n\n @POST(\"shorturl\")\n @Converter(ShortUrlConverter.class)\n Call<String> shortUrl(@Body String longUrl,@Query(\"access_token\")String accessToken);\n\n class ShortUrlConverter extends JacksonConverter<String,String> {\n @Override\n public byte[] request(ObjectMapper mapper, Type type, String longUrl) throws IOException {\n return String.format(\"{\\\"action\\\":\\\"long2short\\\",\\\"long_url”:”%s”}\",longUrl).getBytes(CHARSET_UTF8);\n }\n\n @Override\n public String response(ObjectMapper mapper, Type type, byte[] response) throws IOException {\n JsonNode jsonNode = mapper.readTree(response);\n return jsonNode.path(\"short_url\").asText();\n }\n }\n}", "public interface CoinMarketCapApiEndpointInterface {\n\n String TICKER = \"ticker\";\n\n @GET(TICKER)\n Call<List<CurrencyTicker>> getTickers();\n\n @GET(TICKER + \"/{id}\")\n Call<CurrencyTicker> getCurrencyTicker(@Path(\"id\") int tickerId);\n}", "@Path(\"/providers/Microsoft.Compute/locations/{location}\")\n@RequestFilters({ OAuthFilter.class, ApiVersionFilter.class })\n@Consumes(APPLICATION_JSON)\npublic interface OSImageApi {\n\n /**\n * List Publishers in location\n */\n @Named(\"publisher:list\")\n @GET\n @Path(\"/publishers\")\n @Fallback(EmptyListOnNotFoundOr404.class)\n List<Publisher> listPublishers();\n\n /**\n * List Offers in publisher\n */\n @Named(\"offer:list\")\n @GET\n @Path(\"/publishers/{publisher}/artifacttypes/vmimage/offers\")\n @Fallback(EmptyListOnNotFoundOr404.class)\n List<Offer> listOffers(@PathParam(\"publisher\") String publisher);\n\n /**\n * List SKUs in offer\n */\n @Named(\"sku:list\")\n @GET\n @Path(\"/publishers/{publisher}/artifacttypes/vmimage/offers/{offer}/skus\")\n @Fallback(EmptyListOnNotFoundOr404.class)\n List<SKU> listSKUs(@PathParam(\"publisher\") String publisher, @PathParam(\"offer\") String offer);\n\n /**\n * List Versions in SKU\n */\n @Named(\"version:list\")\n @GET\n @Path(\"/publishers/{publisher}/artifacttypes/vmimage/offers/{offer}/skus/{sku}/versions\")\n @Fallback(EmptyListOnNotFoundOr404.class)\n List<Version> listVersions(@PathParam(\"publisher\") String publisher, @PathParam(\"offer\") String offer,\n @PathParam(\"sku\") String sku);\n \n /**\n * Get the details of a Version\n */\n @Named(\"version:get\")\n @GET\n @Path(\"/publishers/{publisher}/artifacttypes/vmimage/offers/{offer}/skus/{sku}/versions/{version}\")\n @Fallback(EmptyListOnNotFoundOr404.class)\n Version getVersion(@PathParam(\"publisher\") String publisher, @PathParam(\"offer\") String offer,\n @PathParam(\"sku\") String sku, @PathParam(\"version\") String version);\n\n}", "public interface RecipeRetroFit {\n @GET(\"baking.json\")\n Call<ArrayList<RecipeModel>> getRecipe();\n}", "String serviceEndpoint();", "public interface ArticleService {\n @GET(Port.GET_ARTICLE + \"/page/{page}/id/{id}\")\n Call<List<Article>> getArticleList(@Path(\"page\") String page, @Path(\"id\") String id);\n\n @GET(Port.TIME_LINE + \"/page/{page}\")\n Call<List<Article>> getTimeLine(@Path(\"page\") String page);\n}", "public interface ApiService {\n\n @GET(\"/iseAlim/league.json\")\n Call<Leagues> getLeague();\n\n\n}", "public interface HttpService {\n//banner/query?type=1\n // public static final String BASE_URL=\"http://112.124.22.238:8081/course_api/\";\n @GET(\"banner/query\")\n Call<List<HeaderBean>> getHeaderData(@Query(\"type\") String type);\n @GET(\"campaign/recommend\")\n Call<List<RecommendBean>> getRecommendData();\n}", "public interface ArticleAPI {\n\n @GET(\"svc/search/v2/articlesearch.json\")\n Call<SearchAPIResponse> getSearchAPIResponse(@Query(\"q\") String searchTerm);\n\n}", "@RequestMapping(\"/get\")\n\tpublic void get(String id) throws Exception {\n\n\t\tList<ServiceInstance> list = this.discoveryClient.getInstances(\"FEIGN-API\");\n String uri = \"\";\n for (ServiceInstance instance : list) {\n if (instance.getUri() != null && !\"\".equals(instance.getUri())) {\n uri = instance.getUri().toString();\n\t\t\t\tSystem.out.println(uri);\n //break;\n }\n }\n\t\tSystem.out.println(uri+\"/provide/user/get?id=2\" + \"===>\");\n // return uri+\"/provide/user/getInfo\";\n\n//\t\tString baStr = restTemplate.getForObject(uri+\"/provide/user/get?id=2\", String.class );\n//\t\tSystem.out.println(baStr+\"===>\");\n\t\treturn (String) this.userFeignService.get(id);\n\t\t//return \"sss\";\n\t}", "ServiceReferenceProxy getServiceReference();", "public interface LooksoftMainApi {\n @GET(\"main\")\n Call<Data> loadData();\n}", "public interface TravelsService {\n\n /**\n * Get data list.\n *\n * @param query default \"\"\n * @param page default 1\n * @return\n * @throws Exception\n */\n @GET(App.SUFFIX_URL_TRAVELS)\n Call<TravelsMapObject> getData(@Query(\"query\") String query, @Query(\"page\") Integer page) throws Exception;\n\n}", "public interface IpService {\n\n @GET(\"/\")\n Call<Ip> getIp();\n\n}", "public BeerServiceClient(RestTemplateBuilder restTemplateBuilder) {\n this.restTemplate = restTemplateBuilder.build();\n }", "public interface NewsAPI {\n\n// @GET(\"1.json ?api-key= b6075f230e154c32accba228515bdce5\")\n @GET(\"home.json?api-key=b6075f230e154c32accba228515bdce5\")\n Call<NewsModel>getNewsModel();\n\n\n //Dynamic method\n //use if you would like user to alter the information returned from api call\n //\n// @GET(\"{section}.{format}\")\n// Call<NewsModel>test(@Path(\"section\") String s, @Path(\"format\") String f);\n\n\n}", "public interface ArticleClient {\n @GET(\"v2/top-headlines?apiKey=\" + BuildConfig.api_key)\n Call<ArticleResponse> getArticles(@Query(\"country\") String country,\n @Query(\"category\") String category);\n}", "public interface BakingInterface {\n\n @GET(\"5907926b_baking/baking.json\")\n Call<List<Recipe>> getRecipe();\n}", "public interface RestClient {\n public List<UserDTO> getContracts(String tariffTitle) throws IOException;\n\n public boolean buildPDF(String tariffTitle) throws IOException;\n}", "public interface PersonBulbasaurApiInterface {\n @GET(\"person/{id}\")\n Call<UserProfileDTO> getUserProfileDTOById(\n @Path(\"id\") String userId\n );\n\n}", "public interface LibraryService {\n\n @GET(\"resource/b67a-vkqb.json\")\n Call<List<QueensLibraryResponse>> getLibraries();\n\n}" ]
[ "0.78077453", "0.76492864", "0.7618701", "0.75919396", "0.7572117", "0.75562346", "0.7511635", "0.75002515", "0.7334705", "0.73331034", "0.72991955", "0.72580314", "0.7151173", "0.71458775", "0.7133745", "0.7132376", "0.7067401", "0.70590216", "0.70430076", "0.70016086", "0.6999197", "0.6998166", "0.69561404", "0.6890795", "0.68784076", "0.68058085", "0.6792079", "0.6791091", "0.6789317", "0.67623425", "0.67561907", "0.6747035", "0.67456746", "0.6678065", "0.66767377", "0.66585004", "0.66374135", "0.6620561", "0.6617007", "0.66023505", "0.657131", "0.657059", "0.6511824", "0.64891607", "0.6419185", "0.63798285", "0.6344746", "0.63170063", "0.6307926", "0.6249128", "0.6214352", "0.61369073", "0.61113423", "0.5944755", "0.5903856", "0.58962655", "0.5792088", "0.5788285", "0.5740427", "0.5688376", "0.5679889", "0.56787944", "0.5640204", "0.56269705", "0.5621475", "0.5618378", "0.56158817", "0.5614997", "0.561087", "0.5555501", "0.55452824", "0.55441874", "0.5535807", "0.55334103", "0.55196726", "0.5494525", "0.54832107", "0.5481271", "0.54809", "0.54712045", "0.5470786", "0.54704875", "0.54617906", "0.5459127", "0.5447232", "0.5445284", "0.5444476", "0.5436915", "0.54305154", "0.54249597", "0.5424497", "0.54147846", "0.54096276", "0.5402662", "0.5400189", "0.5381292", "0.53747797", "0.5368906", "0.53518915", "0.53468317" ]
0.740025
8
Request. contain way that identical in galleryservice (same signature)
@RequestLine("GET /show") List<Bucket> getAllEmployeesList();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void mo38841a(ImagesRequest imagesRequest) {\n }", "@Override\n public String digestParams(RestInvocation restInvocation) {\n Params params = Params.of();\n restInvocation.getParamsMap().get(FormParam.class).asHttpHeaders().entrySet().stream()\n .filter(e -> !e.getKey().equalsIgnoreCase(\"signature\"))\n .forEach(e -> params.add(e.getKey(), e.getValue()));\n\n // Parse Query String\n byte[] queryString = params.asQueryString().trim().getBytes(UTF8);\n\n // Create And Return Signature\n return hex(getMac().doFinal(queryString));\n }", "void projectUriRequest(Request request);", "@Override\n protected Map<String, String> getParams() throws AuthFailureError {\n Map<String, String> parameters = new HashMap<String, String>();\n parameters.put(\"photo\", Base64.encodeToString(imageHelper.getImage(), Base64.DEFAULT));\n Log.d(\"AAAAAAAAAAAAAAAAAAphoto\", Base64.encodeToString(imageHelper.getImage(), Base64.DEFAULT));\n parameters.put(\"hashcode\", imageHelper.getHashcode());\n parameters.put(\"encrypted\", imageHelper.getEncrypted());\n parameters.put(\"caption\", imageHelper.getCaption());\n return parameters;\n }", "protected Bundle m2197b(Request request) {\n String join;\n Object obj;\n Bundle bundle = new Bundle();\n if (!C0475Q.m992a(request.m1128h())) {\n join = TextUtils.join(\",\", request.m1128h());\n String str = \"scope\";\n bundle.putString(str, join);\n m1175a(str, join);\n }\n bundle.putString(\"default_audience\", request.m1124d().m1182a());\n bundle.putString(\"state\", m1172a(request.m1122b()));\n AccessToken c = AccessToken.m446c();\n String j = c != null ? c.m456j() : null;\n join = \"access_token\";\n if (j == null || !j.equals(m2194g())) {\n C0475Q.m976a(this.f980b.m1158c());\n obj = \"0\";\n } else {\n bundle.putString(join, j);\n obj = \"1\";\n }\n m1175a(join, obj);\n return bundle;\n }", "void projectSurveyUriRequest(Request request);", "protected abstract HttpUriRequest getHttpUriRequest();", "@Override\n protected Map<String, String> getParams() throws AuthFailureError {\n String image = getStringImage(bitmap);\n\n //Creating parameters\n Map<String,String> params = new Hashtable<String, String>();\n\n //Adding parameters\n params.put(\"image\", image);\n params.put(\"userid\",userID);\n params.put(\"jodiUploadImg\",\"\");\n\n //returning parameters\n return params;\n }", "MovilizerRequest prepareUploadRequest(Long systemId, String password, MovilizerRequest request);", "public abstract String getCurrentUserSignature(PortletRequest request);", "public interface RequestModifier {\n\n /**\n * Set HTTP request method, only support get, post,put , delete method.\n *\n * @param method\n *\n */\n public void setMethod(HTTPMethod method);\n\n /**\n * Set HTTP Protocol.\n *\n * @param protocol\n *\n */\n public void setProtocol(String protocol);\n\n /**\n * Set HTTP version , such as HTTP1.1.\n *\n * @param version\n *\n */\n public void setVersion(String version);\n\n /**\n * Set HTTP domain.\n *\n * @param domain\n *\n */\n public void setDomain(String domain);\n\n /**\n * Set path in the url.\n *\n * @param path\n *\n */\n public void setPath(String path);\n\n /**\n * Set web server port\n *\n * @param port\n *\n */\n public void setPort(int port);\n\n /**\n * Set HTTP url\n *\n * @param url\n *\n */\n public void setUrl(URL url);\n\n /**\n * Set HTTP url string\n *\n * @param url\n *\n */\n public void setUrl(String url);\n\n /**\n * Modify the exist argument in url.\n *\n * @param urlArg\n *\n * @return boolean, if success to modfiy this argument, return true.\n * if fail to modfiy this argument, return false.\n */\n public boolean modifyURIArgContent(URLArg urlArg);\n\n /**\n * Modify the exist header in HTTP request headers.\n *\n * @param header\n *\n * @return boolean, if success to modfiy this argument, return true.\n * if fail to modfiy this argument, return false.\n */\n public boolean modifyHeaderContent(Header header);\n\n /**\n * Add the request header, if this header is exist, modfiy this value.\n *\n * @param key\n *\n * @param header\n *\n */\n public void addHeader(String key, String header);\n\n /**\n * Add the request header, if this header is exist, modfiy this value.\n *\n * @param key\n *\n * @param header\n *\n */\n public void delHeader(String key);\n\n /**\n * Add the post arg in request header, if this argument is exist, modfiy this value.\n *\n * @param key\n *\n * @param value\n *\n */\n public void addPostArg(String key, String value);\n\n /**\n * Add the url arg in request url, if this argument is exist, modfiy this value.\n *\n * @param key\n *\n * @param value\n *\n */\n public void addUrlArg(String key, String value);\n}", "fotos(){}", "com.czht.face.recognition.Czhtdev.RequestOrBuilder getRequestOrBuilder();", "String getRequest();", "public PhotoRequest(String token) {\n super(token, \"photos.get\", PhotoResponse.class);\n }", "@Override\n protected Map<String, String> getParams() throws AuthFailureError {\n Map<String, String> parameters = new HashMap<String, String>();\n parameters.put(\"image\", encodedImageString);\n parameters.put(\"uid\", String.valueOf(id));\n return parameters;\n }", "public GrizzletRequest getRequest();", "@Override\n protected Map<String, String> getParams() throws AuthFailureError {\n String imagen = obtenerImagenBase64(bitmap);\n Log.i(\"Base64\", imagen);\n\n //Creación de parámetros\n Map<String,String> params = new Hashtable<String, String>();\n\n //Agregando de parámetros\n params.put(\"imagen\", imagen);\n params.put(\"id_perfil\", id_perfil);\n\n //Parámetros de retorno\n return params;\n }", "Call mo35727a(Request request);", "KijiDataRequest getClientRequest();", "@Override\n protected Map<String, String> getParams() throws AuthFailureError {\n String image = getStringImage(bmpChange);\n\n\n //Creating parameters\n Map<String,String> params = new Hashtable<String, String>();\n\n //Adding parameters\n params.put(\"image\", image);\n\n //returning parameters\n return params;\n }", "public ReAuthRequest createReAuthRequest(Request req) {\n return null;\r\n }", "@FeignClient(name = \"gallery-service\", url = \"http://localhost:8081/\", fallback = StatisticFallbackFactory.class)\npublic interface ServiceFeignClient {\n\n\n // Request. contain way that identical in gallery-service (same signature)\n @RequestLine(\"GET /show\")\n List<Bucket> getAllEmployeesList();\n\n}", "interface LockssPostMethod extends HttpMethod {\n long getResponseContentLength();\n }", "protected Bundle m2195a(Bundle bundle, Request request) {\n bundle.putString(\"redirect_uri\", m2193f());\n bundle.putString(\"client_id\", request.m1120a());\n LoginClient loginClient = this.f980b;\n bundle.putString(\"e2e\", LoginClient.m1143e());\n bundle.putString(\"response_type\", \"token,signed_request\");\n bundle.putString(\"return_scopes\", \"true\");\n bundle.putString(\"auth_type\", request.m1123c());\n if (mo1606d() != null) {\n bundle.putString(\"sso\", mo1606d());\n }\n return bundle;\n }", "public void onActivityResult(int requestCode,int resultCode,Intent data){\n if (resultCode == Activity.RESULT_OK)\n switch (requestCode){\n case GALLERY_REQUEST_CODE:\n //data.getData return the content URI for the selected Image\n Uri selectedImage = data.getData();\n String[] filePathColumn = { MediaStore.Images.Media.DATA };\n // Get the cursor\n Cursor cursor = getContentResolver().query(selectedImage, filePathColumn, null, null, null);\n // Move to first row\n cursor.moveToFirst();\n //Get the column index of MediaStore.Images.Media.DATA\n int columnIndex = cursor.getColumnIndex(filePathColumn[0]);\n //Gets the String value in the column\n String imgDecodableString = cursor.getString(columnIndex);\n cursor.close();\n Log.d(gallery.class.getSimpleName(), \"imgDecodableString : \" + imgDecodableString);\n uploadToServer(imgDecodableString);\n break;\n case CAMERA_REQUEST_CODE:\n Log.d(gallery.class.getSimpleName(), \"cameraFilePath : \" + cameraFilePath);\n uploadToServer(cameraFilePath);\n break;\n }\n }", "byte[] getSignatureImage();", "private void addRequest(InstanceRequest request) {\r\n\t\t\r\n\t}", "@Override\n protected Map<String,String> getParams()\n {\n Map<String, String> params = new HashMap<String, String>();\n params.put(\"name\",user.getFullname());\n params.put(\"phone\",user.getPhone());\n params.put(\"ktp\", user.getKtp());\n if(bitmap != null)\n {\n params.put(\"imgURL\",imageToString(bitmap));\n }\n\n return params;\n }", "com.czht.face.recognition.Czhtdev.Request getRequest();", "private void uploadRequest(String msg){\n String path = \"\";\r\n try {\r\n path = getPath(imageUri);\r\n }\r\n catch (URISyntaxException e){\r\n showMsg(\"wrong uri\");\r\n }\r\n String number = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).getString(\"number\",\"12345\");\r\n\r\n AndroidNetworking.upload(Endpoints.upload_request)\r\n .addMultipartFile(\"file\",new File(path))\r\n .addQueryParameter(\"message\",msg)\r\n .addQueryParameter(\"number\",number)\r\n .setPriority(Priority.HIGH)\r\n .build()\r\n .setUploadProgressListener(new UploadProgressListener() {\r\n @Override\r\n public void onProgress(long bytesUploaded, long totalBytes) {\r\n // do anything with progress\r\n long progress = (bytesUploaded/totalBytes*100);\r\n chooseImageText.setText(String.valueOf(progress));\r\n chooseImageText.setOnClickListener(null);\r\n }\r\n })\r\n .getAsJSONObject(new JSONObjectRequestListener() {\r\n @Override\r\n public void onResponse(JSONObject response) {\r\n try {\r\n if(response.getBoolean(\"success\")){\r\n showMsg(\"Succes\");\r\n MakeRequestActivity.this.finish();\r\n }\r\n else {\r\n showMsg(response.getString(\"message\"));\r\n }\r\n } catch (JSONException e) {\r\n e.printStackTrace();\r\n }\r\n }\r\n\r\n @Override\r\n public void onError(ANError anError) {\r\n\r\n }\r\n });\r\n\r\n }", "public void onActivityResult(int requestCode,int resultCode,Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n if (resultCode == Activity.RESULT_OK)\n switch (requestCode) {\n case 1:\n //data.getData returns the content URI for the selected Image\n Uri photo = data.getData();\n\n //Create a file object using file path\n File file = new File(getPathFromURI(photo));\n RequestBody filePart = RequestBody.create(MediaType.parse(getContentResolver().getType(photo)),\n file);\n MultipartBody.Part mfile = MultipartBody.Part.createFormData(\"profile_image\", file.getName(), filePart);\n\n uploadRestPhoto(mfile);\n\n\n\n break;\n }\n }", "interface LockssGetMethod extends HttpMethod {\n long getResponseContentLength();\n }", "@Override\n protected String getRequestedImage(HttpServletRequest req) {\n\treturn null;\n }", "ChangeHeadpic.Req getChangeHeadpicReq();", "Request(Request otherRequest) {\n this.reqNum = otherRequest.reqNum;\n this.reqText = otherRequest.reqText;\n this.reqExampleDocs = new ArrayList<ExampleDocument>(otherRequest.reqExampleDocs);\n }", "@Override\n protected void initializeVisionRequest(VisionRequest<?> visionRequest)\n throws IOException {\n super.initializeVisionRequest(visionRequest);\n\n String packageName = getPackageName();\n visionRequest.getRequestHeaders().set(ANDROID_PACKAGE_HEADER, packageName);\n\n String sig = PackageManagerUtils.getSignature(getPackageManager(), packageName);\n\n visionRequest.getRequestHeaders().set(ANDROID_CERT_HEADER, sig);\n }", "@Override\n protected void initializeVisionRequest(VisionRequest<?> visionRequest)\n throws IOException {\n super.initializeVisionRequest(visionRequest);\n\n String packageName = getPackageName();\n visionRequest.getRequestHeaders().set(ANDROID_PACKAGE_HEADER, packageName);\n\n String sig = PackageManagerUtils.getSignature(getPackageManager(), packageName);\n\n visionRequest.getRequestHeaders().set(ANDROID_CERT_HEADER, sig);\n }", "@Override\n protected void initializeVisionRequest(VisionRequest<?> visionRequest)\n throws IOException {\n super.initializeVisionRequest(visionRequest);\n\n String packageName = getPackageName();\n visionRequest.getRequestHeaders().set(ANDROID_PACKAGE_HEADER, packageName);\n\n String sig = PackageManagerUtils.getSignature(getPackageManager(), packageName);\n\n visionRequest.getRequestHeaders().set(ANDROID_CERT_HEADER, sig);\n }", "@Override\n protected Map<String, String> getParams() throws AuthFailureError {\n String image = \"\";\n if(bitmap!=null)\n image = getStringImage(bitmap);\n\n //Getting Image Name\n //String name = editTextName.getText().toString().trim();\n\n\n //Creating parameters\n Map<String,String> params = new Hashtable<String, String>();\n\n //Adding parameters\n //StringEntity\n params.put(\"image\", image);\n// try {\n// params.put(\"qbody\", URLEncoder.encode(quesDesc.getText().toString(), \"UTF-8\"));\n// } catch (UnsupportedEncodingException e) {\n// e.printStackTrace();\n// }\n params.put(\"qbody\", quesDesc.getText().toString());\n params.put(\"qtitle\", textView.getText().toString());\n params.put(\"tagarray\",newTagArray);\n params.put(\"uid\", session.getUserName().toString());\n params.put(\"Content-Type\", \"application/json; charset=utf-8\");\n\n //returning parameters\n return params;\n }", "private String getSignString(HttpServletRequest request) throws IOException {\n\t\tString date = ((HttpServletRequest) request).getHeader(HttpHeaders.DATE);\n\t\tString body = ((RequestWrapper) request).getPayload();\n\t\tString base64Body = Base64.encodeBase64String(body.getBytes());\n\n\t\tStringBuilder sb = new StringBuilder(request.getScheme());\n\t\tsb.append(\"://\");\n\t\tsb.append(request.getServerName());\n\t\tsb.append((\"http\".equals(request.getScheme()) && request.getServerPort() == 80) || (\"https\".equals(request.getScheme()) && request.getServerPort() == 443) ? \"\" : \":\" + request.getServerPort() );\n\t\tsb.append(request.getRequestURI());\n\t\tsb.append(request.getQueryString() != null ? \"?\" + request.getQueryString() : \"\");\n\t\tsb.append(\" \");\n\t\tsb.append(date);\n\t\tsb.append(\" \");\n\t\tsb.append(base64Body);\n\n\t\treturn sb.toString();\n\t}", "private SignRequestDocument(final String id, final String name, final int size, final String mimeType, final String signFormat, final String messageDigestAlgorithm, final String params, final String cryptoOperation) {\r\n\t\tthis.id = id;\r\n\t\tthis.name = name;\r\n\t\tthis.size = size;\r\n\t\tthis.mimeType = mimeType;\r\n\t\tthis.signFormat = signFormat;\r\n\t\tthis.messageDigestAlgorithm = messageDigestAlgorithm;\r\n\t\tthis.params = params;\r\n\t\tthis.cryptoOperation = cryptoOperation;\r\n\t}", "private void galleryIntent() {\n Intent intent = new Intent();\n intent.setType(\"image/*\");\n intent.setAction(Intent.ACTION_GET_CONTENT);//\n startActivityForResult(Intent.createChooser(intent, \"Select Photo\"), SELECT_PHOTO);\n }", "private void formRequest() {\r\n\t\tbyte[] user_bytes = _userName.getBytes();\r\n\t\tbyte[] password_bytes = _password.getBytes();\r\n\r\n\t\t_request = new byte[3 + user_bytes.length + password_bytes.length];\r\n\t\t_request[0] = (byte) 1;\r\n\t\t_request[1] = (byte) user_bytes.length;\r\n\t\tSystem.arraycopy(user_bytes, 0, _request, 2, user_bytes.length);\r\n\t\t_request[2 + user_bytes.length] = (byte) password_bytes.length;\r\n\t\tSystem.arraycopy(password_bytes, 0, _request, 3 + user_bytes.length, password_bytes.length);\r\n\t}", "private RequestParams getRequestParams(String tag){\n RequestParams params = new RequestParams();\n params.put(Constants.method_label, Constants.search_method);\n params.put(Constants.api_key_label, Constants.api_key);\n params.put(Constants.tags_label, tag);\n params.put(Constants.content_type_label, Constants.content_type);\n params.put(Constants.media_label, Constants.media);\n params.put(Constants.format_label, Constants.format);\n params.put(Constants.jsonCallback_label, Constants.noJsonCallback);\n return params;\n }", "public boolean service(WebloungeRequest request, WebloungeResponse response) {\n\n WebUrl url = request.getUrl();\n Site site = request.getSite();\n String path = url.getPath();\n String fileName = null;\n\n // This request handler can only be used with the prefix\n if (!path.startsWith(URI_PREFIX))\n return false;\n\n // Get hold of the content repository\n ContentRepository contentRepository = site.getContentRepository();\n if (contentRepository == null) {\n logger.warn(\"No content repository found for site '{}'\", site);\n return false;\n } else if (contentRepository.isIndexing()) {\n logger.debug(\"Content repository of site '{}' is currently being indexed\", site);\n DispatchUtils.sendServiceUnavailable(request, response);\n return true;\n }\n\n // Check if the request uri matches the special uri for previews. If so, try\n // to extract the id from the last part of the path. If not, check if there\n // is an image with the current path.\n ResourceURI resourceURI = null;\n Resource<?> resource = null;\n try {\n String id = null;\n String imagePath = null;\n\n String uriSuffix = StringUtils.chomp(path.substring(URI_PREFIX.length()), \"/\");\n uriSuffix = URLDecoder.decode(uriSuffix, \"utf-8\");\n\n // Check whether we are looking at a uuid or a url path\n if (uriSuffix.length() == UUID_LENGTH) {\n id = uriSuffix;\n } else if (uriSuffix.length() >= UUID_LENGTH) {\n int lastSeparator = uriSuffix.indexOf('/');\n if (lastSeparator == UUID_LENGTH && uriSuffix.indexOf('/', lastSeparator + 1) < 0) {\n id = uriSuffix.substring(0, lastSeparator);\n fileName = uriSuffix.substring(lastSeparator + 1);\n } else {\n imagePath = uriSuffix;\n fileName = FilenameUtils.getName(imagePath);\n }\n } else {\n imagePath = \"/\" + uriSuffix;\n fileName = FilenameUtils.getName(imagePath);\n }\n\n // Try to load the resource\n resourceURI = new ResourceURIImpl(null, site, imagePath, id);\n resource = contentRepository.get(resourceURI);\n if (resource == null) {\n logger.debug(\"No resource found at {}\", resourceURI);\n return false;\n }\n } catch (ContentRepositoryException e) {\n logger.error(\"Error loading resource from {}: {}\", contentRepository, e.getMessage());\n DispatchUtils.sendInternalError(request, response);\n return true;\n } catch (UnsupportedEncodingException e) {\n logger.error(\"Error decoding resource url {} using utf-8: {}\", path, e.getMessage());\n DispatchUtils.sendInternalError(request, response);\n return true;\n }\n\n // Agree to serve the preview\n logger.debug(\"Preview handler agrees to handle {}\", path);\n\n // Check the request method. Only GET is supported right now.\n String requestMethod = request.getMethod().toUpperCase();\n if (\"OPTIONS\".equals(requestMethod)) {\n String verbs = \"OPTIONS,GET\";\n logger.trace(\"Answering options request to {} with {}\", url, verbs);\n response.setHeader(\"Allow\", verbs);\n response.setContentLength(0);\n return true;\n } else if (!\"GET\".equals(requestMethod)) {\n logger.debug(\"Image request handler does not support {} requests\", requestMethod);\n DispatchUtils.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED, request, response);\n return true;\n }\n\n // Is it published?\n // TODO: Fix this. imageResource.isPublished() currently returns false,\n // as both from and to dates are null (see PublishingCtx)\n // if (!imageResource.isPublished()) {\n // logger.debug(\"Access to unpublished image {}\", imageURI);\n // DispatchUtils.sendNotFound(request, response);\n // return true;\n // }\n\n // Can the resource be accessed by the current user?\n User user = request.getUser();\n try {\n // TODO: Check permission\n // PagePermission p = new PagePermission(page, user);\n // AccessController.checkPermission(p);\n } catch (SecurityException e) {\n logger.warn(\"Access to resource {} denied for user {}\", resourceURI, user);\n DispatchUtils.sendAccessDenied(request, response);\n return true;\n }\n\n // Determine the response language by filename\n Language language = null;\n if (StringUtils.isNotBlank(fileName)) {\n for (ResourceContent c : resource.contents()) {\n if (c.getFilename().equalsIgnoreCase(fileName)) {\n if (language != null) {\n logger.debug(\"Unable to determine language from ambiguous filename\");\n language = LanguageUtils.getPreferredContentLanguage(resource, request, site);\n break;\n }\n language = c.getLanguage();\n }\n }\n if (language == null)\n language = LanguageUtils.getPreferredContentLanguage(resource, request, site);\n } else {\n language = LanguageUtils.getPreferredContentLanguage(resource, request, site);\n }\n\n // If the filename did not lead to a language, apply language resolution\n if (language == null) {\n logger.warn(\"Resource {} does not exist in any supported language\", resourceURI);\n DispatchUtils.sendNotFound(request, response);\n return true;\n }\n\n // Find a resource preview generator\n PreviewGenerator previewGenerator = null;\n synchronized (previewGenerators) {\n for (PreviewGenerator generator : previewGenerators) {\n if (generator.supports(resource)) {\n previewGenerator = generator;\n break;\n }\n }\n }\n\n // If we did not find a preview generator, we need to let go\n if (previewGenerator == null) {\n logger.debug(\"Unable to generate preview for {} since no suitable preview generator is available\", resource);\n DispatchUtils.sendServiceUnavailable(request, response);\n return true;\n }\n\n // Extract the image style\n ImageStyle style = null;\n String styleId = StringUtils.trimToNull(request.getParameter(OPT_IMAGE_STYLE));\n if (styleId != null) {\n style = ImageStyleUtils.findStyle(styleId, site);\n if (style == null) {\n DispatchUtils.sendBadRequest(\"Image style '\" + styleId + \"' not found\", request, response);\n return true;\n }\n }\n\n // Get the path to the preview image\n File previewFile = ImageStyleUtils.getScaledFile(resource, language, style);\n\n // Check the modified headers\n long revalidationTime = MS_PER_DAY;\n long expirationDate = System.currentTimeMillis() + revalidationTime;\n if (!ResourceUtils.hasChanged(request, previewFile)) {\n logger.debug(\"Scaled preview {} was not modified\", resourceURI);\n response.setDateHeader(\"Expires\", expirationDate);\n DispatchUtils.sendNotModified(request, response);\n return true;\n }\n\n // Load the image contents from the repository\n ResourceContent resourceContents = resource.getContent(language);\n\n // Add mime type header\n String contentType = resourceContents.getMimetype();\n if (contentType == null)\n contentType = MediaType.APPLICATION_OCTET_STREAM;\n\n // Set the content type\n String characterEncoding = response.getCharacterEncoding();\n if (StringUtils.isNotBlank(characterEncoding))\n response.setContentType(contentType + \"; charset=\" + characterEncoding.toLowerCase());\n else\n response.setContentType(contentType);\n\n // Browser caches and proxies are allowed to keep a copy\n response.setHeader(\"Cache-Control\", \"public, max-age=\" + revalidationTime);\n\n // Set Expires header\n response.setDateHeader(\"Expires\", expirationDate);\n\n // Write the image back to the client\n InputStream previewInputStream = null;\n try {\n if (previewFile.isFile() && previewFile.lastModified() >= resourceContents.getCreationDate().getTime()) {\n previewInputStream = new FileInputStream(previewFile);\n } else {\n previewInputStream = createPreview(request, response, resource, language, style, previewGenerator, previewFile, contentRepository);\n }\n\n if (previewInputStream == null) {\n // Assuming that createPreview() is setting the response header in the\n // case of failure\n return true;\n }\n\n // Add last modified header\n response.setDateHeader(\"Last-Modified\", previewFile.lastModified());\n response.setHeader(\"ETag\", ResourceUtils.getETagValue(previewFile.lastModified()));\n response.setHeader(\"Content-Disposition\", \"inline; filename=\" + previewFile.getName());\n response.setHeader(\"Content-Length\", Long.toString(previewFile.length()));\n previewInputStream = new FileInputStream(previewFile);\n IOUtils.copy(previewInputStream, response.getOutputStream());\n response.getOutputStream().flush();\n return true;\n } catch (EOFException e) {\n logger.debug(\"Error writing image '{}' back to client: connection closed by client\", resource);\n return true;\n } catch (IOException e) {\n DispatchUtils.sendInternalError(request, response);\n if (RequestUtils.isCausedByClient(e))\n return true;\n logger.error(\"Error sending image '{}' to the client: {}\", resourceURI, e.getMessage());\n return true;\n } catch (Throwable t) {\n logger.error(\"Error creating scaled image '{}': {}\", resourceURI, t.getMessage());\n DispatchUtils.sendInternalError(request, response);\n return true;\n } finally {\n IOUtils.closeQuietly(previewInputStream);\n }\n }", "void request(RequestParams params);", "@Override\n\tprotected void onActivityResult(int requestCode, int resultCode, Intent data) {\n\t\tsuper.onActivityResult(requestCode, resultCode, data);\n\t\tif (resultCode == RESULT_OK) {\n\t\t\tswitch (requestCode) {\n//\t\t\tcase EDIT_FROM_EDITOR:\n//\t\t\t\tbyte[] bb = data.getByteArrayExtra(\"bitmap\");\n//\t\t\t\tBitmap tmp_bitmap = BitmapFactory.decodeByteArray(bb, 0,\n//\t\t\t\t\t\tbb.length);\n//\t\t\t\tcur_bitmap_list.add(tmp_bitmap);\n//\t\t\t\tiv_seller_reply_img.setImageBitmap(cur_bitmap_list.get(0));\n//\t\t\t\tbreak;\n\t\t\tcase PICK_FROM_ALBUM :\n//\t\t\t\tIntent intent = new Intent(Consumer_post.this, ImageEditActivity.class);\n//\t\t\t\tintent.putExtra(\"output\", data.getData());\n//\t\t\t\tintent.putExtra(\"flag\", \"album\");\n//\t\t\t\tstartActivityForResult(intent, EDIT_FROM_EDITOR);\n\t\t\t\tif (!addImage(data)) {\n\t\t\t\t\tToast.makeText(Seller_reply.this, \"사진 첨부 실패\",\n\t\t\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t\t\t}\n\t\t\t\tbreak;\n//\t\t\tcase PICK_FROM_CAMERA:\n//\t\t\t\tIntent intent2 = new Intent(Seller_reply.this,\n//\t\t\t\t\t\tImageEditActivity.class);\n//\t\t\t\tintent2.putExtra(\"output\", path + \"/\" + TEMP_IMAGE);\n//\t\t\t\tintent2.putExtra(\"flag\", \"camera\");\n//\t\t\t\tstartActivityForResult(intent2, EDIT_FROM_EDITOR);\n//\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "io.envoyproxy.envoy.type.metadata.v3.MetadataKind.Request getRequest();", "public interface AlexaHttpRequest {\n /**\n * @return the signature, base64 encoded.\n */\n String getBaseEncoded64Signature();\n\n /**\n * @return URL for the certificate chain needed to verify the request signature.\n */\n String getSigningCertificateChainUrl();\n\n /**\n * @return the request envelope, in serialized form.\n */\n byte[] getSerializedRequestEnvelope();\n\n /**\n * @return the request envelope, in deserialized form.\n */\n RequestEnvelope getDeserializedRequestEnvelope();\n}", "@Override\n protected Map<String, String> getParams()\n {\n Map<String, String> params = new HashMap<String, String>();\n params.put(\"nama_kost\", kostt.getNama_kost());\n params.put(\"emailPemilik\", emailFB);\n params.put(\"tipe_kost\", kostt.getTipe_kost());\n params.put(\"alamat_kost\", kostt.getAlamat_kost());\n params.put(\"luas_kost\", String.valueOf(kostt.getLuas_kost()));\n params.put(\"sisa_kamar\", String.valueOf(kostt.getSisa_kamar()));\n if(cek==1) {\n params.put(\"image\", kostt.getImageUrl());\n System.out.println(\"image adalah \"+kostt.getImageUrl());\n }else {\n params.put(\"image\", \"kosong\");\n }\n\n\n return params;\n }", "public interface ZConstants {\n String SAMPLE = \"/documenttype/{Id}\";\n String GET_LOGIN_ROLES = \"user/getloginroles\";\n String LOGIN = \"user/login\";\n String LOGOUT = \"user/Logout\";\n String PHOTO_SEARCH = \"photos/search\";\n String PHOTO_FAVORITE = \"photos/{id}/favorite\";\n\n\n String CONTENT_TYPE = \"Content-Type: \";\n String AUTHORIZATION = \"Authorization\";\n String CM_APPLICATION_JSON = \"application/json\";\n String CM_H_X_WWW_FORM_URLENCODED = \"application/x-www-form-urlencoded\";//Content/Media Type,Header\n String H_X_MS_BLOB_KEY = \"x-ms-blob-type\";\n String H_X_MS_BLOB_VALUE = \"BlockBlob\";\n String C_H_MULTIPART_FORM_DATA = \"multipart/form-data\";\n String GSON_DATE_FORMAT = \"yyyy-MM-dd'T'HH:mm:ssZ\";\n String BEARER_HEAD = \"Bearer \";\n}", "public void upload(String path, String content) {\n\n String url = \"http://api.renren.com/restserver.do\";\n String signature = getParams(content);\n String method = \"photos.upload\";\n String v2 = \"1.0\";\n String access_token = AccessData.access_token;\n String format = \"JSON\";\n String contentType = \"multipart/form-data\";\n String filename = Util.getFileName(path);\n String caption = content;\n byte[] data = getBytes(path);\n\n TreeMap<String, String> params = new TreeMap<String, String>();\n params.put(\"sig\", signature);\n Log.d(\"upload renren\", \"signature:\" + signature);\n params.put(\"method\", method);\n params.put(\"v\", v2);\n params.put(\"access_token\", access_token);\n Log.d(\"upload renren\", \"access_token:\" + access_token);\n params.put(\"format\", format);\n params.put(\"caption\", caption);\n String resp;\n try {\n resp = HttpURLUtils.doUploadFile(url, params, \"upload\",\n filename, contentType, data);\n Log.d(\"upload renren\", \"\" + resp);\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }", "@Override\n protected Map<String, String> getParams() {\n Map<String, String> params = new HashMap<String, String>();\n// params.put(\"ead_tokan\", AppConfig.EAD_TOKEN);\n// params.put(\"ead_email\", email);\n params.put(\"npl_token\", \"a\");\n params.put(\"npl_aid\", mediaId);\n params.put(\"npl_id\", userId);\n return params;\n }", "SdkHttpRequest getLastRequest();", "private void makeUploadRequest(final Map<String, String> params){\n\t\tString url = mContext.getString(R.string.development_url)+\"index.php?type=uploadImage\";\n\n\t\t// Request a string response from the provided URL.\n\t\tStringRequest stringRequest = new StringRequest(Request.Method.POST, url,\n\t\t new Response.Listener<String>() {\n\t\t\t@Override\n\t\t\tpublic void onResponse(String response) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tLog.v(\"ken\", \"Upload image response: \"+response);\n\t\t\t\tif(mOnUploadSuccessListener != null)\n\t\t\t\t\tmOnUploadSuccessListener.onUploadSuccess(response);\n\t\t\t}\n\t\t}, new Response.ErrorListener() {\n\t\t @Override\n\t\t public void onErrorResponse(VolleyError error) {\n\t\t \tLog.v(\"ken\", \"error response after upload: \");\n\t\t }\n\t\t}){\n\n\t\t\t@Override\n\t\t\tprotected Map<String, String> getParams() throws AuthFailureError {\n\t\t\t\treturn params;\n\t\t\t}\n\n\n\t\t};\n\t\t\n\t\t// Add the request to the RequestQueue.\n\t\tVolleySingleton.getInstance(mContext).addToRequestQueue(stringRequest);\n\t\n\t}", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n switch (requestCode) {\n case PICK_FROM_GALLERY_REQUEST_CODE:\n if (resultCode == RESULT_OK) {\n Uri targetUri = data.getData();\n String path = ImageFilePath.getPath(this, data.getData());\n Bitmap bitmap;\n try {\n bitmap = MediaStore.Images.Media.getBitmap(getContentResolver(), targetUri);\n Bitmap finalBitmap = BitmapMods.modifyOrientation(bitmap, path);\n mImages.add(BitmapMods.getResizedBitmap(finalBitmap, 400));\n initializeRecyclerView();\n } catch (Exception e) {\n onPhotoError();\n e.printStackTrace();\n }\n }\n break;\n\n case PICK_FROM_CAMERA_REQUEST_CODE:\n if (resultCode == RESULT_OK) {\n try {\n @SuppressWarnings(\"ConstantConditions\") Bitmap photo = (Bitmap) data.getExtras().get(\"data\");\n mImages.add(photo);\n initializeRecyclerView();\n } catch (Exception e) {\n onPhotoError();\n e.printStackTrace();\n }\n }\n }\n }", "public void gallery(View view) {\n Intent intent = new Intent();\n intent.setType(\"image/*\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(Intent.createChooser(intent, \"Select Picture\"), REQUEST_IMAGE_GALLERY);\n\n\n }", "public Image getSemibreveRest();", "@Override\n\tpublic String ConcatParams() {\n\t\tString params = null;\n\t\tif (this.ValidateParams()) {\n\t\t\tparams = \"/\" + this.Version + \"/image/delete/\"+ID_Image+\".\"+this.Format \n\t\t\t\t\t+ \"?oauth_token=\" + URLEncoder.encode(this.oauth_token);\n\t\t}\n\t\treturn params;\n\t}", "private void goToAddFishActivity(int requestCode, Uri uri, Bitmap photo, int aquariumId){\n Intent addFistIntent = new Intent(this, AddFishActivity.class);\n\n //check if from gallery | Camera\n if(requestCode==ActivityResultsCode.CAMERA_REQUEST){\n addFistIntent.putExtra(\"image\", photo);\n }else{\n addFistIntent.putExtra(\"imageUri\", uri.toString());\n }\n\n addFistIntent.putExtra(\"aquariumId\", aquariumModel.getId());\n startActivityForResult(addFistIntent, ActivityResultsCode.ADD_FISH);\n }", "io.envoyproxy.envoy.type.metadata.v3.MetadataKind.RequestOrBuilder getRequestOrBuilder();", "private void dispatchGalleryIntent() {\n Intent pickPhoto = new Intent(Intent.ACTION_PICK,\n MediaStore.Images.Media.EXTERNAL_CONTENT_URI);\n pickPhoto.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);\n startActivityForResult(pickPhoto, REQUEST_CHOOSE_PHOTO_NUM);\n }", "private void kirimData(final Uri fileUri, final String isi, final String nama, final String rt, final String rw) {\n VolleyMultipartRequest multipartRequest = new VolleyMultipartRequest(Request.Method.POST, \"http://212.237.31.161/api/aspiration\", new Response.Listener<NetworkResponse>() {\n @Override\n public void onResponse(NetworkResponse response) {\n String resultResponse = new String(response.data);\n// try {\n//\n// } catch (JSONException e) {\n// e.printStackTrace();\n// }\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n error.printStackTrace();\n//\n if (error instanceof TimeoutError || error instanceof NoConnectionError) {\n Toast.makeText(TambahAspirasi.this.getContext(), \"Tidak dapat memuat data\\nTolong perika koneksi internet anda !\", Toast.LENGTH_LONG).show();\n }\n\n }\n }) {\n @Override\n protected Map<String, String> getParams() {\n Map<String, String> params = new HashMap<>();\n params.put(\"rt\", rt);\n params.put(\"rw\", rw);\n params.put(\"aspiration\", isi);\n params.put(\"name\", nama);\n params.put(\"title\", nama);\n return params;\n }\n\n @Override\n protected Map<String, DataPart> getByteData() {\n Map<String, DataPart> params = new HashMap<>();\n // file name could found file base or direct access from real path\n // for now just get bitmap data from ImageView\n params.put(\"photo_id\", new DataPart(fileUri.getLastPathSegment(), AppHelper.getFileDataFromDrawable(TambahAspirasi.this.getContext(), fotoktp.getDrawable()), \"image/jpeg\"));\n\n return params;\n }\n };\n\n VolleySingleton.getInstance(TambahAspirasi.this.getContext()).addToRequestQueue(multipartRequest);\n }", "@Override\r\n public UriBuilder getRequestUriBuilder() {\n return null;\r\n }", "@Override\n\tpublic void initRequest() {\n\n\t}", "private void changeRequest(InstanceRequest request) {\r\n\t\t\r\n\t}", "public void setSigRequest() { //method for setting the sigRequest of any loginIndex object, no parameter required, generates it all on its own\r\n \tString ikey = \"DIIDEISCSE5SPOZR41KL\"; //Given by Duo in the Web SDK\r\n \tString skey = \"PJEgxAWQOwumI0TE6yT7vfIDyDB0FIxpcvREJFMh\"; //Given by Duo in the Web SDK\r\n \tString akey = \"b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6bb6b6b66b6b6b6b6\"; //This is randomly generated and should be stored separate from Duo\r\n \tString sig_request = DuoWeb.signRequest(ikey, skey, akey, username); //Generates the signed request by calling on the DuoWeb.java given by Duo\r\n \tthis.sigRequest = sig_request;\r\n }", "public interface ApiService {\n @Headers(\"{CLIENT_TYPE:android}\")\n @Multipart\n @PUT(\"refunds/{orderId}/upload_images.json\")\n Observable<ResponseBody> uploadImage(@Path(\"orderId\") String orderId, @Header(\"AUTHORIZATION\") String token,\n @Header(\"APP_VERSION\") String APP_VERSION,\n @PartMap Map<String, RequestBody> params);\n @Headers(\"{CLIENT_TYPE:android}\")\n @POST(\"users/login.json\")\n Observable<ResponseBody> loginWithPWD(@Body Map<String, String> params);\n\n @FormUrlEncoded\n @Headers({\"Content-Type:application/x-www-form-urlencoded\",\n \"Authorization:Basic NjV1MEM5alFVTWs3dWZXaUJNMVlNREhHc0dBYTpadHdjbVE4VmkwNTgxZlp1V013TmQwbVBSdGdh\"})\n @POST(\"https://devais.pfingo.com:8243/token\")\n\n Observable<ResponseBody> getApplicationToken(/*@Header(\"Authorization\") String base64Secert,*/\n @Field(\"grant_type\") String p);\n}", "protected static HashMap<String, String> multipartRequestToHashMap(Request req)\r\n {\n HashMap<String, String> params = new HashMap<>();\r\n try {\r\n for (Part part : req.raw().getParts()) {\r\n InputStream input = part.getInputStream();\r\n Scanner s = new Scanner(input, \"ISO-8859-1\").useDelimiter(\"\\\\A\");\r\n if (s.hasNext()) {\r\n params.put(part.getName(), s.next());\r\n }\r\n input.close();\r\n }\r\n }\r\n catch (Exception e) {return params;}\r\n return params;\r\n }", "private BoxRequestUpdateSharedItem getCreatedSharedLinkRequest(){\n if (getMainItem() instanceof BoxFile) {\n return mFileApi.getCreateSharedLinkRequest(getMainItem().getId());\n }\n else if (getMainItem() instanceof BoxFolder) {\n return mFolderApi.getCreateSharedLinkRequest(getMainItem().getId());\n\n }\n else if (getMainItem() instanceof BoxBookmark) {\n return mBookmarkApi.getCreateSharedLinkRequest(getMainItem().getId());\n }\n // should never hit this scenario.\n return null;\n }", "@Override\n protected Map<String, String> getParams() {\n Map<String, String> params = new HashMap<String, String>();\n params.put(\"user_email\", email);\n //params.put(\"image\", url_image);\n //params.put(\"content\", descripcion_post.getText().toString());\n //params.put(\"datetime\", \"fecha de prueba\");\n return params;\n\n }", "private void galleryIntent() {\n Intent intent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);\n intent.setType(\"image/*\");\n ((MessageActivity) context).startActivityForResult(Intent.createChooser(intent,\n \"Select Picture\"), SELECT_PICTURE);\n\n }", "private CustomRequest getCustomRequestFor(HttpRequest aRequest,\n Handler aHandler) {\n int lRequestMapped = mapToVolleyMethodCode(aRequest.getMethod());\n RequestComposite lMap = new RequestComposite();\n lMap.setHttpReq(aRequest);\n Handler lHandler = aHandler == null ? mainHandler : aHandler;\n Listener<String> lListener = getListenerForRequest(lMap, lHandler);\n Response.ErrorListener lErrorListener = getErrorListenerForRequest(lMap,\n lHandler);\n CustomRequest lReq = new CustomRequest(lRequestMapped,\n aRequest.getUrl(), lListener, lErrorListener, aRequest);\n // update the reference in the map.\n lMap.setVolleyReq(lReq);\n return lReq;\n }", "public void onActivityResult(int requestCode,int resultCode,Intent data){\n if (resultCode == Activity.RESULT_OK)\n switch (requestCode){\n case GALLERY_REQUEST_CODE:\n if (Uri.parse(getRealPathFromURI(data.getData())) != null){\n /* File file = new File(Objects.requireNonNull\n (Uri.parse(getRealPathFromURI(data.getData())).getPath()));\n */\n //se specifica locatia din telefon unde se afla fisierul img\n cameraFilePath =getRealPathFromURI(data.getData());\n /*uploadToServer(Objects.requireNonNull\n (Uri.parse(getRealPathFromURI(data.getData())).getPath()));*/\n photo.setImageURI(Uri.parse(getRealPathFromURI(data.getData())));\n }\n\n break;\n case CAMERA_REQUEST_CODE:\n photo.setImageURI(Uri.parse(cameraFilePath));\n break;\n }\n }", "@DSComment(\"Private Method\")\n @DSBan(DSCat.PRIVATE_METHOD)\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:33:59.900 -0500\", hash_original_method = \"BDD10C58ECCC962A5941D61E3DCCB1CC\", hash_generated_method = \"CC96DF6BBA141BCD4483A4EED9B38592\")\n \nprivate Photos() {}", "@Override\n\t\tpublic void intercept(RequestInterceptor.RequestFacade request) {\n\t\t\trequest.addQueryParam(\"key\", mKey);\n\n\t\t\t// We need to use token for auth, since user might change password, then token is invalidated and user needs to log in again\n\t\t\t// For creating user, the endpoint can ignore Authorization\n\t\t\t//Assert.assertFalse(TextUtils.isEmpty(mToken));\n\t\t\trequest.addHeader(\"Username\", mAccountUtils.getUsername());\n\t\t\trequest.addHeader(\"Authorization\", mAccountUtils.getToken());\n\t\t\trequest.addHeader(\"User-Agent\", \"gzip\");\n\t\t\trequest.addHeader(\"Accept-Encoding\", \"gzip\");\n\t\t}", "@Multipart\n @PUT(\"photos\")\n Call<Photo> newPhoto(@Part(\"photo\") Photo photoObject,@Part(\"content\") byte[] picture);", "@UnstableApi\npublic interface FullRequest extends Request {}", "@Multipart\n @POST()\n Call<Result> uploadImage(@Part MultipartBody.Part file, @Url String medialUploadUrl, @PartMap() Map<String, RequestBody> partMap);", "WebClientServiceRequest serviceRequest();", "public abstract String getSignature();", "private GetPictureRequest(com.google.protobuf.GeneratedMessage.Builder<?> builder) {\n super(builder);\n this.unknownFields = builder.getUnknownFields();\n }", "@Override\n protected Map<String, String> getParams() {\n return requestParams;\n }", "@Override\n protected Map<String, String> getParams() {\n return requestParams;\n }", "public CurlRequest newRequest(final String action, final String body) {\n\t\tfinal var builder = AWS4SignatureQuery.builder().service(\"cognito-idp\").body(\"&Version=2016-04-18\");\n\t\tfinal var headers = new HashMap<String, String>();\n\t\theaders.put(\"x-amz-target\", \"AWSCognitoIdentityProviderService.\" + action);\n\t\theaders.put(\"Content-Type\", \"application/x-amz-json-1.1\");\n\t\tfinal var query = builder.accessKey(accessKey).secretKey(secretKey).region(region).path(\"/\").headers(headers)\n\t\t\t\t.body(body).host(URI.create(url).getHost()).build();\n\t\tfinal var authorization = signer.computeSignature(query);\n\t\tfinal var request = new CurlRequest(query.getMethod(), url, query.getBody());\n\t\trequest.getHeaders().putAll(query.getHeaders());\n\t\trequest.getHeaders().put(\"Authorization\", authorization);\n\t\trequest.setSaveResponse(true);\n\t\treturn request;\n\t}", "static /* synthetic */ Map m890b(Request request) {\n HashMap hashMap = new HashMap();\n hashMap.put(\"device_verifier\", request.verifier);\n HashMap hashMap2 = new HashMap();\n C1543ak a = C1948n.m1229a().f1421g.mo16243a();\n String str = (String) a.mo16260a().get(C1544al.AndroidAdvertisingId);\n if (str != null) {\n hashMap2.put(\"gpaid\", str);\n }\n String str2 = (String) a.mo16260a().get(C1544al.DeviceId);\n if (str2 != null) {\n hashMap2.put(\"andid\", str2);\n }\n hashMap.putAll(hashMap2);\n HashMap hashMap3 = new HashMap();\n byte[] bytes = ((String) C1948n.m1229a().f1421g.mo16243a().mo16260a().get(C1544al.AndroidInstallationId)).getBytes();\n if (bytes != null) {\n hashMap3.put(\"flurry_guid\", C1734dz.m868a(bytes));\n }\n hashMap3.put(\"flurry_project_api_key\", C1948n.m1229a().f1422h.f444a);\n hashMap.putAll(hashMap3);\n Context context = request.context;\n HashMap hashMap4 = new HashMap();\n hashMap4.put(\"src\", \"flurryandroidsdk\");\n hashMap4.put(\"srcv\", \"12.3.0\");\n hashMap4.put(\"appsrc\", context.getPackageName());\n C1601bl.m537a();\n hashMap4.put(\"appsrcv\", C1601bl.m538a(context));\n hashMap.putAll(hashMap4);\n return hashMap;\n }", "public void opengallery() {\n Intent gallery = new Intent();\n gallery.setType(\"image/*\");\n gallery.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(getIntent().createChooser(gallery, \"Choose image\"), PICK_IMAGE);\n\n }", "@Stability.Internal\n void authHttpRequest(final ServiceType serviceType, final HttpRequest request);", "@Override\r\n\tpublic ResponseWrapper searchMedia(RequestWrapper request ) {\r\n\r\n\t\tIHandler handler = HandlerFactory.getHandler(request.getcategoryType());\r\n\t\t\t\t\t\t\r\n\t\tResponseWrapper response = handler.search(request);\r\n\t\treturn response;\r\n\t}", "String getSignature();", "String getSignature();", "String getSignature();", "private void galleryIntent()\r\n {\r\nIntent gallery=new Intent();\r\ngallery.setType(\"image/*\");\r\ngallery.setAction(Intent.ACTION_GET_CONTENT);\r\n\r\nstartActivityForResult(Intent.createChooser(gallery,\"Select Picture \"),PICK_IMAGE );\r\n }", "protected Optional<RSAPublicKey> extractKeyFromRequest(Request request) throws Http4xx {\n Optional<RSAPublicKey> keyFromAccept = this.extractKeyFromAcceptHeader(request);\n if (keyFromAccept.isPresent()) {\n return keyFromAccept;\n }\n Optional<RSAPublicKey> keyFromAuth = this.extractKeyFromAuthorizationHeader(request);\n if (keyFromAuth.isPresent()) {\n return keyFromAuth;\n }\n return Optional.empty();\n }", "public void addRequest(Request req) {\n\n }", "public interface CommonClient {\n @Multipart\n @POST(Constants.API_COMMON_UPLOAD_IMAGE)\n Call<ArrayModel<String>> uploadPhotos(@Part(\"type\") RequestBody type, @Part(\"foreign_id\") RequestBody foreign_id, @Part ArrayList<MultipartBody.Part> upload_file);\n\n @Multipart\n @POST(Constants.API_COMMON_UPDATE_SUBIMAGE)\n Call<ArrayModel<String>> updateSubPhotos(@Part(\"existingImages\") RequestBody existingImages, @Part(\"userId\") RequestBody userId, @Part ArrayList<MultipartBody.Part> upload_file);\n\n @POST(Constants.API_COMMON_UPLOAD_WEB)\n @FormUrlEncoded\n Call<ObjectModel<String>> uploadWebs(@Field(\"type\") int type, @Field(\"foreign_id\") int foreign_id, @Field(\"web\") JSONStringer webs);\n\n @POST(Constants.API_COMMON_UPLOAD_VIDEO)\n @FormUrlEncoded\n Call<ObjectModel<String>> uploadVideos(@Field(\"type\") int type, @Field(\"foreign_id\") int foreign_id, @Field(\"video[]\") ArrayList<String> videos);\n}", "@Override\n public void intercept(RequestInterceptor.RequestFacade request) {\n if ((mCredentials != null) && (mCredentials.accessToken != null)) {\n request.addEncodedQueryParam(PARAM_ACCESS_TOKEN, mCredentials.accessToken);\n }\n }", "@Override\n\tprotected void onActivityResult(int requestCode, int resultCode, Intent data) {\n\t\tif (resultCode == RESULT_OK) {\n\t\t\tswitch (requestCode) {\n\t\t\tcase REQUEST_IMAGE_CAPTURE1:\n\t\t\t\tBundle extras = data.getExtras();\n\t\t\t\tBitmap imageBitmap = (Bitmap) extras.get(\"data\");\n\n\t\t\t\timView.setImageBitmap(imageBitmap);\n\t\t\t\tBitmapDrawable drawable = (BitmapDrawable) imView.getDrawable();\n\t\t\t\tBitmap bitmap = drawable.getBitmap();\n\t\t\t\tByteArrayOutputStream baos = new ByteArrayOutputStream();\n\t\t\t\tbitmap.compress(Bitmap.CompressFormat.PNG, 100, baos);\n\t\t\t\tbyte[] datas = baos.toByteArray();\n\t\t\t\tstrBase64 = Base64.encodeToString(datas, Base64.DEFAULT);\n\n\t\t\t\tbreak;\n\t\t\tcase REQUEST_IMAGE_CAPTURE2:\n\n\t\t\t\tBundle extras1 = data.getExtras();\n\t\t\t\tBitmap imageBitmap1 = (Bitmap) extras1.get(\"data\");\n\t\t\t\timView2.setImageBitmap(imageBitmap1);\n\t\t\t\tBitmapDrawable drawable2 = (BitmapDrawable) imView2\n\t\t\t\t\t\t.getDrawable();\n\t\t\t\tBitmap bitmap2 = drawable2.getBitmap();\n\n\t\t\t\tByteArrayOutputStream baos2 = new ByteArrayOutputStream();\n\t\t\t\tbitmap2.compress(Bitmap.CompressFormat.PNG, 100, baos2);\n\t\t\t\tbyte[] datas2 = baos2.toByteArray();\n\n\t\t\t\tstrBase642 = Base64.encodeToString(datas2, Base64.DEFAULT);\n\n\t\t\t}\n\t\t}\n\n\t}", "private AddPhotoRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "@Override\n protected Map<String, String> getParams() throws AuthFailureError\n {\n Map<String, String> params = new HashMap<>();\n // params.put(Keys.message,MsgEditText.getText().toString());\n // params.put(Keys.message, String.valueOf(bitmap));\n params.put(Keys.type,\"1\");\n\n return params;\n }" ]
[ "0.6322172", "0.5893699", "0.5887004", "0.5656441", "0.56464505", "0.5593308", "0.5560301", "0.55548537", "0.5542571", "0.5529708", "0.54956067", "0.5477219", "0.5469269", "0.5455528", "0.54367954", "0.5408808", "0.5402869", "0.54012215", "0.5401002", "0.5390528", "0.5379217", "0.5364032", "0.53408587", "0.53232604", "0.5316608", "0.5312805", "0.5303074", "0.52951497", "0.52834445", "0.52670074", "0.5255169", "0.5250018", "0.5233399", "0.5224715", "0.52212346", "0.52202404", "0.5201978", "0.5201978", "0.5201978", "0.5197456", "0.51962596", "0.5188822", "0.5180005", "0.5178487", "0.5170674", "0.5156105", "0.51520365", "0.51517123", "0.51498634", "0.5136315", "0.5136201", "0.51341146", "0.51326734", "0.51310056", "0.5128341", "0.51111513", "0.5097604", "0.50915706", "0.508824", "0.5083189", "0.5069918", "0.5067811", "0.5054697", "0.5054456", "0.5053538", "0.5037428", "0.5035154", "0.50336975", "0.50301605", "0.50147486", "0.5009251", "0.5005505", "0.5002709", "0.500109", "0.4993224", "0.49912792", "0.4984902", "0.49823698", "0.49763912", "0.49762887", "0.49680552", "0.49640846", "0.49595064", "0.49573466", "0.49573466", "0.49540356", "0.4951909", "0.49515337", "0.49471286", "0.49420545", "0.4940576", "0.4940576", "0.4940576", "0.49389565", "0.4938944", "0.49366862", "0.4935997", "0.4927788", "0.4926669", "0.49260885", "0.49234867" ]
0.0
-1
run the value iteration to determine optimal policy
private void valueIteration(double discount, double threshold) { ArrayList<Double> myStateValueCopy = new ArrayList<Double>(this.numMyStates); for(int i=0; i<this.numMyStates; i++) { myStateValueCopy.add((double) this.stateValueList.get(i)); } double delta = 100.0; do { for(int i=0; i<this.numMyStates; i++) { double maxValue = -1000000000000000.0; myState s = new myState(i); for(myAction a: this.getActions(s)) { double qValue = this.rewardTable.get(i).get(a.id); for(int k=0; k<this.numMyStates; k++) { double transProb = this.transitionProbabilityTable.get(i).get(a.id).get(k); qValue+=discount*(transProb*myStateValueCopy.get(k)); } if(qValue>maxValue) { maxValue = qValue; this.policy.set(i, a.id); } } myStateValueCopy.set(i, maxValue); } // compute delta change in value list delta = 0.0; for(int i=0; i<this.numMyStates; i++) { double vsDelta = this.stateValueList.get(i) - myStateValueCopy.get(i); this.stateValueList.set(i, (double) myStateValueCopy.get(i)); delta+= vsDelta*vsDelta; } } while(delta>threshold); System.gc(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void runAlgorithm(){\n fitness = new ArrayList<Double>(); \n \n int iter = 0;\n \n // While temperature higher than absolute temperature\n this.temperature = getCurrentTemperature(0);\n while(this.temperature > this.p_absoluteTemperature && iter < 100000){\n //while(!stopCriterionMet()){\n // Select next state\n //for(int i=0;i<20;i++){\n int count = 0;\n boolean selected = false;\n while(!selected){\n Problem.ProblemState next = nextState();\n if(isStateSelected(next)){\n selected = true;\n this.state = next;\n }\n \n count++;\n if(count == 10) break;\n }\n //}\n \n // Sample data\n double fvalue = this.state.getFitnessValue();\n this.fitness.add(new Double(fvalue));\n \n iter = iter + 1;\n \n // Lower temperature\n this.temperature = getCurrentTemperature(iter);\n }\n \n this.n_iter = iter;\n return;\n }", "public void evaluate()\r\n {\r\n\tdouble max = ff.evaluate(chromos.get(0),generation());\r\n\tdouble min = max;\r\n\tdouble sum = 0;\r\n\tint max_i = 0;\r\n\tint min_i = 0;\r\n\r\n\tdouble temp = 0;\r\n\r\n\tfor(int i = 0; i < chromos.size(); i++)\r\n\t {\r\n\t\ttemp = ff.evaluate(chromos.get(i),generation());\r\n\t\tif(temp > max)\r\n\t\t {\r\n\t\t\tmax = temp;\r\n\t\t\tmax_i = i;\r\n\t\t }\r\n\r\n\t\tif(temp < min)\r\n\t\t {\r\n\t\t\tmin = temp;\r\n\t\t\tmin_i = i;\r\n\t\t }\r\n\t\tsum += temp;\r\n\t }\r\n\r\n\tbestFitness = max;\r\n\taverageFitness = sum/chromos.size();\r\n\tworstFitness = min;\r\n\tbestChromoIndex = max_i;;\r\n\tworstChromoIndex = min_i;\r\n\tbestChromo = chromos.get(max_i);\r\n\tworstChromo = chromos.get(min_i);\r\n\t\r\n\tevaluated = true;\r\n }", "@Override\n\tpublic Solution<TTPVariable> run(SingleObjectiveThiefProblem thief, IEvaluator evaluator, MyRandom rand) {\n\t\tTTPVariable var = TTPVariable.create(new TourOptimalFactory(thief).next(rand), Pack.empty());\n\t\tSolution<TTPVariable> currentBest = thief.evaluate(var);\n\t\t\n\n\t\twhile (evaluator.hasNext()) {\n\n\t\t\t// now take the tour and optimize packing plan\n\t\t\tSolution<Pack> nextPack = optPack(thief, evaluator, rand, currentBest.getVariable().getTour(), currentBest.getVariable().getPack());\n\t\t\t\n\t\t\tSolution<Tour> nextTour = optTour(thief, evaluator, rand, currentBest.getVariable().getTour(), nextPack.getVariable());\n\t\t\t\n\t\t\tTTPVariable next = TTPVariable.create(nextTour.getVariable(), nextPack.getVariable());\n\t\t\tSolution<TTPVariable> s = thief.evaluate(next);\n\t\t\t\n\t\t\t//System.out.println(nextPack);\n\t\t\t//System.out.println(currentBest);\n\t\t\t//System.out.println(\"----------------\");\n\t\t\t\n\t\t\t// update the best found solution\n\t\t\tif (SolutionDominator.isDominating(s, currentBest)) {\n\t\t\t\tcurrentBest = s;\n\t\t\t\t//System.out.println(\"YES\");\n\t\t\t}\n\t\t\tevaluator.notify(currentBest);\n\n\t\t}\n\n\t\treturn currentBest;\n\t}", "public void doOfflineComputation() {\n\t\toptimalPolicy = policyIteration();\n\n\t}", "public Policy solve(Problem prob, int iterations) {\n\t\t\tPolicy policy = new Policy(prob);\n\t\t\tint row;\n\t\t\tint col;\n\t\t\tfor (int i=0; i<= ITERATIONS ; i++)\n\t\t\t{\n\n\t\t\t\trow = rng.nextInt(prob.map.size());\n\t\t\t\tcol = rng.nextInt(prob.map.get(0).size());\t\t\t\t\t\t\t\n\t\t\t\tfetchUtilityValue(prob, row, col, policy);\n\n\t\t\t}\n\n\t\t\tfor (int r = 0; r < rewards.length; r++) \n\t\t\t{\n\t\t\t\tfor (int c = 0; c < rewards[0].length; c++) \n\t\t\t\t{\n\t\t\t\t\tif(policy.bestActions[r][c] == null)\n\t\t\t\t\t{\n\t\t\t\t\t\tint direction =0;\n\t\t\t\t\t\tdouble maxQVal = Integer.MIN_VALUE;\n\t\t\t\t\t\tfor(int i=0; i< ACTION_COUNT ; i++)\n\t\t\t\t\t\t{ \n\t\t\t\t\t\t\tif(utilities[i][r][c] > maxQVal)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tmaxQVal = utilities[i][r][c];\n\t\t\t\t\t\t\t\tdirection = i;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tpolicy.bestActions[r][c] = DIRECTION[direction];\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn policy;\n\t\t}", "boolean updatePolicy() {\n double maxUtilityVal = -Double.MAX_VALUE;\n //if(x==19&&y==0)\n // System.out.println(\"minVal: \"+maxUtilityVal);\n for (int i = 0; i < AbsoluteDirection.values().length; i++) {\n double proposedValue = calculateUtility(AbsoluteDirection.values()[i]);\n // if(x==19&&y==0) {\n // System.out.println(\"Proposed value at cell \" + x + \", \" + y + \" is\" + proposedValue);\n\n // }\n if (proposedValue > maxUtilityVal) {\n policyDirection = AbsoluteDirection.values()[i];\n nextUtilityValue = proposedValue; // update curValues to nextValues at the end of iteration\n maxUtilityVal = proposedValue;\n }\n }\n\n return true;\n }", "public void calcObjective() {\n double obj;\n double objectives[];\n\n for (int i = 0; i < population.getPopulationSize(); i++) { //300\n objectives = population.getObjectiveValues(i);\n obj = evaluateAll(population.getSingleChromosome(i)); //evaluateAll(chromosome chromosome1)\n objectives[indexOfObjective] = obj;\n population.setObjectiveValue(i, objectives);\n }\n }", "private void evaluateProbabilities()\n\t{\n\t}", "public void evaluate() {\n for (Chromosome chromo : chromosomes) {\n double chromoGH = chromo.getTotalGH();\n if (chromo.isValid()) {\n this.validChromosomes++;\n if (chromoGH > this.getBestScore()) {\n this.bestScore = chromoGH;\n this.setBestChromo(chromo);\n }\n }\n //Log.debugMsg(chromo.getTotalGH().toString());\n// this.map.put(chromoGH, chromo);\n }\n }", "public ArrayList execute() {//(MultivariateFunction func, double[] xvec, double tolfx, double tolx) \n num_Function_Evaluation = 0;\n double[] stat = {0.0, 0.0};\n double[] storeBest = null;\n double[] storeMean = null;\n double[] storeStd = null;\n if (isOptimization) {\n storeBest = new double[101];\n storeMean = new double[101];\n storeStd = new double[101];\n //System.out.println(\"Initialization Done\");\n }\n int storeIndex = 0;\n\n //f = func;\n //bestSolution = xvec;\n // Create first generation\n firstGeneration();\n //System.out.println(iRet+\" \"+returnResult[iRet]);\n //stopCondition(fx, bestSolution, tolfx, tolx, true);\n\n //main iteration loop\n while (true) {\n boolean xHasChanged;\n do {\n //printing steps\n if (isPrintSteps) {\n if (currGen % printStep == 0) {\n if (isOptimization) {\n if (storeIndex < 101) {\n storeBest[storeIndex] = fx;\n stat = computFitnessStat();\n storeMean[storeIndex] = stat[0];\n storeStd[storeIndex] = stat[1];\n storeIndex++;\n }\n }\n System.out.printf(\" MH algo It: %5d Best: %.9f Mean: %.9f Std: %.9f \\n\", currGen, fx, stat[0], stat[1]);\n }//printsteps\n }//isPrintSteps\n\n xHasChanged = nextGeneration();\n if (currGen >= maxIter) {//if (maxFun > 0 && numFun > maxFun)\n break;\n }\n //if (prin > 1 && currGen % 20 == 0)\n //printStatistics();\n } while (!xHasChanged);\n //if (stopCondition(fx, bestSolution, tolfx, tolx, false) || (maxFun > 0 && numFun > maxFun))\n if (currGen >= maxIter) {\n break;\n }\n if (fx < 0.0000001) {\n //System.out.println(\"treshold\" + fx);\n //break;\n }\n }//while\n //printing final step\n if (isPrintFinal) {\n if (isOptimization) {\n if (storeIndex < 101) {\n storeBest[storeIndex] = fx;\n stat = computFitnessStat();\n storeMean[storeIndex] = stat[0];\n storeStd[storeIndex] = stat[1];\n storeIndex++;\n }\n }\n System.out.printf(\" MH algo It: %5d Best: %.9f Mean: %.9f Std: %.9f \\nTotal Fun Evaluations: %d\\n\", currGen, fx, stat[0], stat[1], num_Function_Evaluation);\n }\n ArrayList array = new ArrayList();\n array.add(storeBest);\n array.add(storeMean);\n array.add(storeStd);\n return array;\n }", "Policy solve(Problem prob, int iterations) {\n\t\t\tPolicy policy = new Policy(prob);\n\t\t\tfor(int k=0; k <= ITERATIONS; k++)\n\t\t\t{\n\t\t\t\tfor(int i=0; i < utilities.length; i++)\n\t\t\t\t{\n\t\t\t\t\tfor(int j=0; j< utilities[0].length; j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tcalculateUtilityValue(prob, i, j, policy);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn policy;\n\t\t}", "public double getBestSolutionEvaluation();", "public void evaluate() {\r\n Statistics.evaluate(this);\r\n }", "public abstract double evaluateFitness();", "public static void main(String[] args) throws FileNotFoundException, IOException {\nfor (double b = 0.5; b < 0.51; b+=0.1) {\n for (double k = 4.40; k < 4.5; k+=0.5) {\n Machine.b = 0.5; //0.2 - ATCnon-delay\n Machine.k = 1.5; //1.4 - ATCnon delay\n int hits = 0;\n engineJob = new cern.jet.random.engine.MersenneTwister(99999);\n noise = new cern.jet.random.Normal(0, 1, engineJob);\n SmallStatistics[] result = new SmallStatistics[5];\n result[0] = new SmallStatistics();\n result[1] = new SmallStatistics();\n for (int ds = 0; ds < 2; ds++) {\n JSPFramework[] jspTesting = new JSPFramework[105];\n for (int i = 0; i < jspTesting.length; i++) {\n jspTesting[i] = new JSPFramework();\n jspTesting[i].getJSPdata(i*2 + 1);\n }\n //DMU - instances (1-80)//la - instances (81-120)\n //mt - instances (121/-123)//orb - instances (124-133)//ta -instances (134-173)\n //////////////////////////////////////////////\n for (int i = 0; i < jspTesting.length; i++) {\n double countEval = 0;\n double tempObj = Double.POSITIVE_INFINITY;\n double globalBest = Double.POSITIVE_INFINITY;\n boolean[] isApplied_Nk = new boolean[2]; //Arrays.fill(isApplied_Nk, Boolean.TRUE);\n int Nk = 0; // index of the Iterative dispatching rule to be used\n jspTesting[i].resetALL();\n boolean firstIteration = true;\n double countLargeStep = 0;\n do{\n countEval++;\n //start evaluate schedule\n jspTesting[i].reset();\n int N = jspTesting[i].getNumberofOperations();\n jspTesting[i].initilizeSchedule();\n int nScheduledOp = 0;\n\n //choose the next machine to be schedule\n while (nScheduledOp<N){\n\n Machine M = jspTesting[i].Machines[jspTesting[i].nextMachine()];\n\n jspTesting[i].setScheduleStrategy(Machine.scheduleStrategy.HYBRID );\n jspTesting[i].setPriorityType(Machine.priorityType.ATC);\n jspTesting[i].setNonDelayFactor(0.3);\n //*\n jspTesting[i].setInitalPriority(M);\n for (Job J:M.getQueue()) {\n double RJ = J.getReadyTime();\n double RO = J.getNumberRemainingOperations();\n double RT = J.getRemainingProcessingTime();\n double PR = J.getCurrentOperationProcessingTime();\n double W = J.getWeight();\n double DD = J.getDuedate();\n double RM = M.getReadyTime();\n double RWT = J.getCurrentOperationWaitingTime();\n double RFT = J.getFinishTime();\n double RNWT = J.getNextOperationWaitingTime();\n int nextMachine = J.getNextMachine();\n\n if (nextMachine==-1){\n RNWT=0;\n } else {\n RNWT = J.getNextOperationWaitingTime();\n if (RNWT == -1){\n RNWT = jspTesting[i].getMachines()[nextMachine].getQueueWorkload()/2.0;\n }\n }\n if (RWT == -1){\n RWT = M.getQueueWorkload()/2.0;\n }\n //J.addPriority((W/PR)*Math.exp(-maxPlus((DD-RM-PR-(RT-PR+J.getRemainingWaitingTime(M)))/(3*M.getQueueWorkload()/M.getNumberofJobInQueue())))); //iATC\n //J.addPriority((PR*PR*0.614577*(-RM-RM/W)-RT*PR*RT/W)\n // -(RT*PR/(W-0.5214191)-RM/W*PR*0.614577+RT*PR/(W-0.5214191)*2*RM/W));\n //J.addPriority(((W/PR)*((W/PR)/(RFT*RFT)))/(max(div((RFT-RT),(RWT/W)),IF(RFT/W-max(RFT-RT,DD),DD,RFT))+DD/RFT+RFT/W-max(RFT-RFT/W,DD))); //best TWT priorityIterative\n if (Nk==0)\n //J.addPriority(min(W/PR-RFT+min(RT,W/RFT),((min(RT,RNWT-RFT)/(RJ-min(RWT,RFT*0.067633785)))/(RJ-min(RWT,RFT*0.067633785))))/RFT);\n J.addPriority(min(W/PR-RFT+min(RT,W/RFT),((div(min(RT,RNWT-RFT),(RJ-min(RWT,RFT*0.067633785))))/(RJ-min(RWT,RFT*0.067633785))))/RFT);\n else\n J.addPriority(min((((W/PR)/RFT)/(2*RNWT+max(RO,RFT)))/(PR+RNWT+max(RO,RFT)),((W/PR)/RFT)/PR)/RFT);\n }\n //jspTesting[i].calculatePriority(M);\n jspTesting[i].sortJobInQueue(M);\n Job J = M.completeJob();\n if (!J.isCompleted()) jspTesting[i].Machines[J.getCurrentMachine()].joinQueue(J);\n nScheduledOp++;\n }\n double currentObj = -100;\n currentObj = jspTesting[i].getTotalWeightedTardiness();\n if (tempObj > currentObj){\n tempObj = currentObj;\n jspTesting[i].recordSchedule();\n Arrays.fill(isApplied_Nk, Boolean.FALSE);\n //System.out.println(\"Improved!!!\");\n }\n else {\n isApplied_Nk[Nk] = true;\n if (!isNextApplied(Nk, isApplied_Nk)) Nk = circleShift(Nk, isApplied_Nk.length);\n else {\n if (globalBest>tempObj) {\n globalBest = tempObj;\n jspTesting[i].storeBestRecordSchedule();\n } jspTesting[i].restoreBestRecordSchedule();\n if (countLargeStep<1) {\n tempObj = Double.POSITIVE_INFINITY;\n Arrays.fill(isApplied_Nk, Boolean.FALSE);\n jspTesting[i].shakeRecordSchedule(noise, engineJob, globalBest);\n countLargeStep++;\n }\n else break;\n }\n }\n firstIteration = false;\n \n } while(true);\n result[ds].add(jspTesting[i].getDevREFTotalWeightedTardiness(globalBest));\n if (jspTesting[i].getDevLBCmax()==0) hits++;\n System.out.println(jspTesting[i].instanceName + \" & \"+ globalBest + \" & \" + countEval);\n }\n }\n //jsp.schedule();\n //*\n System.out.println(\"*************************************************************************\");\n System.out.println(\"[ & \" + formatter.format(result[0].getMin()) + \" & \"\n + formatter.format(result[0].getAverage()) + \" & \" + formatter.format(result[0].getMax()) +\n \" & \" + formatter.format(result[1].getMin()) + \" & \"\n + formatter.format(result[1].getAverage()) + \" & \" + formatter.format(result[1].getMax()) + \"]\");\n //*/\n System.out.print(\"\"+formatter.format(result[0].getAverage()) + \" \");\n }\n System.out.println(\"\");\n}\n }", "public void run() {\n PopulationFGA<Integer> poblacionActual = new PopulationFGA<>(funcionBorn,\n funcionFitness,\n problema.getDimension(),\n 1);\n poblacionActual.incializa(200);\n while(!condTerminacion.conditionReached(poblacionActual)) {\n System.out.println(\"Generacion Actual: \" + poblacionActual.getGeneracion());\n poblacionActual = iteration(poblacionActual);\n }\n ArrayList<IndividualFGA<Integer>> individuos = poblacionActual.generaIndividuos();\n IndividualFGA<Integer> mejor = individuos.get(0);\n for (IndividualFGA<Integer> e : individuos) {\n if (mejor.getFitness() <= e.getFitness())\n mejor = e;\n }\n System.out.println(\"Mejor solucion \" + '\\n' + mejor.toString());\n //System.out.println(\"Fitness \" + mejor.getFitness());\n int dim = problema.getDimension();\n int costo = 0;\n int obj1;\n int obj2;\n Phenotype<Integer> fenotipo = mejor.getRepActual();\n for (int i = 0; i < (dim - 1); i++) {\n obj1 = fenotipo.getAllele(i).intValue() - 1;\n for (int j = i + 1; j < dim; j++) {\n obj2 =fenotipo.getAllele(j).intValue() - 1; \n costo = costo + problema.getDistanciaEntre(i,j) * problema.getFlujoEntre(obj1,obj2);\n }\n }\n System.out.println(\"Costo de la solucion: \" + costo);\n\n }", "private void evaluationLogic() {\n // setup for logic:\n // if distToClosestEstimate[i][0] is smaller than threshold, we have a Tp\n // if distToClosestEstimate[i][0] is larger than threshold, we have a Fn\n // all estimatedFeatures that are not assigned Tp are therefore Fp\n for (int i = 0; i < groundTruthInstant.size(); ++i) {\n if (distToClosestEstimate[i][0] < truePositiveThreshold) {\n ++truePositiveCount;\n int assignedEstimatedFeature = (int) distToClosestEstimate[i][1];\n assignedEstimatedFeatures[assignedEstimatedFeature] = true;\n } else\n ++falseNegativeCount;\n }\n for (int i = 0; i < estimatedInstant.size(); ++i)\n if (!assignedEstimatedFeatures[i])\n ++falsePositiveCount;\n }", "@Override\n\t\t\t\t\tpublic Iterator<Tuple2<FirstStageAresSolution, Tuple5<Integer,Double,Double,Double,Double>>> call(Tuple2<MobileApplication, MobileDataDistributionInfrastructure> inputValues)\n\t\t\t\t\t\t\tthrows Exception {\n\t\t\t\t\t\tArrayList<Tuple2<FirstStageAresSolution,Tuple5<Integer,Double,Double,Double,Double>>> output = \n\t\t\t\t\t\t\t\t\t\tnew ArrayList<Tuple2<FirstStageAresSolution,Tuple5<Integer,Double,Double,Double,Double>>>();\n\t\t\t\t\t\tOffloadScheduler singleSearch;\n\t\t\t\t\t\t\n\t\t\t\t\t\tArrayList<FirstStageAresSolution> solutions;\n\t\t\t\t\t\t/*switch(SimulationSetup.placementAlgorithm)\n\t\t\t\t\t\t{\n\t\t\t\t\t\tcase \"RANDOM\":\n\t\t\t\t\t\t\tRandomEdgePlanner.setupEdgeNodes(infrastructure);\n\t\t\t\t\t\t\tDefaultNetworkPlanner.setupNetworkConnections(infrastructure);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"ALL\":\n\t\t\t\t\t\t\tEdgeAllCellPlanner.setupEdgeNodes(infrastructure);\n\t\t\t\t\t\t\tDefaultNetworkPlanner.setupNetworkConnections(infrastructure);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"ares\":\n\t\t\t\t\t\t\tFirstStageAresPlanner planner = new FirstStageAresPlanner(inputValues);\n\t\t\t\t\t\t\tplanner.setupEdgeNodes(infrastructure);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tFirstStageAresPlanner aresP = new FirstStageAresPlanner(inputValues);\n\t\t\t\t\t\t\taresP.setupEdgeNodes(infrastructure);\n\t\t\t\t\t\t}*/\n\t\t\t\t\t\t\n\t\t\t\t\t\tSystem.out.println(\"Executing planner\");\n\t\t\t\t\t\t//FirstStageAresPlanner aresP = new FirstStageAresPlanner();\n\t\t\t\t\t\tFirstStageAresPlanner aresP = new FirstStageAresPlanner();\n\t\t\t\t\t\tSystem.out.println(\"Retrieving solutions\");\n\t\t\t\t\t\t//solutions = (ArrayList<FirstStageAresSolution>) aresP.getSolutionList();\n\t\t\t\t\t\tsolutions = (ArrayList<FirstStageAresSolution>) aresP.getSolutionList();\n\t\t\t\t\t\tSystem.out.println(\"Solutions retrieved!\");\n\t\t\t\t\t\t/*switch(algoritmName){\n\t\t\t\t\t\tcase \"weighted\":\n\t\t\t\t\t\t\tsingleSearch = new HeftEchoResearch(inputValues._1(), infrastructure);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"heft\":\n\t\t\t\t\t\t\tsingleSearch = new HEFTResearch(inputValues._1(), infrastructure);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"hbatt\":\n\t\t\t\t\t\t\tsingleSearch = new HEFTBattery(inputValues._1(), infrastructure);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"hcost\":\n\t\t\t\t\t\t\tsingleSearch = new HEFTCostResearch(inputValues._1(), infrastructure);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"bforce-rt\":\n\t\t\t\t\t\t\tsingleSearch = new BruteForceRuntimeOffloader(inputValues._1(), infrastructure);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"nsgaIII\":\n\t\t\t\t\t\t\tsingleSearch = new NSGAIIIResearch(inputValues._1(), infrastructure);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}*/\n\t\t\t\t\t\t//ArrayList<FirstStageAresSolution> temp = new ArrayList<FirstStageAresSolution>();\n\t\t\t\t\t\t//for(FirstStageAresSolution solution : solutions) {\n\t\t\t\t\t\tArrayList<FirstStageAresSolution> temp = new ArrayList<FirstStageAresSolution>();\n\t\t\t\t\t\tfor(FirstStageAresSolution solution : solutions) {\n\t\t\t\t\t\t\t//aresP.applySolutionToInfrastructure(solution, infrastructure);\n\t\t\t\t\t\t\t//ArrayList<InfrastructureProvisioningPlan> offloads = (ArrayList<InfrastructureProvisioningPlan>) singleSearch.findScheduling();\n\t\t\t\t\t\t\t//if(offloads != null)\n\t\t\t\t\t\t\t\t//for(InfrastructureProvisioningPlan os : offloads) \n\t\t\t\t\t\t\t\t//{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//System.out.println(solution);\n\t\t\t\t\t\t\t\t\t//plan.setInfEnergyConsumption(solution.getEnergyConsumption());\n\t\t\t\t\t\t\t\t\t//plan.setRunTime(solution.getAverageDistance());\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/*if(!temp.contains(solution)) \n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttemp.add(solution);\n\t\t\t\t\t\t\t\toutput.add(\n\t\t\t\t\t\t\t\t\t\tnew Tuple2<FirstStageAresSolution,Tuple5<Integer,Double,Double,Double,Double>>\n\t\t\t\t\t\t\t\t\t\t(solution,\n\t\t\t\t\t\t\t\t\t\t\t\tnew Tuple5<Integer,Double,Double,Double,Double>(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsolution.getAverageDistance(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t0.0,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsolution.getEnergyConsumption(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t0.0\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t)));\n\t\t\t\t\t\t\t}*/\n\t\t\t\t\t\t\tif(!temp.contains(solution)) \n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttemp.add(solution);\n\t\t\t\t\t\t\t\toutput.add(\n\t\t\t\t\t\t\t\t\t\tnew Tuple2<FirstStageAresSolution,Tuple5<Integer,Double,Double,Double,Double>>\n\t\t\t\t\t\t\t\t\t\t(solution,\n\t\t\t\t\t\t\t\t\t\t\t\tnew Tuple5<Integer,Double,Double,Double,Double>(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsolution.getAverageDistance(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t0.0,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsolution.getEnergyConsumption(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t0.0\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t)));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn output.iterator();\n\t\t\t\t\t}", "public double[] runOptimizer() {\n List<Integer> sents = new ArrayList<Integer>();\n for(int i=0; i<sentNum; i++)\n sents.add(i);\n \n if(needShuffle)\n Collections.shuffle(sents);\n \n double oraMetric, oraScore, predMetric, predScore;\n double[] oraPredScore = new double[4];\n double eta = 1.0; //learning rate, will not be changed if run percep\n double avgEta = 0; //average eta, just for analysis\n double loss = 0;\n double featNorm = 0;\n double featDiffVal;\n double sumMetricScore = 0;\n double sumModelScore = 0;\n String oraFeat = \"\";\n String predFeat = \"\";\n String[] oraPredFeat = new String[2];\n String[] vecOraFeat;\n String[] vecPredFeat;\n String[] featInfo;\n boolean first = true;\n //int processedSent = 0;\n Iterator it;\n Integer diffFeatId;\n double[] avgLambda = new double[initialLambda.length]; //only needed if averaging is required\n for(int i=0; i<initialLambda.length; i++)\n avgLambda[i] = 0.0;\n\n //update weights\n for(Integer s : sents) {\n //find out oracle and prediction\n if(first)\n findOraPred(s, oraPredScore, oraPredFeat, initialLambda, featScale);\n else\n findOraPred(s, oraPredScore, oraPredFeat, finalLambda, featScale);\n \n //the model scores here are already scaled in findOraPred\n oraMetric = oraPredScore[0];\n oraScore = oraPredScore[1];\n predMetric = oraPredScore[2];\n predScore = oraPredScore[3];\n oraFeat = oraPredFeat[0];\n predFeat = oraPredFeat[1];\n \n //update the scale\n if(needScale) { //otherwise featscale remains 1.0\n sumMetricScore += java.lang.Math.abs(oraMetric+predMetric);\n sumModelScore += java.lang.Math.abs(oraScore+predScore)/featScale; //restore the original model score\n \n if(sumModelScore/sumMetricScore > scoreRatio)\n featScale = sumMetricScore/sumModelScore;\n\n /* a different scaling strategy \n if( (1.0*processedSent/sentNum) < sentForScale ) { //still need to scale\n double newFeatScale = java.lang.Math.abs(scoreRatio*sumMetricDiff / sumModelDiff); //to make sure modelScore*featScale/metricScore = scoreRatio\n \n //update the scale only when difference is significant\n if( java.lang.Math.abs(newFeatScale-featScale)/featScale > 0.2 )\n featScale = newFeatScale;\n }*/\n }\n// processedSent++;\n\n HashMap<Integer, Double> allOraFeat = new HashMap<Integer, Double>();\n HashMap<Integer, Double> allPredFeat = new HashMap<Integer, Double>();\n HashMap<Integer, Double> featDiff = new HashMap<Integer, Double>();\n\n vecOraFeat = oraFeat.split(\"\\\\s+\");\n vecPredFeat = predFeat.split(\"\\\\s+\");\n \n for (int i = 0; i < vecOraFeat.length; i++) {\n featInfo = vecOraFeat[i].split(\":\");\n diffFeatId = Integer.parseInt(featInfo[0]);\n allOraFeat.put(diffFeatId, Double.parseDouble(featInfo[1]));\n featDiff.put(diffFeatId, Double.parseDouble(featInfo[1]));\n }\n\n for (int i = 0; i < vecPredFeat.length; i++) {\n featInfo = vecPredFeat[i].split(\":\");\n diffFeatId = Integer.parseInt(featInfo[0]);\n allPredFeat.put(diffFeatId, Double.parseDouble(featInfo[1]));\n\n if (featDiff.containsKey(diffFeatId)) //overlapping features\n featDiff.put(diffFeatId, featDiff.get(diffFeatId)-Double.parseDouble(featInfo[1]));\n else //features only firing in the 2nd feature vector\n featDiff.put(diffFeatId, -1.0*Double.parseDouble(featInfo[1]));\n }\n\n if(!runPercep) { //otherwise eta=1.0\n featNorm = 0;\n\n Collection<Double> allDiff = featDiff.values();\n for(it =allDiff.iterator(); it.hasNext();) {\n featDiffVal = (Double) it.next();\n featNorm += featDiffVal*featDiffVal;\n }\n \n //a few sanity checks\n if(! evalMetric.getToBeMinimized()) {\n if(oraSelectMode==1 && predSelectMode==1) { //\"hope-fear\" selection\n /* ora_score+ora_metric > pred_score+pred_metric\n * pred_score-pred_metric > ora_score-ora_metric\n * => ora_metric > pred_metric */\n if(oraMetric+1e-10 < predMetric) {\n System.err.println(\"WARNING: for hope-fear selection, oracle metric score must be greater than prediction metric score!\");\n System.err.println(\"Something is wrong!\");\n }\n }\n \n if(oraSelectMode==2 || predSelectMode==3) {\n if(oraMetric+1e-10 < predMetric) {\n System.err.println(\"WARNING: for max-metric oracle selection or min-metric prediction selection, the oracle metric \" +\n \t\t\"score must be greater than the prediction metric score!\");\n System.err.println(\"Something is wrong!\");\n }\n }\n } else {\n if(oraSelectMode==1 && predSelectMode==1) { //\"hope-fear\" selection\n /* ora_score-ora_metric > pred_score-pred_metric\n * pred_score+pred_metric > ora_score+ora_metric\n * => ora_metric < pred_metric */\n if(oraMetric-1e-10 > predMetric) {\n System.err.println(\"WARNING: for hope-fear selection, oracle metric score must be smaller than prediction metric score!\");\n System.err.println(\"Something is wrong!\");\n }\n }\n \n if(oraSelectMode==2 || predSelectMode==3) {\n if(oraMetric-1e-10 > predMetric) {\n System.err.println(\"WARNING: for min-metric oracle selection or max-metric prediction selection, the oracle metric \" +\n \"score must be smaller than the prediction metric score!\");\n System.err.println(\"Something is wrong!\");\n }\n }\n }\n \n if(predSelectMode==2) {\n if(predScore+1e-10 < oraScore) {\n System.err.println(\"WARNING: for max-model prediction selection, the prediction model score must be greater than oracle model score!\");\n System.err.println(\"Something is wrong!\");\n }\n }\n \n //cost - margin\n //remember the model scores here are already scaled\n loss = evalMetric.getToBeMinimized() ? //cost should always be non-negative \n (predMetric-oraMetric) - (oraScore-predScore)/featScale: \n (oraMetric-predMetric) - (oraScore-predScore)/featScale;\n \n if(loss<0)\n loss = 0;\n\n if(loss == 0)\n eta = 0;\n else\n //eta = C < loss/(featNorm*featScale*featScale) ? C : loss/(featNorm*featScale*featScale); //feat vector not scaled before\n eta = C < loss/(featNorm) ? C : loss/(featNorm); //feat vector not scaled before\n }\n \n avgEta += eta;\n\n Set<Integer> diffFeatSet = featDiff.keySet();\n it = diffFeatSet.iterator();\n\n if(first) {\n first = false;\n \n if(eta!=0) {\n while(it.hasNext()) {\n diffFeatId = (Integer)it.next();\n finalLambda[diffFeatId] = initialLambda[diffFeatId] + eta*featDiff.get(diffFeatId);\n }\n }\n }\n else {\n if(eta!=0) {\n while(it.hasNext()) {\n diffFeatId = (Integer)it.next();\n finalLambda[diffFeatId] = finalLambda[diffFeatId] + eta*featDiff.get(diffFeatId);\n }\n }\n }\n \n if(needAvg) {\n for(int i=0; i<avgLambda.length; i++)\n avgLambda[i] += finalLambda[i];\n }\n }\n \n if(needAvg) {\n for(int i=0; i<finalLambda.length; i++)\n finalLambda[i] = avgLambda[i]/sentNum;\n }\n \n avgEta /= sentNum;\n System.out.println(\"Average learning rate: \"+avgEta);\n\n // the intitialLambda & finalLambda are all trainable parameters\n //if (!trainMode.equals(\"3\")) // for mode 3, no need to normalize sparse\n // feature weights\n //normalizeLambda(finalLambda);\n //else\n //normalizeLambda_mode3(finalLambda);\n\n /*\n * for( int i=0; i<finalLambda.length; i++ ) System.out.print(finalLambda[i]+\" \");\n * System.out.println(); System.exit(0);\n */ \n\n double initMetricScore = computeCorpusMetricScore(initialLambda); // compute the initial corpus-level metric score\n double finalMetricScore = computeCorpusMetricScore(finalLambda); // compute final corpus-level metric score // the\n\n // prepare the printing info\n int numParamToPrint = 0;\n String result = \"\";\n\n if (trainMode.equals(\"1\") || trainMode.equals(\"4\")) {\n numParamToPrint = paramDim > 10 ? 10 : paramDim; // how many parameters\n // to print\n result = paramDim > 10 ? \"Final lambda(first 10): {\" : \"Final lambda: {\";\n\n for (int i = 1; i < numParamToPrint; i++)\n // in ZMERT finalLambda[0] is not used\n result += finalLambda[i] + \" \";\n } else {\n int sparseNumToPrint = 0;\n if (trainMode.equals(\"2\")) {\n result = \"Final lambda(regular feats + first 5 sparse feats): {\";\n for (int i = 1; i <= regParamDim; ++i)\n result += finalLambda[i] + \" \";\n\n result += \"||| \";\n\n sparseNumToPrint = 5 < (paramDim - regParamDim) ? 5 : (paramDim - regParamDim);\n\n for (int i = 1; i <= sparseNumToPrint; i++)\n result += finalLambda[regParamDim + i] + \" \";\n } else {\n result = \"Final lambda(first 10 sparse feats): {\";\n sparseNumToPrint = 10 < paramDim ? 10 : paramDim;\n\n for (int i = 1; i < sparseNumToPrint; i++)\n result += finalLambda[i] + \" \";\n }\n }\n\n output.add(result + finalLambda[numParamToPrint] + \"}\\n\" + \"Initial \"\n + evalMetric.get_metricName() + \": \" + initMetricScore + \"\\nFinal \"\n + evalMetric.get_metricName() + \": \" + finalMetricScore);\n\n // System.out.println(output);\n\n if (trainMode.equals(\"3\")) {\n // finalLambda = baseline(unchanged)+disc\n for (int i = 0; i < paramDim; i++)\n copyLambda[i + regParamDim + 1] = finalLambda[i];\n\n finalLambda = copyLambda;\n }\n\n return finalLambda;\n }", "@Override\n public DRFLPSolution algorithm(DRFLPInstance instance) {\n try {\n List<Future<DRFLPSolution>> futures = new ArrayList<>();\n RandomManager.reinitialize(RandomType.LEGACY, 0, this.n);\n for (int i = 0; i < n; i++) {\n int _i = i;\n futures.add(executor.submit(() -> {\n RandomManager.reset(_i);\n return alg.algorithm(instance);\n }));\n }\n var results = ConcurrencyUtil.awaitAll(futures);\n DRFLPSolution best = null;\n for(var solution: results){\n if(solution.isBetterThan(best)){\n best = solution;\n }\n }\n return best;\n } finally {\n executor.shutdown();\n }\n }", "private static void normal(){\n ProblemKnapsackFromFile problem = new ProblemKnapsackFromFile(macPathGetProblemFrom);\n\n //NSGAII algorithm = new NSGAII();\n SPEA2 algorithm = new SPEA2();\n //SPEAHADKA algorithm = new SPEAHADKA();\n //AEMMT algorithm = new AEMMT();\n //AEMMD algorithm = new AEMMD();\n //MOEAD algorithm = new MOEAD();\n\n int x =1;\n int counter = 0;\n\n if (AEMMD.class.isInstance(algorithm) || AEMMT.class.isInstance(algorithm)){\n Parameters.NUMBER_OF_GENERATIONS = 15000;\n }\n else{\n Parameters.NUMBER_OF_GENERATIONS = problem.items.size() < 100? 100 : 200;\n }\n\n while (counter < x) {\n algorithm.runAlgorithm(problem);\n counter++;\n }\n }", "private void runBest() {\n }", "protected void updateValues(){\n double total = 0;\n for(int i = 0; i < values.length; i++){\n values[i] = \n operation(minimum + i * (double)(maximum - minimum) / (double)numSteps);\n \n total += values[i];\n }\n for(int i = 0; i < values.length; i++){\n values[i] /= total;\n }\n }", "private static Population getBestPossibleParettoOfAGS(){\n int numberOfRounds = 10;\n Population allFrontsMembers = new Population();\n\n NSGAII nsgaii = new NSGAII();\n SPEA2 spea2 = new SPEA2();\n AEMMT aemmt = new AEMMT();\n AEMMD aemmd = new AEMMD();\n MOEAD moead = new MOEAD();\n\n ProblemKnapsackFromFile problem = new ProblemKnapsackFromFile(macPathGetProblemFrom);\n progressBar = new ProgressBar((double) numberOfRounds);\n\n for (int i = 0; i < numberOfRounds; i++) {\n\n Parameters.NUMBER_OF_GENERATIONS = problem.items.size() < 100? 100 : 200;\n\n System.out.println(\"NSGAII\");\n nsgaii.runAlgorithm(problem);\n allFrontsMembers.population.addAll(nsgaii.paretto.membersAtThisFront);\n\n System.out.println(\"SPEA2\");\n spea2.runAlgorithm(problem);\n allFrontsMembers.population.addAll(spea2.paretto.membersAtThisFront);\n\n //moead.runAlgorithm(problem);\n //allFrontsMembers.population.addAll( moead.pareto.membersAtThisFront);\n\n Parameters.NUMBER_OF_GENERATIONS = 15000;\n System.out.println(\"AEMMT\");\n aemmt.runAlgorithm(problem);\n allFrontsMembers.population.addAll(aemmt.paretto.membersAtThisFront);\n\n System.out.println(\"AEMMD\");\n aemmd.runAlgorithm(problem);\n allFrontsMembers.population.addAll(aemmd.paretto.membersAtThisFront);\n\n progressBar.addJobDone();\n\n allFrontsMembers.fastNonDominatedSort();\n Problem.removeSimilar(allFrontsMembers.fronts.allFronts.get(0),problem);\n allFrontsMembers.population = allFrontsMembers.fronts.allFronts.get(0).membersAtThisFront;\n }\n\n problem.printResolutionMessage();\n //Printer.printBinaryMembers(allFrontsMembers);\n System.out.println(\"ALL FRONTS SIZE: \"+allFrontsMembers.population.size());\n\n return allFrontsMembers;\n }", "void calculatePR( int iteration){\n\t\t\n\t\ttotal_nodes = inlinks.size();\n\t\tfor(String page : inlinks.keySet()){\n\t\t\tPageRank.put(page, (1/(double)(total_nodes)));\n\t\t\tinit_PageRank.put(page, (1/(double)(total_nodes)));\n\t\t}\n \n double ppx = 0.0;\n boolean cond = true;\n int itr =1;\n // while(iteration >0){ //Used for Graph page rank calculation; c\n while(cond){ \n \tSystem.out.println(\"Iteration\"+itr); \n double sinkPR = 0;\n for(String s: sink){\n \tsinkPR = sinkPR + (PageRank.get(s)); //calculate total sink PR\n }\n \n double entropy = 0.0;\n \n for(String s: PageRank.keySet()){\n \tdouble newPR;\n \tnewPR = (1.0 -d)/total_nodes;\n \tnewPR = newPR + (d*sinkPR)/total_nodes;\n \tSet<String> in = inlinks.get(s); //pages pointing to P\n \tif(in != null){\n \t\tfor(String s1 : in){\n \t\t\tnewPR = newPR + d* (PageRank.get(s1)/outlinks_count.get(s1)); \t\t \n \t\t}\n \t} \n \t\tnew_PageRank.put(s, newPR);\n \t\tentropy = entropy + (newPR*(Math.log(newPR)/Math.log(2))); //entroPy calculation\n \t}\n \n PageRank.putAll(new_PageRank);\n ppx = Math.pow(2,-1*entropy);\n System.out.println(\"perplexity : \"+ ppx);\n ppx_list.add(ppx);\n if(ppx_list.size()>5) \n \tcond= !check(4);\n \n itr++;\n \t\n //\t iteration --; //Used for page Rank Calculation of Graph\n } \n\t}", "public abstract double evaluer(SolutionPartielle s);", "private void EvalFitness(){\r\n _FitVal=0;\r\n for(int i=0; i<7;i++)\r\n for(int j=i+1;j<8;j++){\r\n if( _Data[i]==_Data[j]) _FitVal++;\r\n if(j-i==Math.abs(_Data[i]-_Data[j])) _FitVal++;\r\n }\r\n }", "public Object eval(Individual ind)\r\n {\r\n BinaryIndividual bi = (BinaryIndividual)ind;\r\n int partialFitness = 0;\r\n int distance = 0;\r\n double fitness = 0.0;\r\n\r\n\t for (int i=0; i<100; i++){\r\n\r\n\t distance = 0;\r\n\r\n\t for (int j=0; j<100; j++){\r\n\t if (!((BinaryIndividual)target[i]).getBooleanAllele(j)^bi.getBooleanAllele(j)) { \r\n\t\t distance++;\r\n\t }\r\n \r\n\t if (distance > partialFitness) {\r\n\t partialFitness = distance;\r\n\t }\r\n\t }\r\n }\r\n\r\n fitness = (double)partialFitness/100.0;\r\n return new Double(fitness);\r\n \r\n\r\n }", "public Sample run() {\n\t\t// termination criterion\n\t\tint runsUnchanged = 0;\n\t\tboolean terminated = false;\n\t\tdouble prevBestSampleFit = 0; // remember to set this at some\n\t\t\t\t\t\t\t\t\t\t// point\n\t\tint runs = 0; // testing, remove\n\n\t\t System.out.println(\"Evaluating Particles\");\n\t\t// 1) evaluate all particles\n\t\t// 2) set gBest\n\t\tdouble maxFit = problem.getWorstValue();\n\t\tfor (Particle p : pop) {\n\t\t\tp.calcFitness();\n\n\t\t\t// number of evals done is incremented by numSamples\n\t\t\tnumFitnessEvals += numSamples;\n\n\t\t\tdouble fit = p.getBestSample().getFitness();\n\t\t\t// find initial gBest\n\t\t\tif (problem.compare(maxFit, fit) == 1) {\n\t\t\t\tmaxFit = fit;\n\t\t\t\tbestSample = p.getBestSample();\n\t\t\t\tgBest = p.copy();\n\t\t\t\t System.out.println(\"Global best:\");\n\t\t\t\t bestSample.print();\n\t\t\t}\n\t\t}\n\n\t\twhile (!terminated) {\n\t\t\t System.out.println(\"\\n \\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\");\n\t\t\t System.out.println(\" %%%%%%%%%%%%% RUN \" + runs);\n\t\t\t System.out.println(\" %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\");\n\n\t\t\t// iterate through all particles\n\t\t\tfor (Particle p : pop) {\n\t\t\t\t// System.out.println(\"\\n >>>> Particle \");\n\t\t\t\t// p.print();\n\n\t\t\t\t// 1) update velocity\n//\t\t\t\tSystem.out.println(\">> Velocity Update\");\n\t\t\t\tp.updateVelocity(omega, phi1, phi2, gBest);\n\n\t\t\t\t// 2) update position\n//\t\t\t\tSystem.out.println(\">> Position Update \");\n\t\t\t\tp.updatePosition();\n\t\t\t\t// p.print();\n\n\t\t\t\t// 2.5) change the previous best sample fitness\n\t\t\t\tprevBestSampleFit = bestSample.getFitness();\n\n\t\t\t\t// 3) evaluate fitness\n//\t\t\t\tSystem.out.println(\">> Fitness Calc\");\n\t\t\t\tdouble fit = p.calcFitness(); // this is never used\n\t\t\t\t// number of evals done is incremented by numSamples\n\t\t\t\tnumFitnessEvals += numSamples;\n\n\t\t\t\tdouble sampleFit = p.getBestSample().getFitness();\n\n\t\t\t\t// System.out.println(\"Sample fitness: \" + sampleFit + \" >? Best\n\t\t\t\t// fitness: \" + bestSample.getFitness());\n\n\t\t\t\t// compares and adjusts gBest\n\t\t\t\tif (problem.compare(bestSample.getFitness(), sampleFit) == 1) {\n\t\t\t\t\tsetBestSample(p.getBestSample());\n\t\t\t\t\t// set gBest and bias\n\t\t\t\t\tsetGBest(p);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// updating fitness for evaluation\n\t\t\tfitnesses.add(bestSample.getFitness());\n\n\t\t\t// Next half-dozen or so lines used to determine convergence\n\t\t\tif (Math.abs(prevBestSampleFit - bestSample.getFitness()) < threshold) {\n\t\t\t\trunsUnchanged++;\n\t\t\t} else {\n\t\t\t\trunsUnchanged = 0;\n\t\t\t}\n\t\t\tif (runsUnchanged >= numToConsiderConverged) {\n\t\t\t\t// return if the solution hasn't significantly changed in a\n\t\t\t\t// certain\n\t\t\t\t// number of iterations\n\t\t\t\tterminated = true;\n\t\t\t}\n\t\t\truns++;\n\t\t\t// System.out.println(\">>>>>> RUNS: \" + runs);\n\t\t}\n\n\t\tSystem.out.println(\"Returning best sample:\");\n\t\tbestSample.print();\n\t\tSystem.out.println(\"Fitness: \" + bestSample.getFitness());\n\n\t\tSystem.out.println(\"Fitness Aross Evals:\");\n\t\tfor (Double d : fitnesses) {\n\t\t\tSystem.out.print(d + \" \");\n\t\t}\n\t\tSystem.out.println();\n\n\t\treturn bestSample;\n\t}", "public void calculateUtilityValue(Problem prob, int row, int col, Policy pol)\n\t\t{\n\t\t\tdouble maxActionVal = Double.MIN_VALUE;\n\t\t\tint maxAction;\n\t\t\tint chosenAction=0;\n\t\t\tfor(int i=0; i < ACTION_COUNT; i++)\n\t\t\t{\n\t\t\t\tdouble newSampleVal = 0;\n\n\t\t\t\t\n\t\t\t\tif(isOutOfBound(i, row, col))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\n\t\t\t\tfor(int j=0; j < prob.moveProbs.length ; j++ )\n\t\t\t\t{\n\n\t\t\t\t\tint nextStateVal=0;\n\n\t\t\t\t\tif( i == UP || i == DOWN)\n\t\t\t\t\t{\n\t\t\t\t\t\tnextStateVal = fetchNextStateRowOrColumn(j+1, i, row);\n\t\t\t\t\t\tnewSampleVal += prob.moveProbs[j] * utilities[nextStateVal][col];\n\n\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tnextStateVal = fetchNextStateRowOrColumn(j+1, i, col);\n\t\t\t\t\t\tnewSampleVal += prob.moveProbs[j] * utilities[row][nextStateVal];\n\n\t\t\t\t\t}\n\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(newSampleVal > maxActionVal)\n\t\t\t\t{\n\t\t\t\t\tmaxActionVal = newSampleVal;\n\t\t\t\t\tchosenAction = i;\n\t\t\t\t}\n\t\t\t}\n\t\t\tutilities[row][col] = rewards[row][col] + DISCOUNT_FACTOR * maxActionVal;\n\t\t\tif(prob.map.get(row).get(col).equals(\"G\") || prob.map.get(row).get(col).equals(\"P\"))\n\t\t\t{\n\t\t\t\tpol.bestActions[row][col] = prob.map.get(row).get(col);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tpol.bestActions[row][col] = DIRECTION[chosenAction];\n\t\t\t}\n\t\t}", "public void run(int runIndex, String fullPath) throws ClassNotFoundException, IOException, JMException {\n long seed = (long) 100;//can be randomly seeded.\n RandomGenerator RG = new RandomGenerator(seed);\n\n MetricsUtilPlus utils_ = new MetricsUtilPlus();\n Properties config = new Properties();\n\n String configFile = \"HF_Config_Benchmark/RealProblemSetting.txt\";\n String algorithms[] = {\"NSGAII\", \"SPEA2\", \"IBEA\", \"mIBEA\", \"GDE3\"};\n\n try {\n config.load(new FileInputStream(configFile));\n } catch (IOException e) {\n e.printStackTrace();\n System.err.println(\"Failed to load configuration file!\");\n System.exit(-1);\n }\n\n int totalEval = Integer.parseInt(config.getProperty(\"MaxEvaluations\"));\n int decisionPoints = Integer.parseInt(config.getProperty(\"DecisionPoints\"));//50 iterations\n\n int arcSize = Integer.parseInt(config.getProperty(\"ArchiveSize\"));\n populationSize = Integer.parseInt(config.getProperty(\"PopulationSize\"));\n \n arcSize=100;\n populationSize=100;\n totalEval=250*100;\n totalEval=1000*100;\n \n //arcSize=30;\n //populationSize=30;\n //totalEval=30*50;\n\n //int populationSize = popSize;\n int fixedSolutionEvl = (int) (totalEval / decisionPoints);\n \n System.out.println(\"CF; decision=\"+decisionPoints+\";fixed=\"+fixedSolutionEvl+\";total=\"+totalEval);\n\n MetricsUtil util = new MetricsUtil();\n\n int maxEvals = Integer.parseInt(config.getProperty(\"MaxEvaluations\"));\n\n String SolutionType = config.getProperty(\"SolutionType\");\n int popSize = Integer.parseInt(config.getProperty(\"PopulationSize\"));\n \n popSize=100;\n //popSize=30;\n\n Problem[] problemInstances = new Problem[problemCreator.getQtdProblem()];\n int[] numberOfVar = new int[problemCreator.getQtdProblem()];\n double[] mutationProb = new double[problemCreator.getQtdProblem()];\n Operator[] mutations = new Operator[problemCreator.getQtdProblem()];\n\n //reference point for hypervolume calculation\n /*HyperVolumeMinimizationProblem hyp = new HyperVolumeMinimizationProblem();*/\n /*double[] truePFhypervolume = new double[problemCreator.getQtdProblem()];*/\n for (int problemIndex = 0; problemIndex < problemCreator.getQtdProblem(); problemIndex++) {\n\n problemInstances[problemIndex] = problemCreator.getProblemInstance(problemIndex);\n numberOfVar[problemIndex] = problemInstances[problemIndex].getNumberOfVariables();\n mutationProb[problemIndex] = (Double) 1.0 / numberOfVar[problemIndex];\n HashMap parameters = new HashMap();\n parameters.put(\"probability\", mutationProb[problemIndex]);\n double mutationDistributionIndex = Double.parseDouble(config.getProperty(\"MutationDistributionIndex\"));\n parameters.put(\"distributionIndex\", mutationDistributionIndex);\n String mutationType = config.getProperty(\"MutationType\");\n mutations[problemIndex] = new PolynomialMutation(mutationProb[problemIndex], mutationDistributionIndex);\n }\n\n LLHInterface[] algorithm = new LLHInterface[problemCreator.getQtdProblem()];\n\n System.out.println(\"Run \" + runIndex + \"....\");\n\n choiceFunction CF = new choiceFunction();\n\n for (int instanceIndex = 6; instanceIndex < problemInstances.length; instanceIndex++) {\n numberOfObj=problemInstances[instanceIndex].getNumberOfObjectives();\n reference = new double[numberOfObj];\n Arrays.fill(reference,1.0);\n minimumValues = new double[numberOfObj];\n maximumValues = new double[numberOfObj];\n\n for (int i = 0; i < numberOfObj; i++) {\n reference[i] = 1.0;\n }\n\n int remainEval = totalEval;\n List<S> inputPop = null;\n ArrayList<Integer> heuristicList = new ArrayList<Integer>();\n\n int chosenHeuristic = -1;\n\n QualityIndicators quality = new QualityIndicators();\n double[][] algorithmEffortArray = new double[algorithms.length][2];\n double[][] ROIArray = new double[algorithms.length][2];\n double[][] hyperVolumeArray = new double[algorithms.length][2];\n double[][] uniformDistributionArray = new double[algorithms.length][2];\n\n // for the purpose of computing hypervolume.\n initialiseExtremeValues();\n\n long[] elapsedTime = new long[algorithms.length];\n long[] lastInvokeTime = new long[algorithms.length];\n long[] executionTimeArray = new long[algorithms.length];\n for (int i = 0; i < algorithms.length; i++) {\n elapsedTime[i] = 0;\n }\n\n //initialise population for each instance which is used for each algorithm\n List<S> initialPopulation = ProblemCreator.generateInitialPopulation(problemInstances[instanceIndex], popSize);\n \n List[] resultSolutions = new List[algorithms.length];\n List[] inputSolutions = new List[algorithms.length];\n\n for (int i = 0; i < algorithms.length; i++) {\n inputSolutions[i] = new ArrayList(popSize);\n // at the beginning, all inputsolutions are set as the initialPopulation\n inputSolutions[i] = initialPopulation;\n resultSolutions[i] = new ArrayList(popSize);\n }\n LLHInterface eachAlgorithm = null;\n AlgorithmCreator ac = new AlgorithmCreator(problemInstances[instanceIndex]);\n System.out.println(problemInstances[instanceIndex].getName() + \" \" + problemInstances[instanceIndex].getNumberOfObjectives() + \" \" + problemInstances[instanceIndex].getNumberOfVariables());\n ac.setMaxEvaluationsAndPopulation(totalEval, populationSize);\n //Initialise the choice function matrix and get the initial algorithm\n for (int algorithmIndex = 0; algorithmIndex < algorithms.length; algorithmIndex++) {\n //initialise last invoke time (the start time of calling this algorithm) of each algorithm;\n heuristicList.add(algorithmIndex);\n lastInvokeTime[algorithmIndex] = System.currentTimeMillis();\n\n eachAlgorithm=ac.create(algorithmIndex, remainEval);\n\n long startTime = System.currentTimeMillis();\n\n try {\n resultSolutions[algorithmIndex] = eachAlgorithm.execute(/*initialPopulation*/inputSolutions[algorithmIndex], fixedSolutionEvl);\n } catch (Exception e) {\n e.printStackTrace();\n }\n //record the execution time of each algorithm\n long executionTime = System.currentTimeMillis() - startTime;\n executionTimeArray[algorithmIndex] = executionTime;\n\n remainEval -= fixedSolutionEvl;\n\n //iteration += 2;\n inputSolutions[algorithmIndex] = resultSolutions[algorithmIndex];\n //After executed the algorithm, compute the elapsed time. The end time of called this algorithm\n\n }// end algorithmIndex, executing each algorithm for initialisation the choice function matrix\n\n //update elapsed time of since the heuristic was last called.\n for (int i = 0; i < algorithms.length; i++) {\n elapsedTime[i] = System.currentTimeMillis() - lastInvokeTime[i];\n }\n\n // find worst points and best points for all the three populations\n for (int i = 0; i < algorithms.length; i++) {\n updateExtremeValues(resultSolutions[i]);\n }\n\n for (int i = 0; i < algorithms.length; i++) {\n algorithmEffortArray[i][0] = i;\n algorithmEffortArray[i][1] = quality.getAlgorithmEffort(executionTimeArray[i], fixedSolutionEvl);\n\n ROIArray[i][0] = i;\n ROIArray[i][1] = quality.getRatioOfNonDominatedIndividuals(resultSolutions[i]);\n\n hyperVolumeArray[i][0] = i;\n\n hyperVolumeArray[i][1] = computeScaledHypervolume(resultSolutions[i]);\n //hyperVolumeArray[i][1] = quality.getHyperVolume(resultSolutions[i],realReference);\n\n uniformDistributionArray[i][0] = i;\n uniformDistributionArray[i][1] = quality.getUniformDistribution(resultSolutions[i]);\n\n }\n\n int numberOfMeasures = 4;\n int alpha = 30;//alpha =100;//if turbine number is 30\n\n chosenHeuristic = CF.getMaxChoiceFunction(algorithmEffortArray, 0, ROIArray, 1, hyperVolumeArray, 1,\n uniformDistributionArray, 1, numberOfMeasures, alpha, elapsedTime);\n //start time of the chosen heuristic\n lastInvokeTime[chosenHeuristic] = System.currentTimeMillis();\n\n //the result population of the chosen heuristic is served as the input population\n inputPop = resultSolutions[chosenHeuristic];\n\n while (remainEval > 0) {\n algorithm[instanceIndex]=ac.create(chosenHeuristic, remainEval);\n\n long beginTime = System.currentTimeMillis();\n //execute the chosen algorithm\n heuristicList.add(chosenHeuristic);\n if (fixedSolutionEvl > remainEval) {\n fixedSolutionEvl = remainEval;\n }\n //warranty size. necessary for small pop\n Random rsn=new SecureRandom();\n while(inputPop.size() < populationSize){\n inputPop.add(inputPop.get(rsn.nextInt(inputPop.size())));\n }\n resultSolutions[chosenHeuristic] = algorithm[instanceIndex].execute(inputPop, fixedSolutionEvl);\n inputPop = resultSolutions[chosenHeuristic];\n \n remainEval -= fixedSolutionEvl;\n\n // update executionTimeArray\n executionTimeArray[chosenHeuristic] = System.currentTimeMillis() - beginTime;\n //update elapsed time of since the heuristic was last called.\n for (int i = 0; i < algorithms.length; i++) {\n elapsedTime[i] = System.currentTimeMillis() - lastInvokeTime[i];\n }\n\n algorithmEffortArray[chosenHeuristic][1] = quality.getAlgorithmEffort(executionTimeArray[chosenHeuristic], fixedSolutionEvl);\n\n ROIArray[chosenHeuristic][1] = quality.getRatioOfNonDominatedIndividuals(resultSolutions[chosenHeuristic]);\n\n updateExtremeValues(resultSolutions[chosenHeuristic]);\n hyperVolumeArray[chosenHeuristic][1] = computeScaledHypervolume(resultSolutions[chosenHeuristic]);\n //hyperVolumeArray[chosenHeuristic][1] = quality.getHyperVolume(resultSolutions[chosenHeuristic],realReference);\n\n uniformDistributionArray[chosenHeuristic][1] = quality.getUniformDistribution(resultSolutions[chosenHeuristic]);\n\n chosenHeuristic = CF.getMaxChoiceFunction(algorithmEffortArray, 0, ROIArray, 1, hyperVolumeArray, 1,\n uniformDistributionArray, 1, numberOfMeasures, alpha, elapsedTime);\n //start time of the chosen heuristic\n lastInvokeTime[chosenHeuristic] = System.currentTimeMillis();\n\n //heuristicList.add(chosenHeuristic);\t\t\n }//end while(remainEvl >0)\n \n String arrayListPath = fullPath+\"/\"+problemCreator.getProblemClass() + (instanceIndex + 1) + \"_ChosenHeuristic.txt\";\n utils_.printArrayListInteger(heuristicList, arrayListPath);\n List<S> obtainedSolutionSet = SolutionListUtils.getNondominatedSolutions(inputPop);\n new SolutionListOutput(obtainedSolutionSet)\n .setSeparator(\"\\t\")\n .setFunFileOutputContext(new DefaultFileOutputContext(fullPath+\"/\"+problemCreator.getProblemClass() + (instanceIndex + 1) + \"CF_FinalParetoFront\"\n + runIndex + \".txt\"))\n .print();\n //print out true front's hypervolume\n\n }//end each problem instance\n\n System.out.println(\"Finished\");\n\n }", "public SolutionSet execute() throws JMException, ClassNotFoundException {\n int maxEvaluations ;\n int evaluations ;\n\n SolutionSet population ;\n SolutionSet offspringPopulation ;\n\n Solution betterIndividual ;\n\n Operator mutationOperator ;\n Comparator comparator ;\n Operator localSearchOperator ;\n\n\n comparator = new ObjectiveComparator(0) ; // Single objective comparator\n\n // Read the params\n maxEvaluations = ((Integer)this.getInputParameter(\"maxEvaluations\")).intValue();\n\n // Initialize the variables\n population = new SolutionSet(mu_) ;\n offspringPopulation = new SolutionSet(lambda_) ;\n\n evaluations = 0;\n\n // Read the operators\n mutationOperator = this.operators_.get(\"mutation\");\n localSearchOperator = (LocalSearch) operators_.get(\"improvement\");\n\n System.out.println(\"(\" + mu_ + \" + \" + lambda_+\")ES\") ;\n\n // Create 1-parent population of mu solutions\n Solution newIndividual;\n newIndividual = new Solution(problem_);\n problem_.evaluate(newIndividual);\n evaluations++;\n betterIndividual = new Solution(newIndividual);\n population.add(betterIndividual);\n\n // Main loop\n while (evaluations < maxEvaluations) {\n // STEP 1. Generate the offspring\n Solution offspring = new Solution(population.get(0)) ;\n mutationOperator.execute(offspring);\n /*Solution mutated_solution = (Solution) mutationOperator.execute(offspring);\n if(offspring.getObjective(0) < mutated_solution.getObjective(0))\n offspring = mutated_solution;*/\n problem_.evaluate(offspring);\n Solution local_offspring = (Solution) localSearchOperator.execute(offspring);\n offspring.setObjective(0, local_offspring.getObjective(0));\n offspringPopulation.add(offspring);\n evaluations++;\n\n if(comparator.compare(betterIndividual, offspringPopulation.get(0)) > 0) {\n betterIndividual = new Solution(offspringPopulation.get(0));\n population.clear();\n // STEP 4. Create the new mu population\n population.add(betterIndividual);\n }\n\n System.out.println(population.get(0).getObjective(0)) ;\n\n // STEP 6. Delete the offspring population\n offspringPopulation.clear() ;\n } // while\n\n // Return a population with the best individual\n SolutionSet resultPopulation = new SolutionSet(1) ;\n resultPopulation.add(population.get(0)) ;\n\n return resultPopulation ;\n }", "public double evaluate(){\n trialsSoFar++;\n double tot = 0;\n int ix = 0;\n while (ix < genome.getGenome().size()) {\n // directly access the current value field of each bandit\n boolean block = true;\n for (int j=0; j<blockSize; j++) {\n if (genome.getGenome().get(ix).getX() != 1)\n block = false;\n ix++;\n }\n if (block) {\n tot += blockSize;\n }\n }\n return tot;\n }", "public SolutionSet execute() throws JMetalException, ClassNotFoundException, IOException {\n initialization();\n createInitialSwarm() ;\n evaluateSwarm();\n initializeLeaders() ;\n initializeParticlesMemory() ;\n updateLeadersDensityEstimator() ;\n\n while (!stoppingCondition()) {\n computeSpeed(iterations_, maxIterations_);\n computeNewPositions();\n perturbation();\n evaluateSwarm();\n updateLeaders() ;\n updateParticleMemory() ;\n updateLeadersDensityEstimator() ;\n iterations_++ ;\n }\n\n tearDown() ;\n return paretoFrontApproximation() ;\n }", "public static void main(String[] args) {\n ExecuteParams executeParams1 = new ExecuteParams();\n ExecuteParams executeParams2 = new ExecuteParams();\n ExecuteParams executeParams30 = new ExecuteParams();\n ExecuteParams executeParams31 = new ExecuteParams();\n ExecuteParams executeParams32 = new ExecuteParams();\n ExecuteParams executeParams33 = new ExecuteParams();\n ExecuteParams executeParams34 = new ExecuteParams();\n ExecuteParams executeParams41 = new ExecuteParams();\n\n //*** PARAMS\n executeParams1.DeviationPredictor_CosineMetric();\n executeParams2.DeviationPredictor_PearsonMetric();\n executeParams30.DeviationPredictor_PearsonSignifianceWeightMetric(1);\n executeParams31.DeviationPredictor_PearsonSignifianceWeightMetric(5);\n executeParams32.DeviationPredictor_PearsonSignifianceWeightMetric(50);\n executeParams33.DeviationPredictor_PearsonSignifianceWeightMetric(100);\n executeParams34.DeviationPredictor_PearsonSignifianceWeightMetric(200);\n executeParams41.DeviationPredictor_JaccardMetric();\n //***\n\n computeOne(executeParams1);\n computeOne(executeParams2);\n computeOne(executeParams30,\"N = 1\");\n computeOne(executeParams31,\"N = 5\");\n computeOne(executeParams32,\"N = 50\");\n computeOne(executeParams33,\"N = 100\");\n computeOne(executeParams34,\"N = 200\");\n computeOne(executeParams41);\n }", "@Override\n\tpublic double calculate(int currentIteration, int maxIterations) {\n\t\treturn value;\n\t}", "public void solveSA() {\r\n initState();\r\n for (int ab = 0; ab < Config.NumberOfMetropolisResets; ab++) {\r\n LogTool.print(\"==================== INACTIVE: START CALC FOR OUTER ROUND \" + ab + \"=========================\",\"notification\");\r\n\r\n if (Config.SAverboselvl>1) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\");\r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n }\r\n setCur_cost(costCURsuperfinal()); //One of four possible costNEX variants\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"CUR COST SUPER FINAL \",\"notification\");\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n /* [Newstate] with random dwelltimes */\r\n New_state = newstater(); \r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"NEW STATE \",\"notification\");\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n// newstater();\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"SolveSA: New State before Metropolis: A)\" + New_state[0] + \" B) \" + New_state[1] + \" C) \" + New_state[2],\"notification\");\r\n }\r\n \r\n setNew_cost(costNEXsuperfinal()); //One of four possible costNEX variants\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"NEW COST SUPER FINAL \",\"notification\");\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"SolveSA: New Cost : \" + New_cost,\"notification\");\r\n }\r\n\r\n /**\r\n * MetropolisLoop\r\n * @param Config.NumberOfMetropolisRounds\r\n */\r\n\r\n for(int x=0;x<Config.NumberOfMetropolisRounds;x++) { \r\n LogTool.print(\"SolveSA Iteration \" + x + \" Curcost \" + Cur_cost + \" Newcost \" + New_cost,\"notification\");\r\n if ((Cur_cost - New_cost)>0) { // ? die Kosten\r\n \r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 1 START\",\"notification\");\r\n }\r\n \r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: (Fall 1) Metropolis NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1) Metropolis CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA Cost delta \" + (Cur_cost - New_cost) + \" \",\"notification\");\r\n //</editor-fold>\r\n }\r\n Cur_state = New_state;\r\n Cur_cost = New_cost;\r\n if (Config.SAverboselvl>1) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: (Fall 1 nach set) Metropolis NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1 nach set) Metropolis CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1 nach set): NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1 nach set): CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n New_state = newstater();\r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C1 after generate: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C1 after generate: CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C1 after generate: NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA C1 after generate: CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 1 STOP \",\"notification\");\r\n }\r\n } else if (Math.exp(-(New_cost - Cur_cost)/temperature)> RandGenerator.randDouble(0.01, 0.99)) {\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 2 START: Zufallsgenerierter Zustand traegt hoehere Kosten als vorhergehender Zustand. Iteration: \" + x,\"notification\");\r\n }\r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C2 before set: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 before set: CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 before set: NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA C2 before set: CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n Cur_state = New_state;\r\n Cur_cost = New_cost;\r\n \r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C2 after set: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after set: CurCost : \" + this.getCur_cost(),\"notification\");\r\n //</editor-fold>\r\n }\r\n New_state = newstater();\r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C2 after generate: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after generate: CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after generate: NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after generate: CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 2 STOP: Zufallsgenerierter Zustand traegt hoehere Kosten als vorhergehender Zustand. Iteration: \" + x,\"notification\");\r\n }\r\n } else {\r\n New_state = newstater();\r\n }\r\n temperature = temperature-1;\r\n if (temperature==0) {\r\n break;\r\n }\r\n \r\n setNew_cost(costNEXsuperfinal());\r\n LogTool.print(\"NEW COST SUPER FINAL \",\"notification\");\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n//</editor-fold>\r\n if ((x==58)&(ab==0)) {\r\n LogTool.print(\"Last internal Iteration Checkpoint\",\"notification\");\r\n if ((Cur_cost - New_cost)>0) {\r\n Cur_state = New_state;\r\n Cur_cost = New_cost; \r\n }\r\n }\r\n if ((x>58)&(ab==0)) {\r\n LogTool.print(\"Last internal Iteration Checkpoint\",\"notification\");\r\n }\r\n }\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"Auskommentierter GLowestState Object Class\">\r\n// if (ab==9) {\r\n// double diff=0;\r\n// }\r\n \r\n // Hier wird kontrolliert, ob das minimalergebnis des aktuellen\r\n // Metropolisloops kleiner ist als das bsiher kleinste\r\n \r\n// if (Cur_cost<Global_lowest_cost) {\r\n// this.setGlobal_lowest_cost(Cur_cost);\r\n// GlobalState GLowestState = new GlobalState(this.Cur_state);\r\n// String rGLSOvalue = GLowestState.getGlobal_Lowest_state_string();\r\n// LogTool.print(\"GLS DEDICATED OBJECT STATE OUTPUT -- \" + GLowestState.getGlobal_Lowest_state_string(),\"notification\");\r\n// this.setGlobal_Lowest_state(GLowestState.getDwelltimes());\r\n // LogTool.print(\"READ FROM OBJECT OUTPUT -- \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n// LogTool.print(\"DEBUG: CurCost direct : \" + this.getCur_cost(),\"notification\"); \r\n// LogTool.print(\"Debug: Cur<global CurState get : \" + this.getCur_state_string(),\"notification\");\r\n// LogTool.print(\"Debug: Cur<global GLS get : \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n// this.setGlobal_Lowest_state(this.getCur_state(Cur_state));\r\n// LogTool.print(\"Debug: Cur<global GLS get after set : \" + this.getGlobal_Lowest_state_string(),\"notification\"); \r\n// }\r\n //</editor-fold>\r\n LogTool.print(\"SolveSA: Outer Iteration : \" + ab,\"notification\");\r\n LogTool.print(\"SolveSA: Last Calculated New State/Possible state inner loop (i.e. 99) : \" + this.getNew_state_string(),\"notification\");\r\n// LogTool.print(\"SolveSA: Best Solution : \" + this.getCur_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA: GLS after all loops: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA: LastNewCost, unchecked : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: CurCost : \" + this.getCur_cost() + \"i.e. lowest State of this round\",\"notification\"); \r\n }\r\n // return GLowestState;\r\n }", "public void run() {\n\n long startTime = System.nanoTime();\n\n /*\"*********************************\n * Getting data from the algorithm *\n ***********************************/\n\n // Posterior values, get them from memory instead of propagating again. Since this method is called write,\n // it should only write.\n HashMap<Variable, TablePotential> results = algorithm.getLastPosteriorValues();\n\n // Samples\n double[][] sampleStorage;\n try {\n sampleStorage = algorithm.getSamples();\n if (sampleStorage.length == 0) { // Case of empty database\n throw new NullPointerException();\n }\n\n } catch (NullPointerException e) { // Case of empty database and no database\n logger.error(\"No samples found to write\");\n LocalizedException NoDatabaseException =\n new LocalizedException(new OpenMarkovException(\"Exception.NoDatabase\"), this.dialog);\n NoDatabaseException.showException();\n return;\n }\n\n // Variables\n List<Variable> sampledVariables = algorithm.getVariablesToSample();\n\n // The maximum number of states defines the number of columns of the second sheet in Excel.\n int maxNStates = 0;\n for (Variable variable : sampledVariables) {\n if (variable.getNumStates() > maxNStates) {\n maxNStates = variable.getNumStates();\n }\n }\n\n // Evidence variables\n EvidenceCase evidence = algorithm.getFusedEvidence();\n List<Variable> evidenceVariables = evidence.getVariables();\n\n // Time measuring for this phase\n long elapsedMS = (System.nanoTime() - startTime) / 1000000;\n logger.info(\"Data obtained from the algorithm: \" + Long.toString(elapsedMS) + \" ms elapsed\");\n System.out.println(\"Data obtained from the algorithm: \" + Long.toString(elapsedMS) + \" ms elapsed\");\n\n /*\"***********************\n * Creating the workbook *\n *************************/\n\n SXSSFWorkbook workbook = new SXSSFWorkbook(1000);\n\n /* Styles */\n\n // Styles to convey graphically the weight\n\n // Weight = 0\n XSSFCellStyle incompatibleSample = (XSSFCellStyle) workbook.createCellStyle();\n incompatibleSample.setFillForegroundColor(new XSSFColor(INCOMPATIBLE_SAMPLE));\n incompatibleSample.setFillPattern(FillPatternType.SOLID_FOREGROUND);\n\n // Weight = 1\n XSSFCellStyle compatibleSample = (XSSFCellStyle) workbook.createCellStyle();\n compatibleSample.setFillForegroundColor(new XSSFColor(COMPATIBLE_SAMPLE));\n compatibleSample.setFillPattern(FillPatternType.SOLID_FOREGROUND);\n\n\n /// Font with big emphasis for the next styles\n XSSFFont bigBoldArial = (XSSFFont) workbook.createFont();\n bigBoldArial.setFontName(\"Arial\");\n bigBoldArial.setFontHeightInPoints((short) 11);\n bigBoldArial.setBold(true);\n\n // Header of table\n XSSFCellStyle topTable = (XSSFCellStyle) workbook.createCellStyle();\n\n topTable.setFillForegroundColor(new XSSFColor(HEADER_COLOR));\n topTable.setFillPattern(FillPatternType.SOLID_FOREGROUND);\n topTable.setAlignment(HorizontalAlignment.LEFT);\n topTable.setFont(bigBoldArial);\n\n // Header of table centered\n XSSFCellStyle centeredTopTable = (XSSFCellStyle) workbook.createCellStyle();\n\n centeredTopTable.setFillForegroundColor(new XSSFColor(HEADER_COLOR_2));\n centeredTopTable.setFillPattern(FillPatternType.SOLID_FOREGROUND);\n centeredTopTable.setAlignment(HorizontalAlignment.CENTER);\n centeredTopTable.setFont(bigBoldArial);\n\n\n /// Font with some emphasis\n XSSFFont bigArial = (XSSFFont) workbook.createFont();\n bigArial.setFontName(\"Arial\");\n bigArial.setFontHeightInPoints((short) 10);\n bigArial.setBold(true);\n\n // Chance node\n XSSFCellStyle chanceNode = (XSSFCellStyle) workbook.createCellStyle();\n\n chanceNode.setFillForegroundColor(new XSSFColor(CHANCE_NODE_COLOR));\n chanceNode.setFillPattern(FillPatternType.SOLID_FOREGROUND);\n chanceNode.setFont(bigArial);\n\n // Algorithm name\n XSSFCellStyle subTopTable = (XSSFCellStyle) workbook.createCellStyle();\n\n subTopTable.setFont(bigArial);\n\n\n /// Font with some emphasis and white for contrast\n XSSFFont bigWhiteArial = (XSSFFont) workbook.createFont();\n bigWhiteArial.setFontName(\"Arial\");\n bigWhiteArial.setFontHeightInPoints((short) 11);\n bigWhiteArial.setColor(new XSSFColor(new Color(255, 255, 255)));\n\n // Node with finding\n XSSFCellStyle findingNode = (XSSFCellStyle) workbook.createCellStyle();\n\n findingNode.setFillForegroundColor(new XSSFColor(FINDING_NODE_COLOR));\n findingNode.setFillPattern(FillPatternType.SOLID_FOREGROUND);\n findingNode.setFont(bigWhiteArial);\n\n\n\n // No more than four decimal places\n XSSFCellStyle smartDecimals = (XSSFCellStyle) workbook.createCellStyle();\n smartDecimals.setDataFormat(workbook.createDataFormat().getFormat(\"0.0000\"));\n\n // No more than two decimal places\n XSSFCellStyle smartFewDecimals = (XSSFCellStyle) workbook.createCellStyle();\n smartFewDecimals.setDataFormat(workbook.createDataFormat().getFormat(\"0.##\"));\n\n // Time measuring for this phase\n elapsedMS = (System.nanoTime() - startTime)/1000000;\n logger.info(\"Workbook styles created: \" + Long.toString(elapsedMS) + \" ms elapsed\");\n System.out.println(\"Workbook styles created: \" + Long.toString(elapsedMS) + \" ms elapsed\");\n\n /*\"******************\n * Sheet of samples *\n ********************/\n SXSSFSheet samples = workbook.createSheet(dialog.stringDatabase.getString(\"SheetNames.Samples\"));\n\n /* Title row */\n Row titlesRow = samples.createRow(0);\n titlesRow.createCell(0).setCellValue(dialog.stringDatabase.getString(\"ColumnTitles.SampleN\"));\n for (int colNum = 1; colNum < sampledVariables.size() + 1; colNum++) { // Names of variables\n titlesRow.createCell(colNum).setCellValue(sampledVariables.get(colNum - 1).toString());\n }\n titlesRow.createCell(sampledVariables.size() + 1).setCellValue(dialog.stringDatabase.\n getString(\"ColumnTitles.Weight\"));\n\n // Apply header style\n for (int colNum = 0; colNum < sampledVariables.size() + 2; colNum++) {\n titlesRow.getCell(colNum).setCellStyle(topTable);\n }\n\n // Auto-size columns of first sheet\n for (int colNum = 0; colNum < sampledVariables.size() + 2; colNum++) {\n samples.trackAllColumnsForAutoSizing();\n samples.autoSizeColumn(colNum);\n }\n\n elapsedMS = (System.nanoTime() - startTime)/1000000;\n logger.info(\"Header of samples sheet: \" + Long.toString(elapsedMS) + \" ms elapsed\");\n System.out.println(\"Header of samples sheet: \" + Long.toString(elapsedMS) + \" ms elapsed\");\n\n /* Sample's rows */\n int rowNum;\n\n // Sample's loop\n for (rowNum = 1; rowNum < algorithm.getSampleSize() + 1; rowNum++) {\n\n Row sampleRow = samples.createRow(rowNum);\n sampleRow.createCell(0).setCellValue(rowNum);\n double weight = sampleStorage[rowNum - 1][sampledVariables.size()];\n for (int colNum = 1; colNum < sampledVariables.size() + 2; colNum++) { // Sampled states\n sampleRow.createCell(colNum).setCellValue(sampleStorage[rowNum - 1][colNum - 1]);\n if (weight == 0) {\n sampleRow.getCell(colNum).setCellStyle(incompatibleSample);\n } else {\n sampleRow.getCell(colNum).setCellStyle(compatibleSample);\n }\n }\n }\n\n\n\n elapsedMS = (System.nanoTime() - startTime)/1000000;\n logger.info(\"Sample rows created: \" + Long.toString(elapsedMS) + \" ms elapsed\");\n System.out.println(\"Sample rows created: \" + Long.toString(elapsedMS) + \" ms elapsed\");\n\n /*\"************************\n * Sheet of general stats *\n **************************/\n\n SXSSFSheet generalStats = workbook.createSheet(dialog.stringDatabase.getString(\"SheetNames.GeneralStats\"));\n\n /* Rows of algorithm data */\n\n rowNum = 0;\n generalStats.createRow(rowNum).createCell(0).setCellValue(dialog.stringDatabase.\n getString(\"RowTitles.Algorithm\"));\n generalStats.getRow(rowNum).getCell(0).setCellStyle(topTable);\n generalStats.addMergedRegion(new CellRangeAddress(rowNum, rowNum, 1, maxNStates));\n generalStats.getRow(rowNum).createCell(1).setCellValue(dialog.algorithmName);\n generalStats.getRow(rowNum).getCell(1).setCellStyle(subTopTable);\n\n rowNum++; // Row 1\n generalStats.createRow(rowNum).createCell(0).setCellValue(dialog.stringDatabase.\n getString(\"RowTitles.TotalSamples\"));\n generalStats.getRow(rowNum).getCell(0).setCellStyle(topTable);\n generalStats.addMergedRegion(new CellRangeAddress(rowNum, rowNum, 1, maxNStates));\n generalStats.getRow(rowNum).createCell(1).setCellValue(algorithm.getSampleSize());\n\n rowNum++; // Row 2\n generalStats.createRow(rowNum).createCell(0).setCellValue(dialog.stringDatabase.\n getString(\"RowTitles.RuntimePerSample\"));\n generalStats.getRow(rowNum).getCell(0).setCellStyle(topTable);\n generalStats.addMergedRegion(new CellRangeAddress(rowNum, rowNum, 1, maxNStates));\n generalStats.getRow(rowNum).createCell(1).\n setCellValue(algorithm.getAlgorithmExecutionTime()/algorithm.getSampleSize());\n generalStats.getRow(rowNum).getCell(1).setCellStyle(smartDecimals);\n\n rowNum++; // Row 3\n generalStats.createRow(rowNum).createCell(0).setCellValue(dialog.stringDatabase.\n getString(\"RowTitles.Runtime\"));\n generalStats.getRow(rowNum).getCell(0).setCellStyle(topTable);\n generalStats.addMergedRegion(new CellRangeAddress(rowNum, rowNum, 1, maxNStates));\n generalStats.getRow(rowNum).createCell(1).\n setCellValue(algorithm.getAlgorithmExecutionTime());\n generalStats.getRow(rowNum).getCell(1).setCellStyle(smartFewDecimals);\n\n rowNum++; // Row 4\n generalStats.createRow(rowNum).createCell(0).setCellValue(dialog.stringDatabase.\n getString(\"RowTitles.ValidSamples\"));\n generalStats.getRow(rowNum).getCell(0).setCellStyle(topTable);\n generalStats.addMergedRegion(new CellRangeAddress(rowNum, rowNum, 1, maxNStates));\n generalStats.getRow(rowNum).createCell(1).setCellValue(algorithm.getNumPositiveSamples());\n\n rowNum++; // Row 5\n generalStats.createRow(rowNum).createCell(0).setCellValue(dialog.stringDatabase.\n getString(\"RowTitles.AccumulatedWeight\"));\n generalStats.getRow(rowNum).getCell(0).setCellStyle(topTable);\n generalStats.addMergedRegion(new CellRangeAddress(rowNum, rowNum, 1, maxNStates));\n generalStats.getRow(rowNum).createCell(1).setCellValue(algorithm.getAccumulatedWeight());\n generalStats.getRow(rowNum).getCell(1).setCellStyle(smartFewDecimals);\n\n rowNum++; // Row 6\n generalStats.createRow(rowNum).createCell(0).setCellValue(dialog.stringDatabase.\n getString(\"RowTitles.ExactAlgorithmName\"));\n generalStats.getRow(rowNum).getCell(0).setCellStyle(topTable);\n generalStats.addMergedRegion(new CellRangeAddress(rowNum, rowNum, 1, maxNStates));\n generalStats.getRow(rowNum).createCell(1).setCellValue(dialog.stringDatabase.getString(\"Algorithms.Hugin\"));\n\n // Empty row\n\n rowNum +=2; // rows written until now\n\n /* Row of titles */\n titlesRow = generalStats.createRow(rowNum);\n titlesRow.createCell(0).setCellValue(dialog.stringDatabase.getString(\"ColumnTitles.Variable\"));\n\n // Big long cell for state names\n generalStats.addMergedRegion(new CellRangeAddress(rowNum, rowNum, 1, maxNStates));\n titlesRow.createCell(1).setCellValue(dialog.stringDatabase.getString(\"ColumnTitles.States\"));\n\n // Set header style\n for (int colNum = 0; colNum < 2; colNum++) {\n titlesRow.getCell(colNum).setCellStyle(centeredTopTable);\n }\n\n // Empty row for clarity\n if (evidenceVariables.size() > 0) {\n rowNum++ ;\n }\n\n // Write about evidence variables that have not been sampled\n for (Variable evidenceVariable : evidenceVariables) {\n if (!sampledVariables.contains(evidenceVariable)) {\n\n /* Row of names */\n Row namesRow = generalStats.createRow(rowNum);\n // Write the name of the variable\n Cell variableName = namesRow.createCell(0);\n variableName.setCellValue(evidenceVariable.toString());\n variableName.setCellStyle(findingNode); // The color marks it as a finding\n\n // and then the names of their states\n for (int colNum = 1; colNum < evidenceVariable.getNumStates() + 1; colNum++) {\n Cell stateName = namesRow.createCell(colNum);\n stateName.setCellValue(evidenceVariable.getStateName(colNum - 1));\n stateName.setCellStyle(findingNode);\n }\n\n /* Row of occurrences */\n // Write \"non-sampled\"\n Row occurrencesRow = generalStats.createRow(rowNum + 1);\n Cell nSamples = occurrencesRow.createCell(0);\n nSamples.setCellValue(dialog.stringDatabase.getString(\"RowTitles.Ocurrences\"));\n\n for (int colNum = 1; colNum < evidenceVariable.getNumStates() + 1; colNum++) {\n occurrencesRow.createCell(colNum)\n .setCellValue(dialog.stringDatabase.getString(\"NonSampled\"));\n }\n\n /* Row of finding */\n // Write the finding\n Row approxProbsRow = generalStats.createRow(rowNum + 2);\n Cell approximateProbs = approxProbsRow.createCell(0);\n approximateProbs.setCellValue(dialog.stringDatabase.getString(\"RowTitles.Finding\"));\n\n for (int colNum = 1; colNum < evidenceVariable.getNumStates() + 1; colNum++) {\n int value = 0;\n if (evidence.getState(evidenceVariable) == colNum - 1) {\n value = 1;\n }\n approxProbsRow.createCell(colNum).setCellValue(value);\n }\n\n // Empty row\n Row emptyRow = generalStats.createRow(rowNum + 4);\n emptyRow.setHeight((short) 120);\n\n rowNum += 4; // Go to the next variable (each variable uses 4 rows)\n }\n }\n\n rowNum++; // Empty row for clarity.\n\n // Write sampled variables\n for (int variablePosition = 0; variablePosition < sampledVariables.size(); variablePosition++) {\n\n Variable variableToWrite = sampledVariables.get(variablePosition);\n\n /* Row of names */\n Row namesRow = generalStats.createRow(rowNum);\n // Write the name of the variable\n Cell variableName = namesRow.createCell(0);\n variableName.setCellValue(sampledVariables.get(variablePosition).toString());\n\n // and then the names of its states\n for (int colNum = 1; colNum < variableToWrite.getNumStates() + 1; colNum++) {\n Cell stateName = namesRow.createCell(colNum);\n stateName.setCellValue(variableToWrite.getStateName(colNum - 1));\n }\n\n // In logical sampling, evidence variables are samples. If so, mark them as findings.\n if (evidenceVariables.contains(variableToWrite)) {\n for (int colNum = 0; colNum < variableToWrite.getNumStates() + 1; colNum++) {\n namesRow.getCell(colNum).setCellStyle(findingNode);\n }\n } else {\n for (int colNum = 0; colNum < variableToWrite.getNumStates() + 1; colNum++) {\n namesRow.getCell(colNum).setCellStyle(chanceNode);\n }\n }\n\n /* Row of occurrences */\n Row occurrencesRows = generalStats.createRow(rowNum + 1);\n // Write the title of the row\n Cell nSamples = occurrencesRows.createCell(0);\n nSamples.setCellValue(dialog.stringDatabase.getString(\"RowTitles.Ocurrences\"));\n // Write how many times each state has been sampled\n for (int colNum = 1; colNum < variableToWrite.getNumStates() + 1; colNum++) {\n occurrencesRows.createCell(colNum)\n .setCellValue(getStateOccurrences(sampleStorage, variablePosition,colNum - 1));\n }\n\n /* Row of approximate probabilities */\n Row approxProbsRow = generalStats.createRow(rowNum + 2);\n // Write the title of the row\n Cell approximateProbs = approxProbsRow.createCell(0);\n approximateProbs.setCellValue(dialog.stringDatabase.getString(\"RowTitles.ApproximateProbability\"));\n // Write the sampled probability\n for (int colNum = 1; colNum < variableToWrite.getNumStates() + 1; colNum++) {\n if (evidenceVariables.contains(variableToWrite)) {\n // Logic Sampling: in case of a sampled evidence variable, probability = 1 for the finding.\n int value = 0;\n if (evidence.getState(variableToWrite) == colNum - 1) {\n value = 1;\n }\n approxProbsRow.createCell(colNum).setCellValue(value);\n\n } else {\n approxProbsRow.createCell(colNum)\n .setCellValue(results.get(variableToWrite).getValues()[colNum - 1]);\n }\n approxProbsRow.getCell(colNum).setCellStyle(smartDecimals);\n }\n\n\n /* Row of exact probabilities */\n Row exactProbsRow = generalStats.createRow(rowNum + 3);\n // Write the title of the row\n Cell exactProbs = exactProbsRow.createCell(0);\n exactProbs.setCellValue(dialog.stringDatabase.getString(\"RowTitles.ExactProbability\"));\n // Write how many times each state has been sampled\n for (int colNum = 1; colNum < variableToWrite.getNumStates() + 1; colNum++) {\n exactProbsRow.createCell(colNum)\n .setCellValue(exactPosteriorValues.get(variableToWrite).getValues()[colNum - 1]);\n exactProbsRow.getCell(colNum).setCellStyle(smartDecimals);\n }\n\n // Empty row\n Row emptyRow = generalStats.createRow(rowNum + 4);\n emptyRow.setHeight((short) 120);\n\n rowNum += 5; // Go to the next variable (each variable uses 5 rows)\n\n }\n\n // Auto-size columns of second sheet (variable column + states columns)\n for (int colNum = 0; colNum <= 1 + maxNStates; colNum++) {\n generalStats.trackAllColumnsForAutoSizing();\n generalStats.autoSizeColumn(colNum);\n }\n\n // Time measuring for this phase\n elapsedMS = (System.nanoTime() - startTime)/1000000;\n logger.info(\"General stats added: \" + Long.toString(elapsedMS) + \" ms elapsed\");\n System.out.println(\"General stats added: \" + Long.toString(elapsedMS) + \" ms elapsed\");\n\n /*\"*****************\n * Output the file *\n *******************/\n try {\n FileOutputStream outputStream = new FileOutputStream(fileName);\n workbook.write(outputStream);\n // remember to close\n outputStream.close();\n } catch (IOException e) {\n e.printStackTrace();\n LocalizedException OutputException =\n new LocalizedException(new OpenMarkovException(\"Exception.Output\"), this.dialog);\n OutputException.showException();\n }\n\n // Time measuring for this phase\n elapsedMS = (System.nanoTime() - startTime)/1000000;\n logger.info(\"Writing done: \" + Long.toString(elapsedMS) + \" ms elapsed\");\n System.out.println(\"Writing done: \" + Long.toString(elapsedMS) + \" ms elapsed\");\n\n String conclusion = dialog.stringDatabase.getString(\"Conclusion\") + \"\\n\" + fileName;\n logger.info(conclusion);\n System.out.println(conclusion);\n JOptionPane.showMessageDialog(dialog, conclusion,\n dialog.stringDatabase.getString(\"ConclusionTitle\"), JOptionPane.DEFAULT_OPTION);\n }", "public abstract double evaluate(double value);", "public ModelParams optimize() throws Exception {\n\t\tint iterCount = 0;\n\t\tdivergence = KLDivergenceCalculator.calculate(cState, tState);\n\t\tSystem.out.println(\"KL Divergence : \" + divergence);\n\t\t// ((DivergenceChart) BeanFinder\n\t\t// .findBean(MetaConstants.BEAN_DIVERGENCE_CHART)).update(\n\t\t// iterCount, divergence);\n\t\tdouble delta[] = null;\n\t\tdouble theta[] = data.getParams().getParams();\n\t\tdouble newDivergence = 0.0d;\n\t\tdouble initialStep = data.getInitialStepSize();\n\t\tboolean optimized = false;\n\t\tdo {\n\t\t\tdelta = computeGradient(theta);\n\t\t\tfor (double step = initialStep; iterCount < data.getMaxIterations(); step /= 10) {\n\t\t\t\tSystem.out.println(\"Step size : \" + step);\n\t\t\t\tSystem.out.println(\"KL divergence before taking a step : \"\n\t\t\t\t\t\t+ KLDivergenceCalculator.calculate(cState, tState));\n\t\t\t\tfor (int i = 0; i < delta.length; i++) {\n\t\t\t\t\tif (Double.isNaN(delta[i]))\n\t\t\t\t\t\tSystem.out.print(\"delta is NAN!!\" + delta[i] + \", \");\n\t\t\t\t\ttheta[i] -= step * delta[i];\n\t\t\t\t\tSystem.out.print((theta[i]) + \", \");\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t\tgetNewState(theta);\n\t\t\t\titerCount++;\n\t\t\t\tnewDivergence = KLDivergenceCalculator\n\t\t\t\t\t\t.calculate(cState, tState);\n\t\t\t\tSystem.out.println(\"KL Divergence : \" + newDivergence);\n\t\t\t\t// ((DivergenceChart) BeanFinder\n\t\t\t\t// .findBean(MetaConstants.BEAN_DIVERGENCE_CHART)).update(\n\t\t\t\t// iterCount, newDivergence);\n\t\t\t\tif (newDivergence < divergence) {\n\t\t\t\t\tdivergence = newDivergence;\n\t\t\t\t\tinitialStep = step;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t// before taking the next step size, reset theta to what it was\n\t\t\t\tfor (int i = 0; i < delta.length; i++)\n\t\t\t\t\ttheta[i] += step * delta[i];\n\t\t\t\tgetNewState(theta); // Added for checking. Not required.\n\t\t\t}\n\t\t\toptimized = optimized(theta);\n\t\t} while (!optimized && iterCount < data.getMaxIterations());\n\t\tModelParams optimParams = null;\n\t\tif (optimized) {\n\t\t\toptimParams = new ModelParams();\n\t\t\toptimParams.setParams(theta);\n\t\t}\n\t\treturn optimParams;\n\t}", "protected abstract Value evaluate();", "public abstract double evaluateSolution(Solution solution) throws JMException, SimulationException;", "public Behaviour runObjective() {\n //System.out.println(\"Simulation runObjective(): running method\");\n final int iterations = config.getSimulationIterations();\n return objectiveSimulation(iterations);\n }", "@Override\n public void doEvaluation(ArrayList<Individual> sample, boolean isTrain, GeneticAlgorithm<Individual> GA) {\n for (Individual ind : sample) {\n if (!ind.isEvaluated()) {\n mainEvaluator.doEvaluation(ind, isTrain);\n GA.TrialsPlusPlus();\n ind.setNEval((int) GA.getTrials());\n }\n }\n\n if (isTrain) {\n // Now, apply the decay factor to all individuals in the population\n for (Individual ind : sample) {\n if (!ind.isEmpty()) {\n ArrayDeque<Boolean> aux = appearance.get(ind);\n if (aux != null) {\n Iterator<Boolean> iterator = aux.iterator();\n\n int exponent = -1;\n double decayFactor = 1.0;\n\n // Calculate the decay factor of this individual\n while (iterator.hasNext()) {\n if (!iterator.next()) {\n // The element was present, add to the decay factor\n decayFactor -= Math.pow(2, exponent);\n }\n exponent--;\n }\n\n // Now, get indivual's objectives and apply the dacay factor to all of them\n for (QualityMeasure obj : (ArrayList<QualityMeasure>) ind.getObjs()) {\n if (obj.getValue() >= 0) {\n obj.setValue(obj.getValue() * decayFactor);\n } else {\n // if the value is negative, to make it worst we need to divide\n obj.setValue(obj.getValue() / decayFactor);\n }\n }\n }\n }\n }\n // Once applied the decay factor, update the time structure, adding the new individuals.\n //updateAppearance(sample, GA.getCurrentClass());\n }\n }", "private void learn() {\n\t\tupdateValues();\n\t\tif(CFG.isUpdatedPerformanceHistory()){\n\t\t\tupdateHistory();\n\t\t}\n\t\tif(CFG.isEvaluated()) evaluate();\n\t}", "void evaluate()\n\t{\n\t\toperation.evaluate();\n\t}", "@Override\n public void evaluate(Solution solution) throws JMException {\n\n int[] tour = new int[numberOfNodes + 1];\n int firstCity = ((Permutation) solution.getDecisionVariables()[0]).vector_[0];\n int lastCity = ((Permutation) solution.getDecisionVariables()[0]).vector_[numberOfNodes - 1];\n\n double fitness1_td = 0.0;\n\n // Calculate fitness 1 - total distance\n for (int i = 0; i < numberOfNodes - 1; i++) {\n int x = ((Permutation) solution.getDecisionVariables()[0]).vector_[i];\n int y = ((Permutation) solution.getDecisionVariables()[0]).vector_[i+1];\n\n tour[i] = x;\n tour[i+1] = y;\n\n fitness1_td += calDistances(x, y);\n }\n // generate tour with same start city and end city\n tour[numberOfNodes] = tour[0];\n\n fitness1_td += calDistances(firstCity, lastCity);\n\n\n // Correctness check: does the tour start and end in the same city\n if(tour[0] != tour[tour.length - 1]) {\n System.err.println(\"ERROR: The last city must be the same as the first city\");\n System.exit(1);\n }\n\n /*for (int i = 0; i < tour.length; i++) {\n System.out.print(tour[i] + \" \");\n }*/\n //System.out.println(\"\\n\" + tour.length);\n\n // Calculate fitness 2 - objective value of a given tour\n ArrayInt z = (ArrayInt) solution.getDecisionVariables()[1];\n //System.out.println(z.getLength());\n\n double fitness2_ob;\n double wc = 0.0;\n double ft = 0.0;\n double fp = 0.0;\n\n //the following is used for a different interpretation of \"packingPlan\"\n int itemsPerCity = z.getLength() / (tour.length - 2);\n //System.out.println(itemsPerCity);\n\n for (int i = 0; i < tour.length - 1; i++) {\n\n int currentCityTEMP = tour[i];\n // what's the current city? --> but the items start at city 2 in the TTP file, so I have to take another 1 off!\n int currentCity = currentCityTEMP - 1;\n\n if (i > 0) {\n\n if (currentCity == -1) {\n // No items in city 1\n wc += 0.0;\n fp += 0.0;\n\n } else {\n\n for (int itemNumber = 0; itemNumber < itemsPerCity; itemNumber++) {\n\n int indexOfPackingPlan = (i-1) * itemsPerCity + itemNumber;\n // what is the next item's index in items-array?\n int itemIndex = currentCity + itemNumber * (numberOfNodes - 1);\n //System.out.println(\"i: \" + i);\n\n if (z.getValue(indexOfPackingPlan) == 1) {\n // pack item\n //System.out.println(itemIndex);\n int currentWC = items[itemIndex][2];\n wc += currentWC;\n\n int currentFP = items[itemIndex][1];\n fp += currentFP;\n }\n }\n\n }\n\n int h = (i+1) % (tour.length-1); //h: next tour city index\n //System.out.println(\"h: \" + h);\n long distance = calDistances(i, h);\n // compute the adjusted (effective) distance\n ft += (distance / (1 - wc * (maxSpeed - minSpeed) / capacityOfKnapsack));\n }\n }\n\n wendUsed = wc;\n wend = capacityOfKnapsack - wc;\n fitness2_ob = fp - ft * rentingRatio;\n\n solution.setObjective(0, fitness1_td);\n solution.setObjective(1, -fitness2_ob); // Convert from maximum objective value to minimum objective value\n }", "public void rla() {\r\n\t\tint iter = 0;\r\n\t\t\r\n\t\twhile (true) {\r\n\t\t\titer++;\r\n\t\t\t\r\n\t\t\tHashMap<RouteState, ActionValue<RouteAction>> V0 = new HashMap<RouteState, ActionValue<RouteAction>> (V);\r\n\r\n\t\t\tfor (RouteState state : Q.keySet()) {\r\n\t\t\t\tfor (RouteAction action : Q.get(state).keySet()) {\t\t\t\r\n\t\t\t\t\tdouble value = R.get(state).get(action) + discountedSum(state, action);\r\n\t\t\t\t\tQ.get(state).put(action, value);\r\n\t\t\t\t}\r\n\t\t\t\tRouteAction bestAction = Q.get(state).entrySet().stream().max((entry1, entry2) -> entry1.getValue() > entry2.getValue() ? 1 : -1).get().getKey();\r\n\t\t\t\tDouble bestValue = Q.get(state).get(bestAction);\r\n\t\t\t\tActionValue<RouteAction> av = new ActionValue<RouteAction>(bestAction, bestValue);\r\n\r\n\t\t\t\tV.put(state, av);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (goodEnough(V0, V)) break;\r\n\t\t}\r\n\t\tSystem.out.println(\"Number of iterations: \" + iter);\r\n\t}", "public void iterate()\n\t{\n\t\tfor (int p = 0; p < parasites.length; p++)\n\t\t\tpFitnesses[p][1] = 0;\n\t\t\n\t\ttry\n\t\t{\t// calculate fitnesses against other population\n\t\t\texecutor.invokeAll(tasks);\n\t\t\t// calculate fitness against hall of fame individuals\n\t\t\texecutor.invokeAll(hofTasks);\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tSystem.out.println(\"Something bad happened...\");\n\t\t\tSystem.exit(-1);\n\t\t}\n\t\n\t\tArrays.sort(hFitnesses,new ArrayComparator(1,false));\n\t\tArrays.sort(pFitnesses,new ArrayComparator(1,false));\n\t\t\n\t\tint bestIndex = (int)pFitnesses[0][0];\n\t\tint size = parHOF.length;\n\t\t\n\t\tparHOF[generations%size]=new NeuralPlayer(-1,\"HOF P\",(BasicNetwork)parasites[(int)bestIndex].net.clone());\n\t\tbestIndex = (int)hFitnesses[0][0];\n\t\thostHOF[generations%size]=new NeuralPlayer(1,\"HOF H\",(BasicNetwork)hosts[(int)bestIndex].net.clone());\n\t\t\n\t\tint matePopIndex = (int)(matingPer*popSize)+1;\n\t\tRandom indexG = new Random();\n\t\t// allow top percentage to breed and replace bottom 2*percentage\n\t\t// leave everyone else alone\n\t\tfor (int i = 0; i < popSize*2*matingPer; i++)\n\t\t{\n\t\t\tint pInd1 = indexG.nextInt(matePopIndex);\n\t\t\tint pInd2 = indexG.nextInt(matePopIndex);\n\t\t\tNeuralPlayer p1 = hosts[(int)hFitnesses[pInd1][0]];\n\t\t\tNeuralPlayer p2 = hosts[(int)hFitnesses[pInd2][0]];\n\t\t\tNeuralPlayer child = hosts[(int)hFitnesses[popSize - 1 - i][0]];\n\t\t\tmate(p1, p2,child);\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < popSize*2*matingPer; i++)\n\t\t{\n\t\t\tint pInd1 = indexG.nextInt(matePopIndex);\n\t\t\tint pInd2 = indexG.nextInt(matePopIndex);\n\t\t\tNeuralPlayer p1 = parasites[(int)pFitnesses[pInd1][0]];\n\t\t\tNeuralPlayer p2 = parasites[(int)pFitnesses[pInd2][0]];\n\t\t\tNeuralPlayer child = parasites[(int)pFitnesses[popSize - 1 - i][0]];\n\t\t\tmate(p1, p2,child);\n\t\t}\n\t\t// mutate everyone except top percentage (matingPer)\n\t\tfor (int i = 0; i < popSize*3*matingPer; i++)\n\t\t{\n\t\t\tmutate(parasites[(int)pFitnesses[popSize - 1 - i][0]]);\n\t\t\tmutate(hosts[(int)hFitnesses[popSize - 1 - i][0]]);\n\t\t}\n\t\t\n\t\tgenerations+=1;\n\t\t// every now and then reseed the population with a good individual\n\t\tif (generations%50 == 0)\n\t\t{\n\t\t\thosts[indexG.nextInt(hosts.length)].net = (BasicNetwork)allTimeBestHost.net.clone();\n\t\t\tparasites[indexG.nextInt(parasites.length)].net = (BasicNetwork)allTimeBestPara.net.clone();\n\t\t}\n\t\t\t\n\t}", "protected double eval(S state, P player) {\n if (game.isTerminal(state)) {\n return game.getUtility(state, player);\n } else {\n heuristicEvaluationUsed = true;\n return (utilMin + utilMax) / 2;\n }\n }", "public void run() throws Exception {\r\n long start_time;\r\n // Make sure everything is ready\r\n checkIfReady();\r\n\r\n while (CurrentIteration < MaxIteration) {\r\n System.out.println(\"\\tWorking on iteration \" + (CurrentIteration + 1)\r\n + \" out of \" + MaxIteration);\r\n\r\n // Check to see whether we need to add more candidates\r\n if (Candidates.size() <= CurrentIteration) {\r\n start_time = System.currentTimeMillis();\r\n if (PrintStatus) {\r\n System.out.print(\"\\nGenerating list of new candidates...\");\r\n }\r\n // If needed, train the optimization algorithm\r\n if (ObjectiveFunction instanceof MultiObjectiveEntryRanker) {\r\n MultiObjectiveEntryRanker Ptr = (MultiObjectiveEntryRanker) ObjectiveFunction;\r\n Ptr.train((MultiPropertyDataset) getFullDataset(CurrentIteration));\r\n }\r\n \r\n Dataset new_entries = getNewCandidates();\r\n if (Candidates.size() != currentIteration()) {\r\n throw new Exception(\"Candidates array incorrect size. Ensure getNewCandidates did not edit it.\");\r\n }\r\n Candidates.add(new_entries);\r\n Oracle.importDataset(new_entries);\r\n if (PrintStatus) {\r\n System.out.println(\"Done.\");\r\n UtilityOperations.printRunTime(start_time);\r\n }\r\n }\r\n\r\n // Evaluate all the new candidates using the oracle\r\n start_time = System.currentTimeMillis();\r\n if (PrintStatus) {\r\n System.out.print(\"\\nEvaluating new candidates...\");\r\n }\r\n Oracle.evaluateEntries();\r\n if (PrintStatus) {\r\n System.out.println(\"Done.\");\r\n UtilityOperations.printRunTime(start_time);\r\n }\r\n\r\n // If all entries have been calculated, add them to Candidates and continue\r\n if (Oracle.isComplete()) {\r\n if (PrintStatus) {\r\n System.out.println(\"Oracle has finished calculating.\");\r\n }\r\n Dataset new_entries = Oracle.extractDataset();\r\n Candidates.set(CurrentIteration, new_entries);\r\n CurrentIteration++;\r\n } else {\r\n // If not, return\r\n if (PrintStatus) {\r\n System.out.println(\"Oracle did not finish calculating. Check back later.\");\r\n }\r\n return;\r\n }\r\n }\r\n }", "public void evaluate() {\n int score = sequence.getScore();\n // sequence has already been evaluated\n if (score > 0) {\n sequence.setScore(score);\n return;\n }\n \n int sum = 0;\n for (SingleConstraint c : singleConstraints) {\n sum += c.sumOfPenalties();\n }\n for (PairConstraint c : pairConstraints) {\n sum += c.sumOfPenalties();\n }\n sequence.setScore(sum);\n int bestSequenceScore = bestSequence.getScore();\n if (bestSequenceScore < 0 || sum < bestSequenceScore) {\n bestSequence = sequence;\n System.out.format(\"New best sequence: %s (Score: %d)\\n\", sequence,\n sequence.getScore());\n }\n }", "private static void runAll() throws InterruptedException {\r\n\t\tSystem.out.println(RankEvaluator.printTitle() + \"\\tAvgP\\tTrain Time\\tTest Time\");\r\n\t\t\r\n\t\t// Prefetching user/item similarity:\r\n\t\tif (userSimilarityPrefetch) {\r\n\t\t\tuserSimilarity = calculateUserSimilarity(MATRIX_FACTORIZATION, ARC_COS, 0);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tuserSimilarity = new SparseMatrix(userCount+1, userCount+1);\r\n\t\t}\r\n\t\t\r\n\t\tif (itemSimilarityPrefetch) {\r\n\t\t\titemSimilarity = calculateItemSimilarity(MATRIX_FACTORIZATION, ARC_COS, 0);\r\n\t\t}\r\n\t\telse {\r\n\t\t\titemSimilarity = new SparseMatrix(itemCount+1, itemCount+1);\r\n\t\t}\r\n\t\t\r\n\t\t// Regularized SVD\r\n\t\tint[] svdRank = {1, 5, 10};\r\n\t\t\r\n\t\tfor (int r : svdRank) {\r\n\t\t\tdouble learningRate = 0.005;\r\n\t\t\tdouble regularizer = 0.1;\r\n\t\t\tint maxIter = 100;\r\n\t\t\t\r\n\t\t\tbaseline = new RegularizedSVD(userCount, itemCount, maxValue, minValue,\r\n\t\t\t\tr, learningRate, regularizer, 0, maxIter, false);\r\n\t\t\tSystem.out.println(\"SVD\\tFro\\t\" + r + \"\\t\" + testRecommender(\"SVD\", baseline));\r\n\t\t}\r\n\t\t\r\n\t\t// Rank-based SVD\r\n\t\tint[] rsvdRank = {1, 5, 10};\r\n\t\tfor (int r : rsvdRank) {\r\n\t\t\trunRankBasedSVD(RankEvaluator.LOGISTIC_LOSS, r, 6000, true);\r\n\t\t\trunRankBasedSVD(RankEvaluator.LOG_LOSS_MULT, r, 1700, true);\r\n\t\t\trunRankBasedSVD(RankEvaluator.LOG_LOSS_ADD, r, 1700, true);\r\n\t\t\trunRankBasedSVD(RankEvaluator.EXP_LOSS_MULT, r, 370, true);\r\n\t\t\trunRankBasedSVD(RankEvaluator.EXP_LOSS_ADD, r, 25, true);\r\n\t\t\trunRankBasedSVD(RankEvaluator.HINGE_LOSS_MULT, r, 1700, true);\r\n\t\t\trunRankBasedSVD(RankEvaluator.HINGE_LOSS_ADD, r, 1700, true);\r\n\t\t\trunRankBasedSVD(RankEvaluator.EXP_REGRESSION, r, 40, true);\r\n\t\t}\r\n\t\t\r\n\t\t// Paired Global LLORMA\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOG_LOSS_MULT, 5, 1, 1500, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOG_LOSS_MULT, 5, 5, 1000, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOG_LOSS_MULT, 5, 10, 500, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOG_LOSS_MULT, 10, 1, 3000, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOG_LOSS_MULT, 10, 5, 2000, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOG_LOSS_MULT, 10, 10, 1000, true);\r\n\t\t\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOG_LOSS_ADD, 5, 1, 1200, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOG_LOSS_ADD, 5, 5, 1200, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOG_LOSS_ADD, 5, 10, 900, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOG_LOSS_ADD, 10, 1, 3000, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOG_LOSS_ADD, 10, 5, 3000, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOG_LOSS_ADD, 10, 10, 2000, true);\r\n\t\t\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_LOSS_MULT, 5, 1, 450, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_LOSS_MULT, 5, 5, 250, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_LOSS_MULT, 5, 10, 110, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_LOSS_MULT, 10, 1, 1000, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_LOSS_MULT, 10, 5, 400, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_LOSS_MULT, 10, 10, 200, true);\r\n\t\t\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_LOSS_ADD, 5, 1, 20, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_LOSS_ADD, 5, 5, 13, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_LOSS_ADD, 5, 10, 7, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_LOSS_ADD, 10, 1, 40, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_LOSS_ADD, 10, 5, 25, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_LOSS_ADD, 10, 10, 15, true);\r\n\t\t\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.HINGE_LOSS_MULT, 5, 1, 1000, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.HINGE_LOSS_MULT, 5, 5, 500, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.HINGE_LOSS_MULT, 5, 10, 300, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.HINGE_LOSS_MULT, 10, 1, 2000, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.HINGE_LOSS_MULT, 10, 5, 1000, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.HINGE_LOSS_MULT, 10, 10, 500, true);\r\n\t\t\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.HINGE_LOSS_ADD, 5, 1, 1200, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.HINGE_LOSS_ADD, 5, 5, 1200, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.HINGE_LOSS_ADD, 5, 10, 500, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.HINGE_LOSS_ADD, 10, 1, 2500, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.HINGE_LOSS_ADD, 10, 5, 2500, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.HINGE_LOSS_ADD, 10, 10, 1000, true);\r\n\t\t\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_REGRESSION, 5, 1, 60, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_REGRESSION, 5, 5, 40, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_REGRESSION, 5, 10, 20, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_REGRESSION, 10, 1, 120, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_REGRESSION, 10, 5, 80, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_REGRESSION, 10, 10, 40, true);\r\n\t\t\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOGISTIC_LOSS, 5, 1, 4500, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOGISTIC_LOSS, 5, 5, 3500, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOGISTIC_LOSS, 5, 10, 2500, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOGISTIC_LOSS, 10, 1, 9000, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOGISTIC_LOSS, 10, 5, 7000, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOGISTIC_LOSS, 10, 10, 5000, true);\r\n\t}", "@Override\r\n\tpublic int computeNextVal(boolean prediction, Instance inst) {\n\t\treturn 0;\r\n\t}", "public void fetchUtilityValue(Problem prob, int row, int col, Policy pol)\n\t\t{\n\t\t\tdouble maxActionVal = Double.MIN_VALUE;\n\t\t\tint chosenAction = -1;\n\t\t\tint chosenRow = -1;\n\t\t\tint chosenCol = -1;\n\t\t\t\n\t\t\twhile(true)\t\n\t\t\t{\n\t\t\t\t\n\t\t\t\tif(prob.map.get(row).get(col).equals(\"P\"))\n\t\t\t\t{\n\n\t\t\t\t\t\n\t\t\t\t\tfor(int i=0 ; i< ACTION_COUNT; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tutilities[i][row][col] = PIT_REWARD;\n\t\t\t\t\t}\n\t\t\t\t\tpol.bestActions[row][col] = PIT;\n\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse if(prob.map.get(row).get(col).equals(\"G\"))\n\t\t\t\t{\n\t\t\t\t\tfor(int i=0 ; i< ACTION_COUNT; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t\tutilities[i][row][col] = GOLD_REWARD;\n\t\t\t\t\t}\n\t\t\t\t\tpol.bestActions[row][col] = GOLD;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(rng.nextDouble() < EXPLORE_PROB)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tchosenAction = rng.nextInt( ACTION_COUNT);\n\t\t\t\t\twhile(isOutOfBound(chosenAction, row, col))\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\tchosenAction = rng.nextInt(4);\n\t\t\t\t\t}\n\t\t\t\t\tint displacement = fetchDisplacementValue(prob);\n\t\t\t\t\tif(chosenAction == UP || chosenAction == DOWN)\n\t\t\t\t\t\tchosenRow = fetchNextStateRowOrColumn( displacement, chosenAction, row);\n\t\t\t\t\telse\n\t\t\t\t\t\tchosenCol = fetchNextStateRowOrColumn( displacement, chosenAction, col);\n\t\t\t\t\tmaxActionVal = calculateQValue(prob, chosenAction, row, col, chosenRow, chosenCol);\n\t\t\t\t\tutilities[chosenAction][row][col] = maxActionVal;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tdouble maxUtility = Integer.MIN_VALUE;\n\t\t\t\t\tfor(int i=0; i < ACTION_COUNT; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(isOutOfBound(i, row, col))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(maxUtility < utilities[i][row][col])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmaxUtility = utilities[i][row][col];\n\t\t\t\t\t\t\tchosenAction = i;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\n\t\t\t\t\tint displacement = fetchDisplacementValue(prob);\n\n\t\t\t\t\tif(chosenAction == UP || chosenAction == DOWN)\n\t\t\t\t\t\tchosenRow = fetchNextStateRowOrColumn( displacement, chosenAction, row);\n\t\t\t\t\telse\n\t\t\t\t\t\tchosenCol = fetchNextStateRowOrColumn( displacement, chosenAction, col);\n\t\t\t\t\tmaxActionVal = calculateQValue(prob, chosenAction, row, col, chosenRow, chosenCol);\n\n\t\t\t\t\tutilities[chosenAction][row][col] = maxActionVal;\n\n\t\t\t\t}\n\t\t\t\tif(chosenAction == UP || chosenAction == DOWN) \n\t\t\t\t\trow = chosenRow;\n\t\t\t\telse\n\t\t\t\t\tcol = chosenCol;\n\n\n\t\t\t}\n\n\n\t\t}", "public static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n//\t\tPrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));\n\n\t\tStringTokenizer st = new StringTokenizer(br.readLine());\n\t\tint N= Integer.parseInt(st.nextToken());\n\t\tint T= Integer.parseInt(st.nextToken());\n\t\t\n\t\t//for each N, three possible problem sets (P, A, G)\n\t\t//and P (prep time: min), V (value)\n\t\t//P <= A <= G\n\t\t\n\t\t//given limit T\n\t\t//find max profit\n\t\tint[][] v = new int[N+1][3+1];\n\t\tint[][] w = new int[N+1][3+1];\n\t\t\n\t\t//one \n\t\t\n\t\tfor (int i = 1; i <= N; i++) {\n\t\t\tst = new StringTokenizer(br.readLine());\n\t\t\tfor (int j = 1; j <= 3; j++) {\n\t\t\t\tw[i][j] = Integer.parseInt(st.nextToken());\n\t\t\t\tv[i][j] = Integer.parseInt(st.nextToken());\n\t\t\t}\n\t\t}\n//\t\tfor (int i = 1; i <= N; i++) {\n//\t\t\tfor (int j = 1; j <= 3; j++) {\n//\t\t\t\tSystem.out.println(w[i][j] + \" \"+ v[i][j]);\n//\t\t\t}\n//\t\t}\n\t\tint[][] dp = new int[2][T+1];\n\t\t//where k looks at the kth row of the values/weight array\n\t\tfor (int k = 1; k <= N; k++) {\n\t\t\tfor (int x = 0; x <= T; x++) {\n\t\t\t\t//going through each weight and value\n\t\t\t\tboolean ran = false;\n\t\t\t\tfor (int a = 1; a <= 3; a++) {\t\t\t\t\t\n\t\t\t\t\tif (w[k][a] > x) {\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tran = true;\n\t\t\t\t\t\tdp[1][x] = Math.max(Math.max(dp[0][x],dp[0][x-w[k][a]] + v[k][a]),dp[1][x]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!ran) {\n\t\t\t\t\tdp[1][x] = dp[0][x];\n\t\t\t\t}\n\t\t\t}\n\t\t\tdp[0] = dp[1].clone();\n//\t\t\tfor (int[] row: dp) {\n//\t\t\t\tfor (int m: row) {\n//\t\t\t\t\tSystem.out.print(m + \" \");\n//\t\t\t\t}\n//\t\t\t\tSystem.out.println();\n//\t\t\t}\n\t\t}\n\t\t\n//\t\tfor (int[] row: dp) {\n//\t\t\tfor (int m: row) {\n//\t\t\t\tSystem.out.print(m + \" \");\n//\t\t\t}\n//\t\t\tSystem.out.println();\n//\t\t}\n\t\tSystem.out.println(dp[1][T]);\n\t}", "@Override\n public void postRound() {\n super.postRound();\n Integer res = 0;\n if(this.algorithm_choosed!=-1){\n switch(this.algorithm_choosed) {\n case 1:\n if((res=this.checkingIfAllNodesHasFinished())!=-1 && !this.first_Algorithm){\n this.first_Algorithm = true;\n Tools.appendToOutput(\"Algorithm1 converge in '\" + Tools.getGlobalTime() + \"'Steps'\\n\");\n Tools.appendToOutput(\"Algorithm1 find this size of max matching \"+res+\"\\n\");\n }\n break;\n case 2:\n if ((res=this.checkingIfAllNodesHasFinished())!=-1 && !this.second_Algorithm) {\n this.second_Algorithm = true;\n Tools.appendToOutput(\"Algorithm2 converge in '\" + Tools.getGlobalTime() + \"'Steps'\\n\");\n Tools.appendToOutput(\"Algorithm2 find this size of max matching \"+res+\"\\n\");\n }\n break;\n case 3:\n if ((res=this.checkingIfAllNodesHasFinished())!=-1 && !this.third_Algorithm) {\n this.third_Algorithm = true;\n Tools.appendToOutput(\"Algorithm3 converge in '\" + Tools.getGlobalTime() + \"'Steps'\\n\");\n Tools.appendToOutput(\"Algorithm3 find this size of max matching \"+res+\"\\n\");\n this.tempFourth = res;\n }\n break;\n case 4:\n if(!this.fourth_algorithm && (res=this.checkingIfAllNodesHasFinished())!=-1) {\n Integer c = 0;\n this.fourth_algorithm = true;\n Tools.appendToOutput(\"Maximal converge in '\" + Tools.getGlobalTime() + \"'Steps'\\n\");\n Tools.appendToOutput(\"Maximal matching size is = \"+res+\"\\n\");\n //log.logln(\"Try to find the optimum!!!\");\n for (Iterator<Node> it = Tools.getNodeList().iterator(); it.hasNext();) {\n MS4Node node = (MS4Node) it.next();\n if(node.isMarried()){\n c+=1;\n }\n node.setFindTheOptimum();\n node.end_flag = false;\n }\n this.printTheMarriages();\n //log.logln(\"Total number of nodes married = \"+c);\n this.tempFourth = res;\n }\n if(this.fourth_algorithm && (res=this.checkingIfAllNodesHasFinished())!=-1 && !this.approximazion_alg){\n Tools.appendToOutput(\"RES ---->\"+res+\"\\n\");\n for(Iterator<Node> it = Tools.getNodeList().iterator();it.hasNext();){\n MS4Node node = (MS4Node)it.next();\n if(node.isSecondMatchDone()){\n //Tools.appendToOutput(\"**NODE with a success in MATCH SECOND ==\"+node.ID+\" \\n\");\n node.setColorToEdgeAndNodes(Color.BLACK, Tools.getNodeByID(node.pointingNode));\n Tools.getNodeByID(node.pointingNode).setColor(node.defaultColor);\n node.setColorToEdgeAndNodes(Color.MAGENTA, Tools.getNodeByID(node.getP_v()));\n ((MS4Node)Tools.getNodeByID(node.getP_v())).isMarried = true;\n MS4Node married = (MS4Node)Tools.getNodeByID(node.getPointingNode());\n married.setColorToEdgeAndNodes(Color.MAGENTA,Tools.getNodeByID(married.getP_v()));\n ((MS4Node)Tools.getNodeByID(married.getP_v())).isMarried = true;\n }\n }\n Integer newRes = checkingIfAllNodesHasFinished();\n Tools.appendToOutput(\"Approx algorithm converge in '\" + Tools.getGlobalTime() + \"'Steps'\\n\");\n Tools.appendToOutput(\"New Maximal matching size is = \"+newRes+\" so improved by \"+(newRes-tempFourth)+\"\\n\");\n //log.logln(\"--------------------APPROX RESULT-----------------------------\");\n Integer count = 0;\n for(Iterator<Node> it = Tools.getNodeList().iterator();it.hasNext();){\n MS4Node node = (MS4Node)it.next();\n if(node.isMarried()) {\n count++;\n }\n }\n this.printTheMarriages();\n //log.logln(\"----------------NUMBER OF MARRIED : \"+count+\"-----------------------------\");\n this.approximazion_alg = true;\n break;\n }\n case 5:\n if ((res=this.checkingIfAllNodesHasFinished())!=-1 && !this.fifth_algorithm) {\n this.fifth_algorithm = true;\n Tools.appendToOutput(\"Algorithm3_probabilistic converge in '\" + Tools.getGlobalTime() + \"'Steps'\\n\");\n Tools.appendToOutput(\"Algorithm3_probabilistic find this size of max matching \" + res + \"\\n\");\n }\n\n }\n }\n }", "@Override\n\tpublic double valuta_figli() {\n\t\treturn simple_fitness();\n\t}", "@Override\r\n\tpublic void run() {\n\t\tString sumType = \"min\";\r\n\r\n\t\tdo {\r\n\t\t\t// Hard-coded example.\r\n\t\t\tdouble[][] array = createArray();\r\n\r\n\t\t\tif (array.length > array[0].length) {\r\n\t\t\t\tSystem.out\r\n\t\t\t\t\t\t.println(\"Array transposed (because rows>columns).\\n\");\r\n\t\t\t\tarray = transpose(array);\r\n\t\t\t}\r\n\r\n\t\t\t// <COMMENT> TO AVOID PRINTING THE MATRIX FOR WHICH THE ASSIGNMENT\r\n\t\t\t// IS CALCULATED\r\n\t\t\tSystem.out.println(\"\\n(Printing out only 2 decimals)\\n\");\r\n\t\t\tSystem.out.println(\"The matrix is:\");\r\n\t\t\tfor (int i = 0; i < array.length; i++) {\r\n\t\t\t\tfor (int j = 0; j < array[i].length; j++) {\r\n\t\t\t\t\tSystem.out.printf(\"%.2f\\t\", array[i][j]);\r\n\t\t\t\t}\r\n\t\t\t\tSystem.out.println();\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t\t// </COMMENT>*/\r\n\r\n\t\t\tint[][] assignment = new int[array.length][2];\r\n\t\t\tassignment = hgAlgorithm(array, sumType); // Call Hungarian\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// algorithm.\r\n\r\n\t\t\tSystem.out.println(\"The winning assignment (\" + sumType\r\n\t\t\t\t\t+ \" sum) is:\\n\");\r\n\t\t\tdouble sum = 0;\r\n\t\t\tArrayList<Task> toRemove = new ArrayList<Task>();\r\n\t\t\t\r\n\t\t\tfor (int i = 0; i < this.devs.size(); i++) {\r\n\r\n\t\t\t\tArrayList<Task> at = this.result.get(this.devs.get(i));\r\n\t\t\t\tat.add(this.tasks.get(assignment[i][1]));\r\n\t\t\t\ttoRemove.add(this.tasks.get(assignment[i][1]));\r\n\r\n\t\t\t\t// <COMMENT> to avoid printing the elements that make up the\r\n\t\t\t\t// assignment\r\n\t\t\t\tSystem.out.printf(\"array(%d,%d) = %.2f\\n\",\r\n\t\t\t\t\t\t(assignment[i][0] + 1), (assignment[i][1] + 1),\r\n\t\t\t\t\t\tarray[assignment[i][0]][assignment[i][1]]);\r\n\t\t\t\tsum = sum + array[assignment[i][0]][assignment[i][1]];\r\n\t\t\t\t// </COMMENT>\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.tasks.removeAll(toRemove);\r\n\t\t\t\r\n\t\t\tSystem.out.printf(\"\\nThe %s is: %.2f\\n\", sumType, sum);\r\n\t\t} while (this.tasks.size() > 0);\r\n\t}", "@Test(timeout = 60000)\n public void testVariableAndConstantBoundedIteration() throws Exception {\n JobGraph jobGraph = createVariableAndConstantJobGraph(4, 1000, false, 0, false, 1, result);\n miniCluster.executeJobBlocking(jobGraph);\n\n assertEquals(8001, result.get().size());\n\n // Expected records is round * parallelism * numRecordsPerSource\n Map<Integer, Tuple2<Integer, Integer>> roundsStat =\n computeRoundStat(result.get(), OutputRecord.Event.PROCESS_ELEMENT, 2 * 4 * 1000);\n verifyResult(roundsStat, 2, 4000, 4 * (0 + 999) * 1000 / 2);\n assertEquals(OutputRecord.Event.TERMINATED, result.get().take().getEvent());\n }", "public boolean execute() {\n\t\t\n\t\tfor (int i = 0; i <Network.size(); i++) {\n\t\t\t\n\t\t\tMyNode n = (MyNode)Network.get(i);\n\t\t\t//MyNode n1 = (MyNode) n;\t\t\n \n System.out.println(\"The frobenius_norm at node\"+\"(\"+i+\"):\"+n.frobenius_norm);\n\t\t\tretVal=retVal &&(n.frobenius_norm<=threshold);\n\t\t\tSystem.out.println(retVal);\n }\n if(retVal)\n {\n \t System.out.println(\"ALgorithm Converged...###########################!\");\n \t return myNewSVMCode.end;\n }\n else\t\n {\n\t\treturn false;\n }\n }", "@Override\r\n public void computeDensityEstimator() {\r\n // Compute scalarization values\r\n this.scalWrapper.execute(solutions());\r\n scaleToPositive();\r\n\r\n // Distance matrix\r\n double[][] distanceMatrix;\r\n if (normalizeObjectives) {\r\n FrontNormalizer normalizer = new FrontNormalizer(solutions());\r\n distanceMatrix = SolutionListUtils.distanceMatrix(normalizer.normalize(solutions()));\r\n } else\r\n distanceMatrix = SolutionListUtils.distanceMatrix(solutions());\r\n\r\n // Set fitness based on replacement strategy\r\n double[] energyVector = energyVector(distanceMatrix);\r\n double[] replacementVector = replacementVector(distanceMatrix);\r\n // Flag for memorizing whether solution can improve archive\r\n boolean eligible = false;\r\n for (int i = 0; i < replacementVector.length; i++) {\r\n // New solution is better than incumbent\r\n if (replacementVector[i] < energyVector[i]) {\r\n eligible = true;\r\n switch (replacementStrategy) {\r\n case BEST_FEASIBLE_POSITION:\r\n // Energy decrease is maximal if replacement energy is\r\n // minimized. This is why the the negated entry in\r\n // replacementVector is the corresponding fitness.\r\n fitness.setAttribute(archive.get(i), -replacementVector[i]);\r\n break;\r\n case LARGEST_DIFFERENCE:\r\n fitness.setAttribute(archive.get(i), energyVector[i]);\r\n break;\r\n case WORST_IN_ARCHIVE:\r\n fitness.setAttribute(archive.get(i), energyVector[i] - replacementVector[i]);\r\n break;\r\n }\r\n } else {\r\n // If archive member is not eligible for replacement, make sure\r\n // it is retained in any case.\r\n archive.get(i).attributes().put(fitness.getAttributeIdentifier(), -Double.MAX_VALUE);\r\n }\r\n if (eligible) {\r\n // New solution is always retained\r\n fitness.setAttribute(archive.get(maxSize), -Double.MAX_VALUE);\r\n } else {\r\n // New solution is rejected in any case\r\n fitness.setAttribute(archive.get(maxSize), Double.MAX_VALUE);\r\n }\r\n }\r\n }", "public void runGenerational() {\n\n\t\tSystem.out.println(\"Runing pure generational demo.\");\n\t\tFunction<BitSet, Double> knapsackFitnessFunction = new KnapsackFitness(capacity, parseElements());\n\t\tSpace<BitSet> space = new BitSetSpace(weights.length);\n\n\t\tGeneticSelector<BitSet, Double> rouletteSelector = new RouletteGeneticSelector<>(POP_SIZE);\n\t\tGeneticCrossover<BitSet, Double> crossover = new BinaryCrossover<>(0.9);\n\t\tGeneticOperator<BitSet, Double> geneticOperator = new CustomGeneticOperator<>(crossover);\n\t\tGeneticReplacement<BitSet, Double> replacement = new GenerationalReplacement<>();\n\t\tTracer.add(Population.class);\n\t\tTracer.start();\n\n\t\tSearch<BitSet, Double> search = new GeneticAlgorithm<>(POP_SIZE, NUM_ITER, rouletteSelector, geneticOperator,\n\t\t\t\treplacement);\n\t\tOptimizationProblem<BitSet, Double> problem = new OptimizationProblem<>(space, knapsackFitnessFunction,\n\t\t\t\tComparator.reverseOrder());\n\t\tSolution<BitSet, Double> foundSolution = search.solve(problem);\n\n\t\tSystem.out.println(String.format(\"Best found solution: %f, bitset: %s\",\n\t\t\t\tknapsackFitnessFunction.calculate(foundSolution.getSolution()), foundSolution.getSolution()));\n\n\t\tBitSet optimalBitSet = parseOptimalBitSet();\n\t\tSystem.out.println(String.format(\"Optimal solution: %f, bitset: %s\",\n\t\t\t\tknapsackFitnessFunction.calculate(optimalBitSet), optimalBitSet));\n\t\tKnapsackMetric metric = new KnapsackMetric();\n\t\tmetric.putDataOfBestInFile(1);\n\t}", "public void estimateParameter(){\r\n int endTime=o.length;\r\n int N=hmm.stateCount;\r\n double p[][][]=new double[endTime][N][N];\r\n for (int t=0;t<endTime;++t){\r\n double count=EPS;\r\n for (int i=0;i<N;++i){\r\n for (int j=0;j<N;++j){\r\n p[t][i][j]=fbManipulator.alpha[t][i]*hmm.a[i][j]*hmm.b[i][j][o[t]]*fbManipulator.beta[t+1][j];\r\n count +=p[t][j][j];\r\n }\r\n }\r\n for (int i=0;i<N;++i){\r\n for (int j=0;j<N;++j){\r\n p[t][i][j]/=count;\r\n }\r\n }\r\n }\r\n double pSumThroughTime[][]=new double[N][N];\r\n for (int i=0;i<N;++i){\r\n for (int j=0;j<N;++j){\r\n pSumThroughTime[i][j]=EPS;\r\n }\r\n }\r\n for (int t=0;t<endTime;++t){\r\n for (int i=0;i<N;++i){\r\n for (int j=0;j<N;++j){\r\n pSumThroughTime[i][j]+=p[t][i][j];\r\n }\r\n }\r\n }\r\n\r\n //rebuild gamma\r\n for (int t=0;t<endTime;++t){\r\n for (int i=0;i<N;++i) fbManipulator.gamma[t][i]=0;\r\n for (int i=0;i<N;++i){\r\n for (int j=0;j<N;++j){\r\n fbManipulator.gamma[t][i]+=p[t][i][j];\r\n }\r\n }\r\n }\r\n\r\n double gammaCount=EPS;\r\n //maximum parameter\r\n for (int i=0;i<N;++i){\r\n gammaCount+=fbManipulator.gamma[0][i];\r\n hmm.pi[i]=fbManipulator.gamma[0][i];\r\n }\r\n for (int i=0;i<N;++i){\r\n hmm.pi[i]/=gammaCount;\r\n }\r\n\r\n for (int i=0;i<N;++i) {\r\n gammaCount = EPS;\r\n for (int t = 0; t < endTime; ++t) gammaCount += fbManipulator.gamma[t][i];\r\n for (int j = 0; j < N; ++j) {\r\n hmm.a[i][j] = pSumThroughTime[i][j] / gammaCount;\r\n }\r\n }\r\n for (int i=0;i<N;i++){\r\n for (int j=0;j<N;++j){\r\n double tmp[]=new double[hmm.observationCount];\r\n for (int t=0;t<endTime;++t){\r\n tmp[o[t]]+=p[t][i][j];\r\n }\r\n for (int k=0;k<hmm.observationCount;++k){\r\n hmm.b[i][j][k]=(tmp[k]+1e-8)/pSumThroughTime[i][j];\r\n }\r\n }\r\n }\r\n //rebuild fbManipulator\r\n fbManipulator=new HMMForwardBackwardManipulator(hmm,o);\r\n }", "public void iterate(double zk) {\n\t\t\tprediction();\n\t\t\tcorrection(zk);\n\t}", "@Override\r\n protected Comparable<?> _update(IAlgorithmContext state, IDataElement[] measurementList) throws AlgorithmExecutionException {\n \tdouble avValue = 0.0;\r\n \tint inputs = measurementList.length; \r\n \tboolean rightInputs = true;\r\n \tString type = (String)state.getContextParameter(\"type\"); //Retrieve algorithm's type\r\n \t\r\n \t//Check values that come inside the formatter\r\n \tfor(int i=0; i<measurementList.length ; i++) {\r\n \t\tif(measurementList[i] == null || measurementList[i].getValue() == null) {\r\n \t\t\trightInputs = false; //If one input is empty\r\n \t\t\t\r\n \t\t\tif(type.equalsIgnoreCase(\"hard\"))\r\n \t\t\t\tbreak;\r\n \t\t}\r\n \t}\r\n \t\r\n \tif(type.equalsIgnoreCase(\"hard\")) { //All input streams must give a value\r\n \t\tif(!rightInputs) {\r\n \t\t\t//throw new AlgorithmExecutionException(getType() +\" algorithm in \"+type+\" mode--> All input streams must be present and valid\");\r\n \t\t\tSystem.out.println(\"[AV] WARNING: Algorithm in \"+type+\" mode--> All input streams must be present and not \\\"null\\\"\");\r\n \t\t\treturn null;\r\n \t\t}\r\n \t\t//Input streams must be more than 1 in \"hard\" mode of MultiMean algorithm\r\n \tif(inputs < 2) {\r\n \t\t//throw new AlgorithmExecutionException(\"Algorithm \"+getType()+\" must have 2 or more input streams in \"+type+\" mode\");\t\r\n \t\tSystem.out.println(\"[AV] WARNING: Algorithm must have 2 or more input streams in \"+type+\" mode\");\r\n \t\t\treturn null;\r\n \t}\r\n \t\r\n \t//If all input streams have a value, check if they are all numbers\r\n \t\tfor (IDataElement d : measurementList) {\r\n\t\t\t\tComparable<?> value=d.getValue();\r\n\r\n\t\t\t\tif (value instanceof Number) {\r\n\t\t\t\t\tavValue = avValue + (Double)value;\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\t//throw new AlgorithmExecutionException(getType() +\" algorithm in \"+type+\" mode--> Invalid data value detected(\"+value+\"). Value must be Double\");\r\n\t\t\t\t\tSystem.out.println(\"[AV] WARNING: Algorithm in \"+type+\" mode--> Invalid data value detected(\"+value+\"). Value must be Double\");\r\n\t \t\t\treturn null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n \t} else { //Take into consideration only the available (not null) input streams as long as they are more than 0\r\n \t\tif(inputs == 0) { //If there is no input in current condition\r\n \t\t\t//throw new AlgorithmExecutionException(getType() +\" algorithm in \"+type+\" mode--> We must have at least 1 input stream\");\r\n \t\t\tSystem.out.println(\"[AV] WARNING: Algorithm in \"+type+\" mode--> At least 1 input stream must have a not \\\"null\\\" value\");\r\n \t\t\treturn null;\r\n \t\t}\r\n \t\t\r\n \t\t//If some input streams have a value, check if they are all numbers\r\n \t\tfor (IDataElement d : measurementList) {\r\n\t\t\t\t\r\n \t\t\tif(d!=null && d.getValue()!=null) { //Do not take into account \"null\" input streams\r\n \t\t\t\tComparable<?> value=d.getValue();\r\n\r\n \t\t\t\tif (value instanceof Number) {\r\n \t\t\t\t\tavValue = avValue + (Double)value;\t\t\r\n \t\t\t\t} else {\r\n \t\t\t\t\t//throw new AlgorithmExecutionException(getType() +\" algorithm in \"+type+\" mode--> Invalid data value detected(\"+value+\"). Value must be Double\");\r\n \t\t\t\t\tSystem.out.println(\"[AV] WARNING: Algorithm in \"+type+\" mode--> Invalid data value detected(\"+value+\"). Value must be Double\");\r\n \t \t\t\treturn null;\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t}\r\n \t\r\n \tavValue = avValue * (1.0 / (double) inputs);\r\n \t\r\n \t//System.out.println(\"[AV] OUTPUT: \"+avValue);\r\n\t\treturn avValue;\r\n }", "void optimiseSetPointProfile()\n\t{\n\t\tif (this.owner.storageHeater != null)\n\t\t{\n\t\t\toptimiseStorageHeater(this.owner.storageHeater);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (this.mainContext.logger.isTraceEnabled())\n\t\t{\n\t\t\tthis.mainContext.logger.trace(\"WattboxController:: optimise set point called for agent \" + this.owner.getAgentName());\n\t\t}\n\n\t\t// Initialise optimisation\n\t\tdouble[] localSetPointArray = Arrays.copyOf(this.setPointProfile, this.setPointProfile.length);\n\t\tthis.optimisedSetPointProfile = Arrays.copyOf(this.setPointProfile, this.setPointProfile.length);\n\t\tdouble[] deltaT = ArrayUtils.add(this.setPointProfile, ArrayUtils.negate(this.priorDayExternalTempProfile));\n\t\tdouble[] localDemandProfile = this.calculateEstimatedSpaceHeatPumpDemand(this.setPointProfile);\n\t\tdouble leastCost = this.evaluateCost(localDemandProfile);\n\t\tdouble newCost = leastCost;\n\t\tdouble maxRecoveryPerTick = 0.5d\n\t\t\t\t* Consts.DOMESTIC_COP_DEGRADATION_FOR_TEMP_INCREASE\n\t\t\t\t* ((this.owner.getBuildingHeatLossRate() / Consts.KWH_TO_JOULE_CONVERSION_FACTOR)\n\t\t\t\t\t\t* (Consts.SECONDS_PER_DAY / this.ticksPerDay) * ArrayUtils.max(deltaT)); // i.e.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// can't\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// recover\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// more\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// than\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 50%\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// of\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// heat\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// loss\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// at\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 90%\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// COP.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// TODO:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Need\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// to\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// code\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// this\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// better\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// later\n\n\t\tfor (int i = 0; i < localSetPointArray.length; i++)\n\t\t{\n\t\t\t// Start each evaluation from the basepoint of the original (user\n\t\t\t// specified) set point profile\n\t\t\tlocalSetPointArray = Arrays.copyOf(this.setPointProfile, this.setPointProfile.length);\n\t\t\tdouble totalTempLoss = 0;\n\t\t\tdouble[] otherPrices = Arrays.copyOf(this.dayPredictedCostSignal, this.dayPredictedCostSignal.length);\n\n\t\t\tfor (int j = 0; (j < Consts.HEAT_PUMP_MAX_SWITCHOFF && (i + j < this.ticksPerDay)); j++)\n\t\t\t{\n\t\t\t\tdouble tempLoss = (((this.owner.getBuildingHeatLossRate() / Consts.KWH_TO_JOULE_CONVERSION_FACTOR)\n\t\t\t\t\t\t* (Consts.SECONDS_PER_DAY / this.ticksPerDay) * Math\n\t\t\t\t\t\t.max(0, (localSetPointArray[i + j] - this.priorDayExternalTempProfile[i + j]))) / this.owner\n\t\t\t\t\t\t.getBuildingThermalMass());\n\t\t\t\tif (this.mainContext.logger.isTraceEnabled())\n\t\t\t\t{\n\t\t\t\t\tthis.mainContext.logger.trace(\"Temp loss in tick \" + (i + j) + \" = \" + tempLoss);\n\t\t\t\t}\n\t\t\t\ttotalTempLoss += tempLoss;\n\n\t\t\t\tfor (int k = i + j; k < localSetPointArray.length; k++)\n\t\t\t\t{\n\t\t\t\t\tlocalSetPointArray[k] = this.setPointProfile[k] - totalTempLoss;\n\t\t\t\t\t// availableHeatRecoveryTicks++;\n\t\t\t\t}\n\t\t\t\tdouble availableHeatRecoveryTicks = localSetPointArray.length - j;\n\n\t\t\t\t// Sort out where to regain the temperature (if possible)\n\t\t\t\tint n = (int) Math.ceil((totalTempLoss * this.owner.getBuildingThermalMass()) / maxRecoveryPerTick);\n\t\t\t\t// Take this slot out of the potential cheap slots to recover\n\t\t\t\t// temp in.\n\t\t\t\totherPrices[i + j] = Double.POSITIVE_INFINITY;\n\n\t\t\t\tif (n < availableHeatRecoveryTicks && n > 0)\n\t\t\t\t{\n\t\t\t\t\t// We know it's possible to recover the temperature lost\n\t\t\t\t\t// in switch off period under the constraints set.\n\t\t\t\t\tdouble tempToRecover = (totalTempLoss / n);\n\n\t\t\t\t\t// Find the cheapest timeslots in which to recover the\n\t\t\t\t\t// temperature\n\t\t\t\t\t// If this selection results in a tie, the slot is chosen\n\t\t\t\t\t// randomly\n\t\t\t\t\tint[] recoveryIndices = ArrayUtils.findNSmallestIndices(otherPrices, n);\n\n\t\t\t\t\t// Add on temperature in each temperature recovery slot and\n\t\t\t\t\t// all subsequent slots - thus building an optimised\n\t\t\t\t\t// profile.\n\t\t\t\t\tfor (int l : recoveryIndices)\n\t\t\t\t\t{\n\t\t\t\t\t\tfor (int m = l; m < this.ticksPerDay; m++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlocalSetPointArray[m] += tempToRecover;\nif (\t\t\t\t\t\t\tthis.mainContext.logger.isTraceEnabled()) {\n\t\t\t\t\t\t\tthis.mainContext.logger.trace(\"Adding \" + tempToRecover + \" at index \" + m + \" to counter temp loss at tick \"\n\t\t\t\t\t\t\t\t\t+ (i + j + 1));\n}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ((i + j) == 0)\n\t\t\t\t\t\t{\nif (\t\t\t\t\t\t\tthis.mainContext.logger.isTraceEnabled()) {\n\t\t\t\t\t\t\tthis.mainContext.logger.trace(\"Evaluating switchoff for tick zero, set point array = \"\n\t\t\t\t\t\t\t\t\t+ Arrays.toString(localSetPointArray));\n}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (this.mainContext.logger.isTraceEnabled())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.mainContext.logger.trace(\"In here, adding temp \" + tempToRecover + \" from index \" + l);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (this.mainContext.logger.isTraceEnabled())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.mainContext.logger.trace(\"With result \" + Arrays.toString(localSetPointArray));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tdouble[] tempDifference = ArrayUtils.add(this.setPointProfile, ArrayUtils.negate(localSetPointArray));\n\n\t\t\t\t\tif (ArrayUtils.max(ArrayUtils.add(ArrayUtils.absoluteValues(tempDifference), ArrayUtils\n\t\t\t\t\t\t\t.negate(Consts.MAX_PERMITTED_TEMP_DROPS))) > Consts.FLOATING_POINT_TOLERANCE)\n\t\t\t\t\t{\n\t\t\t\t\t\t// if the temperature drop, or rise, is too great, this\n\t\t\t\t\t\t// profile is unfeasible and we return null\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t// calculate energy implications and cost for this\n\t\t\t\t\t\t// candidate setPointProfile\n\t\t\t\t\t\tlocalDemandProfile = this.calculateEstimatedSpaceHeatPumpDemand(localSetPointArray);\n\t\t\t\t\t\tif ((i + j) == 0)\n\t\t\t\t\t\t{\nif (\t\t\t\t\t\t\tthis.mainContext.logger.isTraceEnabled()) {\n\t\t\t\t\t\t\tthis.mainContext.logger.trace(\"Calculated demand for set point array turning off at tick \" + i + \" for \"\n\t\t\t\t\t\t\t\t\t+ (j + 1) + \" ticks \" + Arrays.toString(localSetPointArray));\n}\n\t\t\t\t\t\t\tif (this.mainContext.logger.isTraceEnabled())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.mainContext.logger.trace(\"Demand = \" + Arrays.toString(localDemandProfile));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (localDemandProfile != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// in here if the set point profile is achievable\n\t\t\t\t\t\t\tnewCost = this.evaluateCost(localDemandProfile);\n\n\t\t\t\t\t\t\t// Decide whether to swap the new profile with the\n\t\t\t\t\t\t\t// current best one\n\t\t\t\t\t\t\t// based on cost.\n\t\t\t\t\t\t\t// Many strategies are available - here we give two\n\t\t\t\t\t\t\t// options\n\t\t\t\t\t\t\t// Either the new cost must be better by an amount\n\t\t\t\t\t\t\t// greater than some decision threshold\n\t\t\t\t\t\t\t// held in Consts.COST_DECISION_THRESHOLD\n\t\t\t\t\t\t\t// OR (currently used) the cost must simply be\n\t\t\t\t\t\t\t// better, with a tie in cost\n\t\t\t\t\t\t\t// being decided by a \"coin toss\".\n\n\t\t\t\t\t\t\t// if((newCost - leastCost) < (0 -\n\t\t\t\t\t\t\t// Consts.COST_DECISION_THRESHOLD))\n\t\t\t\t\t\t\tif (newCost < leastCost || (newCost == leastCost && RandomHelper.nextIntFromTo(0, 1) == 1))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tleastCost = newCost;\n\t\t\t\t\t\t\t\tthis.optimisedSetPointProfile = Arrays.copyOf(localSetPointArray, localSetPointArray.length);\n\t\t\t\t\t\t\t\tthis.heatPumpDemandProfile = ArrayUtils\n\t\t\t\t\t\t\t\t\t\t.multiply(localDemandProfile, (1 / Consts.DOMESTIC_HEAT_PUMP_SPACE_COP));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// Impossible to recover heat within heat pump\n\t\t\t\t\t\t\t// limits - discard this attempt.\n\t\t\t\t\t\t\tif (this.owner.getAgentID() == 1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tSystem.err.println(\"WattboxController: Can't recover heat with \" + availableHeatRecoveryTicks\n\t\t\t\t\t\t\t\t\t\t+ \" ticks, need \" + n);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.expectedNextDaySpaceHeatCost = leastCost;\n\t}", "public static double tryPolicy(Policy policy, Problem prob) {\n\t\tint totalUtility = 0;\n\t\tint totalMoves = 0;\n\t\tfor (int i = 0; i < ITERATIONS; i++) {\n\t\t\t// Random empty starting loc\n\t\t\tint row, col;\n\t\t\tdo {\n\t\t\t\trow = rng.nextInt(prob.map.size());\n\t\t\t\tcol = rng.nextInt(prob.map.get(0).size());\n\t\t\t} while (!prob.map.get(row).get(col).equals(\"-\"));\n\t\t\t// Run until pit, gold, or MAX_MOVES timeout \n\t\t\t// (in case policy recommends driving into wall repeatedly,\n\t\t\t// for example)\n\t\t\tfor (int moves = 0; moves < MAX_MOVES; moves++) {\n\t\t\t\ttotalMoves++;\n\t\t\t\tString policyRec = policy.bestActions[row][col];\n\t\t\t\t// Determine how far we go in that direction\n\t\t\t\tint displacement = 1;\n\t\t\t\tdouble totalProb = 0;\n\t\t\t\tdouble moveSample = rng.nextDouble();\n\t\t\t\tfor (int p = 0; p <= prob.moveProbs.length; p++) {\n\t\t\t\t\ttotalProb += prob.moveProbs[p];\n\t\t\t\t\tif (moveSample <= totalProb) {\n\t\t\t\t\t\tdisplacement = p+1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tint new_row = row;\n\t\t\t\tint new_col = col;\n\t\t\t\tif (policyRec.equals(\"U\")) {\n\t\t\t\t\tnew_row -= displacement;\n\t\t\t\t\tif (new_row < 0) {\n\t\t\t\t\t\tnew_row = 0;\n\t\t\t\t\t}\n\t\t\t\t} else if (policyRec.equals(\"R\")) {\n\t\t\t\t\tnew_col += displacement;\n\t\t\t\t\tif (new_col >= prob.map.get(0).size()) {\n\t\t\t\t\t\tnew_col = prob.map.get(0).size()-1;\n\t\t\t\t\t}\n\t\t\t\t} else if (policyRec.equals(\"D\")) {\n\t\t\t\t\tnew_row += displacement;\n\t\t\t\t\tif (new_row >= prob.map.size()) {\n\t\t\t\t\t\tnew_row = prob.map.size()-1;\n\t\t\t\t\t}\n\t\t\t\t} else if (policyRec.equals(\"L\")) {\n\t\t\t\t\tnew_col -= displacement;\n\t\t\t\t\tif (new_col < 0) {\n\t\t\t\t\t\tnew_col = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\trow = new_row;\n\t\t\t\tcol = new_col;\n\t\t\t\tif (prob.map.get(row).get(col).equals(\"G\")) {\n\t\t\t\t\ttotalUtility += GOLD_REWARD;\n\t\t\t\t\t// End the current trial\n\t\t\t\t\tbreak;\n\t\t\t\t} else if (prob.map.get(row).get(col).equals(\"P\")) {\n\t\t\t\t\ttotalUtility += PIT_REWARD;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn totalUtility/(double)totalMoves;\n\t}", "private void calValue() {\r\n for (char[] array : root.lines()) {\r\n int[] nums = HeuristicAdvanNode.checkLine(array);\r\n value += calHValue(nums[0], nums[1]);\r\n if (Math.abs(value) > xWin) {\r\n return;\r\n }\r\n }\r\n }", "private List<Double> MinimaxAlgorithm(MinimaxNode<GameState> node, int dataCount){\n if(node.getNumberOfChildren() == 0){ //checks to see if terminal node\n List<Double> heuristics = new ArrayList();\n heuristics.addAll(calculateHeuristic(node.getState()));\n return heuristics;\n }\n else{ //will maximise all the scores for each player.\n double value = Double.NEGATIVE_INFINITY;\n double checkValue;\n int bestMove;\n List<Double> heuristics = new ArrayList();\n if(node.getIfChanceNode()){ //checks if current node is a chance node, if so, times \n for (int i = 0; i < node.getChildren().size(); i++){\n List<Double> tempHeuristics = new ArrayList();\n tempHeuristics.addAll(MinimaxAlgorithm(node.getChildren().get(i),dataCount+1));\n checkValue = node.getChildren().get(i).getProbability() * tempHeuristics.get(node.getNodeIndex());\n value = Math.max(value, checkValue);//maximises the score.\n if(checkValue == value){\n heuristics.addAll(tempHeuristics); \n }\n if(dataCount == 0){//checks if this is the root node\n if(checkValue == value){\n MinimaxPlayer.optimalMoves = node.getChildren().get(i).getState().getOrientation(node.getNodeIndex()); \n }\n } \n }\n }\n else{\n for (int i = 0; i < node.getChildren().size(); i++){\n List<Double> tempHeuristics = new ArrayList();\n tempHeuristics.addAll(MinimaxAlgorithm(node.getChildren().get(i),dataCount+1));\n checkValue = tempHeuristics.get(node.getNodeIndex());\n value = Math.max(value, checkValue);//maximises the score.\n if(checkValue == value){\n heuristics.addAll(tempHeuristics); \n }\n if(dataCount == 0){//checks if this is the root node\n if(checkValue == value){\n MinimaxPlayer.optimalMoves = node.getChildren().get(i).getState().getOrientation(node.getNodeIndex()); \n }\n } \n } \n }\n return heuristics;\n } \n }", "@Override\n\tpublic FTrend execute(Problem problem, int maxEvaluations) throws Exception\n\t{\n\t\tFTrend FT = new FTrend(); // Create a fitness trend instance\n\t\tint problemDimension = problem.getDimension(); // Store the dimensionality of the problem domain\n\t\tdouble[][] bounds = problem.getBounds(); // Store the bounds of each variable in the problem domain\n\t\t\n\t\tdouble[] best = new double[problemDimension]; // Initialise the best known solution variable\n\t\tdouble fBest = Double.NaN; // Initialise the fitness value, i.e. \"f(x)\", of the best solution known\n\t\tint k = 0; // Initialise the incremental counter variable\n\t\t\n\t\t// Self-Adaptive Differential Evolution (jDE - jitterDE) variables\n\t\tint populationSize \t \t\t\t= getParameter(\"p0\").intValue(); // Initialise the population size \n\t\t//double scalingFactor \t\t\t= getParameter(\"p1\").doubleValue(); // Initialise the scaling factor of the mutation operator\n\t\t//double crossoverRate \t\t\t= getParameter(\"p2\").doubleValue(); // Initialise the crossover rate of the binomial crossover operator\n\t\tdouble scalingFactorLowerBound \t= getParameter(\"p3\").doubleValue(); // Initialise the upper bound value of the scaling factor of the mutation operator\n\t\tdouble scalingFactorUpperBound \t= getParameter(\"p4\").doubleValue(); // Initialise the lower bound value of the scaling factor of the mutation operator\n\t\tdouble tauOne \t\t\t\t\t= getParameter(\"p5\").doubleValue(); // Initialise the first random probability controlling the scaling factor of the mutation operator\n\t\tdouble tauTwo \t\t\t\t\t= getParameter(\"p6\").doubleValue(); // Initialise the second random probability controlling the binomial crossover rate of the crossover operator\n\t\t\n\t\tdouble[] scalingFactor = new double[populationSize]; // Initialise the scaling factor of the mutation operator\n\t\tdouble[] crossoverRate = new double[populationSize]; // Initialise the crossover rate of the binomial crossover operator\n\t\t\n\t\tdouble[][] population = new double[populationSize][problemDimension]; // Initialise the population of individuals (solutions) variable\n\t\tdouble[] solutionFitness = new double[populationSize]; // Initialise the fitness of a solution (individual) variable\n\t\t\n\t\t// Short Distance Exploration (SDE) variables\n\t\tdouble alpha \t\t\t\t= getParameter(\"p7\"); // Initialise the alpha cut value of the length of the problems decision space\n\t\tdouble proceduralIterations = getParameter(\"p8\").intValue(); // Initialise the procedural iteration budget variable\n\t\t\n\t\tdouble fShort = fBest; // Initialise the fitness value, i.e. \"f(x)\", of the trial solution\n\t\tdouble[] xShort = best; // Initialise the trial solution variable\n\t\tdouble[] exploratoryRadius = new double[problemDimension]; // Initialise the exploratory radius variable for the Short Distance Exploration (S) algorithm\n\t\t\n\t\t// Evaluate initial population of individuals\n\t\tfor (int i = 0; i < populationSize; i++) // For the size of the population of individuals (solutions), do the following\n\t\t{\n\t\t\tdouble[] initialSolution = generateRandomSolution(bounds, problemDimension); // Generate the initial solution (guess)\n\t\t\t\n\t\t\tfor (int j = 0; j < problemDimension; j++) // For the dimensionality of the problem, do the following\n\t\t\t{\n\t\t\t\tpopulation[i][j] = initialSolution[j]; // Initialise the iterated solution (individual) that comprises the population, to the initial solution randomly generated \n\t\t\t}\n\t\t\t\n\t\t\tsolutionFitness[i] = problem.f(population[i]); // Calculate and store the fitness (value) of the iterated solution (individual)\n\t\t\tk++; // Increment the counter to near the computational budget\t\t\n\n\t\t\tif (i == 0 || solutionFitness[i] < fBest) // If the solution generated is the first solution in the population or the fitness of the solution is better than the fitness of the best known solution, do the following\n\t\t\t{\n\t\t\t\tfBest = solutionFitness[i]; // Store the iterated solutions (individuals) fitness (value) as the best known solution\n\t\t\t\t//FT.add(k, fBest); // Add the best solution found in this iteration to the fitness trend (saved to a .txt file)\n\t\t\t\t\n\t\t\t\tfor (int j = 0; j < problemDimension; j++) // For the dimensionality of the problem, do the following\n\t\t\t\t{\n\t\t\t\t\tbest[j] = population[i][j]; // Update the best solution to the points comprising the iterated solution (individual) in the population\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (i == 0 || k % 100 == 0) // If the iterated individual in the population is first individual in the population or the current iteration is divisible by '100' and has no remainder, do the following\n\t\t\t{\n\t\t\t\tFT.add(k, fBest); // Add the best solution found in this iteration to the fitness trend (saved to a .txt file)\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Main loop\n\t\twhile (k < maxEvaluations) // While the computational budget has not been met, do the following\n\t\t{\n\t\t\tdouble[][] nextGeneration = new double[populationSize][problemDimension]; // Reinitialise the next generation of individuals representing the population variable\n\t\t\t\n\t\t\tfor (int j = 0; j < populationSize && k < maxEvaluations; j++) // For the size of the population of individuals (solutions) and whilst within the computational budget, do the following\n\t\t\t{\n\t\t\t\tint fitnessTrendPopulated = 0; // Initialise the fitness trend populated variable\n\t\t\t\t\n\t\t\t\tdouble[] mutantIndividual \t = new double[problemDimension]; // Reinitialise the mutated individuals variable\n\t\t\t\tdouble[] crossoverIndividual = new double[problemDimension]; // Reinitialise the offspring variable\n\t\t\t\tdouble[] populationIndividual = new double[problemDimension]; // Reinitialise the individual (solution) comprising the population variable \n\t\t\t\t\n\t\t\t\tdouble currentFitness \t= Double.NaN; // Reinitialise the fitness of the current solution (individual)\n\t\t\t\tdouble crossoverFitness = Double.NaN; // Reinitialise the fitness of the offspring solution (individual)\n\t\t\t\t\n\t\t\t\tfor (int l = 0; l < problemDimension; l++) // For the dimensionality of the problem, do the following\n\t\t\t\t{\n\t\t\t\t\tpopulationIndividual[l] = population[j][l]; // Initialise the individual (solution) in the population to the iterated individual in the population\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tcurrentFitness = solutionFitness[j]; // Set the current fitness (value) to the fitness of the current individual (solution)\n\t\t\t\n\t\t\t\t// Update the scaling factor (F)\n\t\t\t\tif (RandUtils.random() < tauOne) // If the randomly generated number is smaller than the probability of controlling the scaling factor of the mutation operator, do the following\n\t\t\t\t{\n\t\t\t\t\tscalingFactor[j] = scalingFactorLowerBound + RandUtils.random() * scalingFactorUpperBound; // Resample the scaling factor for the iterated individual of the population\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// DE/rand/1 mutation operator\n\t\t\t\tmutantIndividual = originalMutation(population, scalingFactor[j], problemDimension); // Function call, mutate the population of individuals to obtain a new mutated individual\n\t\t\t\t//mutantIndividual = toro(mutantIndividual, bounds); // Correct the mutated individual (solution) that may exist out of the bounds of the search space (problem domain)\n\t\t\t\t\n\t\t\t\t// Update the crossover rate (CR)\n\t\t\t\tif (RandUtils.random() < tauTwo) // If the randomly generated number is smaller than the probability of controlling the crossover rate of the binomial crossover operator, do the following\n\t\t\t\t{\n\t\t \tcrossoverRate[j] = RandUtils.random(); // Resample the crossover rate for the iterated individual of the population\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Binomial crossover operator\n\t\t\t\tcrossoverIndividual = binomialCrossover(populationIndividual, mutantIndividual, crossoverRate[j], problemDimension); // Function call, crossover the current individual and the mutated individual, binomially (recombination)\n\t\t\t\tcrossoverIndividual = toro(crossoverIndividual, bounds); // Correct the offspring individual (solution) that may exist out of the bounds of the search space (problem domain)\n\t\t\t\t\n\t\t\t\tcrossoverFitness = problem.f(crossoverIndividual); // Calculate and store the fitness (value) of the offspring solution (individual)\n\t\t\t\tk++; // Increment the counter to near the computational budget\n\t\t\t\t\n\t\t\t\t// Replace the original individual in the population\n\t\t\t\tif (crossoverFitness < currentFitness) // If the offspring individual is fitter than the original individual in the population, do the following\n\t\t\t\t{\n\t\t\t\t\tfor (int l = 0; l < problemDimension; l++) // For the dimensionality of the problem, do the following\n\t\t\t\t\t{\n\t\t\t\t\t\t// Survivor selection (1-to-1 spawning)\n\t\t\t\t\t\tnextGeneration[j][l] = crossoverIndividual[l]; // Replace the original individual (solution) in the population with the offspring individual (solution)\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\tsolutionFitness[j] = crossoverFitness; // Update the fitness of the individual (solution) to the fitness of the offspring individual (solution)\n\t\t\t\t\t\n\t\t\t\t\t// Update the best known solution\n\t\t\t\t\tif (crossoverFitness < fBest) // If the offspring individual (solution) is fitter than the best known individual (solution), do the following\n\t\t\t\t\t{\n\t\t\t\t\t\tfBest = crossoverFitness; // Update the fitness (value) of the best known solution to the fitness (value) of the offspring individual (solution)\n\t\t\t\t\t\t//FT.add(k, fBest); // Add the best solution found in this iteration to the fitness trend (saved to a .txt file)\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (k % 100 == 0 && fitnessTrendPopulated != k) // If the current iteration is divisible by '100' and has no remainder whilst the fitness trend has not been populated for the current iteration, do the following\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tFT.add(k, fBest); // Add the best solution found in this iteration to the fitness trend (saved to a .txt file)\n\t\t\t\t\t\t\tfitnessTrendPopulated = k; // The fitness trend has been populated for the current iteration\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor (int l = 0; l < problemDimension; l++) // For the dimensionality of the problem, do the following\n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\tbest[l] = crossoverIndividual[l]; // Update the best known individual (solution) to the offspring individual (solution)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Reset exploratory radius\n\t\t\t\t\t\tfor (int i = 0; i < problemDimension; i++) // For the dimensionality of the problem, do the following\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\texploratoryRadius[i] = alpha * (bounds[i][1] - bounds[i][0]); // Calculate and the exploratory radius for each variable in the problem domain\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Main loop\n\t\t\t\t\t\tfor (int l = 0; l < proceduralIterations && k < maxEvaluations; l++) // For the size of the procedural iteration budget and whilst within the computational budget, do the following\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tboolean improved = false; // Initialise the improved variable (reinitialise every iteration)\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfor (int i = 0; i < problemDimension && k < maxEvaluations; i++) // For the dimensionality of the problem and whilst within the computational budget, do the following\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\txShort[i] = best[i] - exploratoryRadius[i]; // Perturb the currently iterated variable in the problem domain, negatively, along the corresponding axis (exclusively) \n\t\t\t\t\t\t\t\txShort = toro(xShort, bounds); // Correct the trial solution that may exist out of the bounds of the search space (problem domain)\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tfShort = problem.f(xShort); // Calculate the new fitness value of the trial solution\n\t\t\t\t\t\t\t\tk++; // Increment the counter to near the computational budget\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (fShort <= fBest) // If the trial solution is an improvement or equivalent to the best known solution, do the following\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tbest[i] = xShort[i]; // Update the best known solution to the current trial solution (one variable perturbed at each iteration)\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tfBest = fShort; // Store the fitness value of the improved trial solution\n\t\t\t\t\t\t\t\t\t//FT.add(k, fBest); // Add the best solution found in this iteration to the fitness trend (saved to a .txt file)\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif (k % 100 == 0 && fitnessTrendPopulated != k) // If the current iteration is divisible by '100' and has no remainder whilst the fitness trend has not been populated for the current iteration, do the following\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tFT.add(k, fBest); // Add the best solution found in this iteration to the fitness trend (saved to a .txt file)\n\t\t\t\t\t\t\t\t\t\tfitnessTrendPopulated = k; // The fitness trend has been populated for the current iteration\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\timproved = true; // The trial solution is an improvement or equivalent to the best known solution\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if (k < maxEvaluations) // Else if the trial solution is not an improvement to the best solution found and its within the computational budget, do the following\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif (k % 100 == 0 && fitnessTrendPopulated != k) // If the current iteration is divisible by '100' and has no remainder whilst the fitness trend has not been populated for the current iteration, do the following\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tFT.add(k, fBest); // Add the best solution found in this iteration to the fitness trend (saved to a .txt file)\n\t\t\t\t\t\t\t\t\t\tfitnessTrendPopulated = k; // The fitness trend has been populated for the current iteration\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\txShort[i] = best[i] + (exploratoryRadius[i] / 2); // Perturb the currently iterated variable in the problem domain, positively (half-step), along the corresponding axis (exclusively) \n\t\t\t\t\t\t\t\t\txShort = toro(xShort, bounds); // Correct the trial solution that may exist out of the bounds of the search space (problem domain)\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tfShort = problem.f(xShort); // Calculate the new fitness value of the trial solution\n\t\t\t\t\t\t\t\t\tk++; // Increment the counter to near the computational budget\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif (fShort <= fBest) // If the trial solution is an improvement or equivalent to the best known solution, do the following\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tbest[i] = xShort[i]; // Update the best known solution to the current trial solution (one variable perturbed at each iteration)\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tfBest = fShort; // Store the fitness value of the improved trial solution\n\t\t\t\t\t\t\t\t\t\t//FT.add(k, fBest); // Add the best solution found in this iteration to the fitness trend (saved to a .txt file)\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\timproved = true; // The trial solution is an improvement or equivalent to the best known solution\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse // Else if the trial solution is not an improvement to the best solution found, do the following\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\txShort[i] = best[i]; // Return to the original point after the perturbations, as an improvement could not be recognised\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif (k % 100 == 0 && fitnessTrendPopulated != k) // If the current iteration is divisible by '100' and has no remainder whilst the fitness trend has not been populated for the current iteration, do the following\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tFT.add(k, fBest); // Add the best solution found in this iteration to the fitness trend (saved to a .txt file)\n\t\t\t\t\t\t\t\t\t\tfitnessTrendPopulated = k; // The fitness trend has been populated for the current iteration\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (k % 100 == 0 && fitnessTrendPopulated != k) // If the current iteration is divisible by '100' and has no remainder whilst the fitness trend has not been populated for the current iteration, do the following\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tFT.add(k, fBest); // Add the best solution found in this iteration to the fitness trend (saved to a .txt file)\n\t\t\t\t\t\t\t\t\tfitnessTrendPopulated = k; // The fitness trend has been populated for the current iteration\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (improved == false) // If the current best solution has never improved from the initial best solution, do the following\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfor (int i = 0; i < exploratoryRadius.length; i++) // For the dimensionality of the problem, do the following\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\texploratoryRadius[i] = exploratoryRadius[i] / 2; // Store the exploratory radius for each variable in the problem domain to itself, halved (closer search from initial solution in case the initial guess is the optimum)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse // Else if the current best solution has improved from the initial best solution, do the following\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfor (int i = 0; i < problemDimension; i++) // For the dimensionality of the problem, do the following\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tnextGeneration[j][i] = best[i]; // Replace the original individual (solution) in the population with the best known solution (individual)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tsolutionFitness[j] = fBest; // Update the fitness of the individual (solution) to the fitness of the best known solution (individual)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse // Else if the offspring individual is not fitter than the original individual in the population, do the following\n\t\t\t\t{\n\t\t\t\t\tfor (int l = 0; l < problemDimension; l++) // For the dimensionality of the problem, do the following\n\t\t\t\t\t{\n\t\t\t\t\t\tnextGeneration[j][l] = populationIndividual[l]; // Restore the design variables (genes) of the original individual (solution) as the updated individual (solution)\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\tsolutionFitness[j] = currentFitness; // Restore the fitness (value) of the solution to the fitness (value) of the iterated individual (solution)\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (k % 100 == 0 && fitnessTrendPopulated != k) // If the current iteration is divisible by '100' and has no remainder whilst the fitness trend has not been populated for the current iteration, do the following\n\t\t\t\t{\n\t\t\t\t\tFT.add(k, fBest); // Add the best solution found in this iteration to the fitness trend (saved to a .txt file)\n\t\t\t\t\tfitnessTrendPopulated = k; // The fitness trend has been populated for the current iteration\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Survivor selection (1-to-1 spawning)\n\t\t\tpopulation = nextGeneration; // Update the current population of individuals to the next generation of fitter individuals\n\t\t}\n\t\t\n\t\tfinalBest = best; // Store the final iteration of the best known solution\n\t\tFT.add(k, fBest); // Add the final iteration of the best known solution to the fitness trend (saved to a .txt file)\n\n\t\treturn FT; // Return the fitness trend\n\t}", "void compute() {\n\n if (random.nextBoolean()) {\n value = value + random.nextInt(variation);\n ask = value + random.nextInt(variation / 2);\n bid = value + random.nextInt(variation / 2);\n } else {\n value = value - random.nextInt(variation);\n ask = value - random.nextInt(variation / 2);\n bid = value - random.nextInt(variation / 2);\n }\n\n if (value <= 0) {\n value = 1.0;\n }\n if (ask <= 0) {\n ask = 1.0;\n }\n if (bid <= 0) {\n bid = 1.0;\n }\n\n if (random.nextBoolean()) {\n // Adjust share\n int shareVariation = random.nextInt(100);\n if (shareVariation > 0 && share + shareVariation < stocks) {\n share += shareVariation;\n } else if (shareVariation < 0 && share + shareVariation > 0) {\n share += shareVariation;\n }\n }\n }", "public void mainProcess(java.util.ArrayList<double[]> dataPoint, String dist) throws Exception {\n double[][] S = initAP(dataPoint);\r\n// double[][] S = readData(fn);\r\n double[][] A = new double[N][N];\r\n double[][] R = new double[N][N];\r\n //////////////////////////////////////\r\n\tfor(int m=0; m<iter; m++) {\r\n// System.out.println(m);\r\n for(int i=0; i<N; i++) {\r\n for(int k=0; k<N; k++) {\r\n double max = -1e100;\r\n for(int kk=0; kk<k; kk++) {\r\n if(S[i][kk]+A[i][kk]>max)\r\n max = S[i][kk]+A[i][kk];\r\n }\r\n for(int kk=k+1; kk<N; kk++) {\r\n if(S[i][kk]+A[i][kk]>max)\r\n max = S[i][kk]+A[i][kk];\r\n }\r\n R[i][k] = (1-lambda)*(S[i][k] - max) + lambda*R[i][k];\r\n }\r\n }\r\n for(int i=0; i<N; i++) {\r\n for(int k=0; k<N; k++) {\r\n if(i==k) {\r\n double sum = 0.0;\r\n for(int ii=0; ii<i; ii++) {\r\n sum += Math.max(0.0, R[ii][k]);\r\n }\r\n for(int ii=i+1; ii<N; ii++) {\r\n sum += Math.max(0.0, R[ii][k]);\r\n }\r\n A[i][k] = (1-lambda)*sum + lambda*A[i][k];\r\n } else {\r\n double sum = 0.0;\r\n int maxik = Math.max(i, k);\r\n int minik = Math.min(i, k);\r\n for(int ii=0; ii<minik; ii++) {\r\n sum += Math.max(0.0, R[ii][k]);\r\n }\r\n for(int ii=minik+1; ii<maxik; ii++) {\r\n sum += Math.max(0.0, R[ii][k]);\r\n }\r\n for(int ii=maxik+1; ii<N; ii++) {\r\n sum += Math.max(0.0, R[ii][k]);\r\n }\r\n A[i][k] = (1-lambda)*Math.min(0.0, R[k][k]+sum) + lambda*A[i][k];\r\n }\r\n }\r\n }\r\n }\r\n \r\n//\tdouble E[N][N] = {0};\r\n double[][] E = new double[N][N];\r\n\r\n//\tvector<int> center;\r\n java.util.ArrayList<Integer> center = new java.util.ArrayList<>();\r\n for(int i=0; i<N; i++) {\r\n E[i][i] = R[i][i] + A[i][i];\r\n if(E[i][i]>0) {\r\n center.add(i);\r\n }\r\n }\r\n// int idx[N] = {0};\r\n int idx[] = new int[N];\r\n\r\n\tfor(int i=0; i<N; i++) {\r\n int idxForI = 0;\r\n double maxSim = -1e100;\r\n for(int j=0; j<center.size(); j++) {\r\n int c = center.get(j);\r\n if (S[i][c]>maxSim) {\r\n maxSim = S[i][c];\r\n idxForI = c;\r\n }\r\n }\r\n idx[i] = idxForI;\r\n }\r\n// java.util.HashMap<Integer, String> colorMap = new java.util.HashMap<>();\r\n java.util.HashMap<Integer, Integer> idcMap = new java.util.HashMap<>();\r\n java.util.HashSet<Integer> idSet = new java.util.HashSet<>();\r\n for(int i=0; i<N; i++) {\r\n idcMap.put(i, idx[i]);\r\n idSet.add(idx[i]);\r\n// System.out.println(idx[i]+1);\r\n\t}\r\n java.io.FileWriter out = new java.io.FileWriter(dist);\r\n java.util.HashMap<Integer, String> colorMap = getColorMap(idSet);\r\n for(int i=0; i<N; i++){\r\n double d[] = dataPoint.get(i);\r\n if(idSet.contains(i)){\r\n out.write(i+\"\\t\"+d[0]+\"\\t\"+d[1]+\"\\t\"+colorMap.get(i)+\"\\n\");\r\n }\r\n else{\r\n out.write(i+\"\\t\"+d[0]+\"\\t\"+d[1]+\"\\t\"+colorMap.get(idcMap.get(i))+\"\\n\");\r\n }\r\n// System.out.println(i+\"\\t\"+d[0]+\"\\t\"+d[1]+\"\\t\"+colorMap.get(idcMap.get(i)));\r\n }\r\n out.close();\r\n// System.out.println(colorMap);\r\n /////////////////////////////////////////\r\n }", "public void run(){\n this.p_absoluteTemperature = 0.001;\n //this.p_temperatureFactor = 7.5;\n this.p_temperatureFactor = 10;\n \n // Set original and current temperature\n this.temperatureInitial = 100;\n this.temperature = 100;\n \n runAlgorithm();\n }", "protected abstract SoyValue compute();", "@Test\n\tpublic void testOptimization() throws Exception {\n\t\tfor(int i = 0; i < 20000000; i++) {\n\t\t\tint _300s = (int) (Math.random() * 100);\n\t\t\tint _100s = (int) (Math.random() * 100);\n\t\t\tint _50s = (int) (Math.random() * 100);\n\t\t\tint misses = (int) (Math.random() * 100);\n\t\t\t\n\t\t\tdouble acc = OsuApiScore.getAccuracy(_300s, _100s, _50s, misses);\n\t\t\t\n\t\t\tAccuracyDistribution accuracyDistribution = AccuracyDistribution.closest(\n\t\t\t\t\t_300s + _100s + _50s + misses, misses,\n\t\t\t\t\tacc);\n\t\t\t\n\t\t\tdouble rec = OsuApiScore.getAccuracy(accuracyDistribution.getX300(),\n\t\t\t\t\taccuracyDistribution.getX100(), accuracyDistribution.getX50(),\n\t\t\t\t\taccuracyDistribution.getMiss());\n\t\t\t\n\t\t\tassertEquals(acc, rec, 0d);\n\t\t}\n\t}", "public void runOptimizations() {\n\t\tOptInfo info = new OptInfo();\n\t\tfor (int i = 0; i < mainOpts.size(); i++) {\n\t\t\t//Extract the operator in the vector and convert it into a\n\t\t\t//SearchStrategy type. The object that is loaded into the\n\t\t\t//SearchStrategy type is not SearchStrategy as it is an\n\t\t\t//abstract class but a class that inherits off of\n\t\t\t//SearchStrategy such as FirstBestIntraOpt, FirstBestInterOpt\n\t\t\t//and so on. the opt.run method runs the run method\n\t\t\t//from the inheriting class such as FirstBestIntraOpt.\n\t\t\tSearchStrategy opt = (SearchStrategy) mainOpts.elementAt(i);\n\t\t\tSettings.printDebug(Settings.COMMENT, \"Running \" + opt);\n\n\t\t\t//The opt.run method called is dependent on the object that\n\t\t\t//was created in the mainOpts. If the object was BestBestIntraSearch\n\t\t\t//then the run method in BestBestIntraSearch is called.\n\t\t\toptInformation.add(opt.toString() + \" \" + opt.run(mainDepots));\n\t\t\tSettings.printDebug(Settings.COMMENT,\n\t\t\t\t\topt.toString() + \" Stats: \" +\n\t\t\t\t\t\t\tmainDepots.getSolutionString());\n\t\t}\n\t}", "protected boolean update_best_value(Knapsack knapsack) {\n iteration+=1;\n if (knapsack.get_value()>best_value)\n {\n best_value=knapsack.get_value();\n return true;\n }\n if (iteration%100000==0)\n System.out.println(\"iteration:\"+iteration+\" time:\"+System.currentTimeMillis()+\n \" best_value:\"+best_value);\n return false;\n }", "public SolutionSet execute() throws Exception {\r\n\t\tint bisections, archiveSize, maxEvaluations, evaluations;\r\n\t\tAdaptiveGridArchive archive;\r\n\t\tOperator mutationOperator;\r\n\t\tComparator dominance;\r\n\r\n\t\t// Read the params\r\n\t\tbisections = ((Integer) this.getInputParameter(\"biSections\")).intValue();\r\n\t\tarchiveSize = ((Integer) this.getInputParameter(\"archiveSize\")).intValue();\r\n\t\tmaxEvaluations = ((Integer) this.getInputParameter(\"maxEvaluations\")).intValue();\r\n\r\n\t\t// Read the operators\r\n\t\tmutationOperator = this.operators_.get(\"mutation\");\r\n\r\n\t\t// Initialize the variables\r\n\t\tevaluations = 0;\r\n\t\tarchive = new AdaptiveGridArchive(archiveSize, bisections, problem_.getNumberOfObjectives());\r\n\t\tdominance = new DominanceComparator();\r\n\r\n\t\t// -> Create the initial solution and evaluate it and his constraints\r\n\t\tSolution solution = new Solution(problem_);\r\n\t\tproblem_.evaluate(solution);\r\n\t\tproblem_.evaluateConstraints(solution);\r\n\t\tevaluations++;\r\n\r\n\t\t// Add it to the archive\r\n\t\tarchive.add(new Solution(solution));\r\n\t\tint fileNum = 0, num = 0;\r\n\t\ttry {\r\n\t\t\tcreateFile(fileNum);\r\n\t\t\tFileWriter fwTime = new FileWriter(fileName.getAbsoluteFile(), true);\r\n\t\t\tBufferedWriter fileTime = new BufferedWriter(fwTime);\r\n\t\t\tfor (int i = 0; i < archive.size(); i++) {\r\n\r\n\t\t\t\tfileTime.write(archive.get(i).getObjective(0) + \" \" + archive.get(i).getObjective(1) + \" \"\r\n\t\t\t\t\t\t+ archive.get(i).getObjective(2) + \" \" + archive.get(i).getObjective(3) + \" \"\r\n\t\t\t\t\t\t+ archive.get(i).getObjective(4));\r\n\t\t\t\tfileTime.write(\"\\n\");\r\n\t\t\t}\r\n\t\t\tfileTime.close();\r\n\t\t\tfileNum++;\r\n\t\t\tnum += 1000;\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t// Iterations....\r\n\t\tdo {\r\n\t\t\t// Create the mutate one\r\n\t\t\tSolution mutatedIndividual = new Solution(solution);\r\n\t\t\tmutationOperator.execute(mutatedIndividual);\r\n\r\n\t\t\tproblem_.evaluate(mutatedIndividual);\r\n\t\t\tproblem_.evaluateConstraints(mutatedIndividual);\r\n\t\t\tevaluations++;\r\n\t\t\t// <-\r\n\r\n\t\t\t// Check dominance\r\n\t\t\tint flag = dominance.compare(solution, mutatedIndividual);\r\n\r\n\t\t\tif (flag == 1) { // If mutate solution dominate\r\n\t\t\t\tsolution = new Solution(mutatedIndividual);\r\n\t\t\t\tarchive.add(mutatedIndividual);\r\n\t\t\t} else if (flag == 0) { // If none dominate the other\r\n\t\t\t\tif (archive.add(mutatedIndividual)) {\r\n\t\t\t\t\tsolution = test(solution, mutatedIndividual, archive);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t/*\r\n\t\t\t * if ((evaluations % 100) == 0) {\r\n\t\t\t * archive.printObjectivesToFile(\"FUN\"+evaluations) ;\r\n\t\t\t * archive.printVariablesToFile(\"VAR\"+evaluations) ;\r\n\t\t\t * archive.printObjectivesOfValidSolutionsToFile(\"FUNV\"+evaluations) ; }\r\n\t\t\t */\r\n\t\t\tif (evaluations >= num) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tcreateFile(fileNum);\r\n\t\t\t\t\tFileWriter fwTime = new FileWriter(fileName.getAbsoluteFile(), true);\r\n\t\t\t\t\tBufferedWriter fileTime = new BufferedWriter(fwTime);\r\n\t\t\t\t\tfor (int i = 0; i < archive.size(); i++) {\r\n\r\n\t\t\t\t\t\tfileTime.write(archive.get(i).getObjective(0) + \" \" + archive.get(i).getObjective(1) + \" \"\r\n\t\t\t\t\t\t\t\t+ archive.get(i).getObjective(2) + \" \" + archive.get(i).getObjective(3) + \" \"\r\n\t\t\t\t\t\t\t\t+ archive.get(i).getObjective(4));\r\n\t\t\t\t\t\tfileTime.write(\"\\n\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfileTime.close();\r\n\t\t\t\t\tfileNum++;\r\n\t\t\t\t\tnum += 1000;\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} while (evaluations < maxEvaluations);\r\n\r\n\t\t// Return the population of non-dominated solution\r\n\t\tarchive.printFeasibleFUN(\"FUN_PAES\");\r\n\r\n\t\treturn archive;\r\n\t}", "@Test(timeout = 60000)\n public void testVariableAndConstantsUnboundedIteration() throws Exception {\n JobGraph jobGraph = createVariableAndConstantJobGraph(4, 1000, true, 0, false, 1, result);\n miniCluster.submitJob(jobGraph);\n\n // Expected records is round * parallelism * numRecordsPerSource\n Map<Integer, Tuple2<Integer, Integer>> roundsStat =\n computeRoundStat(result.get(), OutputRecord.Event.PROCESS_ELEMENT, 2 * 4 * 1000);\n verifyResult(roundsStat, 2, 4000, 4 * (0 + 999) * 1000 / 2);\n }", "private void calculations() {\n\t\tSystem.out.println(\"Starting calculations\\n\");\n\t\tcalcMedian(myProt.getChain(requestedChain));\n\t\tcalcZvalue(myProt.getChain(requestedChain));\n\t\tcalcSVMweightedZvalue(myProt.getChain(requestedChain));\n\t}", "public void calculateProbabilities(){\n\t}", "public void runSJF() {\n\n //init\n ArrayList<Processus> localProcess = new ArrayList<>(); //Creation of a local list of process\n for (Processus cpy : listOfProcess) { //Copy the list of process in the local list\n localProcess.add(cpy);\n }\n int size = listOfProcess.size(); //variable used to save the initial size of the list of process\n\n Processus executedProc = null; //ExecutedProc is the current process that is being execute\n Processus tmpProc = localProcess.get(0); //The tmpProc is the previous process executed\n\n //Variable we need to calcul\n double occupancyRate = 0;\n double averageWaitingTime = 0;\n double averageReturnTime = 0;\n int currentTime = 0;\n int occupancyTime = 0;\n\n //beginning of the algo\n while (!localProcess.isEmpty()) { //As long as there are processes that are not done yet we keep going on\n\n //Determines the next process that will be executed\n for (Processus proc : localProcess) { //flow all remaining processes\n if (proc.getTime() <= currentTime) { //check if the currentTime of the process is below the currentTime\n if (localProcess.size() == 1) { //if there is only one process left\n executedProc = proc;\n } else if ((proc.getRessource(proc.getCurrentStep()) <= tmpProc.getRessource(tmpProc.getCurrentStep())) || (proc.getTime() < tmpProc.getTime())) {//shortest process selected\n executedProc = proc;\n tmpProc = proc;\n }\n }\n }\n\n //Check if the current process is assigned\n if (executedProc != null) {\n\n //execute the current ressource\n int tmpTime = 0;\n while (executedProc.getRessource(executedProc.getCurrentStep()) > tmpTime) { //As long as there is a resource\n for (Processus proc : localProcess) {\n if (proc.getTime() <= currentTime && !proc.equals(executedProc)) { //checking if there is another process waiting\n proc.setWaitingTime(1);\n }\n }\n currentTime++; //currentTime is updating at each loop\n occupancyTime++; //occupancyTime is updating at each loop\n tmpTime++;\n }\n\n executedProc.setCurrentStep(executedProc.getCurrentStep() + 1); //Update the currentStep to the next one (index of the lists of UC and inOut)\n\n if (executedProc.getCurrentStep() >= executedProc.getlistOfResource().size()) {//if it is the end of the process\n averageReturnTime += executedProc.getExecutedTime(); //update the average return time by adding the time that the process took\n localProcess.remove(executedProc); //remove the process from the list of process that needs to run\n }\n\n if (executedProc.getCurrentStep() <= executedProc.getListOfInOut().size()) { //If there is another inOut, it set the new time\n executedProc.setTime(executedProc.getInOut(executedProc.getCurrentStep() - 1) + currentTime);\n }\n\n executedProc = null;\n } else {\n currentTime++;\n }\n }\n //end of the algo\n\n //Calculation of the variables\n occupancyRate = ((double) occupancyTime / (double) currentTime) * 100;\n for (Processus proc : listOfProcess) {\n averageWaitingTime += proc.getWaitingTime();\n }\n averageWaitingTime = averageWaitingTime / size;\n averageReturnTime = averageReturnTime / size;\n\n //Updating the global variables\n currentAverageReturnTime = averageReturnTime;\n logger.trace(\"Current average return time : \" + currentAverageReturnTime);\n currentAverageWaitingTime = averageWaitingTime;\n logger.trace(\"Current average waiting time : \" + currentAverageWaitingTime);\n currentOccupancyRate = occupancyRate;\n logger.trace(\"Current occupancy rate : \" + currentOccupancyRate);\n currentOccupancyTime = occupancyTime;\n logger.trace(\"Current occupancy time : \" + currentOccupancyTime);\n\n restList(); //reset the list to the origin values so the user can test another algo\n }", "@Override\n // TODO implement call() for expert mode using minimax\n public Integer call() throws Exception {\n Integer val = 0;\n Thread.sleep(150);\n return val;\n }", "double calculate(OptAlgEnvironment<?, ?> environment);", "public void solve_base(Items items,Knapsack knapsack) {\n iteration=0;\n best_value=-1;\n System.out.println(\"iteration:\"+iteration+\" solve_begin_time:\"+System.currentTimeMillis());\n this.solve(items,knapsack);\n System.out.println(\"iteration:\"+iteration+\" solve_end_time:\"+System.currentTimeMillis());\n }", "@Test\n @Order(8)\n void taillardTestMoreIterations() {\n try {\n\n for (int i = 0; i < SearchTestUtil.taillardFilenames.length; i++) {\n int output;\n float sumTabu = 0;\n int minTabu = Integer.MAX_VALUE;\n float sumRecuit = 0;\n int minRecuit = Integer.MAX_VALUE;\n System.out.println(\"Run#\" + SearchTestUtil.taillardFilenames[i]);\n assignementProblem.taillardInitializer(SearchTestUtil.taillardFilenames[i]);\n assignementProblem.setNeighborsFunction(NEIGHBORHOOD_TYPE, assignementProblem.getAssignmentData().getLength());\n for (int j = 0; j < 10; j++) {\n assignementProblem.setInCombination(Combination.generateRandom(assignementProblem.getAssignmentData().getLength()));\n\n System.out.println(\"\\n \\t Test#\"+j);\n executeAlgo(SearchTestUtil.ALGO.TABU);\n output = assignementProblem.getF().apply(assignementProblem.getOutCombination());\n sumTabu += output;\n if (output < minTabu) minTabu = output;\n\n executeAlgo(SearchTestUtil.ALGO.RECUIT);\n output = assignementProblem.getF().apply(assignementProblem.getOutCombination());\n sumRecuit += output;\n if (output < minRecuit) minRecuit = output;\n }\n\n\n System.out.println(\"\\tAverage tabu \" + sumTabu / 10);\n System.out.println(\"\\tMinimum found \" + minTabu);\n\n System.out.println(\"\\tAverage recuit \" + sumRecuit / 10);\n System.out.println(\"\\tMinimum found \" + minRecuit);\n\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private double evaluate() {\n // check for draws first, most lickely\n if (board.gameState() == MNKGameState.DRAW) return 0;\n else if (board.gameState() == MY_WIN) return 2 * M * N; // 2 times max depth\n else if (board.gameState() == ENEMY_WIN) return -2 * M * N;\n else {\n evaluated++;\n // keep the heuristic evaluation between 1 and -1\n return board.value();\n }\n }", "public void calibrationPhase() {\n\t\t// iterate over all secret combination\n\t\tfor (Secret secretA : this.dataSet.getSecrets()) {\n\t\t\tfor (Secret secretB : this.dataSet.getSecrets()) {\n\t\t\t\tif(secretA != secretB) {\n\t\t\t\t\tif(this.optimalBox[0] == 0.0 && this.optimalBox[1] == 0.0) {\n\t\t\t\t\t\tif(searchOptimalBox(secretA, secretB)) {\n\t\t\t\t\t\t\tint smallestSize = searchSmallestSize(secretA, secretB);\n\t\t\t\t\t\t\tthis.openValidationPhase(secretA, secretB, smallestSize, this.optimalBox);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tthis.optimalBox = new double[2];\n\t\t\t\t\t\tthis.optimalBox[0] = 0.0;\n\t\t\t\t\t\tthis.optimalBox[1] = 0.0;\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tint smallestSize = searchSmallestSize(secretA, secretB);\n\t\t\t\t\t\tif(smallestSize != 0) {\n\t\t\t\t\t\t\tplotPool.plot(\"Filtered Measurments: User Input Optimal Box (\" + secretA.getName() + \"-\" + secretB.getName() + \")\", this.optimalBox[0], this.optimalBox[1]);\n\n\t\t\t\t\t\t\tthis.openValidationPhase(secretA, secretB, smallestSize, this.optimalBox);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlogger.warning(secretA.getName() + \" < \" + secretB.getName() + \": no significant different result found! You need to measure more times.\");\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t}", "private double bound(int iter, Solution next) {\n return Math.exp((-1.0 * (next.getValue() - bestSol.getValue())) / denominator(iter));\n }", "private void generateParameterValues()\n\t{\n\t\t/*\n\t\t * Initialize variables for storage of the actual parameter data and prepare the histogram bins aggregating them. \n\t\t */\n\t\t\n\t\t// Init storage.\n\t\tparameterValues.clear();\n\t\tparameterValues.put(\"alpha\", new ArrayList<Double>(numberOfDivisions));\n\t\tparameterValues.put(\"eta\", new ArrayList<Double>(numberOfDivisions));\n\t\tparameterValues.put(\"kappa\", new ArrayList<Double>(numberOfDivisions));\n\t\t\n\t\t// Init bins.\n\t\tfinal int numberOfBins \t\t\t\t\t= 50;\n\t\tMap<String, int[]> parameterBinLists\t= new HashMap<String, int[]>();\n\t\tparameterBinLists.put(\"alpha\", new int[numberOfBins]);\n\t\tparameterBinLists.put(\"eta\", new int[numberOfBins]);\n\t\tparameterBinLists.put(\"kappa\", new int[numberOfBins]);\n\t\t\n\t\t// Init random number generator.\n\t\tRandom randomGenerator\t= new Random();\n\t\t\n\t\t/*\n\t\t * Generate numberOfDivisions values for each parameter.\n\t\t */\n\t\t\n\t\tswitch (sampling_combobox.getValue())\n\t\t{\n\t\t\tcase \"Random\":\n\t\t\t\t// Generated values are allowed to be up to rangeSlider.getHighValue() and as low as rangeSlider.getLowValue().\n\t\t\t\tdouble intervalAlpha \t= rangeSliders.get(\"alpha\").getHighValue() - rangeSliders.get(\"alpha\").getLowValue();\n\t\t\t\tdouble intervalEta\t\t= rangeSliders.get(\"eta\").getHighValue() - rangeSliders.get(\"eta\").getLowValue();\n\t\t\t\tdouble intervalKappa\t= rangeSliders.get(\"kappa\").getHighValue() - rangeSliders.get(\"kappa\").getLowValue();\n\t\t\t\t\n\t\t\t\t// Generate random parameter values.\t\t\n\t\t\t\tfor (int i = 0; i < numberOfDivisions; i++) {\n\t\t\t\t\tparameterValues.get(\"alpha\").add(rangeSliders.get(\"alpha\").getLowValue() + randomGenerator.nextFloat() * intervalAlpha);\n\t\t\t\t\tparameterValues.get(\"eta\").add(rangeSliders.get(\"eta\").getLowValue() + randomGenerator.nextFloat() * intervalEta);\n\t\t\t\t\tparameterValues.get(\"kappa\").add(rangeSliders.get(\"kappa\").getLowValue() + randomGenerator.nextFloat() * intervalKappa);\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase \"Cartesian\":\n\t\t\t\tfor (String param : LDAConfiguration.SUPPORTED_PARAMETERS) {\n\t\t\t\t\tfinal double interval = (rangeSliders.get(param).getHighValue() - rangeSliders.get(param).getLowValue()) / (numberOfDivisions);\n\t\t\t\t\t\n\t\t\t\t\tfor (int i = 0; i < numberOfDivisions; i++) {\n\t\t\t\t\t\tparameterValues.get(param).add(rangeSliders.get(param).getLowValue() + interval * i + interval / 2);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase \"Latin Hypercube\":\n\t\t\t\tfor (String param : LDAConfiguration.SUPPORTED_PARAMETERS) {\n\t\t\t\t\t// Calcualte bin interval.\n\t\t\t\t\tfinal double interval \t\t= (rangeSliders.get(param).getHighValue() - rangeSliders.get(param).getLowValue()) / (numberOfDivisions);\n\n\t\t\t\t\tfor (int i = 0; i < numberOfDivisions; i++) {\n\t\t\t\t\t\t// Minimal value allowed for current bin.\n\t\t\t\t\t\tfinal double currentBinMin = rangeSliders.get(param).getLowValue() + interval * i;\n\t\t\t\t\t\t// Generate value for this bin.\n\t\t\t\t\t\tparameterValues.get(param).add(currentBinMin + randomGenerator.nextFloat() * interval);\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t//\t\t\t\t\tto do:\n\t//\t\t\t\t\t\t- test: check generate.txt.\n\t//\t\t\t\t\t\t- after that: START WRITING PAPER (SATURDAY!).\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\t/*\n\t\t * Bin data for use in histograms/scented widgets.\n\t\t */\n\t\t\n\t\t// Bin data.\n\t\tfor (Map.Entry<String, ArrayList<Double>> entry : parameterValues.entrySet()) {\n\t\t\tdouble binInterval = (rangeSliders.get(entry.getKey()).getMax() - rangeSliders.get(entry.getKey()).getMin()) / numberOfBins;\n\t\t\t\n\t\t\t// Check every value and assign it to the correct bin.\n\t\t\tfor (double value : entry.getValue()) {\n\t\t\t\tint index_key = (int) ( (value - rangeSliders.get(entry.getKey()).getMin()) / binInterval);\n\t\t\t\t// Check if element is highest allowed entry.\n\t\t\t\tindex_key = index_key < numberOfBins ? index_key : numberOfBins - 1;\n\t\t\t\t\n\t\t\t\t// Increment content of corresponding bin.\n\t\t\t\tparameterBinLists.get(entry.getKey())[index_key]++;\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t/*\n\t\t * Transfer data to scented widgets.\n\t\t */\n\t\t\n\t\t// Clear old data.\n\t\talpha_barchart.getData().clear();\n\t\teta_barchart.getData().clear();\n\t\tkappa_barchart.getData().clear();\n\n\t\t// Add data series to barcharts.\n\t\talpha_barchart.getData().add(generateParameterHistogramDataSeries(\"alpha\", parameterBinLists, numberOfBins));\n\t\teta_barchart.getData().add(generateParameterHistogramDataSeries(\"eta\", parameterBinLists, numberOfBins));\n\t\tkappa_barchart.getData().add(generateParameterHistogramDataSeries(\"kappa\", parameterBinLists, numberOfBins));\n\t}", "private int optimize() {\n\t\t// items: Items sorted by value-to-weight ratio for linear relaxation\n\t\t// t: the decision vector being tested at each node\n\t\t// ws, vs, is, bs: stacks of weight, value, item id, whether bring item\n\t\t// p: stack pointer; i, b, weight, value: loop caches; best: max search\n\t\t// ss: stack size: Always <=2 children on stack for <=n-1 parents\n\t\tItem[] items = new Item[n];\n\t\tint ss = 2 * n;\n\t\tint[] itemsSorted = new int[n], t = new int[n], ws = new int[ss],\n\t\t\tvs = new int[ss], is = new int[ss], bs = new int[ss];\n\t\tint i, b, weight, value, best = 0, p = 0;\n\n\t\tfor (int j = 0; j < n; j++)\n\t\t\titems[j] = new Item(j);\n\t\tArrays.sort(items);\n\t\tfor (int j = 0; j < n; j++)\n\t\t\titemsSorted[j] = items[j].i();\n\t\titems = null; // For garbage collection.\n\n\t\t// Push item 0 onto the stack with and without bringing it.\n\t\tws[p] = 0; vs[p] = 0; is[p] = 0; bs[p] = 1; p++;\n\t\tws[p] = 0; vs[p] = 0; is[p] = 0; bs[p] = 0; p++;\n\n\t\twhile (p > 0) {\n\t\t\tp--; // Pop the latest item off the stack\n\t\t\ti = is[p]; b = bs[p];\n\t\t\tweight = ws[p] + w[i] * b;\n\t\t\tif (weight > k)\n\t\t\t\tcontinue;\n\t\t\tvalue = vs[p] + v[i] * b;\n\t\t\tif (bound(i, weight, value, itemsSorted) < best)\n\t\t\t\tcontinue;\n\t\t\tbest = Math.max(value, best);\n\t\t\tt[i] = b;\n\t\t\tif (i < n - 1) { // Push children onto stack w/ & w/o bringing item\n\t\t\t\tws[p] = weight; vs[p] = value; is[p] = i + 1; bs[p] = 1; p++;\n\t\t\t\tws[p] = weight; vs[p] = value; is[p] = i + 1; bs[p] = 0; p++;\n\t\t\t}\n\t\t\telse if (value >= best)\n\t\t\t\tSystem.arraycopy(t, 0, x, 0, n);\n\t\t}\n\t\treturn best;\n\t}", "public int objective() {\n\t\tint value = 0;\n\t\tfor (int i = 0; i < n; i++)\n\t\t\tvalue += v[i] * x[i];\n\t\treturn value;\n\t}", "int getEvaluations();", "public static void run(){\n\t\t\n\t\tMatrix A = null;\n\t\tVector b = null;\n\t\tVector c = null;\n\t\t\n\t\tfor (int n= 3; n<=11; n+=2 )\n\t\t{\n\t\t\tk=n-2;\n\t\t\tA = createConstraint(n, k) ;\n\t\t\tb = create_b(k, 0.5);\n\t\t\tc = create_c(n);\n\t\t\ttable = new SimplexTable(A, b, c, SimplexTable.MODE.EQUALITY);\n\t\t table.solve(); \n\t\t\tp(\"q_n( n=\"+n+\")= \" + (double) table.getMaxValue()); //(Math.round() / 100000);\n\t\t}\n\t\t\n\t}", "max_values OptimizeCargo(ArrayList<ore_excavation> oe, double wt,\n int index) {\n int i;\n double weight = 0.0;\n max_values mv;\n max_values new_mv = new max_values();\n /*\n \t\t * I am making a subset of the original vector because I\n \t\t * will be taking mined minerals out to test if adding\n \t\t * it to the cargo will maximize my value. I may need to\n \t\t * remove this mineral from the cargo and use another.\n \t\t *\n \t\t * But the beauty of recursion is that if the mineral does\n \t\t * not fit, unwinding the stack frames returns the\n \t\t * algorithm to a previous state to try other combinations of\n \t\t * minerals.\n \t\t *\n \t\t * Making a copy of the input vector allows this to happen.\n */\n ArrayList<ore_excavation> ro = new ArrayList<ore_excavation>(oe);\n\n /* Loop over all remaining minerals in subset */\n for (i = index; i < ro.size(); i++) {\n\n ore_excavation o = ro.get(i);\n\n weight = wt - o.ore_mass;\n\n if (weight >= 0.0) {\n /*\n \t\t\t\t * Weight will work. Now make the working\n \t\t\t\t * set smaller and try more minerals.\n \t\t\t\t * Pass the smaller set of remaining minerals\n \t\t\t\t * to try to add them to the cargo.\n */\n ro.remove(i); // Make set smaller.\n mv = OptimizeCargo(ro, weight, 0);\n mv.value += o.ore_value;\n\n if (mv.value > new_mv.value) {\n new_mv.value = mv.value;\n new_mv.weight = mv.weight + o.ore_mass;\n }\n continue;\n }\n }\n return new_mv;\n }", "@Override\n\tpublic double evaluate(IChromosome a_subject) {\n\n\t\t// Get Weights\n\t\tGene[] genes = a_subject.getGenes();\n\t\tdouble[] weights = new double[9];\n\t\tfor (int i = 0; i < genes.length; i++) {\n\t\t\tweights[i] = (double) genes[i].getAllele();\n\t\t}\n\n\t\tdouble totalValue = 0.0;\n\n\t\tfor (int i = 0; i < NUM_GAMES; i++) {\n\t\t\t// Initialize Game\n\t\t\tState s = new State();\n\t\t\t// new TFrame(s);\n\t\t\tdouble numPiecesPlayed = 0.0d;\n\t\t\twhile (!s.hasLost() && numPiecesPlayed < MAX_PIECES) {\n\t\t\t\ts.makeMove(findNextMove(s, weights));\n\t\t\t\t// s.draw();\n\t\t\t\t// s.drawNext(0, 0);\n\t\t\t\tnumPiecesPlayed++;\n\t\t\t\t// try {\n\t\t\t\t// Thread.sleep(10);\n\t\t\t\t// } catch (InterruptedException e) {\n\t\t\t\t// e.printStackTrace();\n\t\t\t\t// }\n\t\t\t}\n\t\t\ttotalValue += (double) s.getRowsCleared() + numPiecesPlayed / 100000d;\n\t\t}\n\n\t\treturn totalValue;\n\t}", "private void run(){\r\n\t\tArrayList<Integer> parcours = new ArrayList<Integer>();\r\n\t\tArrayList<Integer> sommets = new ArrayList<Integer>();\r\n\t\t\r\n\t\t//initialisation de la liste des sommets\r\n\t\tfor (int i=1; i<super.g.getDim();i++) {\r\n\t\t\tsommets.add(i);\r\n\t\t}\r\n\r\n\t\t//g�n�ration d'un parcours initial\r\n\t\tAlgo2opt algo = new Algo2opt(super.g);\r\n\t\tsuper.parcoursMin = algo.parcoursMin;\r\n\t\tsuper.dist = algo.dist;\r\n\r\n\t\tcheminMin(parcours,sommets,super.g.getDim(), 0);\r\n\t}", "public abstract double compute(double value);", "@Test\n public void testSubsequentRunsWithUnsatisfiablePenalizingConstraint() {\n System.out.println(\" - test subsequent runs with unsatisfiable penalizing constraint\");\n // set constraint\n final double penalty = 7.8;\n problem.addPenalizingConstraint(new NeverSatisfiedPenalizingConstraintStub(penalty));\n // perform multiple runs (maximizing objective)\n // perform multiple runs (maximizing objective)\n System.out.format(\" - low temperature (T = %.7f)\\n\", LOW_TEMP);\n multiRunWithMaximumRuntime(searchLowTemp, MULTI_RUN_RUNTIME, MAX_RUNTIME_TIME_UNIT, NUM_RUNS, true, true);\n System.out.format(\" - medium temperature (T = %.7f)\\n\", MED_TEMP);\n multiRunWithMaximumRuntime(searchMedTemp, MULTI_RUN_RUNTIME, MAX_RUNTIME_TIME_UNIT, NUM_RUNS, true, true);\n System.out.format(\" - high temperature (T = %.7f)\\n\", HIGH_TEMP);\n multiRunWithMaximumRuntime(searchHighTemp, MULTI_RUN_RUNTIME, MAX_RUNTIME_TIME_UNIT, NUM_RUNS, true, true);\n // verify\n PenalizedEvaluation penEval;\n penEval = (PenalizedEvaluation) searchLowTemp.getBestSolutionEvaluation();\n assertEquals(penalty, penEval.getEvaluation().getValue() - penEval.getValue(), TestConstants.DOUBLE_COMPARISON_PRECISION);\n penEval = (PenalizedEvaluation) searchMedTemp.getBestSolutionEvaluation();\n assertEquals(penalty, penEval.getEvaluation().getValue() - penEval.getValue(), TestConstants.DOUBLE_COMPARISON_PRECISION);\n penEval = (PenalizedEvaluation) searchHighTemp.getBestSolutionEvaluation();\n assertEquals(penalty, penEval.getEvaluation().getValue() - penEval.getValue(), TestConstants.DOUBLE_COMPARISON_PRECISION);\n }" ]
[ "0.68327725", "0.65435916", "0.63793", "0.6376135", "0.62909913", "0.6264018", "0.6229084", "0.62228125", "0.62217647", "0.61881423", "0.6182659", "0.6144456", "0.6116345", "0.6086706", "0.6015087", "0.5997763", "0.59763825", "0.5975317", "0.5971289", "0.5949306", "0.5933903", "0.59123576", "0.58925945", "0.58872557", "0.5884446", "0.58837885", "0.58798754", "0.58511305", "0.58260345", "0.5812075", "0.58005506", "0.5799134", "0.5787024", "0.57852924", "0.57812417", "0.5749539", "0.57480174", "0.5730408", "0.5727674", "0.5725838", "0.57221377", "0.57138175", "0.5712482", "0.57004917", "0.5695003", "0.56946737", "0.56915057", "0.56888384", "0.5680111", "0.56691337", "0.56575024", "0.5653041", "0.56514096", "0.5637882", "0.5630952", "0.56277794", "0.5614478", "0.56080806", "0.56067854", "0.5606366", "0.56050235", "0.56027144", "0.55973345", "0.5596203", "0.55906963", "0.5589521", "0.5586501", "0.5585608", "0.55744326", "0.55693364", "0.5566812", "0.5562906", "0.5560595", "0.5558732", "0.55481946", "0.5546048", "0.5541019", "0.5528728", "0.5525506", "0.5522763", "0.55187285", "0.5517742", "0.55173737", "0.5506729", "0.5505336", "0.54895735", "0.5487383", "0.5485174", "0.54843277", "0.548181", "0.54758716", "0.5473067", "0.54605037", "0.5455085", "0.54531807", "0.54248714", "0.5411024", "0.54088736", "0.54011583", "0.5390005" ]
0.589353
22
Our Constructor called in the Activities/Fragments
public PhoneInfoRecyclerviewAdapter(ArrayList<PhoneInfoModel> PhoneInfoModelArrayList, CustomItemClickListener customItemClickListener) { this.mPhoneInfoModels = PhoneInfoModelArrayList; this.mCustomItemClickListener = customItemClickListener; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public FragmentMy() {\n }", "public RickAndMortyFragment() {\n }", "private void init() {\n MyDashboard fragment = new MyDashboard();\n doFragmentTransaction(fragment, getString(R.string.dashboard), false);\n toolbar.setTitle(getString(R.string.dashboard));\n }", "public CuartoFragment() {\n }", "@Override\n\tpublic void onCreate(Bundle savedInstanceState){\n\t\tmActivity=getActivity();\n\t\tsuper.onCreate(savedInstanceState);\n\t}", "public IntentDetailFragment() {\n }", "private void init(Bundle savedInstanceState) {\n }", "private void init(Bundle savedInstanceState) {\n }", "private void init(Bundle savedInstanceState) {\n }", "private void init(Bundle savedInstanceState) {\n }", "@Override\n public void onCreate(@Nullable Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n initArguments();\n }", "@Override\n public void onInit()\n {\n\n }", "public ForecastFragment() {\n }", "public NoteActivityFragment() {\n }", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t\tinit();\n\t}", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n initData();\n // L.e(TAG, \"msg: onCreate\" + city);\n }", "@Override\n\tpublic void onActivityCreated(@Nullable Bundle savedInstanceState) {\n\t\tinitView();\n\t\tinitListener();\n\t\tinitData();\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "public PatientDetailLogsFragment() {\n }", "@Override\n public void onActivityCreated(Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n\n }", "@Override\n public void onActivityCreated(Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n\n }", "@Override\r\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\tmInflater = LayoutInflater.from(getActivity());\r\n\t\tmApplication = PushApplication.getInstance();\r\n\t\tmUserDB = mApplication.getUserDB();\r\n\t\tmSpUtil = mApplication.getSpUtil();\r\n\r\n\t\tinitAcountSetView();\r\n\t\tinitFaceEffectView();\r\n\t\tinitExitView();\r\n\t\tinitFeedBackView();\r\n\t\tinitAboutView();\r\n\r\n\t}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n if (savedInstanceState != null) {\n msgType = savedInstanceState.getString(\"msgType\");\n timeFlag = savedInstanceState.getString(\"time\");\n fromme = savedInstanceState.getBoolean(\"fromme\");\n title = savedInstanceState.getString(\"title\");\n } else {\n initPassData();\n }\n initViews();\n initDeatilsData();\n initListener();\n }", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tLogUtil.d(TAG, \"onActivityCreated---------\");\n\t\tinitData(savedInstanceState);\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\n protected void onCreate(@Nullable Bundle savedInstanceState) {\n\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n page = getArguments().getInt(\"someInt\", 0);\n title = getArguments().getString(\"someTitle\");\n context=getActivity();\n isCitySelected=false;\n }", "protected void onInit() {\n\t}", "private void instanciateFragments() {\r\n connectionFragment = new ConnectionFragment();\r\n mNetworkConnectionFragment = new NetworkConnectionFragment();\r\n mMotorFragment = new MotorFragment();\r\n mProcessorFragment = new ProcessorFragment();\r\n mPWMFragment = new PWMFragment();\r\n mOrderTestFragment = new OrderTestFragment();\r\n mTestsFragment = new TestsFragment();\r\n mPositionTestFragment = new PositionTestFragment();\r\n mOrderPilotFragment = new OrderPilotFragment();\r\n mCommandPilotFragment = new CommandPilotFragment();\r\n mPositionPilotFragment = new PositionPilotFragment();\r\n mCartographerFragment = new CartographerFragment();\r\n mHistoryFragment = new HistoryFragment();\r\n }", "public MainActivityFragment(){\n\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceBundle)\n\t{\n\t\tsuper.onCreate(savedInstanceBundle);\n\t\tView initView = initView();\n\t\tsetBaseView(initView);\n\t\tinitValues();\n\t\tinitListeners();\n\t}", "public MyGoodsFragment() {\n }", "@Override\n public void onActivityCreated(Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n }", "@Override\n public void onActivityCreated(Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n }", "public Fragment_Tutorial() {}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t\t\r\n\t\tinitView();\r\n\t}", "@Override\n\tpublic void onActivityCreated(Activity activity, Bundle savedInstanceState)\n\t{\n\t}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n init();\n }", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\n\t\tmContext = (LFActivity) getActivity();\n\t\tinit();\n\t}", "public MainActivityFragment() {\n }", "public MainActivityFragment() {\n }", "@Override\n public void onCreate(@Nullable Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(@Nullable Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate() {\n super.onCreate();\n initData();\n }", "@Override \n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetParams();\n\t}", "private void init() {\n\t\tpager = (MainViewPager) findViewById(R.id.main_pager);\n\t\tfrageManager = getSupportFragmentManager();\n\t\tfoot_group = (RadioGroup) findViewById(R.id.foot_group);\n\t\tadapter = new MyFragmentAdapter(frageManager, list);\n\t}", "public GalleryActivityFragment() { //Constructor which has no function, but is required\n }", "@Override\n\t\tpublic void onCreate(Bundle savedInstanceState)\n\t\t\t{\n\t\t\t\tsuper.onCreate(savedInstanceState);\n\t\t\t}", "@Override\n protected void onCreate(@Nullable Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n BusProvider.register(this);\n findViews();\n init();\n getData();\n //customizeActionBar();\n\n loadContact();\n }", "@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t\t\r\n\t\tinitViewPager();\r\n\t\t\r\n\t\tinitView();\r\n\r\n\t\tinitCursor();\r\n\t\t\r\n\t\tinithuanxin(savedInstanceState);\r\n\t\r\n \r\n\t}", "public LogFragment() {\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "protected void init(){\n /*Link Navigation Header Items*/\n songName = activity.findViewById(R.id.navigation_header_songName);\n songArtist = activity.findViewById(R.id.navigation_header_artistName);\n songAlbumArt = activity.findViewById(R.id.navigation_album_art);\n\n /*Setup Navigation Drawer*/\n mDrawerLayout = activity.findViewById(R.id.drawer_layout);\n mToggle = new ActionBarDrawerToggle(activity, mDrawerLayout, R.string.open, R.string.close);\n mDrawerLayout.addDrawerListener(mToggle);\n\n /*Synchronize the indicator with the state of the linked DrawerLayout after onRestoreInstanceState has occurred.*/\n mToggle.syncState();\n\n NavigationView navigationView = activity.findViewById(R.id.drawer_navigation_view);\n navigationView.setNavigationItemSelectedListener(this);\n\n getSongEventHandler().addSongPlaybackEventListener(this);\n }", "@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t\tinitData(savedInstanceState);\r\n\t}", "@Override\n\tprotected void onCreate(Bundle arg0) {\n\t\t if (arg0 != null) {\n\t\t\t arg0.putParcelable(\"android:support:fragments\",null);\n\t }\n\t\t super.onCreate(arg0);\n\t\t requestWindowFeature(Window.FEATURE_NO_TITLE);\n\t\t setLayout();\n\t\t // 注入控件\n\t ViewUtils.inject(this);\n\t\t init(arg0);\n\t}", "public CustomerFragment() {\n }", "@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t}", "public AddToCardFragment() {\n }", "@Override\n public void onCreate() {\n L.d(\"onCreate is called\");\n super.onCreate();\n }", "public AddReminderFragment() {\n }", "public FitnessActivityTypeFragment() {\n }", "@Override\n public void onCreate(Bundle savedInstanceState)\n {\n super.onCreate( savedInstanceState );\n }", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\n public void onActivityCreated(@Nullable Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n initData(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "public TechFragment() {\n }", "@Override\r\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\r\n c = (CourseModel) getIntent().getSerializableExtra(ContextUtil.CATEGORY_COURSE);\r\n initSlidingMenu();\r\n setContentView(R.layout.unit);\r\n initView();\r\n setListener();\r\n fm = getSupportFragmentManager();\r\n getCourseInfo();\r\n topName.setText(c.getName());\r\n }", "public MyLocationsFragment() {\n }", "@Override\n public void onCreate() {\n super.onCreate();\n }", "@Override\n public void onCreate() {\n super.onCreate();\n }", "public ServiceItemFragmentNew() {\n }", "@Override\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\t\n\t\tmControlCenter = FragmentControlCenter.getInstance(this);\n\t\tpersonfragmentModel = mControlCenter.getPersonFragmentModel();\n\t\tInfos.main=this;\n\t\tsetupViews();\n\t\t\n\t\tinitData();\n\t}", "public NewShopFragment() {\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n }", "public HomeFragment() {}", "@Override\n public void onCreate()\n {\n\n super.onCreate();\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tinitView();\n\t\tinitData();\n\t\tinitEvent();\n\t}", "@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\r\n\r\n\t}", "public LocalizationFragment() {\n }", "public ExploreFragment() {\n\n }", "public MenuCategoryFragment() {\n\n }", "public PersonDetailFragment() {\r\n }", "public VehicleFragment() {\r\n }", "@Override\n protected void init() {\n viewModel.setNavigator(this);\n setUp();\n subscribeToLiveData();\n\n setUpNotificationUi();\n setUpNotification();\n\n setUpAds();\n\n viewModel.start(getCurrentVersionOfApp());\n }" ]
[ "0.68369234", "0.6787069", "0.6783856", "0.67492765", "0.6727946", "0.6682861", "0.6672766", "0.6672766", "0.6672766", "0.6672766", "0.6651027", "0.6635138", "0.6609649", "0.6602784", "0.6599746", "0.65806776", "0.65770364", "0.65743434", "0.65670806", "0.65670806", "0.6556137", "0.655591", "0.65353036", "0.65304947", "0.6522318", "0.6520939", "0.651723", "0.65169907", "0.6510524", "0.65045595", "0.65031856", "0.65031856", "0.64989567", "0.6498288", "0.6494683", "0.6494498", "0.6494488", "0.6493533", "0.64929295", "0.64929295", "0.6482783", "0.6482783", "0.64792717", "0.64753383", "0.64619935", "0.6450618", "0.644989", "0.6448607", "0.64416754", "0.6440493", "0.6439936", "0.64323074", "0.6430437", "0.6429935", "0.6424088", "0.64232475", "0.6420508", "0.64176995", "0.6417608", "0.6417424", "0.6414855", "0.6412784", "0.6412784", "0.6412784", "0.6412784", "0.6412784", "0.6412784", "0.64108413", "0.6410683", "0.6410683", "0.6410683", "0.6410683", "0.6410683", "0.6410683", "0.6410683", "0.6410683", "0.6410683", "0.6410683", "0.6410683", "0.6410683", "0.6410683", "0.6406956", "0.64065117", "0.64046746", "0.63978815", "0.63978815", "0.6394225", "0.6392195", "0.6391375", "0.63879514", "0.6381951", "0.63797706", "0.6376265", "0.63748497", "0.6373701", "0.6372614", "0.637185", "0.636996", "0.63687253", "0.6368121", "0.6366197" ]
0.0
-1
create a new view with our layout
@Override public PhoneInfoRecyclerviewAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { final View inflatedView = LayoutInflater.from(parent.getContext()) .inflate(R.layout.single_view_phone_info, parent, false); // create a new view holder for our inflated new view final ViewHolder holder = new ViewHolder(inflatedView); // setup an on click listener on our inflated view inflatedView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mCustomItemClickListener.onItemClick(inflatedView, holder.getAdapterPosition()); } }); return holder; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "View createView();", "@Override\n public void Create() {\n\n initView();\n }", "ViewContainer createViewContainer();", "ViewElement createViewElement();", "@Override\n\tpublic View onMainCreateView(Activity activity) {\n\t\tlayout = new FrameLayout(activity);\n\t\treturn layout;\n\t}", "private View create(PersistedView pView) {\n DsmSorting sorting = nameToSorting.get(pView.dsmSortingName);\n if (null == sorting) {\n sorting = DsmSorting.values()[0];\n }\n\n View view = new View();\n view.setName(decodeString(pView.name));\n view.setSorting(sorting);\n\n return view;\n }", "public Layout() {\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n\n\n view = inflater.inflate(LAYOUT, container, false);\n return view;\n }", "public View create(Element elem) {\n return null;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(getLayoutId(), container, false);\n init(view);\n return view;\n }", "public abstract ArchECoreView newView(ArchECoreArchitecture architecture) throws ArchEException;", "ViewComponent createViewComponent();", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_new_design, container, false);\n }", "private void createView() {\n\t\tif (txtButtonCaption == null) {\n\t\t\tView v = LayoutInflater.from(getContext()).inflate(R.layout.ijoomer_voice_button, null);\n\n\t\t\tlnrPlayVoice = (LinearLayout) v.findViewById(R.id.lnrPlayVoice);\n\t\t\tlnrReportVoice = (LinearLayout) v.findViewById(R.id.lnrReportVoice);\n\n\t\t\ttxtButtonCaption = (IjoomerTextView) v.findViewById(R.id.txtButtonCaption);\n\t\t\timgPlay = (ImageView) v.findViewById(R.id.imgPlay);\n\t\t\tgifVoiceLoader = (IjoomerGifView) v.findViewById(R.id.gifVoiceLoader);\n\n\t\t\timgReport = (ImageView) v.findViewById(R.id.imgReport);\n\t\t\ttxtReportCaption = (IjoomerTextView) v.findViewById(R.id.txtReportCaption);\n\n\t\t\tpbrLoading = (ProgressBar) v.findViewById(R.id.pbrLoading);\n\n\t\t\taddView(v, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT));\n\t\t\tupdateView();\n\t\t\tsetActionListener();\n\t\t}\n\t}", "@Override\n\tpublic View onCreateView(LayoutInflater inflater,\n\t\t\t@Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n\t\tView view = inflater.inflate(R.layout.one, null);\n\t\treturn view;\n\t}", "private void InitView() {\n\t\tmLinearLayout = new LinearLayout(getContext());\n\t\t//mLinearLayout.setBackgroundResource(MusicApplication.getInstance().getBgResource());\n\t\t\n\t\t//Modify by LiYongNam 2012.9.19_start\n\t\tMusicUtil.setBackgroundOfView ( mLinearLayout, getContext() );\t\t\t\t\n\t\t//Modify by LiYongNam 2012.9.19_end\n\t\t\n\t\tmLinearLayout.setOrientation(LinearLayout.VERTICAL);\n\t\tmLinearLayout.setPadding(1, 1, 1, Util.dipTopx(getContext(), 60));\n\t\t// 导航条\n\t\taddTitleBar(-1, \"编辑列表\", R.drawable.check_off, R.drawable.title_bar);\n\n\t\tmControlBar = new ControlBar(getContext());\n\t\tmControlBar.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,\n\t\t\t\tUtil.dipTopx(getContext(), 60)));\n\n//\t\taddControlButton(\"全选\", CONTROL1, 0);\n\t\taddControlButton(\"播放\", CONTROL2, 1);\n\t\taddControlButton(\"加入\", CONTROL3, 2);\n\t\taddControlButton(\"删除\", CONTROL4, 3);\n\n\t}", "private void addViews() {\n\t}", "@Override\n\tpublic TiUIView createView(Activity activity)\n\t{\n\t\tif (placeholder) {\n\n\t\t\t// Placeholder for header or footer, do not create view.\n\t\t\treturn null;\n\t\t}\n\n\t\treturn new RowView(this);\n\t}", "private View creatView(ViewGroup parent) {\n\t\tView convertView;\n\t\tViewHolder vh = new ViewHolder();\n\t\tconvertView = LayoutInflater.from(mContext).inflate(R.layout.message_function_layout, parent, false);\n\t\tvh.mImageView = (ImageView)convertView.findViewById(R.id.message_function_btn);\n\t\tvh.mTextView = (TextView)convertView.findViewById(R.id.message_function_name);\n\t\tconvertView.setTag(vh);\n\t\treturn convertView;\n\t}", "@Override\n public View getView() {\n photoLayout = new LinearLayout(context);\n addPhotoButton = new Button(context);\n addPhotoButton.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n dispatchTakePictureIntent();\n }\n });\n addPhotoButton.setText(\"Take a photo\");\n photoLayout.addView(addPhotoButton);\n// photoLayout.\n return photoLayout;\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n\t\t\tBundle savedInstanceState) {\n\t\treturn inflater.inflate(R.layout.main_fhmx, container, false);\r\n\t}", "protected void createLayout() {\n\t\tthis.layout = new GridLayout();\n\t\tthis.layout.numColumns = 2;\n\t\tthis.layout.marginWidth = 2;\n\t\tthis.setLayout(this.layout);\n\t}", "private void createDrawingView() {\r\n mDrawingView = new DrawingView(mContext);\r\n LinearLayout mDrawingPad = (LinearLayout) findViewById(R.id.drawing_pad);\r\n mDrawingPad.addView(mDrawingView);\r\n }", "@Override\n public View onCreateView(LayoutInflater inflater,\n @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n mRootView = inflater.inflate(getLayoutId(), null);\n x.view().inject(this, mRootView);\n return mRootView;\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n\t\t\tBundle savedInstanceState) {\n\t\treturn inflater.inflate(R.layout.live_layout, null);\r\n\t}", "private View onRealCreateView(Context context, String name, AttributeSet attrs) {\n View view = null;\n try {\n if (-1 == name.indexOf('.')) {\n if (\"View\".equals(name)) {\n view = LayoutInflater.from(context).createView(name, \"android.view.\", attrs);\n }\n if (view == null) {\n view = LayoutInflater.from(context).createView(name, \"android.widget.\", attrs);\n }\n if (view == null) {\n view = LayoutInflater.from(context).createView(name, \"android.webkit.\", attrs);\n }\n } else {\n view = LayoutInflater.from(context).createView(name, null, attrs);\n }\n\n LogUtils.i(\"about to create \" + name);\n\n } catch (Exception e) {\n LogUtils.e(\"error while create 【\" + name + \"】 : \" + e.getMessage());\n view = null;\n }\n return view;\n }", "@Override\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tmContext = getActivity();\n\t\tll = new LinearLayout(getActivity());\n\t\tLinearLayout.LayoutParams params = new LinearLayout.LayoutParams(\n\t\t\t\tLinearLayout.LayoutParams.FILL_PARENT,\n\t\t\t\tLinearLayout.LayoutParams.FILL_PARENT);\n\t\tthis.getActivity().addContentView(ll, params);\n\t}", "ViewComponentPart createViewComponentPart();", "protected Scene createView() {\n\t\treturn null;\n\t}", "public View create(Element elem, int p0, int p1) {\n return null;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.add, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n\t\tmRoot = inflater.inflate(R.layout.mouse_layout, container, false); \n\t\tinitializeUI();\n\t\treturn mRoot; \n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_top_matrix, container, false);\n\n\n //Wire up the UI widgets so they can handle events later\n wireWidgets(v);\n\n return v;\n }", "private View createAccountLayout() {\r\n\t\tLinearLayout accountLayout = new LinearLayout(getContext());\r\n\t\tLayoutParams aclp = new LayoutParams(android.view.ViewGroup.LayoutParams.WRAP_CONTENT,\r\n\t\t\t\tandroid.view.ViewGroup.LayoutParams.WRAP_CONTENT, 3);\r\n\t\taccountLayout.setOrientation(VERTICAL);\r\n\t\taccountLayout.setLayoutParams(aclp);\r\n\t\tTextView t = new TextView(getContext());\r\n\t\tLayoutParams tlp = new LayoutParams(android.view.ViewGroup.LayoutParams.FILL_PARENT,\r\n\t\t\t\tandroid.view.ViewGroup.LayoutParams.WRAP_CONTENT);\r\n\r\n\t\tt.setLayoutParams(tlp);\r\n\t\tt.setText(account.getName());\r\n\t\tt.setTextSize(16);\r\n\t\tt.setTypeface(Typeface.DEFAULT_BOLD);\r\n\t\tt.setTextColor(getContext().getResources().getColor(R.color.black));\r\n\t\taccountLayout.addView(t);\r\n\r\n\t\tTextView desc = new TextView(getContext());\r\n\t\tif (account.getLastOperation() != null) {\r\n\t\t\tdesc.setText(\"\" + DateUtil.defaultDateFormat.format(account.getLastOperation()));\r\n\t\t}\r\n\t\taccountLayout.addView(desc);\r\n\t\treturn accountLayout;\r\n\t}", "private void setViewLayout() {\n\t\tthis.setBorder(new EmptyBorder(15, 15, 15, 15));\n\t\tthis.setLayout(new GridLayout(2, 2, 15, 15));\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.first_step_layout, container, false);\n initView();\n return view;\n }", "@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\n\t\t\tBundle savedInstanceState) {\n\t\treturn inflater.inflate(R.layout.xxh_gamelayout3, container, false);\n\t}", "@Nullable\n @Override\n public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n return inflater.inflate(R.layout.blank, container, false);\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n\t\t\tBundle savedInstanceState) {\n\t\tView v=inflater.inflate(R.layout.notepad_main, container, false);\r\n\t\tbody=(LineEditText) v.findViewById(R.id.body);\r\n\t\tdel=(Button) v.findViewById(R.id.delAll);\r\n\t\tdel.setOnClickListener(this);\r\n\t\treturn v;\r\n\t}", "@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\n\t\t\tBundle savedInstanceState) {\n\t\tView view = inflater.inflate(R.layout.fragment_topo_structure,\n\t\t\t\tcontainer, false);\n\t\tnodeView = (topoStructureView) view.findViewById(R.id.topoStructureView);\n\t\tif (MainActivity.serialPortConnect)\n\t\t\tnew Thread(new MyThread()).start();\n\t\t\n\t\treturn view;\n\t}", "Board createLayout();", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.add_chat, container, false);\n }", "@Override\n public void Create() {\n initView();\n initData();\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n\t\t\tBundle savedInstanceState) {\n\t\tv = inflater.inflate(R.layout.wisata, container, false);\r\n \r\n\t\t\r\n\t\t\r\n\t\treturn v;\r\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.be_admin_printers, container, false);\n\n /** RETURN THE VIEW INSTANCE TO SETUP THE LAYOUT **/\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_add_stamp, container, false);\n ButterKnife.bind(this, rootView);\n constraintLayout = rootView.findViewById(R.id.layout_header);\n init();\n return rootView;\n\n }", "@Override\n public View newView(Context context, Cursor cursor, ViewGroup parent) {\n\n View view = LayoutInflater.from(context).inflate(R.layout.grid_item_movie, parent, false);\n\n return view;\n }", "@Override\n\t\tpublic View newView(Context context, Cursor cursor, ViewGroup parent) {\n\t\t\tLayoutInflater inflater = (LayoutInflater)context\n\t\t\t\t.getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n\t\t\treturn inflater\n\t\t\t\t\t.inflate(R.layout.list_item_exercise, parent, false);\n\t\t}", "private void initView() {\n\n LayoutInflater inflater = getLayoutInflater();\n final int screenWidth = MyUtils.getScreenMetrics(this).widthPixels;\n final int screenHeight = MyUtils.getScreenMetrics(this).heightPixels;\n for (int i = 0; i < 3; i++) {\n ViewGroup layout = (ViewGroup) inflater.inflate(\n R.layout.content_layout, myHorizontal, false);\n layout.getLayoutParams().width = screenWidth;\n TextView textView = (TextView) layout.findViewById(R.id.title);\n textView.setText(\"page \" + (i + 1));\n layout.setBackgroundColor(Color.rgb(255 / (i + 1), 255 / (i + 1), 0));\n createList(layout);\n myHorizontal.addView(layout);\n }\n }", "private void buildView() {\n this.setHeaderInfo(model.getHeaderInfo());\n\n CWButtonPanel buttonPanel = this.getButtonPanel();\n \n buttonPanel.add(saveButton);\n buttonPanel.add(saveAndCloseButton);\n buttonPanel.add(cancelButton);\n \n FormLayout layout = new FormLayout(\"pref, 4dlu, 200dlu, 4dlu, min\",\n \"pref, 2dlu, pref, 2dlu, pref, 2dlu, pref\"); // rows\n\n layout.setRowGroups(new int[][]{{1, 3, 5}});\n \n CellConstraints cc = new CellConstraints();\n this.getContentPanel().setLayout(layout);\n \n this.getContentPanel().add(nameLabel, cc.xy (1, 1));\n this.getContentPanel().add(nameTextField, cc.xy(3, 1));\n this.getContentPanel().add(descLabel, cc.xy(1, 3));\n this.getContentPanel().add(descTextField, cc.xy(3, 3));\n this.getContentPanel().add(amountLabel, cc.xy(1, 5));\n this.getContentPanel().add(amountTextField, cc.xy(3, 5));\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_add_new_entry, container, false);\n }", "@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n\t\tview = inflater.inflate(R.layout.main, container,false);\n\n\t\t//Update this view's content\n\t\tupdate();\n\n\t\t//Return this view to the adapter\n\t\treturn view;\n\t}", "private void createView() {\n\t\tTabWidget tWidget = (TabWidget) findViewById(android.R.id.tabs);\r\n\t\tshowLayout = (LinearLayout) LayoutInflater.from(this).inflate(\r\n\t\t\t\tR.layout.tab_layout, tWidget, false);\r\n\t\tImageView imageView = (ImageView) showLayout.getChildAt(0);\r\n\t\tTextView textView = (TextView) showLayout.getChildAt(1);\r\n\t\timageView.setImageResource(R.drawable.main_selector);\r\n\t\ttextView.setText(R.string.show);\r\n\r\n\t\taddLayout = (LinearLayout) LayoutInflater.from(this).inflate(\r\n\t\t\t\tR.layout.tab_layout, tWidget, false);\r\n\t\tImageView imageView1 = (ImageView) addLayout.getChildAt(0);\r\n\t\tTextView textView1 = (TextView) addLayout.getChildAt(1);\r\n\t\timageView1.setImageResource(R.drawable.add_selector);\r\n\t\ttextView1.setText(R.string.add_record);\r\n\r\n\t\tchartLayout = (LinearLayout) LayoutInflater.from(this).inflate(\r\n\t\t\t\tR.layout.tab_layout, tWidget, false);\r\n\t\tImageView imageView2 = (ImageView) chartLayout.getChildAt(0);\r\n\t\tTextView textView2 = (TextView) chartLayout.getChildAt(1);\r\n\t\timageView2.setImageResource(R.drawable.chart_selector);\r\n\t\ttextView2.setText(R.string.chart_show);\r\n\t}", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n\t\t\tBundle savedInstanceState) {\n\t\treturn inflater.inflate(R.layout.stage_layout, null);\r\n\t}", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n\t\t\tBundle savedInstanceState) {\n\t\treturn inflater.inflate(R.layout.wallpager_layout, null);\r\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.book_list, container, false);\n\n /** RETURN THE VIEW INSTANCE TO SETUP THE LAYOUT **/\n return view;\n }", "public ViewClass() {\n\t\tcreateGUI();\n\t\taddComponentsToFrame();\n\t\taddActionListeners();\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n\treturn inflater.inflate(R.layout.activity_main, container, false);\n }", "public myView() {\n initComponents();\n CreatMenu();\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n \n return this.view;\n }", "private void initView() {\n\n }", "void initView();", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.gui_fragment,\n container, false);\n\n return view;\n }", "public void layoutView()\n\t{\n\t\tthis.setLayout(new GridLayout(2,5));\n\t\tthis.add(expression);\n\t\tthis.add(var);\n\t\tthis.add(start);\n\t\tthis.add(end);\n\t\tthis.add(this.plot);\n\t\tthis.add(InputView.coords);\n\t\tthis.add(this.in);\n\t\tthis.add(this.out);\n\t}", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {\n\n return inflater.inflate(R.layout.model_detail_layout, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View layout = inflater.inflate(R.layout.fragment_explore, container, false);\n PlantasInit(getContext());\n rv = layout.findViewById(R.id.homerv);\n rv.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayout.VERTICAL,false));\n return layout;\n }", "public View() {\n this.view = new ViewPanel();\n //this.view.setGraph(this.graph);\n initComponents();\n this.m_algoritmos.setEnabled(false);\n this.mi_maze.setEnabled(false);\n this.mi_salvarImagem.setEnabled(false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n Log.v(\"MeInfoEdit\",\"onCreateView\");\n if(view==null){\n view =inflater.inflate(R.layout.fragment_me_info_edit, container, false);\n }\n ((MainActivity)getActivity()).unBindDrawer();\n ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);\n swipLayout=new SwipLayout(getContext());\n swipLayout.setLayoutParams(params);\n swipLayout.setBackgroundColor(Color.TRANSPARENT);\n swipLayout.removeAllViews();\n swipLayout.addView(view);\n if(CoreApplication.newInstance().getRoot()!=null){\n Log.v(\"MeinfoEdit\",\"rootView not null\");\n }\n swipLayout.setParentView(getTargetFragment().getView()).setFragment(MeInfoEdit.this);\n return swipLayout;\n }", "@Nullable\n public View onCreateView(LayoutInflater inflater,\n @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n if (null == view) {\n myContainer = new LinearLayout(mContext);\n view = inflater.inflate(R.layout.listitem_banner, null);\n view.setMinimumHeight(((WindowManager) getActivity()\n .getSystemService(Context.WINDOW_SERVICE))\n .getDefaultDisplay().getHeight());\n view.setMinimumWidth(((WindowManager) getActivity()\n .getSystemService(Context.WINDOW_SERVICE))\n .getDefaultDisplay().getWidth());\n initData();\n myContainer.addView(view);\n } else {\n myContainer.removeAllViews();\n myContainer = new LinearLayout(getActivity());\n myContainer.addView(view);\n }\n return myContainer;\n }", "@NonNull\n View buildView(@NonNull LayoutInflater inflater, @NonNull ViewGroup parent);", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_ins_tructor_event_create, container, false);\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n\t\tmainLayout = inflater.inflate(R.layout.fragment_play, container, false);\r\n\t\treturn mainLayout;\r\n\t}", "public FinalEditLayout(ViewGroup parent){\n this.parent = parent;\n onCreate();\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.day_layout, container,false);\n setPieMap(v);\n loadDatas();\n simulator();\n return v;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_site_progress_add, container, false);\n setHasOptionsMenu(true);\n ButterKnife.bind(this, view);\n\n initializeUI();\n bindData();\n return view;\n }", "public abstract void initView();", "@Override\n public void createInitialLayout(IPageLayout layout) {\n defineActions(layout);\n defineLayout(layout);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_create_class, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_admin_dash_board, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fg_movie, null);\n }", "public void createInitialLayout(IPageLayout layout) {\n \n\t}", "private void init() {\n mainll = new LinearLayout(getContext());\n mainll.setId(View.generateViewId());\n mainll.setLayoutParams(new ActionBar.LayoutParams(ActionBar.LayoutParams.MATCH_PARENT, ActionBar.LayoutParams.WRAP_CONTENT));\n mainll.setOrientation(LinearLayout.VERTICAL);\n\n map = new HashMap<>();\n\n RelativeLayout mainrl = new RelativeLayout(getContext());\n RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(ActionBar.LayoutParams.MATCH_PARENT,\n ActionBar.LayoutParams.WRAP_CONTENT);\n\n params.addRule(RelativeLayout.BELOW, mainll.getId());\n\n save = new Button(getContext());\n\n save.setLayoutParams(params);\n save.setText(\"save\");\n\n mainrl.addView(mainll);\n mainrl.addView(save);\n addView(mainrl);\n }", "public Layout() {\n super(\"Chitrashala\");\n initComponents();\n }", "private ViewFactory() {}", "@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\n\t\t\tBundle savedInstanceState) {\n\n\t\tif (view != null) {\n\t\t\tLog.i(\"222222\", \"11111111\");\n\t\t\tViewGroup parent = (ViewGroup) view.getParent();\n\t\t\tif (parent != null)\n\t\t\t\tparent.removeView(view);\n\t\t}\n\t\ttry {\n\t\t\tview = inflater.inflate(R.layout.f_mine, container, false);\n\t\t\tinitView();\n\t\t} catch (InflateException e) {\n\n\t\t}\n\n\t\treturn view;\n\t}", "@Override\n public View newView(Context context, Cursor cursor, ViewGroup parent) {\n return LayoutInflater.from(context).inflate(R.layout.todo_row, parent, false);\n }", "public abstract void initViews();", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view=inflater.inflate(R.layout.fragment_seperate_detail_map, container, false);\n defineView(view);\n return view;\n }", "@Override public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_movement, container, false);\n ButterKnife.bind(this, view);\n return view;\n }", "protected abstract void initView();", "protected void onLoadLayout(View view) {\n }", "private void setUpView(int width, int height){\n addKeyListener(new KeyPadListener());\n setFocusable(true);\n setLayout(null);\n setBounds(0,0,width,height);\n setBackground(new Color(0,0,0,0));\n requestFocus();\n addMouseListener(new MouseCatcher());\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.root_fragment, container, false);\n//replace root_frame with newGameView\n FragmentTransaction transaction = getFragmentManager()\n .beginTransaction();\n transaction.replace(R.id.root_frame, new NewGameView());\n transaction.commit();\n\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState)\n {\n return inflater.inflate(R.layout.frag_new_entries, container, false);\n }", "protected ViewLayoutState createChild(View v) {\n ViewLayoutState child;\n if (v instanceof ViewLayoutState) {\n child = (ViewLayoutState)v;\n } else { // view does not implement ViewLayoutState\n child = createDefaultChild(v);\n }\n return child; \n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_add_new_incident, container, false);\n\n initView(view);\n incidentData();\n\n return view;\n }", "@Override\n\tprotected int initView() {\n\t\treturn R.layout.activity_zhusu_detail;\n\t}", "@Override\r\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_fore_cast, container, false);\r\n initView();\r\n mainLayout.setVisibility(View.GONE);\r\n apiInterface = RestClinet.getClient().create(ApiInterface.class);\r\n loadData();\r\n return view;\r\n }", "public void layout() {\n TitleLayout ll1 = new TitleLayout(getContext(), sourceIconView, titleTextView);\n\n // All items in ll1 are vertically centered\n ll1.setGravity(Gravity.CENTER_VERTICAL);\n ll1.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,\n LayoutParams.WRAP_CONTENT));\n ll1.addView(sourceIconView);\n ll1.addView(titleTextView);\n\n // Container layout for all the items\n if (mainLayout == null) {\n mainLayout = new LinearLayout(getContext());\n mainLayout.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,\n LayoutParams.WRAP_CONTENT));\n mainLayout.setPadding(adaptSizeToDensity(LEFT_PADDING),\n adaptSizeToDensity(TOP_PADDING),\n adaptSizeToDensity(RIGHT_PADDING),\n adaptSizeToDensity(BOTTOM_PADDING));\n mainLayout.setOrientation(LinearLayout.VERTICAL);\n }\n\n mainLayout.addView(ll1);\n\n if(syncModeSet) {\n mainLayout.addView(syncModeSpinner);\n }\n\n this.addView(mainLayout);\n }", "private void setupView(JLabel view, int w, int h, int x, int y) {\n\n view.setSize(w,h);\n view.setLocation(x,y);\n\n add(view);\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.layout_detail, container, false);\n ButterKnife.bind(this, view);\n return view;\n }" ]
[ "0.78457", "0.7139722", "0.7044578", "0.68942297", "0.68596846", "0.6628105", "0.6625789", "0.65503657", "0.6544132", "0.65380484", "0.6533626", "0.6520995", "0.651452", "0.6502942", "0.65020955", "0.6490033", "0.64502984", "0.6449736", "0.64155054", "0.6412615", "0.64103305", "0.6410141", "0.6402316", "0.64022493", "0.6399382", "0.6393651", "0.63879955", "0.6385312", "0.63813007", "0.63768125", "0.6371693", "0.6364604", "0.63633764", "0.63500804", "0.63391685", "0.6336281", "0.63338214", "0.63317513", "0.6329756", "0.6319688", "0.63182384", "0.63098216", "0.6298769", "0.62961584", "0.62927556", "0.62806743", "0.62678695", "0.6252183", "0.6249158", "0.6248727", "0.624616", "0.623522", "0.6232052", "0.62315875", "0.6230744", "0.62275183", "0.6218379", "0.62159175", "0.62124574", "0.6206933", "0.6204591", "0.62025803", "0.6193691", "0.61841035", "0.6181799", "0.6180456", "0.6175531", "0.6174721", "0.6171671", "0.61695135", "0.6168932", "0.6160941", "0.6157778", "0.61538935", "0.6153087", "0.6149104", "0.6144789", "0.614002", "0.6136681", "0.6136358", "0.61318547", "0.61285007", "0.6120922", "0.6120272", "0.61202306", "0.6117785", "0.6117616", "0.6112753", "0.6110476", "0.61092937", "0.61030763", "0.61017", "0.6100701", "0.61002314", "0.60997224", "0.60956126", "0.609391", "0.6088569", "0.60841596", "0.60831505", "0.6082116" ]
0.0
-1
get ref to a single model
@Override public void onBindViewHolder(ViewHolder holder, int position) { PhoneInfoModel phoneInfo = mPhoneInfoModels.get(position); // bind the model to the holder holder.bindPhoneInfo(phoneInfo); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "EReference getModelReference();", "Object getRefid();", "public ObjectReference getObject();", "public Object getModel();", "public long getModelId();", "public DatabaseReference getRef(String type) {\n return db.getReference(type);\n }", "public String getFraudModelModelReference() {\n return fraudModelModelReference;\n }", "public String getReference();", "public String getReference();", "public Model getModel () { return _model; }", "SingleDocumentModel getCurrentDocument();", "java.lang.String getRef();", "String getReference();", "String getReference();", "String getT_modelUri();", "@Override\r\n\tpublic Ref getRef() {\n\t\treturn ref;\r\n\t}", "static RatAppModel getInstance() {return model;}", "@Override\r\n\tpublic T getModel() {\n\t\treturn model;\r\n\t}", "@Nullable\n String getRef();", "ModelData getModel();", "@Override\n\tpublic <T> T getReference(Class<T> entityClass, Object primaryKey) {\n\t\treturn null;\n\t}", "public String getModel();", "public ModelSnapshot getModel() {\n return model;\n }", "A getModel();", "@Override\n\tpublic Model findOne(Model model) throws ServiceException {\n\t\tMap<String, Object> result = getDao().findOne(model, null);\n\t\tmodel = buildModel(result);\n\t\treturn model;\n\t}", "public ReferenceHelper getReferenceHelper();", "protected Object resolveModel(Object model) {\n\t\treturn model;\n\t}", "public INamedReference<IEntity> getEntityRef();", "Model getModel();", "Model getModel();", "Model getModel();", "public Document getModel(){\n return getDocument();\n }", "public Object elGetReference(Object bean);", "public Model getModel(){\r\n return model;\r\n }", "protected E getModel ()\n\t{\n\t\treturn model;\n\t}", "public String getRef() {\n return ref;\n }", "public Object getModel() {\n\t\treturn null;\n\t}", "public String getReferenceId();", "String getObjectRefName();", "Corretor findOne(Long id);", "public abstract URI getModelURI();", "public String getRef(){\r\n\t\treturn this.getAttribute(\"ref\").getValue();\r\n\t}", "@Override\r\n\tpublic LinkMan getModel() {\n\t\treturn linkman;\r\n\t}", "public Reference getReference() throws NamingException\n {\n return ref;\n }", "public abstract T ref(ID id);", "public abstract Reference getReference() throws NamingException ;", "public ContainmentModel getModel()\n {\n return m_model;\n }", "PIMBankObject getDomainObjectRef();", "public ObjectReference getObjectReference() {\n return new ObjectReferenceBuilder()\n .withApiVersion(getApiVersion())\n .withKind(getKind())\n .withName(getMetaName())\n .withNamespace(getMetaspace())\n .withUid(getMetadata().getUid())\n .build();\n }", "private ObsolescenceReference retrieveReference() {\n \n if (StringUtil.isEmptyOrNull(selectedReferenceName)) {\n return null;\n }\n \n switch (referenceTypeChosen) {\n case MANUFACTURERPN_TYPEARTICLE:\n ManufacturerPN lManufacturerPN =\n articleBean.findManufacturerPNByName(selectedReferenceName);\n if (lManufacturerPN != null && selectedTypeArticle != null) {\n return new ObsolescenceReference(lManufacturerPN,\n selectedTypeArticle);\n }\n else {\n return null;\n }\n \n case AIRBUSPN_TYPEARTICLE:\n AirbusPN lAirbusPN =\n articleBean.findAirbusPNByName(selectedReferenceName);\n if (lAirbusPN != null && selectedTypeArticle != null) {\n return new ObsolescenceReference(lAirbusPN, selectedTypeArticle);\n }\n else {\n return null;\n }\n \n case SOFTWARE:\n return new ObsolescenceReference(\n softBean.findByCompleteName(selectedReferenceName));\n \n case TYPEPC:\n return new ObsolescenceReference(\n articleBean.findTypePCByName(selectedReferenceName));\n default:\n }\n return null;\n }", "public T getRefer() {\n return refer;\n }", "public long getRefId() {\n return refId;\n }", "public Integer getRefId() {\n return refId;\n }", "public IDatatype getReference() { \n\t\treturn myReference;\n\t}", "public OntModel getModel()\r\n\t{\r\n\t\treturn this.ONT_MODEL;\r\n\t}", "public SoftReference getReference ()\r\n {\r\n return _reference;\r\n }", "public Object getObject() {\n return getObject(null);\n }", "public Model getModel(int index) {\r\n if (index >= models.size()) return null;\r\n return (Model) models.elementAt(index);\r\n }", "public String getModel() {\n return this.model;\r\n }", "@Override\n\tpublic CalEntity getModel() {\n\t\treturn model;\n\t}", "OwnerModel getOwnerByID(int ownerID) throws Exception;", "public String getModel() {\r\n return model;\r\n }", "public AssetRef retrieveRef(Long id) throws IOException, SQLException {\n String select = \"select definition_id, name, ref from ASSET_REF where definition_id = ?\";\n try (Connection conn = getDbConnection();\n PreparedStatement stmt = conn.prepareStatement(select)) {\n stmt.setLong(1, id);\n try (ResultSet rs = stmt.executeQuery()) {\n if (rs.next()) {\n return new AssetRef(rs.getString(\"name\"), id, rs.getString(\"ref\"));\n }\n }\n }\n return null;\n }", "@Override\n\tprotected Model fetchOne(int id) {\n\t\treturn null;\n\t}", "public String reference(Object obj) {\n return null;\n }", "RefClass getOwnerClass();", "public String getModel() {\r\n return (String) store.get(Names.model);\r\n }", "@Override\r\n\tpublic Model getModel() {\n\t\treturn this.model;\r\n\t}", "public Behavior getModel(){\n\t\treturn (this.model);\n\t}", "String getModelA();", "@Override\n\tpublic String getModel() {\n\t\treturn model;\n\t}", "public String getModel()\n {\n return model;\n }", "public ViewObjectImpl getLovModelVO1() {\n return (ViewObjectImpl) findViewObject(\"LovModelVO1\");\n }", "public abstract <T extends BaseSlingModel> T getModel();", "Symbol getRef();", "public Model getModel() {\n return model;\n }", "public Model getModel() {\n return model;\n }", "public Model getModel() {\n return model;\n }", "public Model getModel() {\n return model;\n }", "@Override\r\n\tpublic FqAccidenthistory getModel() {\n\t\treturn fqbean;\r\n\t}", "public String getModel() {\n return model;\n }", "public String getModel() {\n return model;\n }", "public String getReferenceId() {\n return refid;\n }", "public Model getModel()\n\t{\n\t\treturn this.model;\n\t}", "public Model getModel() {\n\t\treturn model;\n\t}", "public Model getModel() {\n\t\treturn model;\n\t}", "public Model getModel() {\n\t\treturn model;\n\t}", "public Integer getModelId() {\r\n return modelId;\r\n }", "Reference owner();", "public String getReference() {\n return reference;\n }", "public String getReference() {\n return reference;\n }", "public String getReference() {\n return reference;\n }", "public String getReference() {\n return reference;\n }", "public PrimObject reference(String name) {\n return resolveObject(name);\n }", "@Override\n\tpublic Editore getOneByName(String name) {\n\t\treturn null;\n\t}", "public final String getReference() {\n return reference;\n }", "public String getModel() {\n\t\treturn model; \n\t}", "public RepriceDocEditModelBean getRepriceDocModel()\n\t{\n\t\treturn ModelsAccessPoint.read(getRepriceDocModelKey(),\n\t\t RepriceDocEditModelBean.class);\n\t}", "public Model getModel() {\n return petal_model;\n }", "Optional<OrdPaymentRefDTO> findOne(Long id);", "public static Reference getReference() {\n return getRequest() == null ? null : getRequest().getResourceRef();\n }" ]
[ "0.69341695", "0.6368193", "0.6236013", "0.62268704", "0.6170672", "0.61576724", "0.61559427", "0.61384815", "0.61384815", "0.612272", "0.6120076", "0.6110108", "0.6096917", "0.6096917", "0.60478336", "0.6028701", "0.59895176", "0.5986912", "0.5983677", "0.59666175", "0.59550977", "0.5954547", "0.59446543", "0.59117746", "0.59103316", "0.5897788", "0.58916783", "0.5883472", "0.5868887", "0.5868887", "0.5868887", "0.5843361", "0.5832066", "0.5829954", "0.5824329", "0.5810888", "0.5793677", "0.579072", "0.57691425", "0.57625633", "0.5760395", "0.5755393", "0.5728987", "0.5706254", "0.5703534", "0.56858337", "0.5683603", "0.5676736", "0.5669432", "0.56681144", "0.5662057", "0.56511873", "0.56357527", "0.56202346", "0.5612776", "0.5612574", "0.5610768", "0.5609932", "0.55968267", "0.55874395", "0.5583859", "0.55796516", "0.55790293", "0.55744874", "0.5572962", "0.5569363", "0.55679834", "0.5562204", "0.55620444", "0.5560438", "0.5555848", "0.5548855", "0.55453926", "0.554139", "0.5535423", "0.5534359", "0.5534359", "0.5534359", "0.5534359", "0.55312043", "0.5523011", "0.5523011", "0.5522423", "0.5521837", "0.55184865", "0.55184865", "0.55184865", "0.5516224", "0.55140144", "0.55119896", "0.55119896", "0.55119896", "0.55102825", "0.55067587", "0.54959446", "0.5492189", "0.5485301", "0.5481267", "0.54807216", "0.54781795", "0.5476636" ]
0.0
-1
return the number of info models
@Override public int getItemCount() { return mPhoneInfoModels.size(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getNumModels() {\n return models.size();\n }", "public int size() {\n return models.size();\n }", "int getInfoCount();", "int getInfoCount();", "int getInfoCount();", "public int getInfoCount() {\n return info_.size();\n }", "private int infoCount() {\n return data.size();\n }", "public int getInfoCount() {\n if (infoBuilder_ == null) {\n return info_.size();\n } else {\n return infoBuilder_.getCount();\n }\n }", "public long getModelCount() throws StorageIOException {\n try {\n return this.databaseHelper.getDao(ModelDB.class).countOf();\n } catch (SQLException e) {\n throw new StorageIOException(\"Failed to get models' count\", e);\n }\n }", "int getMetaInformationCount();", "int getMetaInformationCount();", "int getMetaInformationCount();", "int getMetaInformationCount();", "int getMetaInformationCount();", "public int getCount() {\n return gdModels.size();\n }", "int getPersonInfoCount();", "int getSnInfoCount();", "int getSnInfoCount();", "int getSnInfoCount();", "@Override\n public long size() {\n return model.size();\n }", "int getDetailsCount();", "int getDetailsCount();", "public int getSnInfoCount() {\n if (snInfoBuilder_ == null) {\n return snInfo_.size();\n } else {\n return snInfoBuilder_.getCount();\n }\n }", "public int getSnInfoCount() {\n if (snInfoBuilder_ == null) {\n return snInfo_.size();\n } else {\n return snInfoBuilder_.getCount();\n }\n }", "public int getSnInfoCount() {\n if (snInfoBuilder_ == null) {\n return snInfo_.size();\n } else {\n return snInfoBuilder_.getCount();\n }\n }", "int getMetadataCount();", "int getMetadataCount();", "int getMetadataCount();", "int getMetadataCount();", "private void cmdInfoModel() throws NoSystemException {\n MSystem system = system();\n MMVisitor v = new MMPrintVisitor(new PrintWriter(System.out, true));\n system.model().processWithVisitor(v);\n int numObjects = system.state().allObjects().size();\n System.out.println(numObjects + \" object\"\n + ((numObjects == 1) ? \"\" : \"s\") + \" total in current state.\");\n }", "public int getModelSize()\n\t{\n\t\treturn this.model.listStatements().toList().size();\n\t}", "public int getMetaInformationCount() {\n if (metaInformationBuilder_ == null) {\n return metaInformation_.size();\n } else {\n return metaInformationBuilder_.getCount();\n }\n }", "public int getMetaInformationCount() {\n if (metaInformationBuilder_ == null) {\n return metaInformation_.size();\n } else {\n return metaInformationBuilder_.getCount();\n }\n }", "public int getMetaInformationCount() {\n if (metaInformationBuilder_ == null) {\n return metaInformation_.size();\n } else {\n return metaInformationBuilder_.getCount();\n }\n }", "public int getMetaInformationCount() {\n if (metaInformationBuilder_ == null) {\n return metaInformation_.size();\n } else {\n return metaInformationBuilder_.getCount();\n }\n }", "public int getMetaInformationCount() {\n if (metaInformationBuilder_ == null) {\n return metaInformation_.size();\n } else {\n return metaInformationBuilder_.getCount();\n }\n }", "public int getObjectCount() {\n\t\treturn objects.size(); // Replace with your code\n\t}", "public static int numberObjects()\r\n\t{\r\n\t\treturn(no_of_obj);\r\n\t}", "public int getSnInfoCount() {\n return snInfo_.size();\n }", "public int getSnInfoCount() {\n return snInfo_.size();\n }", "public int getSnInfoCount() {\n return snInfo_.size();\n }", "public int getMetaInformationCount() {\n return metaInformation_.size();\n }", "public int getMetaInformationCount() {\n return metaInformation_.size();\n }", "public int getMetaInformationCount() {\n return metaInformation_.size();\n }", "public int getMetaInformationCount() {\n return metaInformation_.size();\n }", "public int getMetaInformationCount() {\n return metaInformation_.size();\n }", "int getSeenInfoCount();", "int getAchieveInfoCount();", "int getFeaturesCount();", "public int getNumObjects(){\n return numObjects;\n }", "public int getFeaturesCount();", "@Override\n\tprotected int getNumOfSearchableInformations() {\n\t\treturn ItemSearchableInformations.values().length;\n\t}", "@Override\n\t\t\t\tpublic int getModelRowCount() {\n\t\t\t\t\treturn model.getListaBase().size();\n\t\t\t\t}", "public int getSeenInfoCount() {\n return instance.getSeenInfoCount();\n }", "int getObjectAnnotationsCount();", "int getObjectAnnotationsCount();", "public int get_count();", "int getStatMetadataCount();", "int getAttributesCount();", "int getAttributesCount();", "int getPartsCount();", "int getPartsCount();", "public int getSeenInfoCount() {\n return seenInfo_.size();\n }", "public int getEquipmentCount() {\r\n\t\tint ret = 0;\r\n\t\tPerson p = model.getData();\r\n\t\tif ( p!=null ) {\r\n\t\t\tret = p.getEquipmentCount();\r\n\t\t}\r\n\t\treturn ret;\r\n\t}", "public static int numElements_infos_metadata() {\n return 2;\n }", "public int getCount() {\n return cp.getmImageIds(gridType).length;\n\n }", "public int getNumOfClasses();", "public int getMetadataCount() {\n return metadata_.size();\n }", "public int getCount(){\r\n\t\tif(_serverinfo != null){\r\n\t\t\treturn _serverinfo.length / 6;\r\n\t\t}\r\n\t\treturn 0;\r\n\t}", "public abstract int getModelRowCount();", "int getFieldsCount();", "int getFieldsCount();", "public int nMetaInfoLines() {\n return metaInfoLines.length;\n }", "public int getNumbObjects()\n\t{\n\t\treturn this.numObjects;\n\t}", "@Override\n\t\tpublic int getCount() {\n\t\t\treturn infos.size();\n\t\t}", "public int getCount() {\n return objects.size();\n }", "public int getProductCount();", "int getViewsCount();", "int getFeatureCount();", "int getListCount();", "int getNewsindentifydetailCount();", "int getNumItems();", "public static int size() {\n\t\treturn anisLookup.size();\n\t}", "int getItemsCount();", "int getItemsCount();", "int getPropertiesCount();", "@Override\n public int getItemCount() {\n //int size = dataset.size();\n int size = coupons.size();\n return size;\n }", "int countFeatures();", "int countFeatures();", "int getWifisCount();", "int getFieldCount();", "int getNumberOfNecessaryAttributes();", "int getNumberOfInfantry();", "@Override\n\t\tpublic int getCount() {\n\t\t\treturn resInfo.size();\n\t\t}", "public int getCount() {\n return definition.getInteger(COUNT, 1);\n }", "int getDataCount();", "int getDataCount();", "int getDataCount();", "int getDataCount();", "int getDataCount();" ]
[ "0.78559583", "0.7735402", "0.76771647", "0.76771647", "0.76771647", "0.755231", "0.73119265", "0.72942954", "0.72764826", "0.7201574", "0.7201574", "0.7201574", "0.7201574", "0.7201574", "0.7196036", "0.7046872", "0.7018849", "0.7018849", "0.7018849", "0.68562716", "0.6752005", "0.6752005", "0.6746692", "0.6746692", "0.6746692", "0.6717122", "0.6717122", "0.6717122", "0.6717122", "0.6692172", "0.6687555", "0.6684472", "0.6684472", "0.6684472", "0.6684472", "0.6684472", "0.6666809", "0.6632154", "0.6623456", "0.6623456", "0.6623456", "0.6609481", "0.6609481", "0.6609481", "0.6609481", "0.6609481", "0.6600426", "0.6580565", "0.65620655", "0.6557322", "0.6554", "0.6521992", "0.64738506", "0.636219", "0.6336669", "0.6336669", "0.6330864", "0.6302232", "0.6295417", "0.6295417", "0.6295161", "0.6295161", "0.62837094", "0.62804615", "0.62734854", "0.6270118", "0.6267665", "0.62583536", "0.6243413", "0.6232397", "0.62215143", "0.62215143", "0.6214906", "0.6211189", "0.61962664", "0.6194376", "0.619162", "0.61791426", "0.6173211", "0.6171891", "0.6158746", "0.61437356", "0.6131521", "0.61304325", "0.61304325", "0.6127732", "0.61240584", "0.6116477", "0.6116477", "0.610997", "0.6108746", "0.6100055", "0.6095201", "0.60945755", "0.60867196", "0.60802174", "0.60802174", "0.60802174", "0.60802174", "0.60802174" ]
0.6308496
57
Created by Pieter on 6/23/2016.
public interface TextParserService { public Optional<String> parseStringToHtml(String input) throws TextParsingException; public Optional<String> parseStringToHtml(String input, int limit) throws TextParsingException; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "private stendhal() {\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "public final void mo51373a() {\n }", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "private void poetries() {\n\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "public void mo4359a() {\n }", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "private static void cajas() {\n\t\t\n\t}", "public void mo38117a() {\n }", "@Override\n public void init() {\n\n }", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tpublic void einkaufen() {\n\t}", "private void m50366E() {\n }", "@Override\n protected void initialize() {\n\n \n }", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "private Rekenhulp()\n\t{\n\t}", "@Override\n protected void getExras() {\n }", "@Override\n public void memoria() {\n \n }", "@Override\n\tpublic int mettreAJour() {\n\t\treturn 0;\n\t}", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\n\tprotected void update() {\n\t\t\n\t}", "Petunia() {\r\n\t\t}", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n public void init() {\n }", "@Override\n void init() {\n }", "@Override\r\n\tprotected void doF6() {\n\t\t\r\n\t}", "private void kk12() {\n\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n public int retroceder() {\n return 0;\n }", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "protected boolean func_70814_o() { return true; }", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void mo6081a() {\n }", "@Override\n\tpublic void verkaufen() {\n\t}", "@Override\n public void init() {}", "private void strin() {\n\n\t}", "public void mo21877s() {\n }", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n public void initialize() { \n }", "private void init() {\n\n\t}", "public void mo21779D() {\n }", "@Override\n protected void init() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n public int describeContents() { return 0; }", "public void mo12628c() {\n }", "public void Tyre() {\n\t\t\r\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}" ]
[ "0.6281783", "0.603581", "0.6005846", "0.598069", "0.59023976", "0.58958435", "0.58958435", "0.58561486", "0.582657", "0.5822592", "0.5783071", "0.5780415", "0.57642746", "0.57559836", "0.575076", "0.57477653", "0.5744552", "0.5672483", "0.56700176", "0.56559116", "0.56559116", "0.5643371", "0.56113046", "0.559809", "0.55942386", "0.5586856", "0.558413", "0.55787784", "0.5576844", "0.5569759", "0.5550105", "0.5544595", "0.5535753", "0.5533018", "0.5527525", "0.55273813", "0.55247587", "0.552349", "0.5523197", "0.55034393", "0.5488168", "0.5470229", "0.5466877", "0.5465012", "0.5465012", "0.5465012", "0.5465012", "0.5465012", "0.5455814", "0.5442234", "0.54409456", "0.54333323", "0.54333323", "0.54333323", "0.54333323", "0.54333323", "0.54333323", "0.5431936", "0.5431936", "0.54260635", "0.54164726", "0.54031956", "0.53983396", "0.5395808", "0.53812605", "0.53812605", "0.53812605", "0.53812605", "0.53812605", "0.53812605", "0.53812605", "0.5380867", "0.53736347", "0.5368745", "0.5367741", "0.53594434", "0.5346881", "0.5346881", "0.5344874", "0.53426737", "0.53378147", "0.5332153", "0.53295", "0.53291553", "0.5327753", "0.5326791", "0.5326791", "0.5326791", "0.53223777", "0.53215027", "0.53215027", "0.53215027", "0.53207207", "0.5314122", "0.53066903", "0.53044516", "0.5295982", "0.52945924", "0.5292373", "0.52886975", "0.52842784" ]
0.0
-1
Created by tanweihan on 16/11/11.
public interface AuthorityDao { /** * @param bucketInst * @param authId */ public void saveBucketInstAuthority(BucketInst bucketInst, int authId); /** * @param dataInst * @param authId */ public void saveDataInstAuthority(DataInst dataInst, int authId); /** * @param bucketId */ public void deleteBucketInstAuthority(long bucketId); /** * @param bucketId * @return */ public Set<Authority> getBucketInstAuthority(long bucketId); /** * @param dataInstId */ public void deleteDataInstAuthority(long dataInstId); /** * @param dataInstId * @return */ public Set<Authority> getDataInstAuthority(long dataInstId); /** * @param userId * @param bucketId * @return */ public BucketInstAuthority getBucketAuthorityInst(long userId, long bucketId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "private stendhal() {\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "private static void cajas() {\n\t\t\n\t}", "public final void mo51373a() {\n }", "@Override\n public void init() {\n\n }", "private void poetries() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "public void mo38117a() {\n }", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void gored() {\n\t\t\n\t}", "private void init() {\n\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "private void strin() {\n\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "public void mo4359a() {\n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n public void init() {\n }", "private void kk12() {\n\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n void init() {\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\n }", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\n protected void initialize() \n {\n \n }", "protected boolean func_70814_o() { return true; }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "private void m50366E() {\n }", "@Override\n public void init() {}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n protected void init() {\n }", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\r\n\tpublic void init() {}", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\n\tpublic void init()\n\t{\n\n\t}", "@Override\n public int describeContents() { return 0; }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void init() {\n\t}", "private Rekenhulp()\n\t{\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "public void mo6081a() {\n }", "private void init() {\n\n\n\n }", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "public void mo55254a() {\n }", "@Override\n public void memoria() {\n \n }", "@Override\n public void initialize() { \n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "protected void mo6255a() {\n }", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}" ]
[ "0.61052805", "0.60355073", "0.5914594", "0.59107095", "0.5800018", "0.5800018", "0.5783017", "0.5738029", "0.57175195", "0.5703858", "0.5702258", "0.5697964", "0.56968766", "0.56960917", "0.5692949", "0.56913996", "0.5689067", "0.5676397", "0.5665911", "0.5665911", "0.5665911", "0.5665911", "0.5665911", "0.56522954", "0.56323576", "0.563019", "0.56169456", "0.5613156", "0.5612555", "0.5607943", "0.56018895", "0.5596146", "0.5582868", "0.5582579", "0.55780905", "0.5577437", "0.55746657", "0.5565623", "0.55571073", "0.5548433", "0.5548433", "0.55325043", "0.55325043", "0.55325043", "0.5514248", "0.5514248", "0.55127245", "0.55127245", "0.55127245", "0.551191", "0.5508115", "0.5507804", "0.5507804", "0.5507804", "0.5507804", "0.5507804", "0.5507804", "0.5504899", "0.5504899", "0.5502574", "0.5502574", "0.5502574", "0.5501773", "0.5501773", "0.5501773", "0.5501773", "0.5501773", "0.5501773", "0.5501773", "0.5491507", "0.54896206", "0.548527", "0.54841", "0.5482701", "0.5478541", "0.5477157", "0.54715604", "0.5465109", "0.54596514", "0.545475", "0.54537624", "0.5450192", "0.54380965", "0.54328007", "0.54312265", "0.54305613", "0.5416626", "0.54120505", "0.54093623", "0.54031366", "0.5397834", "0.537867", "0.53723264", "0.53669983", "0.5361987", "0.53561914", "0.5334899", "0.5330414", "0.53283954", "0.5326837", "0.53190094" ]
0.0
-1
Initial Array Initialized with 3 persons
public static void main(String[] args) { Address johnDoeAdd = new Address("114 Market St", "St Louis", "MO", "63403"); Person johnDoe = new Person("John", "", "Doe", "2456895241", johnDoeAdd); Address johnEDoeAdd = new Address("324 Main St", "St Charles", "MO", "63303"); Person johnEDoe = new Person("John", "E", "Doe", "8475390126", johnEDoeAdd); Address johnMDoeAdd = new Address("574 Pole ave", "St. Peters", "MO", "63333"); Person johnMDoe = new Person("John Michael", "", "West Doe", "5628592375", johnMDoeAdd); Person[] persons = new Person[3]; persons[0] = johnDoe; persons[1] = johnEDoe; persons[2] = johnMDoe; int choice = 0; while (choice != 11) { choice = menu(); switch (choice) { case 1: System.out.println("Add a new person"); add(); case 2: case 3: case 11: break; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Person[] createList(Person... persons){\n Person[] people = persons;\n return people;\n }", "public static CreateUser[] createArrayOfEmployeeNames(){\n\n CreateUser[] arr1 = new CreateUser[5];\n\n for (int i=0; i < arr1.length; i++){\n int age = (int) Math.random()* 100;\n String name = \"John\"+i;\n arr1[i] = new CreateUser(age, name); // create random peop;e w/ ages\n\n }\n\n return arr1;\n }", "public Company(int size) {\n employees = new Person[size];\n }", "private void populate()\n\t{\n\t\tages = new int[] { 15, 18, 16, 16, 15, 16 }; \n\t}", "private final int[] initializeInstanceVariable() {\n\t\tint n = 10;\n\t\tint[] temp = new int[n];\n\t\tfor (int i = 0; i < n; i++) {temp[i] = i;}\n\t\treturn temp;\n\t}", "public ArrayRegister(int size) {\r\n persons = new Person[size];\r\n count = 0;\r\n }", "public Author[] createAuthors() {\r\n Author[] authorList = new Author[10];\r\n authorList[0] = createAuthor(\"Daniel\", 1);\r\n authorList[1] = createAuthor(\"Jeremy\", 2);\r\n return authorList;\r\n }", "private void createArray() {\n\t\tdata = new Integer[userInput];\n\t\tRandom rand = new Random();\n\n\t\t// load the array with random numbers\n\t\tfor (int i = 0; i < data.length; i++) {\n\t\t\tdata[i] = rand.nextInt(maximumNumberInput);\n\t\t}\n\n\t\t// copy the array to the sorting method\n\t\tinsertionData = data.clone();\n\t\tquickData = data.clone();\n\n\t}", "private static int[] arrayInitializer(int length) {\n int[] myArray = new int[length];\n Random rand = new Random();\n for (int i = 0; i < length; i++) {\n myArray[i] = rand.nextInt(1000);\n }\n return myArray;\n }", "public void createCountries() {\n\t\t\n\t\tcountryArray = new Country[Constants.NUM_COUNTRIES];\n\t\t\n\t\tfor(int i=0; i<Constants.NUM_COUNTRIES; i++) {\n\t\t\tcountryArray[i] = (new Country(i));\n\t\t}\n\t}", "public static int[] f_fill_vector_age_people(int N){\n int[] v_vector_age= new int[N];\n for(int i=0; i<N; i++){\n\n v_vector_age[i]= (int) (Math.random()*100)+1;\n\n }\n return v_vector_age;\n }", "public static void main(String[] args) {\n\t\tPerson[] persons = new Person[2];\n\n\t\tPerson p1 = new Person();\n\t\tPerson p2 = new Person();\n\n\t\tpersons[0] = p1;\n\t\tpersons[1] = p2;\n\n\t\tp1.age = 20;\n\t\tp1.name = \"이상훈\";\n\t\tp1.gender = \"male\";\n\n\t\tp2.age = 50;\n\t\tp2.name = \"박보검\";\n\t\tp2.gender = \"male\";\n\n\t\tSystem.out.println(\"persons[0].age : \" + persons[0].age);\n\t\tSystem.out.println(\"persons[0].name : \" + persons[0].name);\n\t\tSystem.out.println(\"persons[0].gender : \" + persons[0].gender);\n\n\t\tSystem.out.println(\"==========================\");\n\n\t\tSystem.out.println(\"persons[1].age : \" + persons[1].age);\n\t\tSystem.out.println(\"persons[1].name : \" + persons[1].name);\n\t\tSystem.out.println(\"persons[1].gender : \" + persons[1].gender);\n\t\t\n\t\t////// Call By Value\n\t\tint[] arr = new int[3];\n\n\t\tint a = 10, b = 20, c = 30;\n\t\tarr[0] = a;\n\t\tarr[1] = b;\n\t\tarr[2] = c;\n\t\t\n\t\ta = 20;\n\t\tb = 30;\n\t\tc = 40;\n\t\tSystem.out.println(\"==========================\");\n\t\tSystem.out.println(arr[0]);\n\t\tSystem.out.println(arr[1]);\n\t\tSystem.out.println(arr[2]);\n\t\t\n\n\t}", "private void initializeArrays(){\n arrayOfBadges = new String[6];\n stateArray = new int[6];\n for (int i = 0; i<6; i++){\n stateArray[i]=0;\n }\n arrayOfBadges[0] = \"Community\";\n arrayOfBadges[1] = \"Academic\";\n arrayOfBadges[2] = \"Dean\";\n arrayOfBadges[3] = \"Honor\";\n arrayOfBadges[4] = \"Abroad\";\n arrayOfBadges[5] = \"Graduation\";\n\n\n }", "public void inicializarArrays(){\n for(int i=0;i<=10;i++){\n dni[i] = 0;\n nombre[i] = \"\";\n apellido[i] = \"\";\n direccion[i] = \"\";\n telefono[i] = \"\";\n fNacimiento[i] = \"\";\n }\n }", "public void initUsers() {\n User user1 = new User(\"Alicja\", \"Grzyb\", \"111111\", \"grzyb\");\n User user2 = new User(\"Krzysztof\", \"Kowalski\", \"222222\", \"kowalski\");\n User user3 = new User(\"Karolina\", \"Nowak\", \"333333\", \"nowak\");\n User user4 = new User(\"Zbigniew\", \"Stonoga \", \"444444\", \"stonoga\");\n User user5 = new User(\"Olek\", \"Michnik\", \"555555\", \"michnik\");\n users.add(user1);\n users.add(user2);\n users.add(user3);\n users.add(user4);\n users.add(user5);\n }", "public static Player[] createPlayers(){\r\n\t\tPlayer[] players = new Player[2];\r\n\t\tSystem.out.print(\"Enter three letter nick name of Player1: \");\r\n\t\tplayers[0] = new Player(getName(), 0);\r\n\t\tSystem.out.print(\"Enter three letter nick name of Player2: \");\r\n\t\tplayers[1] = new Player(getName(), 18);\r\n\t\treturn players;\r\n\t}", "public void initialize() {\n\n list.add(user1);\n list.add(user2);\n list.add(user3);\n }", "private Countable[] generateArray(int rank){\n var numbers = new Countable[rank];\n for (int i = 0; i < rank; i++) {\n numbers[i] = getRandomCountable();\n }\n return numbers;\n }", "private static void init() {\n Friend friend0 = new Friend(\"Arne\", \"Andersen\", \"95123900\", \"Postveien 0\");\n Friend friend1 = new Friend(\"Berit\", \"Bertnsen\", \"95123901\", \"Postveien 1\");\n Friend friend2 = new Friend(\"Carl\", \"Carlsen\", \"95123902\", \"Postveien 2\");\n Friend friend3 = new Friend(\"Dora\", \"Danielsen\", \"95123903\", \"Postveien 3\");\n Friend friend4 = new Friend(\"Erik\", \"Erickson\", \"95123904\", \"Postveien 4\");\n Friend friend5 = new Friend(\"Fred\", \"Freddson\", \"95123905\", \"Postveien 5\");\n\n friendList.addFirst(friend1);\n friendList.addFirst(friend5);\n friendList.addFirst(friend3);\n friendList.addFirst(friend0);\n friendList.addFirst(friend2);\n friendList.addFirst(friend4);\n }", "public void makeArray(){\n for (int i = 0; i<length; i++){\n departements[i] = wallList.get(i).getName();\n }\n }", "public void initPeople() {\n this.people = new ArrayList<>();\n this.people.addAll(services.getPeopleList());\n }", "Main(int citizens)\n {\n\n this.citizens = citizens;\n rank = new int[citizens];\n id = new int[citizens];\n for (int i = 0; i < citizens; i++){\n\n rank[i] = 1;\n id[i] = i;\n }\n }", "void createArray(int n) {\n numbers = new int[n];\n for ( int i = 0; i < n; i++){\n numbers[i] = random.nextInt(1000);\n }\n }", "@Override\n public void initialize() {\n numPlayers = game().numPlayers();\n haveSeen = new ArrayList<>();\n goldProb = new double[3];\n Probability = new double[numPlayers];\n oldBoard = game().board().copy();\n //sets all of the players to miners at first\n //the lower the value the higher the player is predicted as Saboteur\n for (int i = 0; i < numPlayers; i++) {\n Probability[i] = 0.5;\n haveSeen.add(new int[3]);\n }\n for(int i=0; i<3; i++) {\n //top is 0, middle is 1, bottom is 2\n goldProb[i]=0.1;\n }\n if(role() == Role.SABOTEUR) Probability[index()]=0;\n else if(role() == Role.GOLD_MINER) Probability[index()]=1;\n }", "public Person(String name, ArrayList<String> pnArray) {\n\n\t}", "public College(int number) {\n this.number = number;\n labs = new Lab[number];\n }", "public static int[] constructor(int n) {\r\n int v[] = new int[n];\r\n\r\n for (int i = 0; i < v.length; i++) {\r\n int dato = (int) (Math.random() * 20);\r\n v[i] = dato;\r\n }\r\n return v;\r\n }", "private int[] generateInitialSolution(){\n int[] initialSolution = new int[tspProblem.getNumberOfCities()];\n ArrayList<Integer> listToGetRandomCities = new ArrayList<Integer>();\n\n for(int i = 0; i <= initialSolution.length - 1; i++){\n listToGetRandomCities.add(i);\n }\n\n for(int i = 0; i <= initialSolution.length - 1; i++){\n initialSolution[i] = getRandomCity(listToGetRandomCities);\n }\n\n return initialSolution;\n }", "public ContactList(int size) {\n\t\tcontactList = new Person[size];\n\t\tcontactCounter = 0;\n\t}", "public void initialiseGodList() {\n PlayerCreator playerCreator = new PlayerCreator();\n for (int i = 0; i < playerCreator.getArrayGods().size(); i++)\n godListNames.add(playerCreator.getArrayGods().get(i).getGodName());\n }", "private static int[] initArray(int N){\n int[] a = new int[N];\n for (int i=0;i<N;i++)\n a[i] = (int)(Math.random()*99999 + 100000);\n return a;\n }", "private ArrayList<Integer> fillDomain() {\n ArrayList<Integer> elements = new ArrayList<>();\n\n for (int i = 1; i <= 10; i++) {\n elements.add(i);\n }\n\n return elements;\n }", "private List<Integer> createData() {\r\n\t\tList<Integer> data = new ArrayList<Integer>();\r\n\t\tfor (int i = 0; i < N; i++) {\r\n\t\t\tdata.add(i);\r\n\t\t}\r\n\t\treturn data;\r\n\t}", "public void init() {\n initLayers();\n for (int i = 0; i < indivCount; i++) {\n ArrayList<Layer> iLayers = new ArrayList<>();\n for (Layer l : layers)\n iLayers.add(l.cloneSettings());\n individuals[i] = new Individual(iLayers);\n }\n }", "public static void main(String[] args) {\n\n for(int i=0; i<3;i++){\n // arr[i] = new Array1(i+3,i*2);\n //arr[0] = arr.getArray(3,5);\n\n }\n\n }", "public static void fillEmployees() {\n\t\tString name1;\n\t\tString name2;\n\t\tString name3;\n\t\tString name4;\n\t\tfor(int i=0;i<auxEmployees.length;i++) { //Va llenando de una en una las filas del array auxiliar de empleados (cada fila es una empresa) con nommbres aleatorios del array employees\n\t\t\tname1=\"\";\n\t\t\tname2=\"\";\n\t\t\tname3=\"\";\n\t\t\tname4=\"\";\n\t\t\twhile (name1.equals(name2) || name1.equals(name3) || name1.equals(name4) || name2.equals(name3) || name2.equals(name4) || name3.equals(name4)) { //Si los nombres son iguales vuelve a asignar nombres\n\t\t\t\tname1=employees[selector.nextInt(employees.length)];\n\t\t\t\tname2=employees[selector.nextInt(employees.length)];\n\t\t\t\tname3=employees[selector.nextInt(employees.length)];\n\t\t\t\tname4=employees[selector.nextInt(employees.length)];\n\t\t\t}\n\t\t\tauxEmployees[i][0]=name1;\n\t\t\tauxEmployees[i][1]=name2;\n\t\t\tauxEmployees[i][2]=name3;\n\t\t\tauxEmployees[i][3]=name4;\n\t\t}\n\t}", "public static void fillArray() {\r\n\t\tfor (int i = 0; i < myOriginalArray.length - 1; i++) {\r\n\t\t\tRandom rand = new Random();\r\n\t\t\tmyOriginalArray[i] = rand.nextInt(250);\r\n\t\t}\r\n\t\t// Copies original array 4 times for algorithm arrays\r\n\t\tmyBubbleArray = Arrays.copyOf(myOriginalArray, myOriginalArray.length);\r\n\t\tmySelectionArray = Arrays.copyOf(myOriginalArray, myOriginalArray.length);\r\n\t\tmyInsertionArray = Arrays.copyOf(myOriginalArray, myOriginalArray.length);\r\n\t\tmyQuickArray = Arrays.copyOf(myOriginalArray, myOriginalArray.length);\r\n\t}", "public static void createArrays() {\r\n\t\tRandom rand = new Random();\r\n\t\tfor (int i = 0; i < N; i++) {\r\n\t\t\tint size = rand.nextInt(5) + 5;\r\n\t\t\tTOTAL += size;\r\n\t\t\tArrayList<Integer> numList = new ArrayList<>();\r\n\t\t\tfor (int j = 0; j < size; j++) {\r\n\t\t\t\tint value = rand.nextInt(1000) + 1;\r\n\t\t\t\tnumList.add(value);\r\n\t\t\t}\r\n\t\t\tCollections.sort(numList);\r\n\t\t\tarrayMap.put(i + 1, numList);\r\n\t\t}\r\n\t}", "public Generator() {\n identificationNumbers = new int[100][31];\n }", "public StudentGroup(int length) {\r\n\t\tthis.students = new Student[length];\r\n\t}", "public PegArray(int n) {\r\n\t\tpegs = new Peg[n];\r\n\t\tfor(int i=0; i<n; i++)\r\n\t\t\tpegs[i] = new Peg();\r\n\t\texactMatch = partialMatch = -1;\r\n\t}", "public Person1(int[] celNumber, int age, String name) {\n\t\tsuper();\n\t\tthis.celNumber = celNumber;\n\t\tthis.age = age;\n\t\tthis.name = name;\n\t}", "private void loadExamplePeople(){\r\n\t\tpeople.add(new Person(\"Quiche\",\"Lorraine\",\"617-253-1000\",\"quiche@scotty.mit.edu\",Color.RED,this));\r\n\t\tpeople.add(new Person(\"Alice\",\"Whacker\",\"617-253-7788\",\"aw@scotty.mit.edu\",Color.RED.darker().darker(),this));\r\n\t\tpeople.add(new Person(\"Zygorthian\",\"Space-Raiders\",\"617-253-1541\",\"zsr@scotty.mit.edu\",new Color(50,70,90),this));\r\n\t\tpeople.add(new Person(\"Opus\",\"\",\"617-253-1000\",\"opus@scotty.mit.edu\",Color.RED.darker(),this));\r\n\t\tpeople.add(new Person(\"Rick\",\"Chang\",\"617-232-3257\",\"rick@mit.edu\",Color.RED.darker().darker().darker(),this));\r\n\t\tpeople.add(new Person(\"Ben\",\"Bitdiddle\",\"303-494-4774\",\"bitdiddle@scotty.mit.edu\",new Color(56,50,50),this));\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\tint[] [] numbers = {{1,2,3}, {10,20,30,40,50},{100,200,300}};\n\t// if we need first conteiner second value its gonna be int [0] [1] (value = 2)\n\t// \tif we need third conteiner third value its gonna be int [2] [2] (value = 300)\n\t\t\n\t\tSystem.out.println(numbers[0][0]);\n\t\t\n\t\tint [] [] nums = new int[3][];\n\t\tSystem.out.println(nums[1][3]);\n\t\t\n\t\tint [] ages = {26,25,50,10};\n\t\t//numbers[0] = new int[4];\n\t\tnums[0]=ages;\n\t\tSystem.out.println(nums[0][2]);\n\t\t\n}", "public int[] threeLuckyNumbers() {\n\t\tint[] intArray = new int[3];\n\t\tRandom rand = new Random(); \n\t\tint rand_int1 = rand.nextInt(101);\n\t\tint rand_int2 = rand.nextInt(101);\n\t\tint rand_int3 = rand.nextInt(101);\n\t\tintArray[0] = rand_int1;\n\t\tintArray[1] = rand_int2;\n\t\tintArray[2] = rand_int3;\n\t\t\n\t\t\n\t\t\n\t\treturn intArray;\n\t}", "private static int[] createArray() {\n\t\trnd = new Random();\r\n\t\trandomArray = new int[8];\r\n\t\tfor (int i = 0; i < 8; i++) {\r\n\t\t\trandomArray[i] = rnd.nextInt(45);\r\n\t\t}\r\n\t\treturn randomArray;\r\n\t}", "public void inicialisation(){\r\n\t\t\r\n\t\tgoods = new AutoParts[0];\r\n\t\tclient = new Client[0];\r\n\t\t\r\n\t\tshop = new Shopping[0];\r\n\t\tsale = new Sale[0];\r\n\t\ttransaction = new Document[0];\r\n\t\t\r\n\t\tbalancesAutoParts = new BalancesAutoParts[0];\r\n\t\t\r\n\t\tprices = new Prices[0];\r\n\t\t\r\n\t\tagriment = new Agreement[0];\r\n\t\t\r\n\t}", "private static void initialise( String booth[] ) {\n\r\n for (int x = 0; x < 6; x++ ) { //Assigning all the 6 booths as \"empty\"\r\n booth[x] = \"empty\";\r\n }\r\n }", "private static int[] createArray(int n) {\n\t \tint[] array = new int[n];\n\t \tfor(int i=0; i<n; i++){\n\t \t\tarray[i] = (int)(Math.random()*10);\n\t \t}\n\t\t\treturn array;\n\t\t}", "public static void main(String[] args) {\n ObjectArray[] objectArray = new ObjectArray[3];\n //Add new ObjectArray objects to the array\n objectArray[0] = new ObjectArray(\"ONE\");\n objectArray[1] = new ObjectArray(\"TWO\");\n objectArray[2] = new ObjectArray(\"THREE\");\n }", "public AgeRangeEntity[] newArray(int i) {\n return new AgeRangeEntity[i];\n }", "public Pile(){\n //initializes the Card array\n pile = new Card[6];\n for(int i = 0; i < 6; i++){\n pile[i] = new Card(0,0); //loads empty cards.\n }\n\n pilePlace = 0;\n\n }", "public static int[][] init() {\n int[][] arr={\n {0,1,0,1,0,0,0},\n {0,0,1,0,0,1,0},\n {1,0,0,1,0,1,0},\n {0,0,1,0,0,1,0},\n {0,0,1,1,0,1,0},\n {1,0,0,0,0,0,0}\n };\n return arr;\n }", "private void addDefaultPerson() {\n personNames.add(\"you\");\n personIds.add(STConstants.PERSON_NULL_ID);\n personPhotos.add(null);\n personSelections.add(new HashSet<Integer>()); \n }", "@SuppressWarnings(\"unchecked\")\n\tpublic void init()\n\t{\n\t\tscore = 0;\n\t\tlives = 3;\n\t\tgameTime = 0;\n\n\t\t\t/*initialize an array of array lists\n\t\t\tfor storing game objects currently in world\t\t\t\n\t\t\tAsteroids: index 0\n\t\t\tPlayer ship: index 1\n\t\t\tNon player ship: index 2\n\t\t\tenemy missile: index 3\n\t\t\tfriendly missile: index 4\n\t\t\tSpace station: index 5\n\t\t\t*/\t\t\n\t\t\tgameObj = new ArrayList[6];\n\t\t\tfor(int i = 0; i<gameObj.length; i++)\n\t\t\t{\n\t\t\t\tgameObj[i] = new ArrayList<GameObject>();\n\t\t\t}\n\t}", "public static void main(String[] args)\n {\n \n Dinosaur[] population = new Dinosaur[50];\n int counter = 0;\n \n for (int index = 0; index<population.length; index+=3)\n {\n counter++;\n if (counter == 1) {\n population[index] = new TRex();\n } else if (counter == 2) {\n population[index] = new Bronto();\n } else if (counter == 3) {\n population[index] = new Stego();\n counter = 0;\n }\n System.out.println(population[index].dinosaurString());\n }\n \n for (int index = 0; index<population.length; index ++)\n {\n int next = 1;\n \n \n }\n }", "public PersonList() {\r\n this.personList = new ArrayList<Person>();\r\n }", "public void initializePopulation(){\n\t\t// create the population\n\t\tfor(int i = 0; i < POPULATION_SIZE; i++){\n\t\t\t// get a random length for the building sequence\n\t\t\tint randArraySize = randomGenerator.nextInt(possiblePieces.length-1)+1;\n\t\t\t\n\t\t\tBuildingPiece[] pieceSequence = new BuildingPiece[randArraySize];\n\t\t\tfor(int j = 0; j < randArraySize; j++){\n\t\t\t\t// get a random possible piece and insert it into the sequence\n\t\t\t\tint randIndex = randomGenerator.nextInt(possiblePieces.length);\n\t\t\t\tpieceSequence[j] = possiblePieces[randIndex];\n\t\t\t}\n\t\t\t\n\t\t\t/* add a new number sequence with the newly created \n\t\t\t * sequence from the input */\n\t\t\tpopulation.add(new Building(pieceSequence, generation, possiblePieces));\n\t\t}\n\t}", "private void createArray()\r\n\t{\r\n\t\tscorers = new String[NUMBER_OF_ENTRIES];\r\n\t\tfor(int i = 0; i < NUMBER_OF_ENTRIES; i += 2)\r\n\t\t{\r\n\t\t\tscorers[i] = \"[NULL]\";\r\n\t\t\tscorers[i + 1] = String.valueOf(-1);\r\n\t\t}\r\n\t}", "public Integer[] createArray() {\n Integer[] value = new Integer[defaultLaenge];\n\n for (int i = 0; i < value.length; i++) {\n value[i] = (int)(value.length*Math.random());\n }\n\n return value;\n }", "private static Student[] makeStudents() {\n\t\treturn null;\n\t}", "private static void initUsers() {\n\t\tusers = new ArrayList<User>();\n\n\t\tusers.add(new User(\"Majo\", \"abc\", true));\n\t\tusers.add(new User(\"Alvaro\", \"def\", false));\n\t\tusers.add(new User(\"Luis\", \"ghi\", true));\n\t\tusers.add(new User(\"David\", \"jkl\", false));\n\t\tusers.add(new User(\"Juan\", \"mno\", true));\n\t\tusers.add(new User(\"Javi\", \"pqr\", false));\n\t}", "public void makeArray() {\r\n for (int i = 0; i < A.length; i++) {\r\n A[i] = i;\r\n }\r\n }", "@Before\n\tpublic void initialize() {\n\t\t\n\t\tfewUnique50 = new int[50];\n\t\tUtility.fillIntArrayFromFile(fewUnique50, \"/premade/fewUnique500\");\n\t\tfewUnique500 = new int[500];\n\t\tUtility.fillIntArrayFromFile(fewUnique500, \"/premade/fewUnique500\");\n\t\tfewUnique5000 = new int[5000];\n\t\tUtility.fillIntArrayFromFile(fewUnique5000, \"/premade/fewUnique5000\");\n\t\tfewUnique50000 = new int[50000];\n\t\tUtility.fillIntArrayFromFile(fewUnique50000, \"/premade/fewUnique50000\");\n\t\t\n//\t\tSystem.out.print(\"{\");\n//\t\tSystem.out.print(fewUnique50000[0]);\n//\t\tfor (int i = 1; i < fewUnique50000.length; i++) System.out.print(\", \" + fewUnique50000[i]);\n//\t\tSystem.out.println(\"}\");\n\t}", "public abstract Animal[] createGeneration (int count, Animal[] lastGeneration);", "public static void main(String[] args) {\n ArrayOfUnInitializedObjects arrayOfUnInitializedObjects[] = new ArrayOfUnInitializedObjects[10];\n }", "public static List<Person> getExamplePeople() {\n return Arrays.asList(\n new Person(\"1230\", \"John\", \"Smith\", LocalDate.of(1965, 1, 20), \"Some Street 3, Some City, Some Country\", \n Arrays.asList(\n new PersonContact(PersonContactType.PHONE, \"Home number\", \"+123 4567890\"),\n new PersonContact(PersonContactType.EMAIL, \"Personal e-mail\", \"some@email.nil\")\n )\n ),\n new Person(\"1231\", \"Jack\", \"Tree\", LocalDate.of(1971, 3, 20), \"Some Street 9, Some City, Some Country\", \n Arrays.asList(\n new PersonContact(PersonContactType.MOBILE, \"Personal number\", \"+123 456789011\")\n )\n ),\n new Person(\"1232\", \"Mary\", \"Jones\", LocalDate.of(1980, 2, 20), \"Some Street 7, Some City, Some Country\", \n null\n ),\n new Person(\"1233\", \"Maria\", \"Johnson\", LocalDate.of(1991, 9, 12), \"Some Street 30, Some City, Some Country\", \n Arrays.asList(\n new PersonContact(PersonContactType.PHONE, \"Work number\", \"+123 4634563\")\n )\n ),\n new Person(\"1234\", \"Luke\", \"Miller\", LocalDate.of(1986, 12, 3), \"Some Street 87, Some City, Some Country\", \n Arrays.asList(\n new PersonContact(PersonContactType.PHONE, \"Home number\", \"+123 13433653\"),\n new PersonContact(PersonContactType.EMAIL, \"Personal e-mail\", \"my@email.nil\"),\n new PersonContact(PersonContactType.MOBILE, \"Preferred contact\", \"+123 365346456\")\n )\n ),\n new Person(\"1235\", \"Michelle\", \"Smith\", LocalDate.of(1966, 6, 30), \"Some Street 3, Some City, Some Country\", \n Arrays.asList(\n new PersonContact(PersonContactType.PHONE, \"Home number\", \"+123 4567890\"),\n new PersonContact(PersonContactType.EMAIL, \"Personal e-mail\", \"other@email.nil\")\n )\n )\n );\n }", "public static void main(String[] args) {\n String [] names = new String[3];\n System.out.println(names);\n System.out.println(names.length);\n\n names[0] = \"ram\";\n names[1] = \"shyam\";\n names[2] = \"hari\";\n// names[3] = \"krishna\";\n System.out.println(names[0]);\n System.out.println(names[1]);\n System.out.println(names[2]);\n// System.out.println(names[3]);\n }", "private ArrayList<Person> parsePersons(int i) {\n\t\trestart();\n\t\tString nxtLine;\n\t\tint nbrOfP; \n\t\tArrayList<Person> persons = new ArrayList<Person>();\n\t\twhile(s.hasNextLine()) {\n\t\t\tnxtLine = s.nextLine();\n\t\t\tif(nxtLine.contains(\"=\")){\n//\t\t\t\tSystem.out.println(\"found it\");\n\t\t\t\tnbrOfP = Integer.parseInt(nxtLine.substring(2));\n//\t\t\t\tSystem.out.println(\"\"+nbrOfP);\n\t\t\t\tif(i==0)\n\t\t\t\t\tpersons = createMenList(nbrOfP);\n\t\t\t\telse\n\t\t\t\t\tpersons = createWomenList(nbrOfP);\n\t\t\t}\n\t\t}\n\t\treturn persons;\n\t}", "public StudentGroup(int length) {\n\t\tthis.students = new Student[length];\n\t}", "public void init() {\n for (Point[] p : prev) {\n Arrays.fill(p, null);\n }\n }", "private List<Person> fetchingUtility() {\n List<Person> fetchedList = new ArrayList<>();\n fetchedList.add(new Person(-26.220616, 28.079329, \"PJ0\", \"https://twitter.com/pjapplez\", false));\n fetchedList.add(new Person(-26.187616, 28.079329, \"PJ1\", \"https://twitter.com/pjapplez\", false));\n fetchedList.add(new Person(-26.207616, 28.079329, \"PJ2\", \"https://twitter.com/pjapplez\", false));\n fetchedList.add(new Person(-26.217616, 28.079329, \"PJ3\", \"https://twitter.com/pjapplez\", false));\n fetchedList.add(new Person(-26.346316, 28.079329, \"PJ4\", \"https://twitter.com/pjapplez\", false));\n fetchedList.add(new Person(-26.215896, 28.079329, \"PJ5\", \"https://twitter.com/pjapplez\", false));\n fetchedList.add(new Person(-26.215436, 28.079129, \"PJ6\", \"https://twitter.com/pjapplez\", false));\n fetchedList.add(new Person(-26.431461, 28.079329, \"PJ7\", \"https://twitter.com/pjapplez\", false));\n fetchedList.add(new Person(-26.168879, 28.079329, \"PJ8\", \"https://twitter.com/pjapplez\", false));\n fetchedList.add(new Person(-26.227616, 28.079329, \"PJ9\", \"https://twitter.com/pjapplez\", false));\n\n return fetchedList;\n }", "private static Occupation[] m147579a(int i) {\n return new Occupation[i];\n }", "@Override\r\n public Solution[] initialize() {\r\n System.out.println(\"c Attempting feasible initialization\");\r\n Solution[] initial_pop = new Solution[populationSize];\r\n for (int i = 0; i < populationSize; ++i) {\r\n initial_pop[i] = problem.newSolution();\r\n attemptFeasibleInitialization(initial_pop[i]);\r\n }\r\n return initial_pop;\r\n }", "public void initPop(int num) {\n\t\tif (num % 2 == 1) {\n\t\t\tnum -= 1;\n\t\t}\n\t\tthis.individuals = new AI[num];\n\t\tfor (int i = 0; i < num; i++)\n\t\t\tthis.individuals[i] = new AI();\n\t}", "public List<Contestant> initializeContestants() {\n List<Contestant> contestants = new ArrayList<>();\n addContestants(contestants);\n return contestants;\n }", "public static Participant[] createParticipants(Scanner console) {\n System.out.println();\n printHighlighted(\"CREATE PARTICIPANTS LIST\");\n System.out.println();\n printHighlighted(\"Enter the number of participants desired\");\n int num = promptInt(console);\n while (num <= 0) {\n printHighlighted(\"Please enter a valid number.\");\n num = promptInt(console);\n }\n \n // to get rid of the \\n created from nextInt() to fix Scanner's nextLine()\n console.nextLine(); \n \n Participant[] participants = new Participant[num];\n for (int i = 0; i < participants.length; i++) {\n System.out.println();\n \n printHighlighted(\"Enter the name for participant #\" + (i + 1));\n String name = console.nextLine();\n printHighlighted(\"Enter the email for participant #\" + (i + 1) + \": \\\"\" + name + \"\\\"\");\n String email = console.nextLine();\n participants[i] = new Participant(name, email);\n }\n \n System.out.println();\n return participants;\n }", "public void initialisationGrille(){\n for(int i = 0; i < this.grille.length ; i++)\n {\n for(int j = 0 ; j < this.grille[i].length;j++)\n {\n this.grille[i][j] = \"0\";\n this.grilleObjectif[i][j] = \"0\";\n }\n }\n }", "public int[] initializingArray(int size) {\n\t\tint [] array = createArrays(size);\n\t\tfor(int i = 0;i < array.length; i++) {\n\t\t\tarray[i] = rand.nextInt(10);\n\t\t}\n\t\treturn array;\n\t}", "public void init() {\n for (int i = 0; i < MAX_SCORES; i++) {\n highScores[i] = 0;\n names[i] = \"---\";\n }\n }", "public List<Person> createPersonListUsingNew() {\n return names.stream()\n // .parallel()\n .map(Person::new)\n .collect(LinkedList::new, // Supplier<LinkedList>\n LinkedList::add, // BiConsumer<LinkedList,Person>\n LinkedList::addAll); // BiConsumer<LinkedList,LinkedList>\n }", "public MyArrayList() {\n mMyArray = new Comparable[10];\n size = 10;\n head = tail = size / 3;\n }", "static void initializeArray2() {\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tRandom r = new Random();\n\t\t\tint val = r.nextInt(m);\n\t\t\t// Hash implementation\n\t\t\tint mod = val % m;\n\t\t\tarray[mod] = val;\n\t\t\tresult[1]++;\n\t\t}\n\t}", "public void createPlayers(String[] playerNames) {\n\t\tif(playerArray==null) {\n\t\t\tplayerArray = new Player[getPlayerCount()];\n\t\t\t\n\t\t\tfor(int i=0; i<getPlayerCount(); i++) {\n\t\t\t\tplayerArray[i] = new Player(playerNames[i], i);\n\t\t\t}\n\t\t} else {\n\t\t\tSystem.out.println(\"Error, Players array already initialised\");\n\t\t}\n\t}", "ContactsManager(){\n friendsCount = 0;\n myFriends = new Contact[500];\n }", "Array createArray();", "public void setPerson(Person[] person) {\n\t\tthis.person = person;\n\t}", "public MyArrayList(int length) {\n data = new Object[length];\n }", "public void createPlayerListArray(int numberOfPlayers) throws IOException {\n //Generate string from JSON data\n String jsonFile = \"data/players.json\";\n //Instantiate new Gson class\n Gson gson = new Gson();\n FileReader fileReader = new FileReader(jsonFile);\n JsonReader jsonReader = new JsonReader(fileReader);\n ReadJson[] data = gson.fromJson(jsonReader, ReadJson[].class);\n\n for (int i = 0; i < numberOfPlayers; i++) {\n\n String firstName = data[i].getFirst_name();\n String lastName = data[i].getLast_name();\n\n this.playersList.add(new Player(firstName, lastName));\n //shuffle the arrayList for randomness\n Collections.shuffle(playersList);\n\n }\n }", "@Override\r\n\tpublic List<Person> getPeople() {\n\t\tList<Person> personList = new ArrayList<Person>();\r\n\t\tpersonList.add(getPerson(234L));\r\n\t\tpersonList.add(getPerson(123L));\r\n\t\tpersonList.add(getPerson(345L));\r\n\t\tpersonList.add(getPerson(42L));\r\n\t\treturn personList ;\r\n\t}", "@PostConstruct\r\n public void init() {\n List<Person> personList = personRepository.findAll();\r\n for(Person person:personList)\r\n personHashMap.put(person.getId(),person);\r\n }", "private void createAIPlayers(int numOfAIPlayers) {\n // starts with 1 because HumanPlayer is in index 0\n for (int i = 1; i <= numOfAIPlayers; i++) {\n players[i] = new AIPlayer(\"AI\" + i);\n }\n }", "public ArrayOfFraction()\r\n\t{\r\n\t\ta=new Fraction [2];\r\n\t\tn=0;\r\n\t}", "static int[] populateArray(int lenght) {\n\t\tint[] A = new int[lenght];\n\t\t\n\t\tfor(int i=0; i < A.length; i++) {\n\t\t\tA[i] = (int)(Integer.MAX_VALUE * Math.random());\n\t\t}\n\t\t\n\t\treturn A;\n\t}", "public StudentService_ver2() {//Constructor\n\t\tfor(int i=0;i<3;i++) {\n\t\t\tstuArr[i]=new Student();\n\t\t}\n\t}", "public void readFromFile(){\n\t\ttry {\r\n\t\t\tFile f = new File(\"E:\\\\Study\\\\Course\\\\CSE215L\\\\Project\\\\src\\\\Railway.txt\");\r\n\t\t\tScanner s = new Scanner(f);\r\n\t\t\tpersons = new Person2 [50]; \r\n\t\t\tint i = 0;\r\n\t\t\t\r\n\t\t\twhile(s.hasNextLine()){\r\n\t\t\t\tString a = s.nextLine();\r\n\t\t\t\tString b = s.nextLine();\r\n\t\t\t\tString c = s.nextLine();\r\n\t\t\t\tString d = s.nextLine();\r\n\t\t\t\tString e = s.nextLine();\r\n\t\t\t\tString g = s.nextLine();\r\n\t\t\t\tString h = s.nextLine();\r\n\t\t\t\tString j = s.nextLine();\r\n\t\t\t\tPerson2 temp = new Person2 (a,b,c,d,e,g,h,j);\r\n\t\t\t\tpersons[i] = temp;\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n int[] ages; // declaration of an int array\n char[] characters; // declaration of a char array\n\n //NOT preferred ways of creating arrays\n String [] lastNames;\n String addresses [];\n\n //Giving a size to array\n String[] names = new String[3];\n names[0] = \"Kaan\";\n names[2] = \"Mbappe\";\n\n System.out.println(names[0]);\n System.out.println(names[2]);\n System.out.println(names[1]); //null\n }", "public void getInput(){\n\t\tScanner scan= new Scanner(System.in);\n\t\t//Get the range\n\t\tif(scan.hasNext()){\n\t\t\tcount=Integer.parseInt(scan.nextLine()); \n\t\t}\n\t\t//Initialize the array\n\t\tpeople = new People[count];\n\t\t//Get the array elements\n\t\tint i=0;\n\t\twhile(i<count){\n\t\t\tString lin[] = scan.nextLine().split(\" \");\n\t\t\tpeople[i] = new People(Integer.parseInt(lin[0]), Double.parseDouble(lin[1]));\n\t\t\ti++;\n\t\t}\n\t\t\n\t\t\n\t}", "public static int[] fillArray(int N) {\n\t\talgorithmThree = new int[N];\n\t\tfor(int i = 0; i < N; i++) {\n\t\t\talgorithmThree[i] = i;\n\t\t\tswap(algorithmThree[i], algorithmThree[randInt(0,i)]);\n\t\t}\n\t\t\n\t\treturn algorithmThree;\n\t}", "static void initializeArray(boolean firstTime) {\n\t\tint count = 0;\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tRandom r = new Random();\n\t\t\tint val = r.nextInt(m);\n\t\t\tint mod = val % m;\n\t\t\tif (array[mod] == -1) {\n\t\t\t\tarray[mod] = val;\n\t\t\t\tresult[1]++;\n\t\t\t\tcount++;\n\t\t\t} else if (firstTime) {\n\t\t\t\tresult[0] = count;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "int sizeOfControlPersonsArray();" ]
[ "0.6384872", "0.6306806", "0.6267728", "0.6252106", "0.62288576", "0.6171", "0.6093511", "0.60798776", "0.60156727", "0.5998047", "0.59225297", "0.5906387", "0.5847069", "0.5841194", "0.584018", "0.5824156", "0.5823618", "0.58040595", "0.58010733", "0.5787947", "0.57865834", "0.5747889", "0.57341987", "0.5714323", "0.5699822", "0.5693779", "0.5636829", "0.5630696", "0.5610811", "0.56000936", "0.5597225", "0.55891156", "0.55835", "0.5581328", "0.55766153", "0.5572468", "0.55534756", "0.5552668", "0.55464387", "0.5545054", "0.5541046", "0.55347544", "0.55308825", "0.5517513", "0.5514517", "0.55066603", "0.5505436", "0.5490225", "0.5478654", "0.54777986", "0.54744923", "0.5473746", "0.54676735", "0.54598856", "0.5453675", "0.5450403", "0.5447613", "0.54422283", "0.54409057", "0.5437017", "0.54331064", "0.54304963", "0.5427073", "0.5410651", "0.5403375", "0.5400344", "0.5394232", "0.53914505", "0.538364", "0.5380389", "0.537779", "0.5376663", "0.5375454", "0.5371807", "0.5365076", "0.53629774", "0.53598636", "0.5359617", "0.53537", "0.53467435", "0.53444356", "0.5344056", "0.5338653", "0.5332727", "0.53288287", "0.5322964", "0.531638", "0.53155714", "0.53142035", "0.5312307", "0.5311345", "0.5310473", "0.5307003", "0.53065115", "0.5301547", "0.5301541", "0.5299786", "0.529425", "0.5291978", "0.5290737", "0.5288679" ]
0.0
-1
Write a method to split the first string based on the second string value.
public String split(String s1,String s2) { return s1.split(s2, 1).toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String[] splitString2(String haystack, String needle) {\n if (haystack.equals(\"\") || needle.equals(\"\") // non empty strings are\n // not accepted\n || haystack.indexOf(needle) == -1 // haystack must have at least\n // one needle\n || haystack.startsWith(needle) // needle must not be at the\n // beginning of haystack\n || haystack.endsWith(needle)// needle must not be at the end of\n // haystack\n || haystack.contains(needle + needle) // needle must not repeat\n ) {\n throw new IllegalArgumentException();\n }\n // Do actual splitting using string builder method\n String newHaystack = haystack;\n int index = newHaystack.indexOf(needle);\n List<String> resultList = new ArrayList<String>();\n\n do {\n StringBuilder before = new StringBuilder();\n for (int i = 0; i < index; i++) {\n before.append(newHaystack.charAt(i));\n if (i == index - 1)\n resultList.add(before.toString());\n }\n StringBuilder after = new StringBuilder();\n for (int i = index + needle.length(); i < newHaystack.length(); i++) {\n after.append(newHaystack.charAt(i));\n if (i == newHaystack.length() - 1)\n newHaystack = after.toString();\n }\n index = newHaystack.indexOf(needle);\n } while (index != -1);\n\n resultList.add(newHaystack); // add remaining haystack \n \n\n // need to return an array not Array List\n String[] res = new String[resultList.size()];\n for (int j = 0; j < resultList.size(); j++) {\n res[j] = resultList.get(j);\n }\n return res;\n\n }", "public static String[] splitString1(String haystack, String needle) {\n if (haystack.equals(\"\") || needle.equals(\"\") // non empty strings are\n // not accepted\n || haystack.indexOf(needle) == -1) { // haystack must have at\n // least one needle\n throw new IllegalArgumentException();\n }\n\n // Do actual splitting using String.indexOf() method and do-while loop \n String newHaystack = haystack;\n int index = newHaystack.indexOf(needle);\n List<String> resultList = new ArrayList<String>();\n\n do {\n resultList.add(newHaystack.substring(0, index));\n newHaystack = newHaystack.substring(index + needle.length());\n index = newHaystack.indexOf(needle);\n\n } while (index != -1);\n\n resultList.add(newHaystack); // add remaining haystack \n\n // need to return an array not Array List\n String[] res = new String[resultList.size()];\n for (int j = 0; j < resultList.size(); j++) {\n res[j] = resultList.get(j);\n }\n return res;\n\n }", "@Test\n void labTask() {\n String s = \"abczefoh\";\n List<String> result = StringSplitter.labTask(s);\n\n String first = result.get(0);\n assertEquals(3, first.length());\n assertEquals('a', first.charAt(0));\n assertFalse(\"abc\".contains(String.valueOf(first.charAt(1))));\n assertEquals('c', first.charAt(2));\n\n String second = result.get(1);\n assertEquals(2, second.length());\n assertEquals('o', second.charAt(0));\n assertFalse(\"oh\".contains(String.valueOf(second.charAt(1))));\n\n String third = result.get(2);\n assertEquals(3, third.length());\n assertEquals('z', third.charAt(0));\n assertFalse(\"zef\".contains(String.valueOf(second.charAt(1))));\n assertEquals('f', third.charAt(2));\n }", "public String[] split(String value, String splitter) {\n\t\tString[] newValue;\n\t\tnewValue = value.split(splitter);\n\t\treturn newValue;\n\t}", "public static String[] splitString3(String haystack, String needle) {\n // return array of one empty string element if haystack is empty\n if(haystack.equals(\"\")){\n return new String[] {};\n }\n // for empty needle, just return array of characters (cast to String)\n if (needle.equals(\"\")){\n char[] charArray = haystack.toCharArray();\n String[] result = new String[charArray.length];\n \n for(int i = 0; i < charArray.length; i++){\n result[i] = Character.toString(charArray[i]);\n };\n return result;\n }\n // Do actual splitting using String.indexOf() method\n String newHaystack= haystack;\n int index = newHaystack.indexOf(needle);\n List<String> resultList = new ArrayList<String>();\n \n while (index != -1){ \n resultList.add(newHaystack.substring(0, index)); \n newHaystack = newHaystack.substring(index + needle.length()); \n index = newHaystack.indexOf(needle); \n if(index == -1) resultList.add(newHaystack); // add remaining string before exit loop\n }\n \n // need to return an array not Array List\n String[] res = new String[resultList.size()];\n for(int j = 0; j < resultList.size(); j++) {\n res[j] = resultList.get(j);\n } \n return res; \n \n }", "public Value splitBy(Value s,Value start,Value end) {\n String[] split = this.toString().split(s.toString());\r\n return new Values(split);\r\n }", "public static String[] splitString4(String haystack, String needle) {\n \n // return array of one empty string element if haystack is empty\n if (haystack.equals(\"\")){\n return new String[] {};\n }\n // for empty needle, just return array of single element = the whole haystack string - still valid\n if (needle.equals(\"\")){\n return new String[] { haystack };\n }\n \n // Do actual splitting using String.indexOf() method\n String newHaystack= haystack;\n int index = newHaystack.indexOf(needle);\n List<String> resultList = new ArrayList<String>();\n \n while (index != -1){ \n if(index > 0) {\n resultList.add(newHaystack.substring(0, index)); \n }\n newHaystack = newHaystack.substring(index + needle.length()); \n index = newHaystack.indexOf(needle); \n if(index == -1 && !newHaystack.equals(\"\")) {\n resultList.add(newHaystack); // add remaining string before exit loop\n }\n }\n \n // need to return an array not Array List\n String[] res = new String[resultList.size()];\n for(int j = 0; j < resultList.size(); j++) {\n res[j] = resultList.get(j);\n } \n return res; \n \n }", "@Test\n public void testCaseNumberSplit() {\n String caseNumber1 = \"NTN-57930\";\n String[] parts1 = caseNumber1.split( \"-\" );\n //String[] parts2 = caseNumber2.split(\"-\");\n //String[] parts3 = caseNumber3.split(\"-\");\n System.out.println( parts1.length );\n //System.out.println( parts2.length);\n //System.out.println( parts3.length);\n if (parts1.length > 2) {\n System.out.println( parts1[0] );\n String case1 = caseNumber1.substring( caseNumber1.indexOf( caseNumber1.split( \"-\" )[0] ), caseNumber1.indexOf( caseNumber1.split( \"-\" )[2] ) - 1 );\n System.out.println( case1 );\n } else {\n String case1 = caseNumber1;\n System.out.println( case1 );\n }\n }", "private static ArrayIterator<String> splitString(String base, String delimiter) {\r\n\t\tString[] substrings = base.split(delimiter);\r\n\t\treturn ArrayIterator.create(substrings);\r\n\t}", "public static String[] split(String value, String spliter) {\r\n\t\tif(value == null) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn value.trim().split(spliter);\r\n\t}", "public static final List<?> split(final String string, final String divider) {\n\t\t\n\t\tif (string == null) {\n\t\t\treturn null;\n\t\t}\n\t\tfinal List<String> result = new ArrayList<>();\n\t\tfinal int length = divider.length();\n\t\tif (length == 1) {\n\t\t\tfor (final StringTokenizer st = new StringTokenizer(string, divider); st.hasMoreTokens();) {\n\t\t\t\tresult.add(st.nextToken());\n\t\t\t}\n\t\t} else {\n\t\t\tint start = 0;\n\t\t\tint end = 0;\n\t\t\tfor (;;) {\n\t\t\t\tstart = string.indexOf(divider, end);\n\t\t\t\tif (start == -1) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tresult.add(string.substring(end, start));\n\t\t\t\tend = start + length;\n\t\t\t}\n\t\t\tif (end < string.length()) {\n\t\t\t\tresult.add(string.substring(end));\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}", "public static ArthurString divide(ArthurString one, ArthurString two) {\n String twoReverse = new StringBuilder(two.str).reverse().toString();\n return multiply(one, new ArthurString(twoReverse));\n }", "@Test(testName = \"splitFunctioanlity\")\n\t public static void splitFunction() \n\t { \n\t String str = \"geekss@for@geekss\"; \n\t String[] arrOfStr = str.split(\"s\", 5); \n\t \n\t for (String a : arrOfStr) \n\t System.out.println(a); \n\t \t}", "private static String[] splitString(String stringToSplit, String delimiter, boolean takeDelimiter)\n\t{\n\t\tString[] aRet;\n\t\tint iLast;\n\t\tint iFrom;\n\t\tint iFound;\n\t\tint iRecords;\n\t\tint iJump;\n\n\t\t// return Blank Array if stringToSplit == \"\")\n\t\tif (stringToSplit.equals(\"\")) { return new String[0]; }\n\n\t\t// count Field Entries\n\t\tiFrom = 0;\n\t\tiRecords = 0;\n\t\twhile (true)\n\t\t{\n\t\t\tiFound = stringToSplit.indexOf(delimiter, iFrom);\n\t\t\tif (iFound == -1)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tiRecords += (takeDelimiter ? 2 : 1);\n\t\t\tiFrom = iFound + delimiter.length();\n\t\t}\n\t\tiRecords = iRecords + 1;\n\n\t\t// populate aRet[]\n\t\taRet = new String[iRecords];\n\t\tif (iRecords == 1)\n\t\t{\n\t\t\taRet[0] = stringToSplit;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tiLast = 0;\n\t\t\tiFrom = 0;\n\t\t\tiFound = 0;\n\t\t\tiJump = 0;\n\t\t\tfor (int i = 0; i < iRecords; i++)\n\t\t\t{\n\t\t\t\tiFound = stringToSplit.indexOf(delimiter, iFrom);\n\t\t\t\tif (takeDelimiter)\n\t\t\t\t{\n\t\t\t\t\tiJump = (iFrom == iFound ? delimiter.length() : 0);\n\t\t\t\t\tiFound += iJump;\n\t\t\t\t}\n\t\t\t\tif (iFound == -1)\n\t\t\t\t{ // at End\n\t\t\t\t\taRet[i] = stringToSplit.substring(iLast + delimiter.length(), stringToSplit.length());\n\t\t\t\t}\n\t\t\t\telse if (iFound == 0)\n\t\t\t\t{ // at Beginning\n\t\t\t\t\taRet[i] = delimiter;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{ // somewhere in middle\n\t\t\t\t\taRet[i] = stringToSplit.substring(iFrom, iFound);\n\t\t\t\t}\n\t\t\t\tiLast = iFound - (takeDelimiter ? iJump : 0);\n\t\t\t\tiFrom = iFound + (takeDelimiter ? 0 : delimiter.length());\n\t\t\t}\n\t\t}\n\t\treturn aRet;\n\t}", "private static void huffmanStringSplit(Node x, String value)\r\n {\r\n if (x == null)\r\n {\r\n return;\r\n }\r\n\r\n if (x.isLeaf()) //if it's a leaf or not\r\n {\r\n secondMap.put(x.character, value);\r\n }\r\n else\r\n {\r\n huffmanStringSplit(x.right, (value + \"1\"));\r\n huffmanStringSplit(x.left, (value + \"0\"));\r\n }\r\n }", "abstract List<String> splitStringToCollection(String inputString, String separator);", "public static String[] splitAt (String toSplit, char splitter) {\n\t\n\t\tint placeHolder = 0; //tracks latest position of new substring\n\t\tint arrayCount = 0; //tracks of position of array entries\n\t\tint numberOfSplitters = 0; /*counts number of splitters so that\n\t\t\t\t\t\t\t\t\t*the length of array will be correct\n\t\t\t\t\t\t\t\t\t*/\n\t\tfor (int x = 0; x < toSplit.length(); x++) {\n\t\t\tif (toSplit.charAt(x) == splitter)\n\t\t\t\tnumberOfSplitters += 1;\n\t\t}\n\t\t/*\n\t\t * creates array to return with the correct number of \n\t\t * elements based on number of splitters plus 1\n\t\t */\n\t\tString[] splitArray = new String[numberOfSplitters + 1];\n\t\tfor (int x = 0; x < toSplit.length(); x++){\n\t\t\tif (toSplit.charAt(x) == splitter) {\n\t\t\t\tsplitArray[arrayCount] = \n\t\t\t\t\t\ttoSplit.substring(placeHolder, x);\n\t\t\t\tplaceHolder = x + 1;\n\t\t\t\tarrayCount += 1;\n\t\t\t}\n\t\t}\n\t //adds substring from last splitter to end of string\n\t\tsplitArray[arrayCount] = \n\t\t\t\ttoSplit.substring(placeHolder);\n\t\treturn splitArray;\n\t}", "public static ArthurString divide(ArthurString one, ArthurNumber two) {\n int x = Math.abs((int) Math.round(two.val));\n int lastPos = Math.max(0, one.str.length() - x);\n String cut = one.str.substring(lastPos);\n return new ArthurString(cut);\n }", "public static String[] splitFirst(String source, String splitter)\n\t {\n\t Vector<String> rv = new Vector<String>();\n\t int last = 0;\n\t int next = 0;\n\n\t // find first splitter in source\n\t next = source.indexOf(splitter, last);\n\t if (next != -1)\n\t {\n\t // isolate from last thru before next\n\t rv.add(source.substring(last, next));\n\t last = next + splitter.length();\n\t }\n\n\t if (last < source.length())\n\t {\n\t rv.add(source.substring(last, source.length()));\n\t }\n\n\t // convert to array\n\t return (String[]) rv.toArray(new String[rv.size()]);\n\t }", "public String[] splitBySplitter(String s) {\r\n\t\tString[] returnArray = new String[4];\r\n\t\treturnArray = s.split(\"-\");\r\n\t\treturn returnArray;\r\n\t}", "public static String[] split(String toSplit, char spliter){\n String[] endStringArray = new String[4];\n StringBuilder st = new StringBuilder();\n int i = 0;\n for (int j = 0; j < toSplit.length(); j++){\n if (toSplit.charAt(j) != spliter){\n st.append(toSplit.charAt(j));\n }\n else{\n endStringArray[i] = st.toString();\n st = new StringBuilder();\n i++;\n }\n }\n endStringArray[i] = st.toString();\n int size = 0;\n for (String s : endStringArray){\n if (s != null)\n size++;\n }\n String[] reducedArray = new String[size];\n System.arraycopy(endStringArray, 0, reducedArray, 0, size);\n return reducedArray;\n }", "int stringsConstruction(String a, String b){\n a=\" \"+a+\" \";\n b=\" \"+b+\" \";\n int output = b.split(\"\"+a.charAt(1)).length - 1;\n for(char i = 'a'; i <= 'z'; i++) {\n if (a.split(\"\"+i).length > 1) {\n int tempOut = (b.split(\"\"+i).length - 1) / (a.split(\"\"+i).length - 1);\n if (output > tempOut) {\n output = tempOut;\n }//if (output > tempOut) {\n }//if (a.split(\"\"+i).length > 1) {\n }//for(char i = 'a'; i <= 'z'; i++) {\n return output;\n }", "public abstract void split(Space s);", "public static String[] split(String toSplit, String delimiter) {\n if (!hasLength(toSplit) || !hasLength(delimiter)) {\n return null;\n }\n int offset = toSplit.indexOf(delimiter);\n if (offset < 0) {\n return null;\n }\n\n String beforeDelimiter = toSplit.substring(0, offset);\n String afterDelimiter = toSplit.substring(offset + delimiter.length());\n return new String[]{beforeDelimiter, afterDelimiter};\n }", "private boolean splitString(String string) throws Exception {\n\t\tString firstPart;\n\t\tString secondPart;\n\t\tStringTokenizer st;\n\n\t\tst = new StringTokenizer(string, \" \");\n\t\tif (st.countTokens() == 2) {\n\t\t\tfirstPart = new String(st.nextToken());\n\t\t\tsecondPart = new String(st.nextToken());\n\t\t\tsplitDateTime(firstPart);\n\t\t\tsplitDateTime(secondPart);\n\t\t}\n\t\telse if (st.countTokens() == 1) {\n\t\t\tfirstPart = new String(st.nextToken());\n\t\t\tsplitDate(firstPart);\n\t\t}\n\t\telse\n\t\t\tthrow new Exception(\"Too many arguments\");\n\t\treturn true;\n\t}", "@Test\n void splitAndReplace_WorksCorrectly_abcdefghi() {\n String s = \"abcdefghi\";\n List<String> result = StringSplitter.splitAndReplace(s, 3, 1);\n assertEquals(3, result.size());\n\n String first = result.get(0);\n assertEquals(3, first.length());\n assertEquals('a', first.charAt(0));\n assertFalse(\"abc\".contains(String.valueOf(first.charAt(1))));\n assertEquals('c', first.charAt(2));\n\n String second = result.get(1);\n assertEquals(3, second.length());\n assertEquals('d', second.charAt(0));\n assertFalse(\"def\".contains(String.valueOf(second.charAt(1))));\n assertEquals('f', second.charAt(2));\n\n String third = result.get(2);\n assertEquals(3, third.length());\n assertEquals('g', third.charAt(0));\n assertFalse(\"gh\".contains(String.valueOf(second.charAt(1))));\n assertEquals('i', third.charAt(2));\n }", "@Test\n void splitAndReplace_WorksCorrectly_abcdefgh() {\n String s = \"abcdefgh\";\n List<String> result = StringSplitter.splitAndReplace(s, 3, 1);\n assertEquals(3, result.size());\n\n String first = result.get(0);\n assertEquals(3, first.length());\n assertEquals('a', first.charAt(0));\n assertFalse(\"abc\".contains(String.valueOf(first.charAt(1))));\n assertEquals('c', first.charAt(2));\n\n String second = result.get(1);\n assertEquals(3, second.length());\n assertEquals('d', second.charAt(0));\n assertFalse(\"def\".contains(String.valueOf(second.charAt(1))));\n assertEquals('f', second.charAt(2));\n\n String third = result.get(2);\n assertEquals(2, third.length());\n assertEquals('g', third.charAt(0));\n assertFalse(\"gh\".contains(String.valueOf(second.charAt(1))));\n }", "public static String[] SplitRule(String q2) {\n\t\tString[] arrOfString = null;\n\t\tarrOfString = q2.split(\"->\");\t\t\n\t\treturn arrOfString;\n\t}", "@Test\n void splitAndReplace_WorksCorrectly_abcdefg() {\n String s = \"abcdefg\";\n List<String> result = StringSplitter.splitAndReplace(s, 3, 1);\n assertEquals(3, result.size());\n\n String first = result.get(0);\n assertEquals(3, first.length());\n assertEquals('a', first.charAt(0));\n assertFalse(\"abc\".contains(String.valueOf(first.charAt(1))));\n assertEquals('c', first.charAt(2));\n\n String second = result.get(1);\n assertEquals(3, second.length());\n assertEquals('d', second.charAt(0));\n assertFalse(\"def\".contains(String.valueOf(second.charAt(1))));\n assertEquals('f', second.charAt(2));\n\n String third = result.get(2);\n assertEquals(1, third.length());\n assertEquals('g', third.charAt(0));\n }", "@Test\n public void testSplitOnPattern() {\n List<String> list = Splitter.on(\n Pattern.compile(\"\\\\|\")\n ).trimResults().omitEmptyStrings().splitToList(\"hello | world|||\");\n assertThat(list, notNullValue());\n assertThat(list.size(), equalTo(2));\n assertThat(list.get(0), equalTo(\"hello\"));\n assertThat(list.get(1), equalTo(\"world\"));\n }", "@Override\n public String split(String source) {\n String result = (hasEnd()) ? source.substring(getStart(), getEnd()) : source.substring(getStart());\n result = (trimmed) ? result.trim() : result;\n return wordCase.apply(result);\n }", "private static String[] splitPartName(String partName) {\n if (partName == null) {\n partName = \"\";\n }\n\n int last_match = 0;\n LinkedList<String> splitted = new LinkedList<String>();\n Matcher m = partNamePattern.matcher(partName);\n while (m.find()) {\n if (!partName.substring(last_match, m.start()).trim().isEmpty()) {\n splitted.add(partName.substring(last_match, m.start()));\n }\n if (!m.group().trim().isEmpty()) {\n splitted.add(m.group());\n }\n last_match = m.end();\n }\n if (!partName.substring(last_match).trim().isEmpty()) {\n splitted.add(partName.substring(last_match));\n }\n return splitted.toArray(new String[splitted.size()]);\n }", "private void splitHelper(double splitStartFraction, String name1, String name2) {\n\t\tthis.children = new Zone[2];\n\t\tthis.splitStartFraction = splitStartFraction;\n\t\tthis.children[0] = new Zone(this, name1);\n\t\tthis.children[1] = new Zone(this, name2);\n\t}", "@Test\r\n\tvoid testsplitStringHandout2() {\n\t\tString input = Main.TEXT_2;\r\n\t\tString expected[] = {\"A\",\"long\",\"time\",\"ago\",\"in\",\"a\",\"galaxy\",\"far,\",\"far\",\"away...\"};\r\n\t\t\r\n\t\t// Use assertEquals to compare arrays\r\n\t\tassertArrayEquals(expected, Main.splitString(input) );\r\n\t\t\r\n\t\tassertEquals(7, Main.maxWordLength(Main.splitString(input)));\r\n\r\n\t}", "public static String[] strParts(String string, String delim) {\r\n //StringTokenizer st = new StringTokenizer(string);\r\n String[] strings = string.split(delim);\r\n return removeSpaces(strings);\r\n }", "static String doit(final String string1, final String string2) {\n String shorterString; // a\n String longerString; // b\n if (string1.length() > string2.length()) {\n shorterString = string2;\n longerString = string1;\n } else {\n longerString = string2;\n shorterString = string1;\n }\n String r = \"\";\n\n for (int i = 0; i < shorterString.length(); i++) {\n for (int j = shorterString.length() - i; j > 0; j--) {\n for (int k = 0; k < longerString.length() - j; k++) {\n if (shorterString.regionMatches(i, longerString, k, j) && j > r.length()) {\n r = shorterString.substring(i, i + j);\n }\n }\n } // Ah yeah\n }\n return r;\n\n }", "@Test\n\tpublic void common() {\n\t\tString testString = \"Monday,Tuesday,Thursday,Friday,,\";\n\t\tIterable<String> parts = Splitter.on(\",\").split(testString);\n\t\tfor (String s : parts)\n\t\t\tSystem.out.println(s);\n\t}", "public static StringSplit newSplit(int start, int end) {\n return new StringSplit(start, end, WordCase.NO_CASE, false);\n }", "public static String between(String src, String str1, String str2) {\n String rt = src;\n rt = right(rt, str1);\n rt = left(rt, str2);\n return rt;\n }", "String getBeginSplited();", "public static String[] split(String s, char token) {\n\t\tint tokenCount = 0;\n\t\tfor(int i=0;i<s.length();i++) {\n\t\t\tif(s.charAt(i) == token) {\n\t\t\t\ttokenCount++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tString[] splits = new String[tokenCount+1];\n\t\t\n\t\tString temp = \"\";\n\t\tint tokenItr = 0;\n\t\tfor(int i=0;i<s.length();i++) {\n\t\t\tif(s.charAt(i) == token) {\n\t\t\t\tsplits[tokenItr] = temp;\n\t\t\t\ttokenItr++;\n\t\t\t\ttemp = \"\";\n\t\t\t} else {\n\t\t\t\ttemp+=s.charAt(i);\n\t\t\t}\n\t\t}\n\t\tsplits[tokenItr] = temp; //For the left over strings in s\n\t\t\n\t\treturn splits;\n\t}", "private static String[] partition(String str, char character) {\n int index = str.indexOf(character);\n\n String[] pair = new String[2];\n\n if (index > -1) {\n // Gets rid of a space in the end of the first partition.\n pair[0] = str.substring(0, index).trim();\n pair[1] = str.substring(index + 1).trim();\n } else {\n // If there exists no '/' in the string, set the tail of the pair as an empty string.\n pair[0] = str;\n pair[1] = \"\";\n }\n return pair;\n }", "public static Vector<String> splitString(String str, String delimiter) {\n Vector<String> strVec = new Vector<>();\n int p = 0, dp;\n do {\n dp = str.indexOf(delimiter, p);\n if (dp == -1) dp = str.length();\n if (dp == p) {\n strVec.add(\"\");\n p += delimiter.length();\n } else {\n strVec.add(str.substring(p, dp));\n p = dp + 1;\n }\n } while(p < str.length());\n return strVec;\n }", "private void Split_Seek_value()\r\n\t{\r\n\t\tif (StStr != null) //erase old result file.\r\n\t\t{\r\n\t\t\terase del = new erase(StStr);\r\n\t\t\t//del.erase_output(StStr);\r\n\t\t}\r\n\r\n\t\t// StStr <-- frm1txtStringSeek1\r\n\t\tStStr = frm1txtStringSeek1.getText();\r\n\r\n\t\t//split into String Array. (delimiter= \",\")\r\n\t\tStStrSplit = StStr.split(delimiter);\r\n\t\t//l = new log(\"input\",\"String Seek \",StStr);\r\n\r\n\t\t/* print substrings */\r\n\t\tfor(int i =0; i < StStrSplit.length ; i++)\r\n\t\t{\r\n\t\t\tl = new log(\"input\",\"String Seek\",StStrSplit[i]);\r\n\t\t}\t \r\n\t}", "public static String getNext(String s1,String s2){\n\t\tint x = s1.indexOf(s2) + s2.length();\n\t\tif(x==s2.length()-1)\n\t\t\treturn null;\n\t\tString[] arr = s1.substring(x).split(\",(?=(?:[^\\\"]*\\\"[^\\\"]*\\\")*[^\\\"]*$)\", -1)[1].split(\"\\n\");\n\t\treturn arr[0];\n\t}", "public static String[] split(String value) {\r\n\t\tif(value == null) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn value.trim().split(\",\");\r\n\t}", "static String twoStrings(String s1, String s2){\n // Complete this function\n String letters = \"abcdefghijklmnopqrstuvwxyz\";\n for(int i=0;i<letters.length();i++){\n char lettersChar = letters.charAt(i); \n if(s1.indexOf(lettersChar) > -1 && s2.indexOf(lettersChar) > -1){\n return \"YES\";\n }\n }\n \n return \"NO\";\n }", "public String[] sortingwords(String p1)\n {\n String[] splitedword;\n splitedword = p1.split(\"\\\\s\");\n //splits the string\n\n for (int i = 0; i < splitedword.length; i++)\n {\n for (int j = i + 1; j < splitedword.length; j++)\n {\n if (splitedword[i].compareTo(splitedword[j]) > 0)\n {\n String temp = splitedword[i];\n splitedword[i] = splitedword[j];\n splitedword [j] = temp;\n }\n }\n }\n return splitedword;\n // return splited word\n }", "public StringWrapper[] split(DocText docText, BreakStrategy breakStrategy) {\n final String string = docText.getString();\n final String[] pieces = string.split(pattern);\n\n final List<StringWrapper> result = new ArrayList<StringWrapper>();\n\n for (int i = 0; i < pieces.length; ++i) {\n if (!\"\".equals(pieces[i])) {\n result.add(new StringWrapper(pieces[i], breakStrategy));\n }\n }\n\n return result.toArray(new StringWrapper[result.size()]);\n }", "public static void main(String[] args) {\n String myRegExString = \"[a-zA-Z\\\\s]+\";\n\n // This is the string we will check to see if our regex matches:\n String myString = \"The quick brown fox jumped over the lazy dog...\";\n\n // Create a Pattern object (compiled RegEx) and save it as 'p'\n Pattern p = Pattern.compile(myRegExString);\n\n // We need a Matcher to match our compiled RegEx to a String\n Matcher m = p.matcher(myString);\n\n // if our Matcher finds a match\n if (m.find()) {\n // Print the match\n System.out.println(m.group());\n }\n\n String s = \"Hello, Goodbye, Farewell\";\n Pattern p1 = Pattern.compile(\"\\\\p{Alpha}+\");\n Matcher m1 = p1.matcher(s);\n\n while( m.find() ){\n System.out.println(m1.group());\n }\n\n String s1 = \"Hello, Goodbye, Farewell\";\n String s2 = \"Hola, Adios, Hasta Luego\";\n\n String myDelimiter = \", \";\n\n String[] s1array = s1.split(myDelimiter);\n String[] s2array = s2.split(myDelimiter);\n\n System.out.println(\"s1array[0]: \" + s1array[0]);\n System.out.println(\"s1array[1]: \" + s1array[1]);\n System.out.println(\"s1array[2]: \" + s1array[2]);\n System.out.println(\"s2array[0]: \" + s2array[0]);\n System.out.println(\"s2array[1]: \" + s2array[1]);\n System.out.println(\"s2array[2]: \" + s2array[2]);\n\n }", "private String[] split(String string){\n\t\tString[] split = string.split( \" \" );\n\t\t\n\t\tfor(int i = 0; i < split.length; i++){\n\t\t\tString index = split[i];\n\t\t\tindex = index.trim();\n\t\t}\n\t\t\n\t\treturn split;\n\t}", "private ArrayList<String> stringToArrayList(String group, String splitter) {\n\t\t\n\t\t// Temp variables for splitting the string\n\t\tString[] splitString = TextUtils.split(group, splitter);\n\t\tArrayList<String> al = new ArrayList<String>();\n\t\t\n\t\t\n\t\tfor(int i=0; i<splitString.length; i++){\n\t\t\tLog.v(TAG, \"Read group \" + splitString[i]);\n\t\t\tal.add(splitString[i]);\n\t\t}\n\t\t\n\t\treturn al;\n\t}", "public static String getSecondPart(String str) {\n\t\t// we assume that str argument will only have even(length) strings\n\t\t// return second part of the string \n\t\t\n\t\t// str.substring(2); // abcd -> cd : 4 / 2 = 2\n\t\t// str.substring(3); // banana : 6 / 2 = 3\n\t\t// str.substring(4); // 12345678 : 8 / 2 =4\n\t\t\n\t\tint len = str.length();\n\t\tstr = str.substring(len / 2);\n\t\treturn str;\n\t}", "private String [] splitString(String name) {\r\n String [] parts = {\"\", \"\"};\r\n if (name != null) {\r\n String [] t = StringExtend.toArray(name, \".\", false);\r\n if (t.length == 3) {\r\n parts [0] = t [0] + \".\" + t [1];\r\n parts [1] = t [2];\r\n }\r\n else if (t.length == 2) {\r\n parts [0] = t [0]; parts [1] = t [1];\r\n }\r\n else if (t.length == 1) {\r\n parts [1] = t [0];\r\n }\r\n }\r\n\r\n return parts;\r\n }", "@NonNull\n Split andThen(Split next);", "public static void main(String[] args) {\n\n String firstString = \"this is what I'm searching in\";\n String secondString = \"I\";\n\n System.out.println(subStringIn(firstString, secondString));\n }", "public static void main(String[] args) {\n String s1 = \"01724-063642\";\n String s2 = s1.replace('i', 'j');\n\n System.out.println(s2);\n \n //String[] sp = s1.split(\" \");\n //String[] sp = s1.split(\"_\");\n String[] sp = s1.split(\"-\");\n for (String s:sp) {\n System.out.println(s);\n }\n \n }", "static String morganAndString(String a, String b) {\n\n\t\tString result = \"\";\n\n\t\tint pointerA = 0, pointerB = 0;\n\n\t\touter:\n\t\t\twhile ( pointerA < a.length() || pointerB < b.length()){\n\t\t\t\tif ( pointerA == a.length()) {\n\t\t\t\t\tresult = result + b.charAt(pointerB++);\n\t\t\t\t}\n\t\t\t\telse if ( pointerB == b.length()) {\n\t\t\t\t\tresult = result + a.charAt(pointerA++);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tchar ca = a.charAt ( pointerA );\n\t\t\t\t\tchar cb = b.charAt ( pointerB );\n\n\t\t\t\t\tif ( ca < cb ) {\n\t\t\t\t\t\tresult = result + ca;\n\t\t\t\t\t\tpointerA++;\n\t\t\t\t\t}\n\t\t\t\t\telse if ( cb < ca ){\n\t\t\t\t\t\tresult = result + cb;\n\t\t\t\t\t\tpointerB++;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// Find the smallest successor.\n\t\t\t\t\t\tint extraPointer = 1;\n\t\t\t\t\t\twhile ( pointerA + extraPointer < a.length() && pointerB + extraPointer < b.length()){\n\t\t\t\t\t\t\tchar cEa = a.charAt ( pointerA + extraPointer);\n\t\t\t\t\t\t\tchar cEb = b.charAt ( pointerB + extraPointer);\n\n\t\t\t\t\t\t\tif ( cEa < cEb ){\n\t\t\t\t\t\t\t\tresult = result + cEa;\n\t\t\t\t\t\t\t\tpointerA++;\n\t\t\t\t\t\t\t\tcontinue outer;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if ( cEb < cEa ){\n\t\t\t\t\t\t\t\tresult = result + cEb;\n\n\n\t\t\t\t\t\t\t\tpointerB++;\n\t\t\t\t\t\t\t\tcontinue outer;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\textraPointer++;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// We got to the point in which both are the same.\n\t\t\t\t\t\tif ( pointerA + extraPointer == a.length() && pointerB + extraPointer == b.length()){\n\t\t\t\t\t\t\t// Both are equal. It doesn't matter which one I take it from.\n\t\t\t\t\t\t\tresult = result + ca;\n\t\t\t\t\t\t\tpointerA++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tif ( pointerA + extraPointer == a.length() ){\n\t\t\t\t\t\t\t\t// Compare the current one of B with the next letter.\n\t\t\t\t\t\t\t\t// If next letter is smaller than current one, cut from here.\n\t\t\t\t\t\t\t\t// else, cut from A.\n\t\t\t\t\t\t\t\tif ( b.charAt ( pointerB + extraPointer ) > b.charAt ( pointerB + extraPointer + 1)){\n\t\t\t\t\t\t\t\t\tresult = result + cb;\n\t\t\t\t\t\t\t\t\tpointerB++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tresult = result + ca;\n\t\t\t\t\t\t\t\t\tpointerA++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t// The opposite.\n\t\t\t\t\t\t\t\t// Compare the current one of B with the next letter.\n\t\t\t\t\t\t\t\t// If next letter is smaller than current one, cut from here.\n\t\t\t\t\t\t\t\t// else, cut from A.\n\t\t\t\t\t\t\t\tif ( a.charAt ( pointerA + extraPointer ) > a.charAt ( pointerA + extraPointer + 1)){\n\t\t\t\t\t\t\t\t\tresult = result + ca;\n\t\t\t\t\t\t\t\t\tpointerA++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tresult = result + cb;\n\t\t\t\t\t\t\t\t\tpointerB++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\treturn result;\n\n\n\t}", "public void splitter(String values) {\n\n\t\tfor(int i=0; i < values.length(); i++) {\n\t\t\tnewString += values.charAt(i);\n\n\t\t\tif(semi == values.charAt(i)) {\n\t\t\t\tnewString = newString.replaceAll(\";\", \"\");\n\t\t\t\tnewString = newString.replaceAll(\"\\n\", \"\");\n\t\t\t\tsplittedString.add(newString);\n\t\t\t\tnewString = \"\";\n\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i=0; i < splittedString.size()-1; i++) {\n\t\t\tsection = splittedString.get(i);\n\t\t\tString[] dev = section.split(\",\");\n\t\t\tboolean validValues = true;\n\t\t\tfor(int x1 = 0; x1 < dev.length; x1+=3) {\n\t\t\t\tString xx1 = dev[x1];\n\t\t\t\tif(isInteger(xx1) && validValues) {\n\t\t\t\t\tx.add(Integer.parseInt(xx1));\n\t\t\t\t} else {\n\t\t\t\t\tvalidValues = false;\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\tfor(int y1= 1; y1 <dev.length; y1+=3) {\n\t\t\t\tString yy1 = dev[y1];\n\t\t\t\tif(isInteger(yy1) && validValues) {\n\t\t\t\t\ty.add(Integer.parseInt(yy1));\n\t\t\t\t} else {\n\t\t\t\t\tvalidValues = false;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tfor(int z1= 2; z1 <dev.length; z1+=3) {\n\t\t\t\tString zz1 = dev[z1];\n\t\t\t\tif(isInteger(zz1) && validValues) {\n\t\t\t\t\tz.add(Integer.parseInt(zz1));\n\t\t\t\t} else {\n\t\t\t\t\tvalidValues = false;\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t}", "private static ArrayList<String> split(String str) {\n String[] splits = str.split(DELIMITER);\n return new ArrayList<>(Arrays.asList(splits));\n }", "private String[] extractTextAndPerformParameterParsing(String command, ArrayList<Parameter> parameters,\n\t\t\tint indexOfFirstSpace, int indexOfFirstInvertedSlash) {\n\t\tString splitedText[] = null;\n\t\tString text;\n\t\tif (indexOfFirstSpace < command.length()) {\n\t\t\tif (isValidCommandWithParameter(indexOfFirstSpace, indexOfFirstInvertedSlash)) {\n\t\t\t\ttext = command.substring(indexOfFirstSpace + 1, indexOfFirstInvertedSlash);\n\n\t\t\t\tString parameterStr = command.substring(indexOfFirstInvertedSlash, command.length());\n\t\t\t\tString[] parameterArr = parameterStr.split(\" \");\n\t\t\t\textractParameter(parameters, parameterArr);\n\t\t\t} else {\n\n\t\t\t\ttext = command.substring(indexOfFirstSpace + 1, command.length());\n\t\t\t}\n\t\t\t// For multiple add and done\n\t\t\tsplitedText = text.split(VERTICAL_DASH);\n\t\t}\n\t\treturn splitedText;\n\t}", "private static List<String> splitTypes(String typesString, char delimiter)\r\n {\r\n // Feel free to write a RegEx for that, and compare the\r\n // performance of the RegEx to this approach....\r\n List<String> typeStrings = new ArrayList<String>();\r\n int openBrackets = 0;\r\n StringBuilder sb = new StringBuilder();\r\n for (int i=0; i<typesString.length(); i++)\r\n {\r\n char c = typesString.charAt(i);\r\n if (c == '<')\r\n {\r\n openBrackets++;\r\n sb.append(\"<\");\r\n }\r\n else if (c == '>')\r\n {\r\n openBrackets--;\r\n sb.append(\">\");\r\n }\r\n else if (openBrackets==0 && c == delimiter)\r\n {\r\n typeStrings.add(sb.toString().trim());\r\n sb = new StringBuilder();\r\n }\r\n else\r\n {\r\n sb.append(c); \r\n }\r\n }\r\n if (sb.length() > 0)\r\n {\r\n typeStrings.add(sb.toString().trim());\r\n }\r\n if (openBrackets > 0)\r\n {\r\n throw new IllegalArgumentException(\r\n \"No matching '>' for '<' in input string: \"+typesString);\r\n }\r\n if (openBrackets < 0)\r\n {\r\n throw new IllegalArgumentException(\r\n \"No matching '<' for '>' in input string: \"+typesString);\r\n }\r\n return typeStrings;\r\n }", "@TypeConverter\r\n public String[] fromString(String value) {\r\n String[] split = value.split(SEPERATOR.toString());\r\n return value.isEmpty() ? split : split;\r\n }", "public static void main(String[] args) {\n\t\t\n\t\tString str= \"I liked Java, did you like it\";\n\t\t\n\t\tString arr[]=str.split(\"d\");\n\t\t\n\t\tSystem.out.println(Arrays.toString(arr));\n\t\t\nString str1[]=str.split(\" \");\n\t\t\n\t\tSystem.out.println(Arrays.toString(str1));\n\t\t\n\t\t\n\t}", "private ArrayList<String> splitHelper(ArrayList<String> accumulator, String remainder, int width, FontMetrics metrics){\n if (metrics.stringWidth(remainder) + 100 < width){\n accumulator.add(remainder);\n return accumulator;\n }\n int i = 0;\n while (metrics.stringWidth(remainder.substring(0,i++)) + 100 < width){}\n while (remainder.charAt(i--) != ' '){}\n accumulator.add(remainder.substring(0,++i));\n return splitHelper(accumulator,remainder.substring(i),width,metrics);\n }", "private String[] compareKeys(String currentString) {\n String s1 = \"\";\n String s2 = \"\";\n String[] answer = new String[2];\n for(int i = 0; i < currentString.length(); i++) {\n if(currentString.charAt(i) == '|') {\n s1 = currentString.substring(0,i);\n s2 = currentString.substring(i + 1);\n }\n }\n int compare = s1.compareTo(s2);\n String lesser = \"\";\n String greater = \"\";\n if(compare < 1) {\n lesser = s1;\n greater = s2;\n }\n else{\n lesser = s2;\n greater = s1;\n }\n answer[0] = lesser;\n answer[1] = greater;\n return answer;\n }", "private String[] splitResource(String resource, String delimiter)\r\n {\r\n String[] retval = new String[2];\r\n String head, tail;\r\n\r\n int delLen = (delimiter.equals(TIGHT_BINDING)) ? TIGHT_BINDING_LEN :\r\n LOOSE_BINDING_LEN ;\r\n // find the first delimiter\r\n int index = resource.indexOf(delimiter);\r\n\r\n if (index != -1)\r\n {\r\n // split into head and tail\r\n head = resource.substring(0, index);\r\n tail = resource.substring(index+delLen);\r\n }\r\n else\r\n {\r\n // there is no tail, only a head\r\n head = resource;\r\n tail = null;\r\n }\r\n\r\n retval[0] = head;\r\n retval[1] = tail;\r\n\r\n return retval;\r\n }", "static String findSubstringByHeaderString(String src, String start1, String start2, String before, String after, boolean caseSensitive)\n throws UnexpectedFormatException {\n int pos = safeIndexOf(src, start1, 0, caseSensitive);\n pos = safeIndexOf(src, start2, pos, caseSensitive);\n return findSubstringByHeaderString(src, pos+start2.length(), before, after, caseSensitive);\n }", "public static String[] m66063a(Comparator<? super String> comparator, String[] strArr, String[] strArr2) {\n ArrayList arrayList = new ArrayList();\n for (String str : strArr) {\n int length = strArr2.length;\n int i = 0;\n while (true) {\n if (i >= length) {\n break;\n } else if (comparator.compare(str, strArr2[i]) == 0) {\n arrayList.add(str);\n break;\n } else {\n i++;\n }\n }\n }\n return (String[]) arrayList.toArray(new String[arrayList.size()]);\n }", "@SuppressWarnings(\"unused\")\r\n\tprivate static List<String> splitToken (String token) {\r\n\r\n Matcher m = Contractions.matcher(token);\r\n if (m.find()){\r\n \tString[] contract = {m.group(1), m.group(2)};\r\n \treturn Arrays.asList(contract);\r\n }\r\n String[] contract = {token};\r\n return Arrays.asList(contract);\r\n }", "@Test\n public void testSplitDomain2() {\n System.out.println(\"splitDomain2\");\n String domain = \"example.com\";\n Map<URLParser.DomainParts, String> expResult = new HashMap<>();\n expResult.put(URLParser.DomainParts.TLD, \"com\");\n expResult.put(URLParser.DomainParts.DOMAINNAME, \"example\");\n expResult.put(URLParser.DomainParts.SUBDOMAIN, null);\n \n \n Map<URLParser.DomainParts, String> result = URLParser.splitDomain(domain);\n assertEquals(expResult, result);\n }", "private ArrayList<String> split(String string, int width, FontMetrics metrics){\n return splitHelper(new ArrayList<>(),string,width,metrics);\n }", "@Override\r\n\t\t\tpublic int compare(String o1, String o2) {\n\t\t\t\tString[] values = o1.split(\";\");\r\n\t\t\t\t//Take the second string and do the same thing\r\n\t\t\t\tString[] values2 = o2.split(\";\");\r\n\t\t\t\t//Compare strings according to their integer values\r\n\t\t\t\treturn Integer.valueOf(values[0].replace(\"\\\"\", \"\")).compareTo(Integer.valueOf(values2[0].replace(\"\\\"\", \"\")));\r\n\t\t\t}", "public static String splitBinaryRep(final String to_split, final int byte_index)\n\t{\n\t\tfinal int byte_size = 8, starting_index = byte_size * byte_index;\n\t\tint ending_index = (byte_index == 0) ? byte_size : (byte_size * byte_index) + byte_size;\n\t\treturn to_split.substring(starting_index, ending_index) ;\n\t}", "@Test\n public void testSplitURL_String() throws Exception {\n System.out.println(\"splitURL\");\n String URLString = \"http://user:password@www.example.com:8080/to/path/document?arg1=val1&arg2=val2#part\";\n Map<URLParser.URLParts, String> expResult = new HashMap<>();\n expResult.put(URLParser.URLParts.PROTOCOL, \"http\");\n expResult.put(URLParser.URLParts.PATH, \"/to/path/document\");\n expResult.put(URLParser.URLParts.HOST, \"www.example.com\");\n expResult.put(URLParser.URLParts.PORT, \"8080\");\n expResult.put(URLParser.URLParts.USERINFO, \"user:password\");\n expResult.put(URLParser.URLParts.FILENAME, \"/to/path/document?arg1=val1&arg2=val2\");\n expResult.put(URLParser.URLParts.QUERY, \"arg1=val1&arg2=val2\");\n expResult.put(URLParser.URLParts.AUTHORITY, \"user:password@www.example.com:8080\");\n expResult.put(URLParser.URLParts.REF, \"part\");\n \n Map<URLParser.URLParts, String> result = URLParser.splitURL(URLString);\n assertEquals(expResult, result);\n }", "public static void main(String[] args) {\n\t\tString A = \"This\";\n\t\tString B = \"This\";//new String()\n\t\t\n\t\tStringBuilder sb = new StringBuilder(200);\n\t\tsb.append(\"Hello\");\n\t\tsb.append(\" my name is Tiki.\");\n\t\tsb.append(\" This is my story.\");\n\t\tsb.append(\" The end.\");\n\t\t\n\t\tStringBuffer sbuff = new StringBuffer();\n\t\tsbuff.append(\"\");\n\t\t\n\t\tString result = sb.toString();\n\t\tSystem.out.println(result);\n\t\t\n\t\tA.toLowerCase();//{return new String();}\n\t\tB.toLowerCase();\n\t\t\n\t\tresult.split(\"\\\\d\\\\-\");\n\t\t\n\t\tif(result.contains(\"Tiki\"))\n\t\t{\n\t\t\tString resultSub = result.substring(result.indexOf(\"Tiki\"));\n\t\t\tSystem.out.println(\"Result: \" + resultSub);\n\t\t\tSystem.out.println(\"Character count: \" + result.length());\n\t\t}\n\t\t//A = B + \" and That\";\n\t\t\n\t\tString names = \"\";\n\t\tnames += \"Tiki\";\n\t\tnames += \",Ahad\";\n\t\tnames += \",Dat\";\n\t\tnames += \",Kevin\";\n\t\tnames += \",Son\";\n\t\t\n\t\tDemo obj1 = new Demo();\n\t\tobj1.x = 10;\n\t\tobj1.y = 2.5;\n\t\t\n\t\tDemo obj2 = new Demo();\n\t\tobj2.x = 10;\n\t\tobj2.y = 2.5;\n\t\t\n\t\tSystem.out.println(obj1);\n\t\tSystem.out.println(obj2);\n\t\t\n\t\tif(A.equals(B))\n\t\t{\n\t\t\tSystem.out.println(\"Same Object\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"Not the same object\");\n\t\t}\n\t}", "private String mergeStringsLists(String string1, String string2) {\n if (string1==null || string1.isEmpty()) return string2;\n else if (string2==null || string2.isEmpty()) return string1;\n else {\n String[] elements1=string1.split(\"\\\\s*,\\\\s*\");\n String[] elements2=string2.split(\"\\\\s*,\\\\s*\");\n ArrayList<String> result=new ArrayList<String>(elements1.length);\n for (String e:elements1) result.add(e.trim());\n for (String e:elements2) if (!result.contains(e.trim())) result.add(e.trim());\n StringBuilder builder=new StringBuilder(string1.length()+string2.length());\n builder.append(result.get(0));\n for (int i=1;i<result.size();i++) {builder.append(\",\");builder.append(result.get(i));}\n return builder.toString();\n }\n }", "public String comboString(String a, String b) {\r\n return a.length() > b.length() ? b + a + b : a + b + a;\r\n }", "public static StringSplit newSplit(int start, int end, WordCase wordCase) {\n return new StringSplit(start, end, wordCase, false);\n }", "public String findFirstWord(String a, String b) {\n\t\tchar[] aArray = a.toCharArray();\n\t\tchar[] bArray = b.toCharArray();\n\n\t\t//loop through letters of each\n\t\tfor (int i = 0; i < aArray.length; i++) {\n\n\t\t\t// if letter in a comes before b, then return a\n\t\t\tif (aArray[i] < bArray[i]) {\n\t\t\t\treturn a;\n\t\t\t}\n\n\t\t\t// check if letter in b comes before a\n\t\t\tif (aArray[i] > bArray[i]) {\n\t\t\t\treturn b;\n\t\t\t}\n\n\t\t\t// otherwise they are equal and you can move to the next letter\n\t\t}\n\n\t\t// you need this line in case the above loop doesn't return anything.\n\t\t// this is for the compiler.\n\t\treturn a;\n\t}", "public ArrayList<ArrayList<String>> fromFirstToSecond(ArrayList<String> words);", "public static String[] splitString(char delim, String string) {\n\t Vector<String> res = new Vector<String>();\n\t int len = string.length();\n\t int start = 0;\n\t for (int i=0; i<len; i++) {\n\t\t if (string.charAt(i) == delim) {\n\t\t\t res.add(string.substring(start, i));\n\t\t\t start = i+1;\n\t\t }\n\t }\n\t res.add(start==len ? \"\" : string.substring(start));\n\t return res.toArray(new String[res.size()]);\n }", "@Override\n public Map<Boolean, Sort> split2 (int delim) {\n int subcl = 0, offset=0;//index of the non-single-values sub-intv, and marker offset\n if (isSplit()) //the class is partitioned in subclasses\n for (int j =0; j < this.constraints.length; j++) //we seek the non-single-values sub-intv\n if (this.constraints[j].singleValue()) \n offset += this.constraints[j].lb();\n else \n subcl = j;\n \n return split2(delim - offset, subcl + 1);\n }", "private String cutString(String value){\n String [] strings = value.split(\" \");\n System.out.println(strings[0]);\n return strings[0];\n }", "public static String[] split(String src, String sep) {\n if (src == null || src.equals(\"\") || sep == null || sep.equals(\"\")) return new String[0];\n List<String> v = new ArrayList<String>();\n int idx;\n int len = sep.length();\n while ((idx = src.indexOf(sep)) != -1) {\n v.add(src.substring(0, idx));\n idx += len;\n src = src.substring(idx);\n }\n v.add(src);\n return (String[]) v.toArray(new String[0]);\n }", "public static ArrayList<String> stringSplit(String stringToSplit, String delimiter) \n\t{\n\t\tif (delimiter == null) delimiter = \" \";\n\t\tArrayList<String> stringList = new ArrayList<String>();\n\t\tString currentWord = \"\";\n\n\t\tfor (int i = 0; i < stringToSplit.length(); i++) \n\t\t{\n\t\t\tString s = Character.toString(stringToSplit.charAt(i));\n\n\t\t\tif (s.equals(delimiter)) \n\t\t\t{\n\t\t\t\tstringList.add(currentWord);\n\t\t\t\tcurrentWord = \"\";\n\t\t\t} \n\t\t\telse { currentWord += stringToSplit.charAt(i); }\n\n\t\t\tif (i == stringToSplit.length() - 1) stringList.add(currentWord);\n\t\t}\n\n\t\treturn stringList;\n\t}", "static String division (String s1, String s2) {\r\n if (s2==null || s2.length()==0) return s1;\r\n return product (s1, invert(s2));\r\n }", "public static String[] split(char c, String value) {\n\t\t int count,idx;\n\t\t for(count=1,idx=value.indexOf(c);idx>=0;idx=value.indexOf(c,++idx),++count);\n\t\t String[] rv = new String[count];\n\t\t if(count==1) {\n\t\t\t rv[0]=value;\n\t\t } else {\n\t\t\t int last=0;\n\t\t\t count=-1;\n\t\t\t for(idx=value.indexOf(c);idx>=0;idx=value.indexOf(c,idx)) {\n\t\t\t\t rv[++count]=value.substring(last,idx);\n\t\t\t\t last = ++idx;\n\t\t\t }\n\t\t\t rv[++count]=value.substring(last);\n\t\t }\n\t\t return rv;\n\t }", "public int selectWordTokens (String [] list1, int count1, String [] list2){\n \n int count = 0;\n \n //Runs through each value of list1 grabs the values that align with \"[A-Za-z]+\" and assigns them to list2\n for (int i = 0; i < count1 ; i++){\n if (list1[i].matches(\"[A-Za-z]+\")){\n String Str = list1[i]; \n list2[count]= Str; \n count++;\n }//End if statement\n }//End for loop\n \n return count;\n \n }", "public static List<String> splitBitStrings(String bitString){\n\t\tList<String> LR = new ArrayList<String>();\n\t\tString L = bitString.substring(0,(bitString.length()/2));\n\t\tString R = bitString.substring((bitString.length()/2),bitString.length());\n\t\tLR.add(L);\n\t\tLR.add(R);\n\t\t\n\t\treturn LR;\n\n\t}", "static String toLookupKey(final String left, final String right) {\n return toLookupKey(left, SPLIT_STR, right);\n }", "private static String[] sepInst(String inst){\n\n String[] separated = new String[3];\n separated[0] = inst.substring(0, inst.indexOf(' '));\n if(-1 == inst.indexOf(',')){//enters if when only one variable\n separated[1] = inst.substring(inst.indexOf(' ')+1, inst.length());\n }else{//enters else when only when two variables\n separated[1] = inst.substring(inst.indexOf(' ')+1, inst.indexOf(','));\n separated[2] = inst.substring(inst.indexOf(',')+2, inst.length());\n }//end ifelse\n\n return separated;\n }", "void mo1340v(String str, String str2);", "public abstract int compare(String s1, String s2) throws NumberFormatException, ParseException;", "private void SplitString(String line) {\n String[] splittedLine = line.split(\"-\");\n AddLineToDictionary(Integer.parseInt(splittedLine[0]), splittedLine[1]);\n }", "static String twoStrings(String s1, String s2) {\n Hashtable<Character, Integer> shortDict = null;\n Hashtable<Character, Integer> longDict = null;\n \n boolean isCommonSubset = false;\n \n String longerString = s1.length() >= s2.length() ? s1 : s2;\n String shorterString = s1.length() < s2.length() ? s1 : s2;\n \n longDict = prepareHashtable(longerString);\n shortDict = prepareHashtable(shorterString);\n \n for (char ch: shortDict.keySet()) {\n if (longDict.containsKey(ch)) {\n isCommonSubset = true;\n break;\n }\n }\n \n return isCommonSubset ? \"YES\" : \"NO\";\n }", "@Test\n public void testSplitDomain1() {\n System.out.println(\"splitDomain1\");\n String domain = \"www.cars.example.co.uk\";\n Map<URLParser.DomainParts, String> expResult = new HashMap<>();\n expResult.put(URLParser.DomainParts.TLD, \"co.uk\");\n expResult.put(URLParser.DomainParts.DOMAINNAME, \"example\");\n expResult.put(URLParser.DomainParts.SUBDOMAIN, \"www.cars\");\n \n \n Map<URLParser.DomainParts, String> result = URLParser.splitDomain(domain);\n assertEquals(expResult, result);\n }", "public static void main(String[] args) {\n\t\tString s1=\"abc def ghi\";\n\t\tString s3=\"rupomroy\";\n\t\tString s7 =s3.substring(0, 4);\n\t\tSystem.out.println(s7);\n\t\t\n\t\t String[] s5 =s3.split(\"roy\");\n\t\t System.out.println(s5[0]);\n String s2 = s1.substring(4);\t\n System.out.println(s2);\n\t\t\n\t\t String[] s = s1.split(\" \");\n\t\t System.out.println(s[0]);\n\t\t System.out.println(s[1]);\n\t\t System.out.println(s[2]);\n\t\t\n\t\tSystem.out.println(s1);\n\t\t\n\t\t\n\n\t}", "public static String[] split(String str) {\n\t\treturn split(str, null, -1);\n\t}", "public StringArraySplitterBuilder addStringSplit(int start, int end) {\n splitter.addSplit(StringSplit.newSplit(start, end));\n return this;\n }" ]
[ "0.66457385", "0.6520467", "0.6278488", "0.62580854", "0.6233051", "0.6200837", "0.6124926", "0.60092235", "0.5836382", "0.58189255", "0.57442564", "0.5736536", "0.5706135", "0.5678788", "0.5669335", "0.5640395", "0.5638077", "0.5611893", "0.5586607", "0.5534343", "0.55277103", "0.5519351", "0.5508818", "0.5495575", "0.5492199", "0.5488819", "0.5485934", "0.5473158", "0.5466494", "0.5459556", "0.5438041", "0.54020333", "0.535027", "0.5349755", "0.53410894", "0.5295988", "0.5268352", "0.5261966", "0.52133864", "0.5189477", "0.5171822", "0.5163476", "0.5153892", "0.5151191", "0.5150562", "0.5135932", "0.5122772", "0.51215816", "0.5114986", "0.51141024", "0.5105615", "0.51047075", "0.50996983", "0.509368", "0.50774723", "0.5074281", "0.50643694", "0.50633025", "0.5059153", "0.50414985", "0.50387675", "0.5038307", "0.50334495", "0.5032866", "0.5020559", "0.50180024", "0.5014412", "0.5009787", "0.50023425", "0.4996143", "0.4982602", "0.4980307", "0.49779433", "0.4971597", "0.49673134", "0.4963796", "0.49597123", "0.4954578", "0.4950181", "0.49501115", "0.4946567", "0.49464244", "0.49451914", "0.49435708", "0.4941118", "0.49341834", "0.492893", "0.49222636", "0.49181685", "0.4916911", "0.4912571", "0.49088857", "0.4902175", "0.4895316", "0.4885861", "0.48817387", "0.4881676", "0.48753628", "0.48676616", "0.4865127" ]
0.721621
0
Write a method to find the index value of the given character in the first string.
public String indexOf(String s1,String ch) { int i = s1.indexOf(ch); return Integer.toString(i); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected int findFromIndex(char c) {\r\n int len = fromChars.length;\r\n for(int i = 0; i < len; i++) {\r\n if(fromChars[i] == c) return i;\r\n }\r\n return -1;\r\n }", "String getFirstIndex();", "private int findCharacter(char ch, String inputString, int currentIdx) {\n if (inputString.isEmpty()) {\n return -1;\n }\n return inputString.charAt(0) == ch ? currentIdx : findCharacter(ch, inputString.substring(1), ++currentIdx);\n }", "static int getIdx(char ch)\n {\n return (ch - 'a');\n }", "Index getIndex(String symbol);", "int indexOf(ASCIIString str, int fromIndex);", "public int indexOf(String str)\n\t{\n\t\tint indexOf = recursiveIndexOf(firstC, length, 0, -1, str);\n\t\treturn indexOf;\n\t}", "public int indexOf(int ch) {\n/* 411 */ return this.m_str.indexOf(ch);\n/* */ }", "public Integer indexOf(String s){\n\t\tInteger i;\n\t\tif((i=indices.get(s))!=null)\n\t\t\treturn i;\n\t\telse\n\t\t\treturn Integer.valueOf(-1);\n\t}", "protected int charIndex(char c) {\r\n\t\ttry {\r\n\t\t\treturn characterMap.indexOf(c);\r\n\t\t} catch (IndexOutOfBoundsException e) {\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t}", "int getIndex(Character c)\n{\n int a = Character.getNumericValue('a');\n int z = Character.getNumericValue('z');\n int val = Character.getNumericValue(c);\n \n if (a <= val && val <= z) return val - a;\n return -1;\n}", "public int getCharaterPositionWithName(String s){\n int i;\n for(i = 0; i<alCharacter.size(); i++){\n String nameNextChar = alCharacter.get(i).getName();\n if(s.equals(nameNextChar)){\n break;\n }\n }\n return i;\n }", "int getStartCharIndex();", "public int indexOf(String str) {\n/* 514 */ return this.m_str.indexOf(str);\n/* */ }", "static int strStr(String s, String x){\n return s.indexOf(x);\n }", "public static int nextIndexOf(String string, String characters, int index) {\n int retInd = string.length();\n int auxIndex = -1;\n \n for (int i = 0; i < characters.length(); i++) {\n auxIndex = string.substring(index + 1).indexOf(characters.charAt(i));\n if ((auxIndex > -1) && (auxIndex + index + 1 < retInd)) {\n retInd = auxIndex + index + 1;\n }\n }\n return retInd;\n }", "public int indexOf(int ch, int fromIndex) {\n/* 444 */ return this.m_str.indexOf(ch, fromIndex);\n/* */ }", "private int getIndex(char c) {\n // if the character is a-z then return 0-25 based on position in alphabet\n if (c >= 'a' && c <= 'z') {\n return c - 'a';\n }\n // if the character is an appostrophe return 26 (last element in node array)\n else if (c == '\\'') {\n return 26;\n }\n // if the character is not a-z nor an apostrophe, return -1 to signify error\n else {\n return -1;\n }\n }", "public static int indexOf(char c, CharSequence seq) {\n int max = seq.length();\n for (int i = 0; i < max; i++) {\n if (c == seq.charAt(i)) {\n return i;\n }\n }\n return -1;\n }", "public static int indexOfChar(char A,String alphabet) throws IOException\n {\n for(int i=0;i< alphabet.length();i++)\n {\n if(alphabet.charAt(i)==A)\n return i;\n }\n // Not Found in the alphabet\n return -1;\n }", "public int search(char value)\n {\n for(int i = 0; i < this.raw_value.length; i++)\n {\n if(this.raw_value[i] == value) return i;\n }\n return -1;\n }", "public int b(char paramChar)\r\n/* 714: */ {\r\n/* 715:706 */ return this.f[\"0123456789abcdef\".indexOf(paramChar)];\r\n/* 716: */ }", "int indexOf(String column);", "int indexOf(String column);", "public char givenIndex(String str, int index)\r\n {\r\n char a= str.charAt(index);\r\n return a;\r\n }", "public static int finder(String line){\n for (int i = 0; i < line.length(); i++) {//i is the current index \n char current_char = line.charAt(i);\n if(current_char == '+' || current_char == '-' || current_char == '*' || current_char == '/' ){\n return i;\n }\n }\n return line.length();\n}", "public int indexOf(String cate, int idx) {\n\t\tif (idx >= seq.size()) return -1;\n\t\tfor (int i=idx; i < seq.size(); i++) {\n\t\t\tif (seq.get(i).equals(cate))\n\t\t\t\treturn i;\n\t\t}\n\t\treturn -1;\n\t}", "public int indexOf(XMLString str) {\n/* 536 */ return this.m_str.indexOf(str.toString());\n/* */ }", "public static void main(String[] args) {\n\t \r\n\t\t\tString s1=\"this is index of example\"; \r\n\t\t\t//passing substring with from index \r\n\t\t\tint index3=s1.indexOf(\"is\",4);//returns the index of is substring after 4th index \r\n\t\t\t\tSystem.out.println(index3);//5 i.e. the index of another is \r\n\t\t\t\t \r\n\t\t\t\t//passing char value \r\n\t\t\t\tint index4=s1.indexOf('s');//returns the index of s char value \r\n\t\t\t\tSystem.out.println(index4);//3 \r\n\t\t\t}", "public static void main(String[] args) {\n String Data=\"The generations of our family changing\";\nSystem.out.println(Data.indexOf(\"The\")); //Index ==== displays \"the\" position in the string\nSystem.out.println(Data.indexOf(\"family\"));\nSystem.out.println(Data.indexOf(\"Family\")); //case sensitive ====== for index thats the reason -1 is printing.\n\t}", "public static int indexOf(String s, String sub) {\r\tfor (int i = 0; i < s.length() - sub.length() + 1; i++)\r\t\tif (isEqual(substring(s, i, sub.length()), sub))\r\t\t\treturn i;\r\r\treturn -1;\r\t\r\t\r\t\r }", "public static void main(String[] args) {\n\n String haystack = \"abc\";\n String needle = \"c\";\n\n\n int idx = strStr(haystack, needle);\n System.out.println(idx);\n }", "public char charAt(int index);", "public static Character findFirstNonRepetedCharacter(String str){\n Map<Character,Integer> map = new HashMap<>();\n\n char[] chars = str.toCharArray();\n for(Character ch: chars){\n //Terinery operator if chracter contains value increment by one\n var count = map.containsKey(ch) ? map.get(ch) : 0;\n map.put(ch,count +1);\n }\n\n //due to hashfunction map store these values in different places in memory( not sequentially)\n //now match the character in String from first to end corresponding to Map values\n for(Character ch: chars){\n //first non repeated value a green apple in string | in { =2, p=2, a=2, r=1, e=3, g=1, l=1, n=1}\n if(map.get(ch)==1) return ch; // ^\n }\n\n return Character.MIN_VALUE; // a default value when cant find any 1st repeated\n }", "public int letterToIndex(char letter) {\r\n\t\tif (Character.toLowerCase(letter) == 'a')\r\n\t\t\treturn 0;\r\n\t\telse if (Character.toLowerCase(letter) == 'b')\r\n\t\t\treturn 1;\r\n\t\telse if (Character.toLowerCase(letter) == 'c')\r\n\t\t\treturn 2;\r\n\t\telse if (Character.toLowerCase(letter) == 'd')\r\n\t\t\treturn 3;\r\n\t\telse if (Character.toLowerCase(letter) == 'e')\r\n\t\t\treturn 4;\r\n\t\telse if (Character.toLowerCase(letter) == 'f')\r\n\t\t\treturn 5;\r\n\t\telse if (Character.toLowerCase(letter) == 'g')\r\n\t\t\treturn 6;\r\n\t\telse if (Character.toLowerCase(letter) == 'h')\r\n\t\t\treturn 7;\r\n\t\telse if (Character.toLowerCase(letter) == 'i')\r\n\t\t\treturn 8;\r\n\t\telse if (Character.toLowerCase(letter) == 'j')\r\n\t\t\treturn 9;\r\n\t\telse\r\n\t\t\treturn -1;\r\n\t}", "public static int index_of_first_vowel(String word) {\r\n // Iterate over each letter of the word from the start\r\n for (int i = 0; i < word.length(); i++) {\r\n // True when the index i of the string is a vowel\r\n if(Main.VOWELS.indexOf(word.charAt(i)) > -1){\r\n return i;\r\n }\r\n }\r\n\r\n return -1; // Condition when the word contains no vowels, program will just add ay to the end in this case\r\n }", "public int firstUniqChar2(String s) {\r\n \r\n char[] arr= s.toCharArray();\r\n int index = -1;\r\n HashMap<Character, Integer> map = new HashMap<>();\r\n \r\n for (int i=0;i<arr.length;i++){\r\n if (map.containsKey(arr[i])){\r\n map.put(arr[i], -1);\r\n } else {\r\n map.put(arr[i],i);\r\n }\r\n }\r\n \r\n for (int i : map.values()){\r\n if (i >-1){\r\n if (index == -1){\r\n index = i;\r\n } else if (i<index) {\r\n index = i; \r\n }\r\n \r\n }\r\n }\r\n \r\n return index;\r\n }", "public int findPosition(int num) {\n\t\t\n\t\tString s = new Integer(num).toString();\n\t\tSystem.out.println(\"After converting input number to string: \" + s);\n\t\t\n\t\tint i = 0, j = 0;\n\t\tint m = s.length(), n = input.length();\n\t\t\n\t\tfor(i = 0; i <= n - m; i++) {\n\t\t\tj = 0;\n\t\t\twhile(j < m && input.charAt(i + j) == s.charAt(j)) {\n\t\t\t\tj++;\n\t\t\t}\n\t\t\tif(j == m) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\t\t\n\t\t\n\t\treturn -1;\n\t}", "public static int intForChar(char c) {\n for (int i = 0; i < DICT.length; i++) {\n if (DICT[i] == c) {\n return i;\n }\n }\n //Return 0 if character can't be found.\n return 0;\n }", "public char charAt(int index) {\n/* 121 */ return this.m_str.charAt(index);\n/* */ }", "private int findIndex(String str){\n for(int i=size()-1;i>=0;i--){\n if(str.compareTo(get(i))>0){\n return i+1;\n }\n }\n return 0;\n }", "public char charAt(int charOffset);", "public abstract int indexOf(E e);", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "public static int approach1(String str) {\n\t\tint strLength = str.length();\n\t\tfor(int i = 0; i < strLength; i++) {\n\t\t\tfor(int j = i+1; j < strLength; j++) {\n\t\t\t\tif(str.charAt(i) == str.charAt(j)) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}", "public int firstUniqChar(String s) {\n Map<String, Integer> occurMap = new LinkedHashMap<>();\n for (int i = 0; i < s.length(); i++) {\n String si = s.substring(i, i + 1);\n if (occurMap.containsKey(si)) {\n if (occurMap.get(si) > -1) {\n occurMap.put(si, -1);\n }\n } else {\n occurMap.put(si, i);\n }\n }\n for (Integer idx : occurMap.values()) {\n if (idx > -1) {\n return idx;\n }\n }\n return -1;\n }", "public int mo131897a(String str) {\n return super.indexOf(str);\n }", "public static char first(String s) {\n\treturn s.charAt(0);\n\t}", "char getFirstChar(String input) {\n\t\tchar firstChar = input.charAt(0), temp;\n\t\tint count;\n\t\tfor(int index=0; index<input.length(); index++) {\n\t\t\ttemp = input.charAt(index);\n\t\t\tcount=0;\n\t\t\tfor(int innerIndex=0; innerIndex<input.length(); innerIndex++) {\n\t\t\t\tif(temp == input.charAt(innerIndex)) \n\t\t\t\t\tcount++;\n\t\t\t}\n\t\t\tif(count==1) {\n\t\t\t\tfirstChar = temp;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn firstChar;\n\t}", "public static char scanChar(String s) {\n\t\tCharacter key = null;\n\t\tMap<Character, String> mapping = new HashMap<>();\n\t\tfor (char c = 'A'; c <= '?'; c++) {\n\t\t\tmapping.put(c, AsciiArt.printChar(c));\n\t\t}\n\n\t\tfor (Map.Entry entry : mapping.entrySet()) {\n\t\t\tif (s.equals(entry.getValue())) {\n\t\t\t\tkey = (char) entry.getKey();\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\tkey = '?';\n\t\t\t}\n\t\t}\n\n\t\treturn key;\n\n\t}", "public int getIndex(int position);", "public static int getLetterIndex(String word, byte startFrom) {\r\n int i, j;\r\n if (startFrom == head) // start checking from beginning\r\n {\r\n for (i = 0; i < word.length(); i++) {\r\n if (word.charAt(i) >= 'a' && word.charAt(i) <= 'z')\r\n return i;\r\n }\r\n return -1; // cannot found any letter in the string\r\n } else if (startFrom == tail) // start check from the ed\r\n {\r\n for (j = word.length() - 1; j >= 0; j--) {\r\n if (word.charAt(j) >= 'a' && word.charAt(j) <= 'z')\r\n return j;\r\n }\r\n return -1; // cannot found any letter in the string\r\n }\r\n return 0;\r\n }", "public int getIndex(String s){\r\n int b = 1;\r\n int l = hashFunction(s);\r\n if(table[l].getKey().equals(s)){\r\n return l;\r\n }\r\n else{\r\n while(table[l + b*b] != null){\r\n if(table[l].getKey().equals(s)){\r\n break;\r\n }\r\n else{\r\n b++;\r\n } \r\n }\r\n if(table[l].getKey().equals(s)){\r\n return l;\r\n }\r\n else{\r\n return 0;\r\n }\r\n }\r\n }", "public static void main(String[] args) {\n System.out.println(indexOf(\"Devxschoooool\", 'o'));\n //substring(1, 2)\n }", "String getWordIn(String schar, String echar);", "public static int findIndex(String string1, String string2) {\n char c;\n char d;\n int index = -1;\n boolean match = true;\n int count = 1;\n int counter = 0;\n boolean matchFound = false;\n for (int i = 0; i < string2.length(); i++) {\n c = string2.charAt(i);\n if (string2.length() > string1.length()) {\n match = false;\n break;\n }\n // Checks if the characters after the first of string 2 match in string 1\n if (matchFound == true) {\n for (int j = count + counter; j < string1.length(); j++) {\n d = string1.charAt(j);\n if (d != c) {\n \n match = false;\n } else {\n counter++;\n index = j -1;\n matchFound = true;\n break;\n }\n }\n } \n // Checks for the first character in string2 in string1\n if (matchFound == false) {\n for (int k = 0; k < string1.length(); k++) {\n d = string1.charAt(k); \n if (d != c) {\n count ++;\n \n matchFound = false;\n } else {\n index = k;\n matchFound = true;\n break;\n } \n match = true;\n } \n } \n }\n // returns the index number\n return index;\n \n \n }", "@Override\n\tpublic String strindexOf(String str, char ch) {\n\t\treturn null;\n\t}", "public static int indexOf(String firstStr, String secondStr) {\n return indexOf(firstStr, secondStr, 0);\n }", "public int firstUniqChar2(String s) {\n char[] chars = s.toCharArray();\n \n for (int i = 0; i < chars.length; i++) {\n char c = chars[i];\n if (s.indexOf(c) == s.lastIndexOf(c)) return i;\n }\n \n return -1;\n }", "int indexOf(int val);", "private static int charAt(String data) {\n\t\treturn 0;\n\t}", "private int findIndex(String value) {\n\tint index = 0;\n\tfor (int i = 0; i < getData().length && index == 0;) {\n\t if (value.compareTo(getData()[i]) <= 0) {\n\t\tindex = i;\n\t }\n\t else {\n\t\ti++;\n\t }\n\t}\n\treturn index;\n }", "Integer getIndexOfGivenValue(String value) {\n Integer index = null;\n for (IndexValuePair indexValuePair : indexValuePairs) {\n if (indexValuePair.getValue().equals(value)) {\n index = indexValuePair.getIndex();\n break;\n }\n }\n return index;\n }", "public int indexOf()\n {\n\treturn indexOfValue(mValue);\n }", "public static char first(String s) {\n return s.charAt(0);\n }", "private int locate(String str, String substr, int pos) {\n if (substr.length() == 0) {\n if (pos <= (str.length() + 1)) {\n return pos;\n }\n else {\n return 0;\n }\n }\n int idx = StringUtils.indexOf(str, substr, pos - 1);\n if (idx == -1) {\n return 0;\n }\n return idx + 1;\n }", "public static int firstUniqChar(String s) {\n Map<Character, Integer> map = new HashMap<>();\n for (int i = 0; i < s.length(); i++) {\n char c = s.charAt(i);\n if (map.containsKey(c)) {\n map.put(c, map.get(c) + 1);\n } else {\n map.put(c, 1);\n }\n }\n\n for (int i = 0; i < s.length(); i++) {\n char c = s.charAt(i);\n if (map.get(c) == 1) {\n return i;\n }\n }\n return -1;\n\n }", "public static int indexOf(String[] arr, String e) {\n\t\tfor (int i = 0; i < arr.length; i++)\n\t\t\tif (arr[i].startsWith(e))\n\t\t\t\treturn i;\n\t\treturn -1;\n\t}", "private int findFirstNotWhitespace(char[] characters) \n\t{\n\t\t//find starting position of token\n\t\tfor(int i=0; i<characters.length; i++)\n\t\t{\n\t\t\t//check if character is not whitespace.\n\t\t\tif(!Character.isWhitespace( characters[i]))\n\t\t\t{\n\t\t\t\t//non-whitespace found, return position \n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\t//no non-whitespace in char[].\n\t\treturn -1;\n\t}", "public int find(String string) {\n\t\tif (string==null) {\n\t\t\treturn -1;\n\t\t}\n\t\tfor (int i=0;i!=m_stringOffsets.length;++i) {\n\t\t\tint offset=m_stringOffsets[i];\n\t\t\tint length=getShort(m_strings,offset);\n\t\t\tif (length!=string.length()) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tint j=0;\n\t\t\tfor (;j!=length;++j) {\n\t\t\t\toffset+=2;\n\t\t\t\tif (string.charAt(j)!=getShort(m_strings,offset)) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (j==length) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}", "private int findPos(String x) {\n\t int offset = 1;\n\t int currentPosition = myhash(x);\n\t \n\t while (array[currentPosition] != null && !array[currentPosition].element.getContent().equals(x)) {\n\t currentPosition += offset; // Compute ith probe\n\t offset += 2;\n\t if(currentPosition >= array.length)\n\t currentPosition -= array.length;\n\t }\n\t \n\t return currentPosition;\n\t }", "public int getIndex();", "public int getIndex();", "public int getIndex();", "private int indexOf(final String string, final String sub, final boolean start,\n final boolean ends, final InputInfo info) throws QueryException {\n\n final RuleBasedCollator rbc = rbc(info);\n final CollationElementIterator i = rbc.getCollationElementIterator(string);\n final CollationElementIterator is = rbc.getCollationElementIterator(sub);\n do {\n final int cs = next(is);\n if(cs == -1) return 0;\n int c;\n do {\n c = next(i);\n if(c == -1) return -1;\n } while(c != cs);\n\n final int s = i.getOffset();\n if(startsWith(i, is) && (!ends || next(i) == -1))\n return start ? s - 1 : i.getOffset();\n i.setOffset(s);\n is.reset();\n } while(true);\n }", "private int getIndex(Spinner spinner, String myString) {\n for (int i = 0; i < spinner.getCount(); i++) {\n if (spinner.getItemAtPosition(i).toString().equalsIgnoreCase(myString)) {\n return i;\n }\n }\n return -1;\n }", "private static int find_value(String b)\n {\n int store = 0;\n List<String> name = new ArrayList<String>(library.return_name());\n //System.out.println(name);\n for(int x = 0; x < name.size(); x++)\n {\n if(name.get(x).charAt(0) == b.charAt(0))\n store = x;\n }\n List<Integer> value = new ArrayList<Integer>(library.return_value());\n return value.get(store);\n }", "public char findFirstUniqueCharacter (String string) { // O(n*n)\n for (int i = 0; i < string.length(); i++) {\n char currentChar = string.charAt(i);\n\n if (i == string.lastIndexOf(currentChar)) {\n return currentChar;\n }\n }\n\n return '\\n';\n }", "private int getCharacterIndex(Character c, int index) {\r\n if (c instanceof CommonInfected) {\r\n return (index % cInfectedNum);\r\n\t\t}\r\n else if (c instanceof Tank) {\r\n return (index % tankNum);\r\n\t\t}\r\n else if (c instanceof Child) {\r\n return (index % childNum);\r\n\t\t}\r\n else if (c instanceof Teacher) {\r\n return (index % teacherNum);\r\n\t\t}\r\n else if (c instanceof Soldier) {\r\n return (index % soldierNum);\r\n\t\t}\r\n else {\r\n return -1;\r\n\t\t}\r\n }", "private String findIndexOfI (Comparable<E> item) {\n String compareString = item.toString();\n for (int i = 0; i < data.length; i++) {\n if (data[i].toString().equals(item)) {\n return data[i].toString();\n } else {\n String compareSecond = compareString.substring(2, 3);\n if (data[i].toString().substring(2, 3).equals(compareSecond)) {\n return data[i].toString();\n }\n\n }\n }\n return (\"failed to find\");\n }", "private int getIndex(Spinner spinner, String myString){\n for (int i=0;i<spinner.getCount();i++){\n if (spinner.getItemAtPosition(i).toString().equalsIgnoreCase(myString)){\n return i;\n }\n }\n\n return 0;\n }", "private static int ind(char a, char b) {\n return (a == b) ? 1 : 0;\n }", "private int getIndex(Spinner spinner, String myString)\n {\n int index = 0;\n\n for (int i=0;i<spinner.getCount();i++){\n if (spinner.getItemAtPosition(i).toString().equalsIgnoreCase(myString)){\n index = i;\n break;\n }\n }\n return index;\n }", "public static char getLetter(String s){\n //A variable used in the helper method\n int i = 0;\n return getLetter(codeTree, s, i);\n }", "public static int getValueAt(char[] parleValues, char index) {\t\n\t\treturn parleValues[binarySearchLeft(parleValues, index)+2];\n\t}", "private static int findTheLastIndexInString(String s, char x){\n\n\t\tfor(int i=s.length()-1 ; i>=0; i--){\n\t\t\t\n\t\t\tif(s.charAt(i) == x)\n\t\t\t\treturn i;\n\t\t}\n\t\treturn -1;\n\t}", "public static void main(String[] args) {\n\n\t\tString str=\"javs\";\n\t\tint index=0;\n\t\tindex=str.indexOf(\"v\");\n\t\t\n\t\tSystem.out.println(index);\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t\n\t\tString str1 = \"Java World\";\n\t\tSystem.out.println(str1.indexOf(\"v\"));\n\t\t//Ekrana 2 yazdirir. Cunku index sayimi 0'dan baslar. \n\t\t\t\n\t\tSystem.out.println(str1.indexOf(\"W\"));// Ekrana 5 yazdirir. //Space Java icin bir character'dir.\n\t\t\n\t\tSystem.out.println(str1.indexOf(\"w\"));\n\t\t// Javada yukarida indexI bulamaz. Java \"case sensitive\" dir.\n\t\t// Kucuk w String'te yoktur. Java character bulamayinca -1 return eder.\n\t\t\n\t\tSystem.out.println(str1.indexOf(\"a\"));// Ekrana 1 yazdirir. Birden fazla \n\t\t// kullanilan characterler icin Java ilk character'in indexini verir.\n\t\t\n\t\t// indexOf methodu diger versiyonu:\n\t\t//\"Javva\" Stringinde asagidaki a characterinin farkli indexlerini bulunuz.\n\t\tString str4 = \"Javva World\";\n\t\tSystem.out.println(str4.indexOf(\"a\",2));//Stringteki ikinci 'a' characterinin indexini bulunuz.\n\t\t// Ekrana 4 yazdirmali.\n\t\t\n\t\tSystem.out.println(str4.indexOf(\"a\",4));// Ekrana 4 yazdirir.\n\t\tSystem.out.println(str4.indexOf(\"a\",1));// Ekrana 1 yazdirir.\n\t\tSystem.out.println(str4.indexOf(\"a\",5));// Ekrana -1 yazdirir.\n\t\t\n\t\t\n\t\t//\"Alamanya\" Stringindeki ikinci 'a' characterinin indexini bulunuz.\n\t\t\n\t\tString str2 = \"Alamanya\";\n\t\tSystem.out.println(str2.indexOf(\"a\"));// Bu birinci 'a' nin indexi 2 \n\t\tint idx = str2.indexOf(\"a\");\n\t\tSystem.out.println(str2.indexOf(\"a\",idx+1));\n\t\t// indexOf methodunun 3.versiyonu\n\t\tString str3 = \"Missisippi\";\n\t\tSystem.out.println(str3.indexOf(\"is\")); // Java bir hecenin indexini yazarken ilk harfin indexini\n\t\t//return eder. Bu ornekte ilk \"is\" teki i harfinin indexi olan 1 i return eder. \n\t\t\n\t\tSystem.out.println(str3.indexOf(\"si\"));// Ekrana 3 yazdirir.\n\t}" ]
[ "0.7417419", "0.73519605", "0.734573", "0.71395284", "0.7095446", "0.70845646", "0.70210016", "0.6934145", "0.6876942", "0.6865533", "0.68441975", "0.6814515", "0.67846906", "0.67105335", "0.66719896", "0.6655663", "0.66470075", "0.6646947", "0.6614987", "0.6609335", "0.6606629", "0.6602869", "0.65971875", "0.65971875", "0.6583682", "0.6549149", "0.65489626", "0.64735234", "0.647293", "0.6469858", "0.64634305", "0.63662404", "0.6362077", "0.6355028", "0.63440835", "0.6341099", "0.63389677", "0.63153046", "0.63096535", "0.6290196", "0.6281379", "0.62442434", "0.6233685", "0.62255776", "0.62255776", "0.62255776", "0.62255776", "0.62255776", "0.62255776", "0.62255776", "0.62255776", "0.62255776", "0.62255776", "0.62255776", "0.62255776", "0.62255776", "0.62254375", "0.62114984", "0.6206937", "0.6204958", "0.62027895", "0.6201112", "0.6189614", "0.61856717", "0.61772794", "0.61739236", "0.6173795", "0.6168289", "0.61642414", "0.6161962", "0.6140305", "0.6138548", "0.61361533", "0.61264706", "0.6122073", "0.6116594", "0.61056185", "0.6105609", "0.61033267", "0.6099812", "0.60936713", "0.60884273", "0.6084551", "0.60812706", "0.60812706", "0.60812706", "0.6071816", "0.606997", "0.6069903", "0.60615104", "0.60505486", "0.6033221", "0.6024163", "0.60163295", "0.6015554", "0.6012015", "0.60118216", "0.5996124", "0.5995814", "0.59845066" ]
0.6708884
14
Gets the value of the result property.
public boolean isResult() { return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Result getResult() {\n\t\treturn this._result;\n\t}", "public String getResult() {\n return mResult;\n }", "@Override\n\tpublic Result getResult() {\n\t\treturn m_Result;\n\t}", "@SuppressWarnings(\"unchecked\")\r\n\t@Override\r\n\tpublic String getResult() {\n\t\treturn this.result;\r\n\r\n\t}", "public Result getResult() {\n return result;\n }", "public ResultType getResult() {\r\n return result;\r\n }", "public String getResult() {\n return result;\n }", "public String getResult() {\n return result;\n }", "public String getResult() {\n return result;\n }", "public String getResult()\r\n\t{\r\n\t\treturn result;\r\n\t}", "public int getResult() {\n return this.result;\n }", "public int getResultValue() {\n return mResultValue;\n }", "public Result getResult() {\n return result;\n }", "@java.lang.Override public int getResultValue() {\n return result_;\n }", "public String getResult()\n {\n return result;\n }", "@java.lang.Override public int getResultValue() {\n return result_;\n }", "public E getResult(){\r\n\t\treturn this.result;\r\n\t}", "public int getResult() {\n\t\t\treturn this.result;\r\n\t\t}", "public Integer getResult() {\n return result;\n }", "public int getResult() {\n return result;\n }", "public ValueType getResultValue() {\n\t\treturn this.value;\n\t}", "public Object getResult() {\n if (result == null) {\n return defaultResult();\n } else {\n return result;\n }\n }", "public int getResult() {\r\n\t\t\treturn result_;\r\n\t\t}", "public String getResult() \n\t{\n\t\treturn strResult;\n\t}", "public int getResult() {\r\n\t\t\t\treturn result_;\r\n\t\t\t}", "public TResult getResult() {\n return result;\n }", "public VData getResult() {\n\t\treturn mResult;\n\t}", "@Override\n\tpublic String getResult() {\n\t\treturn result;\n\t}", "public T result() {\n return result;\n }", "int getResult() {\n return result;\n }", "public T getResult() {\n return result;\n }", "public T getResult() {\n return result;\n }", "public Object getResult(final SessionContext ctx)\n\t{\n\t\treturn getProperty( ctx, RESULT);\n\t}", "@Override\n \tpublic Object getResult() {\n \t\treturn result;\n \t}", "public int getresult(){\n return result;}", "public int getResult(){\r\n\t\t return result;\r\n\t }", "public Boolean getResult() {\n return result;\n }", "@Nullable public R result() {\n return res;\n }", "public boolean result () {\n return m_result;\n }", "public native String getResult() /*-{\n\t\treturn this.target.result;\n\t}-*/;", "synchronized public Result getResult () {\n Result result = (Result) get (RESULT.toString());\n if (result == null) {\n result = new Result();\n put (RESULT.toString(), result);\n }\n return result;\n }", "@ApiModelProperty(required = true, value = \"Indication of whether the test succeeded.\")\n public String getResult() {\n return result;\n }", "double getResult() {\r\n\t\treturn result;\r\n\t}", "int getResultValue();", "int getResultValue();", "public boolean getResult() {\r\n\treturn result;\r\n }", "public double getResult() {\n\t\treturn result; // so that skeleton code compiles\n\t}", "protected SimulatorValue giveResult() {\n\tthis.evalExpression();\n\treturn value;\n }", "public boolean getResult() {\n return result_;\n }", "public boolean getResult() {\n return result_;\n }", "public boolean getResult() {\n return result_;\n }", "public boolean getResult() {\n return result_;\n }", "protected R getResult() {\n\t\treturn result;\n\t}", "public boolean getResult() {\n return result_;\n }", "public boolean getResult() {\n return result_;\n }", "public boolean getResult() {\n return result_;\n }", "public boolean getResult() {\n return result_;\n }", "public final String getResultStr() {\n return this.resultStr;\n }", "public Result getResults()\r\n {\r\n return result;\r\n }", "public java.lang.String getResult() {\n java.lang.Object ref = result_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n result_ = s;\n }\n return s;\n }\n }", "public com.google.protobuf.ByteString\n getResultBytes() {\n java.lang.Object ref = result_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n result_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public java.lang.String getResult() {\n java.lang.Object ref = result_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n result_ = s;\n }\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public com.google.protobuf.ByteString\n getResultBytes() {\n java.lang.Object ref = result_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n result_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.rpg.framework.database.Protocol.ResponseCode getResult() {\n return result_;\n }", "public com.rpg.framework.database.Protocol.ResponseCode getResult() {\n return result_;\n }", "public com.rpg.framework.database.Protocol.ResponseCode getResult() {\n return result_;\n }", "public com.rpg.framework.database.Protocol.ResponseCode getResult() {\n return result_;\n }", "public com.rpg.framework.database.Protocol.ResponseCode getResult() {\n return result_;\n }", "public com.rpg.framework.database.Protocol.ResponseCode getResult() {\n return result_;\n }", "public com.rpg.framework.database.Protocol.ResponseCode getResult() {\n return result_;\n }", "public com.rpg.framework.database.Protocol.ResponseCode getResult() {\n return result_;\n }", "public com.rpg.framework.database.Protocol.ResponseCode getResult() {\n return result_;\n }", "public com.rpg.framework.database.Protocol.ResponseCode getResult() {\n return result_;\n }", "public int result() {\n\t\treturn total;\n\t}", "public JSONObject getResult()\n {\n return result;\n }", "@Override\n public boolean getResult() {\n return result_;\n }", "public MatchResult getResult() {\n return result;\n }", "@Override\n public boolean getResult() {\n return result_;\n }", "public Object getResult()\n/* */ {\n/* 129 */ Object resultToCheck = this.result;\n/* 130 */ return resultToCheck != RESULT_NONE ? resultToCheck : null;\n/* */ }", "public String getResult();", "public String getResult();", "public String getResult();", "@Override\r\n\tpublic Porduct GetResult() {\n\t\treturn product;\r\n\t}", "@ScriptyCommand(name = \"dbg-result\", description =\n \"(dbg-result)\\n\" +\n \"Get the result of the current debugging session if one has been reached or null.\\n\" +\n \"See also: dbg-expr, dbg-result?.\")\n @ScriptyRefArgList(ref = \"no arguments\")\n public Object result()\n throws CommandException {\n checkTrace();\n return trace.getResult();\n }", "public void setResult(String result) {\n this.result = result;\n }", "public int getResult(){\n return localResult;\n }", "@java.lang.Override public POGOProtos.Rpc.AssetVersionOutProto.Result getResult() {\n @SuppressWarnings(\"deprecation\")\n POGOProtos.Rpc.AssetVersionOutProto.Result result = POGOProtos.Rpc.AssetVersionOutProto.Result.valueOf(result_);\n return result == null ? POGOProtos.Rpc.AssetVersionOutProto.Result.UNRECOGNIZED : result;\n }", "public com.google.protobuf.StringValue getResultId() {\n return resultId_ == null ? com.google.protobuf.StringValue.getDefaultInstance() : resultId_;\n }", "public String getResultToken() {\n return resultToken;\n }", "public static String getOpResult (){\n \treturn opResult;\n }", "public void setResult(Object result) {\n this.result = result;\n }", "public void setResult(String result) {\n this.result = result;\n }", "@java.lang.Override\n public POGOProtos.Rpc.AssetVersionOutProto.Result getResult() {\n @SuppressWarnings(\"deprecation\")\n POGOProtos.Rpc.AssetVersionOutProto.Result result = POGOProtos.Rpc.AssetVersionOutProto.Result.valueOf(result_);\n return result == null ? POGOProtos.Rpc.AssetVersionOutProto.Result.UNRECOGNIZED : result;\n }", "@Nullable\n Result getResult();", "public void setResult(String result)\n {\n this.result = result;\n }", "public double getResult()\n { \n return answer;\n }", "public String getResultmsg() {\n return resultmsg;\n }", "public java.lang.String getGetsfzyResult() {\r\n return localGetsfzyResult;\r\n }", "public int getEresult() {\n return eresult_;\n }", "public java.lang.String getGetItemDataResult() {\r\n return localGetItemDataResult;\r\n }" ]
[ "0.8027345", "0.7905211", "0.7797313", "0.77768767", "0.7749912", "0.7726988", "0.7716189", "0.7716189", "0.7716189", "0.76868683", "0.7675652", "0.7653097", "0.7647881", "0.7641024", "0.7638867", "0.7614408", "0.7564852", "0.756106", "0.7540312", "0.7513443", "0.74925125", "0.7489977", "0.7474379", "0.7449601", "0.744198", "0.736451", "0.7364031", "0.7348925", "0.7334714", "0.732411", "0.72975373", "0.72975373", "0.7272598", "0.7260555", "0.722419", "0.71726793", "0.7160967", "0.7153442", "0.71381694", "0.71196276", "0.7104905", "0.70754486", "0.7068606", "0.70102054", "0.70102054", "0.70056635", "0.70043916", "0.6995762", "0.6928705", "0.6928705", "0.6928705", "0.6928705", "0.6914098", "0.6896404", "0.6896404", "0.6896404", "0.6896404", "0.6886378", "0.6872198", "0.6860483", "0.6849196", "0.6812473", "0.6808507", "0.6790784", "0.679041", "0.679041", "0.6790227", "0.6790227", "0.67712593", "0.67712593", "0.67712593", "0.67704296", "0.67704296", "0.67602295", "0.6680245", "0.66744876", "0.66577375", "0.6587932", "0.65846425", "0.6577795", "0.6577795", "0.6577795", "0.6566906", "0.6527437", "0.64961225", "0.64877367", "0.6476217", "0.6473912", "0.64738536", "0.64590514", "0.6450604", "0.64461094", "0.6440755", "0.64320016", "0.6414426", "0.64132947", "0.6408552", "0.63999027", "0.63931113", "0.6391924" ]
0.6556403
83
Sets the value of the result property.
public void setResult(boolean value) { this.result = value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setResult(Object result) {\n this.result = result;\n }", "public void setResult(Result result) {\n this.result = result;\n }", "public void setResult(Result result) {\n\t\tthis._result = result;\n\t}", "public void setResult(T result) {\n this.result = result;\n }", "protected void maybeSetResultPropertyValue(int result) {\r\n String res = Integer.toString(result);\r\n if (resultProperty != null) {\r\n getProject().setNewProperty(resultProperty, res);\r\n }\r\n }", "protected void setResult(R result) {\n _result = result;\n }", "public void setResult() {\n }", "public void setResult(String result)\r\n\t{\r\n\t\tthis.result = result;\r\n\t}", "public void setResult(String result)\n {\n this.result = result;\n }", "public void setResult(String result) {\n this.result = result;\n }", "public void setResult (String Result);", "public void setResult(String result) {\n this.result = result;\n }", "public void setResult(final Integer res) {\n this.result = res;\n }", "@Override\n public void setResult(Object result) throws EngineException {\n \n }", "public void setResult(boolean result) {\n\t\t_result = result;\n\t}", "public void setResult(final SessionContext ctx, final Object value)\n\t{\n\t\tsetProperty(ctx, RESULT,value);\n\t}", "public Builder setResult(int value) {\r\n\t\t\t\tbitField0_ |= 0x00000001;\r\n\t\t\t\tresult_ = value;\r\n\t\t\t\tonChanged();\r\n\t\t\t\treturn this;\r\n\t\t\t}", "public void setResult(final String incomingResult)\r\n {\r\n \r\n result = incomingResult;\r\n }", "public ResponsibilityResultMessage setResult(TResult result) {\n this.result = result;\n return this;\n }", "public void setResult(String strResult) \n\t{\n\t\tthis.strResult = strResult;\n\t}", "public void setResult(String result) {\n this.result = result == null ? null : result.trim();\n }", "public void setResult(download.Map result) {\n this.result = result;\n }", "ScriptBuilder setBuildResult(String result) {\n this.result = result;\n return this;\n }", "public Builder setResult(boolean value) {\n bitField0_ |= 0x00000001;\n result_ = value;\n onChanged();\n return this;\n }", "public Builder setResult(boolean value) {\n\n result_ = value;\n onChanged();\n return this;\n }", "public void setResult(final Object value)\n\t{\n\t\tsetResult( getSession().getSessionContext(), value );\n\t}", "public Builder setResult(boolean value) {\n \n result_ = value;\n onChanged();\n return this;\n }", "public Builder setResult(boolean value) {\n \n result_ = value;\n onChanged();\n return this;\n }", "public Builder setResult(boolean value) {\n \n result_ = value;\n onChanged();\n return this;\n }", "public Builder setResultValue(int value) {\n \n result_ = value;\n onChanged();\n return this;\n }", "public Builder setResult(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n result_ = value;\n onChanged();\n return this;\n }", "public void setResult(int result) {\n this.result = result;\n this.isSix = this.result == 6;\n }", "public static void setResult(String resultInfo) {\n }", "public boolean setResult(T result)\n/* */ {\n/* 204 */ return setResultInternal(result);\n/* */ }", "public void setResultDoc(ResultDoc resultDoc) {\n\t\tthis.resultDoc = resultDoc;\n\t}", "public boolean setErrorResult(Object result)\n/* */ {\n/* 248 */ return setResultInternal(result);\n/* */ }", "public void setResult(int param){\n \n // setting primitive attribute tracker to true\n \n if (param==java.lang.Integer.MIN_VALUE) {\n localResultTracker = false;\n \n } else {\n localResultTracker = true;\n }\n \n this.localResult=param;\n \n\n }", "public io.confluent.developer.InterceptTest.Builder setResultJson(java.lang.String value) {\n validate(fields()[7], value);\n this.result_json = value;\n fieldSetFlags()[7] = true;\n return this;\n }", "public static void setMethodResult(String methodSignature, Object result) {\n MockPageContext.methodResults.put(methodSignature, result);\n }", "public Builder setEresult(int value) {\n bitField0_ |= 0x00000040;\n eresult_ = value;\n onChanged();\n return this;\n }", "public void setLastResult(final Object val) {\n lastResult = val;\n }", "@java.lang.Override public int getResultValue() {\n return result_;\n }", "private void setResult(String term){\n\t\taddResponseToResult(term);\n\t}", "public final void settest_result(com.mendix.systemwideinterfaces.core.IContext context, String test_result)\n\t{\n\t\tgetMendixObject().setValue(context, MemberNames.test_result.toString(), test_result);\n\t}", "public int getresult(){\n return result;}", "@java.lang.Override public int getResultValue() {\n return result_;\n }", "public void setResultId(int value) {\n this.resultId = value;\n }", "public void setResultToken(String resultToken) {\n this.resultToken = resultToken;\n }", "public final void settest_result(String test_result)\n\t{\n\t\tsettest_result(getContext(), test_result);\n\t}", "public void setResults(List<Person> results){\n\t\tmResult = results;\n\t\tmListeners.resultListUpdated();\n\t\t\n\t}", "public void setResult(String name) {\r\n DatabaseField returnField = (DatabaseField)getParameters().get(0);\r\n returnField.setName(name);\r\n }", "public getValue_result(getValue_result other) {\n if (other.isSetSuccess()) {\n this.success = other.success;\n }\n }", "public int getResult(){\r\n\t\t return result;\r\n\t }", "public void setResultId(long resultId) {\n this.resultId = resultId;\n }", "public io.confluent.developer.InterceptTest.Builder setResultPost(java.lang.String value) {\n validate(fields()[8], value);\n this.result_post = value;\n fieldSetFlags()[8] = true;\n return this;\n }", "protected SimulatorValue giveResult() {\n\tthis.evalExpression();\n\treturn value;\n }", "@Generated\n @Selector(\"setResultType:\")\n public native void setResultType(@NUInt long value);", "public void setResults(ArrayList<Integer> results){\n this.results = results;\n }", "public T result() {\n return result;\n }", "public void setMeasureResult(String measureResult) {\r\n this.measureResult = measureResult;\r\n }", "public Builder setResult(POGOProtos.Rpc.AssetVersionOutProto.Result value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n result_ = value.getNumber();\n onChanged();\n return this;\n }", "@Override\n \tpublic Object getResult() {\n \t\treturn result;\n \t}", "public ResultType getResult() {\r\n return result;\r\n }", "public void setRet(int ret) {\n\t\tthis.ret = ret;\n\t}", "private StepResult setResultAttributes(Result result, StepResult stepResult) {\n //remove possible null\n long duration = result.getDuration() == null ? 0 : result.getDuration();\n latestStepResult = stepResult;\n latestStepResult.setStatus(StepStatus.resolveStatus(result.getStatus()));\n latestStepResult.setDuration(duration);\n latestStepResult.setErrorMessage(result.getErrorMessage());\n\n return latestStepResult;\n }", "public void setResultPublicity() {\n CreatePollLogic.setResultPublicity(publicResults, publicResultsButton);\n }", "public static void resultMessage (int result) {\n System.out.println(\"The result of choosed operation is: \" + result);\n }", "public synchronized void putResult(DrownVulnerabilityType result) {\n if (result != null) {\n switch (result) {\n case NONE:\n putResult(AnalyzedProperty.VULNERABLE_TO_GENERAL_DROWN, false);\n break;\n case UNKNOWN:\n resultMap.put(AnalyzedProperty.VULNERABLE_TO_GENERAL_DROWN.toString(), TestResult.UNCERTAIN);\n break;\n default:\n putResult(AnalyzedProperty.VULNERABLE_TO_GENERAL_DROWN, TestResult.TRUE);\n }\n }\n }", "@Override\n public void result(Result result) {\n backgroundSteps = false;\n\n setResultAttributes(result, latestStepResult);\n }", "@ApiModelProperty(required = true, value = \"Indication of whether the test succeeded.\")\n public String getResult() {\n return result;\n }", "public void setResult(int resultCode) {\n synchronized (this) {\n mResultCode = resultCode;\n mResultData = null;\n }\n }", "public int getResult() {\r\n\t\t\t\treturn result_;\r\n\t\t\t}", "public void setFirstResult(int val) throws HibException;", "@Generated(hash = 750945346)\n public synchronized void resetResult() {\n result = null;\n }", "public void setLovResult(String lovResult) {\r\n\t\tthis.lovResult = lovResult;\r\n\t}", "public int getResult() {\n return result;\n }", "public void init(String result) {\n resultStr.setText(result);\n }", "public int getResultValue() {\n return mResultValue;\n }", "public void setResultJson(java.lang.String value) {\n this.result_json = value;\n }", "public final void setResultHandler(DeferredResultHandler resultHandler)\n/* */ {\n/* 167 */ Assert.notNull(resultHandler, \"DeferredResultHandler is required\");\n/* */ \n/* 169 */ if (this.expired) {\n/* 170 */ return;\n/* */ }\n/* */ \n/* 173 */ synchronized (this)\n/* */ {\n/* 175 */ if (this.expired) {\n/* 176 */ return;\n/* */ }\n/* 178 */ Object resultToHandle = this.result;\n/* 179 */ if (resultToHandle == RESULT_NONE)\n/* */ {\n/* 181 */ this.resultHandler = resultHandler;\n/* 182 */ return;\n/* */ }\n/* */ }\n/* */ \n/* */ try\n/* */ {\n/* */ Object resultToHandle;\n/* 189 */ resultHandler.handleResult(resultToHandle);\n/* */ }\n/* */ catch (Throwable ex) {\n/* 192 */ logger.debug(\"Failed to handle existing result\", ex);\n/* */ }\n/* */ }", "public void setReturnValue(Object value) {\n this.returnValue = value;\n }", "public int getResult() {\r\n\t\t\treturn result_;\r\n\t\t}", "void ComputeResult(Object result);", "int getResult() {\n return result;\n }", "public void storeResult(String strResult) \n\t{\n this.strResult = strResult;\n }", "public void putAResult(Result result) {\n restTemplate.exchange(\n queueUrl + \"/putAResult\",\n HttpMethod.POST,\n new HttpEntity<>(result),\n String.class);\n }", "public TResult getResult() {\n return result;\n }", "public final void setAccountAuthenticatorResult(Bundle result) {\n this.mResultBundle = result;\n }", "private void retrieveResult() {\n if (result == null) {\n this.setResult(((DocumentBuilder)this.getHandler()).getResult());\n }\n }", "public void setResults(ArrayList results) {\n this.results = results;\n }", "public int getResult() {\n return this.result;\n }", "public Builder setResults(\n int index, entities.Torrent.NodeSearchResult value) {\n if (resultsBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureResultsIsMutable();\n results_.set(index, value);\n onChanged();\n } else {\n resultsBuilder_.setMessage(index, value);\n }\n return this;\n }", "void setReturnValue(Object returnValue) {\r\n this.returnValue = returnValue;\r\n }", "public T getResult() {\n return result;\n }", "public T getResult() {\n return result;\n }", "public void setResultType(Class cls) {\n _res = cls;\n }", "@Override\n public void doNotify(String result) {\n this.result = result;\n }", "public Builder setResult(com.rpg.framework.database.Protocol.ResponseCode value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000001;\n result_ = value;\n onChanged();\n return this;\n }", "public Builder setResult(com.rpg.framework.database.Protocol.ResponseCode value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000001;\n result_ = value;\n onChanged();\n return this;\n }", "public Builder setResult(com.rpg.framework.database.Protocol.ResponseCode value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000001;\n result_ = value;\n onChanged();\n return this;\n }" ]
[ "0.84665644", "0.83870465", "0.8343351", "0.83383316", "0.80465925", "0.80369633", "0.8007598", "0.7991144", "0.7933673", "0.7897118", "0.780851", "0.7803967", "0.7750355", "0.76588523", "0.75902736", "0.73641455", "0.7239195", "0.7225009", "0.72163", "0.71374995", "0.7122958", "0.7106995", "0.71026254", "0.7093386", "0.70849776", "0.7050009", "0.70466006", "0.70466006", "0.7039787", "0.70167613", "0.7000278", "0.6979272", "0.6948157", "0.68440515", "0.6679981", "0.66596955", "0.6524519", "0.65066737", "0.6499835", "0.6495714", "0.6480784", "0.6435992", "0.64348906", "0.64219064", "0.6407844", "0.6397992", "0.63791674", "0.63752514", "0.6371048", "0.6340575", "0.63141656", "0.62729585", "0.6272719", "0.6246336", "0.62409824", "0.6230463", "0.6219168", "0.62030643", "0.61828226", "0.6161482", "0.6132104", "0.6131743", "0.61300814", "0.61281055", "0.61238706", "0.61117506", "0.61076397", "0.6107439", "0.6093817", "0.6085677", "0.60689265", "0.60665995", "0.60652375", "0.60574985", "0.6052693", "0.60524994", "0.6050463", "0.6049834", "0.60496205", "0.60374856", "0.6036644", "0.6036209", "0.6025345", "0.6020692", "0.6013265", "0.600976", "0.5997146", "0.5993728", "0.5961944", "0.59613717", "0.594565", "0.5942791", "0.5934705", "0.592305", "0.592305", "0.59210306", "0.5919569", "0.5919027", "0.5919027", "0.5918055" ]
0.7524166
15
Create a public.qs table reference
public Qs() { this("qs", null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "PivotTable createPivotTable();", "tbls createtbls();", "private String getCloneSetLinkTableQuery() {\n \t\tfinal StringBuilder builder = new StringBuilder();\n \n \t\tbuilder.append(\"create table CLONE_SET_LINK(\");\n \t\tbuilder.append(\"CLONE_SET_LINK_ID LONG PRIMARY KEY,\");\n \t\tbuilder.append(\"BEFORE_ELEMENT_ID LONG,\");\n \t\tbuilder.append(\"AFTER_ELEMENT_ID LONG,\");\n \t\tbuilder.append(\"BEFORE_REVISION_ID LONG,\");\n \t\tbuilder.append(\"AFTER_REVISION_ID LONG,\");\n \t\tbuilder.append(\"CHANGED_ELEMENTS INTEGER,\");\n \t\tbuilder.append(\"ADDED_ELEMENTS INTEGER,\");\n \t\tbuilder.append(\"DELETED_ELEMENTS INTEGER,\");\n \t\tbuilder.append(\"CO_CHANGED_ELEMENTS INTEGER,\");\n \t\tbuilder.append(\"CODE_FRAGMENT_LINKS TEXT NOT NULL\");\n \t\tbuilder.append(\")\");\n \n \t\treturn builder.toString();\n \t}", "public static final String getTopicTableCreationSQL(String shortname) {\r\n\t\tString crTopicTableSQL = \"CREATE TABLE IF NOT EXISTS dblp_topic_\" +shortname +\r\n\t\t\"(tid varchar(50) NOT NULL, \" +\r\n\t\t\" keyword varchar(255) NOT NULL, \" + \r\n\t\t\" istop tinyint UNSIGNED ZEROFILL, \" + // Is this keyword a top keyword for this topic\r\n\t\t\" PRIMARY KEY (tid,keyword)) \";\r\n\t\treturn crTopicTableSQL;\r\n\t}", "public static String createSimpleCreateTableQuery(String tableName, String storageEngine, String selectQuery) {\n builder.setLength(0);\n builder.append(\"CREATE TABLE `\").append(tableName).append(\"` ENGINE = \").append(storageEngine).append(\" AS \");\n builder.append(selectQuery);\n return builder.toString();\n }", "TABLE createTABLE();", "public static QueryDelegate generateTableQuery(String tableName) {\n String FROM_QUERY = \" FROM \" + tableName;\n String SELECT_QUERY=\" SELECT * \" +\n FROM_QUERY;\n String COUNT_QUERY = \"SELECT count(*) \" + FROM_QUERY;\n String CONTAINS_QUERY = \"SELECT * FROM \" + tableName + \" WHERE id = ?\";\n\n return generateQueryDelegate(SELECT_QUERY, COUNT_QUERY, CONTAINS_QUERY);\n }", "public void CreateTables() {\n\t\ttry {\n\t\t\tString schema = Schema.META;\n\t\t\tInstall_DBMS_MetaData(schema.getBytes(),0);\n\n\t\t\t// load and install QEPs\n\t\t\tClass<?>[] executionPlans = new Class[] { QEP.class };\n\t\t\tQEPng.loadExecutionPlans(TCell_QEP_IDs.class, executionPlans);\n\t\t\tQEPng.installExecutionPlans(db);\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private String getCloneSetTableQuery() {\n \t\tfinal StringBuilder builder = new StringBuilder();\n \n \t\tbuilder.append(\"create table CLONE_SET(\");\n \t\tbuilder.append(\"CLONE_SET_ID LONG PRIMARY KEY,\");\n \t\tbuilder.append(\"OWNER_REVISION_ID LONG,\");\n \t\tbuilder.append(\"ELEMENTS TEXT NOT NULL,\");\n \t\tbuilder.append(\"NUMBER_OF_ELEMENTS INTEGER\");\n \t\tbuilder.append(\")\");\n \n \t\treturn builder.toString();\n \t}", "FromTable createFromTable();", "public interface SettingsEventQuery {\r\n public static final String[] COLUMNS = {\"keyField\", \"keyValue\"};\r\n public static final String CREATE_TABLE = (\"CREATE TABLE IF NOT EXISTS Settings(\" + COLUMNS[0] + \" TEXT, \" + COLUMNS[1] + \" TEXT )\");\r\n public static final String DROP_TABLE = \"DROP TABLE IF EXISTS Settings\";\r\n public static final int KEY_FIELD = 0;\r\n public static final int KEY_VALUE = 1;\r\n public static final String TABLE = \"Settings\";\r\n }", "@Override\n\tpublic Query createQuery(String qlString) {\n\t\treturn null;\n\t}", "@Override\n\tpublic void onCreate(SQLiteDatabase db) {\n\t\n\t\t\n\t\tdb.execSQL(\"CREATE TABLE \"+TABLE+\" (\"+QID+\" TEXT, \"+\n\t\t\t\tQNAME+\" TEXT, \"+OPTIONA+\" TEXT,\"+OPTIONB+\" TEXT,\"+OPTIONC+\" TEXT,\"+OPTIOND+\" TEXT,\"+ANS+\" TEXT) ;\");\n\t\t\n\t//\tdb.execSQL(\"insert into \"+TestTable+\"values('10','Grace period for the renewal of a permanent Driving License','a)Nill','b)30days','C)60days','D)90days');\");\n\t\t\n\t}", "public void createQuery(String s) throws HibException;", "public Qs(String alias) {\n this(alias, QS);\n }", "public QuestionsRecord() {\n\t\tsuper(sooth.entities.tables.Questions.QUESTIONS);\n\t}", "public static final String getAuthKWRelTableCreationSQL(String shortname) {\r\n\t\tString crTopicTableSQL = \"CREATE TABLE IF NOT EXISTS dblp_authkw_\" +shortname +\r\n\t\t\"(author varchar(70) NOT NULL, \" +\r\n\t\t\" keyword varchar(255) NOT NULL, \" + \r\n\t\t\" PRIMARY KEY (keyword,author)) \";\r\n\t\treturn crTopicTableSQL;\r\n\t}", "void create(Trubriques trubriques);", "TableInstance createTableInstance();", "private void createStocksTable() {\n\t\ttry {\n\t\t\tStatement stmt = this.conn.createStatement();\n\t\t\tstmt.executeUpdate(\"CREATE TABLE stocks \"\n\t\t\t\t\t+ \"(id BIGINT GENERATED ALWAYS AS IDENTITY, \" + \"owner INT, \"\n\t\t\t\t\t+ \"shareAmount INT, \" + \"purchasePrice DOUBLE, \" + \"symb VARCHAR(10), \"\n\t\t\t\t\t+ \"timePurchased BIGINT)\");\n\t\t\tconn.commit();\n\t\t\tSystem.out.println(\"Created table stocks\");\n\t\t} catch (SQLException sqle) {\n\t\t\tSystem.err.println(\"Creation of stocks table FAILED\");\n\t\t\tSystem.err.println(sqle);\n\t\t}\n\t}", "Table createTable();", "public void creatTable(String tableName,LinkedList<String> columnsName,LinkedList<String> columnsType );", "public qEntry() { }", "@Override\n public void setUp() throws SQLException {\n connection.createStatement().executeUpdate(\n \"CREATE TABLE IF NOT EXISTS \\\"ENTRY\\\" (\" +\n \"\\\"SHARED_ID\\\" SERIAL PRIMARY KEY, \" +\n \"\\\"TYPE\\\" VARCHAR, \" +\n \"\\\"VERSION\\\" INTEGER DEFAULT 1)\");\n\n connection.createStatement().executeUpdate(\n \"CREATE TABLE IF NOT EXISTS \\\"FIELD\\\" (\" +\n \"\\\"ENTRY_SHARED_ID\\\" INTEGER REFERENCES \\\"ENTRY\\\"(\\\"SHARED_ID\\\") ON DELETE CASCADE, \" +\n \"\\\"NAME\\\" VARCHAR, \" +\n \"\\\"VALUE\\\" TEXT)\");\n\n connection.createStatement().executeUpdate(\n \"CREATE TABLE IF NOT EXISTS \\\"METADATA\\\" (\"\n + \"\\\"KEY\\\" VARCHAR,\"\n + \"\\\"VALUE\\\" TEXT)\");\n }", "public void createTable(String tableName) {\n //SQL Statement\n String query = \"call aTable\";\n\n try {\n //connection\n stmt = con.createStatement();\n //execute query\n stmt.executeUpdate(query);\n System.out.println(\"\\n--Table \" + tableName + \" created--\");\n } catch (SQLException ex) {\n System.out.println(\"\\n--Query did not execute--\");\n ex.printStackTrace();\n }\n }", "SqlTables(String tableName){\n\t\t\t this.tableName = tableName; \n\t\t}", "public String createTable(){\r\n return \"CREATE TABLE Doctor \" +\r\n \"(idDoctor decimal primary key, \" +\r\n \"firstNameDoctor char(14), \" +\r\n \"lastNameDoctor char(14), \" +\r\n \"costPerVisit integer,\" +\r\n \"qualification varchar(32))\";\r\n }", "private Tables() {\n\t\tsuper(\"TABLES\", org.jooq.util.mysql.information_schema.InformationSchema.INFORMATION_SCHEMA);\n\t}", "private String getRevisionTableQuery() {\n \t\tfinal StringBuilder builder = new StringBuilder();\n \n \t\tbuilder.append(\"create table REVISION(\");\n \t\tbuilder.append(\"REVISION_ID LONG PRIMARY KEY,\");\n \t\tbuilder.append(\"REVISION_IDENTIFIER TEXT UNIQUE\");\n \t\tbuilder.append(\")\");\n \n \t\treturn builder.toString();\n \t}", "@Override\n\tpublic void onCreate(SQLiteDatabase sdb) {\n\t\tsdb.execSQL(CREATE_QUERY);\n\t\tLog.d(\"DB ops: \", \"Table Created \");\n\t}", "public void createQuery(ResultSet rs, String Query) throws SQLException {\n this.data.add(new QueryConversionData(rs));\n this.queryHistory.add(Query);\n }", "TableId table();", "public InsertQuery(String tableName) {\r\n\t\tthis.tableName = tableName;\r\n\t\tfieldNames = new ArrayList<String>();\r\n\t\tfieldValues = new ArrayList<String>();\r\n\t}", "void create(QueryCursor cursor, String indexName, String... templateProperties) throws SQLException;", "@Override\n\tpublic String createTable() {\n\t\t\t\treturn \"CREATE TABLE history_table_view(id number(8) primary key not null ,sqltext text, pointid varchar2(1024), type varchar2(100))\";\n\t}", "public static void createTable() {\n\n // Create statement\n Statement statement = null;\n try {\n statement = Database.getDatabase().getConnection().createStatement();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n\n // Attempt to create table\n try {\n statement.execute(\n \"CREATE TABLE \" + Constants.SANITATION_TABLE + \"(\" +\n \"requestID INT PRIMARY KEY GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1),\" +\n \"nodeID VARCHAR(100) References \" + Constants.LOCATION_TABLE + \" (nodeID), \" +\n \"priority VARCHAR(10), \" +\n \"status VARCHAR(100), \" +\n \"description VARCHAR(100), \" +\n \"requesterID INT REFERENCES \" + Constants.USERS_TABLE + \"(userID), \" +\n \"requestTime TIMESTAMP, \" +\n \"servicerID INT REFERENCES \" + Constants.USERS_TABLE + \"(userID), \" +\n \"claimedTime TIMESTAMP, \" +\n \"completedTime TIMESTAMP, \" +\n \"CONSTRAINT priority_enum CHECK (priority in ('LOW', 'MEDIUM', 'HIGH')), \" +\n \"CONSTRAINT status_enum CHECK (status in ('INCOMPLETE', 'COMPLETE')))\"\n );\n } catch (SQLException | NullPointerException e) {\n e.printStackTrace();\n }\n }", "public void createTable(String tableName) {\n db.execSQL(\"create table if not exists '\" + tableName.replaceAll(\"\\\\s\", \"_\") + \"' (\"\n + KEY_ROWID + \" integer primary key autoincrement, \"\n + KEY_QUESTION + \" string not null, \"\n + KEY_ANSWER + \" string not null);\");\n }", "private static String getCreateQuery(String tableName,String CSVHeader){\n\n\t\tString query=\"create table \"+tableName +\"(\";\n\t\tString columns[]=CSVHeader.split(\",\");\n\t\tfor(int i=0;i<columns.length-1;i++){\n\t\t\tquery+=columns[i]+\" string,\";\n\t\t}\n\t\tquery+=columns[columns.length-1]+\" string)\";\n\t\tquery+=\" row format delimited fields terminated by ',' stored as textfile\";\n\t\t// System.out.println(query);\n\t\treturn query;\n\t}", "public Mytable() {\n this(DSL.name(\"mytable\"), null);\n }", "Query query();", "public TableDefinition(String tableName) {\n this.tableName = tableName;\n }", "private String getCrdQuery() {\n \t\tfinal StringBuilder builder = new StringBuilder();\n \n \t\tbuilder.append(\"create table CRD(\");\n \t\tbuilder.append(\"CRD_ID LONG PRIMARY KEY,\");\n \t\tbuilder.append(\"TYPE TEXT NOT NULL,\");\n \t\tbuilder.append(\"HEAD TEXT NOT NULL,\");\n \t\tbuilder.append(\"ANCHOR TEXT NOT NULL,\");\n \t\tbuilder.append(\"NORMALIZED_ANCHOR TEXT NOT NULL,\");\n \t\tbuilder.append(\"CM INTEGER,\");\n \t\tbuilder.append(\"ANCESTORS TEXT NOT NULL,\");\n \t\tbuilder.append(\"FULL_TEXT TEXT NOT NULL\");\n \t\tbuilder.append(\")\");\n \n \t\treturn builder.toString();\n \t}", "private String createTableSQL()\n\t{\n\t\tStringBuffer str = new StringBuffer();\n\n\t\t// Keep track of the list of fields\n\t\tList<String> listFields = new ArrayList<String>();\n\n\t\t// Table command\n\t\tstr.append(\"CREATE TABLE \" + getFullPath() + \"( \");\n\t\tstr.append(createStandardGZFields());\n\n\t\t// Loop through all InputFields\n\t\tfor (InputFieldSet fieldSet : function.getInputFieldSets())\n\t\t{\n\t\t\tfor (InputField inputField : fieldSet.getInputFields())\n\t\t\t{\n\t\t\t\t// Phase 2 does not support repeating fields being journalled\n\t\t\t\tif (!Field.isRepeating(inputField))\n\t\t\t\t{\n\t\t\t\t\t// Field\n\t\t\t\t\tString fieldName = SQLToolbox.cvtToSQLFieldName(inputField.getId());\n\n\t\t\t\t\t// add if not yet existing\n\t\t\t\t\tif (listFields.indexOf(fieldName) == -1)\n\t\t\t\t\t{\n\t\t\t\t\t\tstr.append(\", \");\n\t\t\t\t\t\tString fieldDataType = inputField.getDataType();\n\t\t\t\t\t\tString fieldType = SQLToolbox.cvtToSQLFieldType(fieldDataType, inputField.getSize(), inputField\n\t\t\t\t\t\t\t\t\t\t.getDecimals());\n\t\t\t\t\t\tString fieldDefault = SQLToolbox.cvtToSQLDefault(fieldDataType);\n\t\t\t\t\t\tstr.append(fieldName + \" \" + fieldType + \" \" + \" not null default \" + fieldDefault);\n\t\t\t\t\t\tlistFields.add(fieldName);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// End\n\t\tstr.append(\" ) \");\n\t\t// RCDFMT \" + getJournalRcdName());\n\n\t\treturn str.toString();\n\t}", "private RunQueriesEx setupQueries() {\n RunQueriesEx queries = new RunQueriesEx();\n \n //for each column in our table, update one of our lists\n for(int i = 0; i < this.dataTable.getColumnCount(); i++) {\n this.updateList(i);\n }\n \n updateEmptyLists(); //pads any lists that didn't get updates with empty strings\n \n //add a new query for each row in the table\n for(int i = 0; i < this.dataTable.getRowCount(); i++) {\n queries.add(this.createQueryFromRow(i));\n }\n \n return queries;\n }", "public interface Sqlable {\n\n Map<String, Object> getSqlMap();\n\n String getTableName();\n\n}", "public interface QtlAdaptor extends Adaptor {\n \n /**\n * Adaptor type. TYPE = \"qtl\".\n */\n final static String TYPE = \"qtl\";\n \n /**\n * Fetch Qtl by it's internalID.\n * @return Qtl with specied internalID, or null if no such Qtl exists in database.\n */\n Qtl fetch(long internalID) throws AdaptorException ;\n \n /**\n * Fetch all Qtls from database.\n * @return list of zero or more Qtls.\n */\n List fetchAll() throws AdaptorException ;\n \n /**\n * Fetch all Qtls from database with the specified trait.\n * @param trait trait affected by Qtl.\n * @return list of zero or more Qtls.\n */\n List fetchByTrait(String trait) throws AdaptorException ;\n \n\n /**\n * Fetch all Qtls from database that originally come from the specified\n * database.\n * @param sourceDatabaseName name of the source database.\n * @return list of zero or more Qtls.\n */\n List fetchBySourceDatabase(String sourceDatabaseName) throws AdaptorException ;\n \n /**\n * Fetch all Qtls from database that originally come from the specified\n * database and have the specified id.\n * @param sourceDatabaseName name of the source database.\n * @param sourceID id in the source database.\n * @return list of zero or more Qtls matching the criteria.\n */\n List fetchBySourceDatabase(String sourceDatabaseName, String sourceID) throws AdaptorException ;\n \n}", "public abstract String createQuery();", "public interface ISQLiteJoinTableCreator {\n\n}", "private String getCloneGenealogyTableQuery() {\n \t\tfinal StringBuilder builder = new StringBuilder();\n \n \t\tbuilder.append(\"create table CLONE_GENEALOGY(\");\n \t\tbuilder.append(\"CLONE_GENEALOGY_ID LONG PRIMARY KEY,\");\n \t\tbuilder.append(\"START_REVISION_ID LONG,\");\n \t\tbuilder.append(\"END_REVISION_ID LONG,\");\n \t\tbuilder.append(\"CLONES TEXT NOT NULL,\");\n \t\tbuilder.append(\"CLONE_LINKS TEXT NOT NULL,\");\n \t\tbuilder.append(\"CHANGES INTEGER,\");\n \t\tbuilder.append(\"ADDITIONS INTEGER,\");\n \t\tbuilder.append(\"DELETIONS INTEGER,\");\n \t\tbuilder.append(\"DEAD INTEGER\");\n \t\tbuilder.append(\")\");\n \n \t\treturn builder.toString();\n \t}", "public abstract String[] createTablesStatementStrings();", "TemperatureQuery createTemperatureQuery();", "public static String AssetRef_CreateTable()\n\t{\n\t\tString str = \"create table assetref (\" \n\t\t\t\t+ \"id INTEGER PRIMARY KEY,\"\n\t\t\t\t+ \"uniqueId string,\"\n\t\t\t\t+ \"path string,\"\n\t\t\t\t+ \"name string,\"\n\t\t\t\t+ \"size int,\"\n\t\t\t\t+ \"lastChanged time\"\n\t\t\t\t+ \")\";\n\t\treturn str;\t\n\t}", "public CreateTableExternalRequest() {\n tableName = \"\";\n filepaths = new ArrayList<>();\n modifyColumns = new LinkedHashMap<>();\n createTableOptions = new LinkedHashMap<>();\n options = new LinkedHashMap<>();\n }", "public Query() {\n\n// oriToRwt = new HashMap();\n// oriToRwt.put(); // TODO\n }", "private void appendPrimaryTableName() {\n super.appendTableName(Constants.FROM, joinQueryInputs.primaryTableName);\n }", "@Override\n\tpublic void onCreate(SQLiteDatabase sdb) {\n\t\tsdb.execSQL(CREATE_QUERY);\n\t\tLog.d(\"Database operations\", \"table created\");\n\t}", "Pivots createPivots();", "void prepareTables();", "public void buildRatingsTable() {\n try (PreparedStatement prep = Database.getConnection()\n .prepareStatement(\"CREATE TABLE IF NOT EXISTS user_ratings (user_id\"\n + \" TEXT, rating REAL, user_type TEXT, FOREIGN KEY (user_ID)\"\n + \" REFERENCES users(id) ON UPDATE CASCADE ON DELETE CASCADE);\")) {\n prep.executeUpdate();\n } catch (final SQLException e) {\n e.printStackTrace();\n }\n }", "public void listarQuartos(JTable table) {\r\n\t\ttry {\r\n\t\t\tStatement st = conexao.createStatement();\r\n\t\t\tResultSet rs = st.executeQuery(\"SELECT idQuartos,tipo FROM quartos\");\r\n\t\t\ttable.setModel(DbUtils.resultSetToTableModel(rs));\r\n\t\t}\r\n\t\tcatch (SQLException e) {}\r\n\t}", "public static final String getAuthCollabOverKWTableCreationSQL(String shortname) {\r\n\t\tString crTopicTableSQL = \"CREATE TABLE IF NOT EXISTS dblp_authcollabkw_\" +shortname +\r\n\t\t\"(keyword varchar(255) NOT NULL, \" + \r\n\t\t\"author varchar(70) NOT NULL, \" + \r\n\t\t\" collabauth varchar(70) NOT NULL, \" +\r\n\t\t\"collabcnt int NOT NULL\" +\r\n\t\t\" ) \";\r\n\t\treturn crTopicTableSQL;\r\n\t}", "QueryType createQueryType();", "public CheckOutQ() {\r\n\t\tq = new LinkedList<Person>();\r\n\t\tmaxQ = 0;\r\n\t}", "PivotForClause createPivotForClause();", "private void generateTemporaryTable(String tableName, Collection<?> items, SQLProcessor sqlP)\n throws GenericEntityException {\n //Ensure connection is created\n sqlP.getConnection();\n\n //Determine the data type to create based on the item element type\n //Right now this only works for SQL server so we hardcode the SQL server data types\n //And we only support numbers and strings at this point\n Object firstItem = items.iterator().next();\n String dataType;\n if (firstItem instanceof Number) {\n dataType = \"bigint\";\n } else {\n dataType = \"varchar(8000)\"; //8000 is max size of varchar for SQL server\n }\n\n sqlP.executeUpdate(\"create table #\" + tableName + \" (item \" + dataType + \" primary key)\");\n\n //Insert data into this temporary table\n sqlP.prepareStatement(\"insert into #\" + tableName + \" (item) values (?)\");\n PreparedStatement stat = sqlP.getPreparedStatement();\n try {\n for (Object item : items) {\n if (item instanceof Number) {\n stat.setLong(1, ((Number) item).longValue());\n } else if (item instanceof String) {\n stat.setString(1, (String) item);\n } else {\n stat.setObject(1, item);\n }\n\n stat.addBatch();\n }\n stat.executeBatch();\n } catch (SQLException e) {\n throw new GenericEntityException(e.getMessage(), e);\n } finally {\n try {\n stat.close();\n } catch (SQLException ignore) {\n }\n }\n }", "BTable createBTable();", "protected void constructTable(Logger l, Statement s, int run)\n throws SQLException{\n createTable(s, run);\n insertResults(l,s,run);\n }", "public void doBuild() throws TorqueException\n {\n dbMap = Torque.getDatabaseMap(\"cream\");\n\n dbMap.addTable(\"OPPORTUNITY\");\n TableMap tMap = dbMap.getTable(\"OPPORTUNITY\");\n\n tMap.setPrimaryKeyMethod(TableMap.NATIVE);\n\n\n tMap.addPrimaryKey(\"OPPORTUNITY.OPPORTUNITY_ID\", new Integer(0));\n tMap.addColumn(\"OPPORTUNITY.OPPORTUNITY_CODE\", \"\");\n tMap.addColumn(\"OPPORTUNITY.STATUS\", new Integer(0));\n tMap.addColumn(\"OPPORTUNITY.PRIORITY\", new Integer(0));\n tMap.addColumn(\"OPPORTUNITY.OPPORTUNITY_TYPE\", new Integer(0));\n tMap.addColumn(\"OPPORTUNITY.OPPORTUNITY_NAME\", \"\");\n tMap.addForeignKey(\n \"OPPORTUNITY.OPPORTUNITY_CAT_ID\", new Integer(0) , \"OPPORTUNITY_CATEGORY\" ,\n \"OPPORTUNITY_CAT_ID\");\n tMap.addForeignKey(\n \"OPPORTUNITY.LEAD_SOURCE_ID\", new Integer(0) , \"LEAD_SOURCE\" ,\n \"LEAD_SOURCE_ID\");\n tMap.addColumn(\"OPPORTUNITY.ISSUED_DATE\", new Date());\n tMap.addColumn(\"OPPORTUNITY.EXPECTED_DATE\", new Date());\n tMap.addColumn(\"OPPORTUNITY.CLOSED_DATE\", new Date());\n tMap.addForeignKey(\n \"OPPORTUNITY.CUSTOMER_ID\", new Integer(0) , \"CUSTOMER\" ,\n \"CUSTOMER_ID\");\n tMap.addForeignKey(\n \"OPPORTUNITY.PROJECT_ID\", new Integer(0) , \"PROJECT\" ,\n \"PROJECT_ID\");\n tMap.addForeignKey(\n \"OPPORTUNITY.CURRENCY_ID\", new Integer(0) , \"CURRENCY\" ,\n \"CURRENCY_ID\");\n tMap.addColumn(\"OPPORTUNITY.CURRENCY_AMOUNT\", new BigDecimal(0));\n tMap.addColumn(\"OPPORTUNITY.SALES_STAGE\", new Integer(0));\n tMap.addColumn(\"OPPORTUNITY.PROBABILITY\", new Integer(0));\n tMap.addColumn(\"OPPORTUNITY.SUBJECT\", \"\");\n tMap.addColumn(\"OPPORTUNITY.NEXT_STEPS\", \"\");\n tMap.addColumn(\"OPPORTUNITY.NOTES\", \"\");\n tMap.addColumn(\"OPPORTUNITY.CREATED\", new Date());\n tMap.addColumn(\"OPPORTUNITY.MODIFIED\", new Date());\n tMap.addColumn(\"OPPORTUNITY.CREATED_BY\", \"\");\n tMap.addColumn(\"OPPORTUNITY.MODIFIED_BY\", \"\");\n }", "public void createQuestion(int sid,int qid,String qtype,String qtitle,String answer_a,String answer_b,String answer_c,String answer_d);", "protected void constructTable(Logger l, Statement s, int run)\n throws SQLException{\n createTable(s, run);\n insertResults(l,s,run);\n }", "public void formDatabaseTable() {\n }", "private String createSEQTable() {\n\t\tStringBuffer buildSQL = new StringBuffer();\n\t\tbuildSQL.append(\" CREATE TABLE \" + DEFAULT_SEQUENCE_NAME + \" ( \");\n\t\tbuildSQL.append(\"id bigint(20) NOT NULL AUTO_INCREMENT, \");\n\t\tbuildSQL.append(\"prefix_value varchar(12) NOT NULL, \");\n\t\tbuildSQL.append(\"next_val int(11) NOT NULL, \");\n\t\tbuildSQL.append(\"increment int(11) NOT NULL, \");\n\t\tbuildSQL.append(\"PRIMARY KEY (id) \");\n\t\tbuildSQL.append(\") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;\");\n\t\t// --log.debug(buildSQL.toString());\n\t\treturn buildSQL.toString();\n\t}", "Table getTable();", "@Override\r\n\tpublic String generate() {\r\n\t\tStringBuilder query = new StringBuilder();\r\n\r\n\t\tquery.append(\"INSERT INTO \").append(tableName).append(\" (\");\r\n\t\tfor (int i = 0; i < fieldNames.size(); i++) {\r\n\t\t\tquery.append(fieldNames.get(i));\r\n\t\t\tif (i < fieldNames.size() - 1) {\r\n\t\t\t\tquery.append(\", \");\r\n\t\t\t}\r\n\t\t}\r\n\t\tquery.append(\") VALUES (\");\r\n\t\tfor (int i = 0; i < fieldValues.size(); i++) {\r\n\t\t\tquery.append(\"'\").append(fieldValues.get(i)).append(\"'\");\r\n\t\t\tif (i < fieldValues.size() - 1) {\r\n\t\t\t\tquery.append(\", \");\r\n\t\t\t}\r\n\t\t}\r\n\t\tquery.append(\");\");\r\n\t\treturn query.toString();\r\n\t}", "public void doCreateTable();", "public PgPublicationTables(Name alias) {\n this(alias, PG_PUBLICATION_TABLES);\n }", "private String buildStaticViewString(Stream strm, String name) {\n\t\tString viewString = \"CREATE TEMP TABLE \"+name;\n\t\tviewString += \" AS \";\n\t\tviewString += \"SELECT * FROM \" + generateStreamData(strm, name, false) + \";\\r\\n\";\n\t\treturn viewString;\n\t}", "@SuppressWarnings(\"unchecked\")\n private void createTable() {\n table = (LinkedList<Item<V>>[])new LinkedList[capacity];\n for(int i = 0; i < table.length; i++) {\n table[i] = new LinkedList<>();\n }\n }", "private String getCodeFragmentLinkTableQuery() {\n \t\tfinal StringBuilder builder = new StringBuilder();\n \n \t\tbuilder.append(\"create table CODE_FRAGMENT_LINK(\");\n \t\tbuilder.append(\"CODE_FRAGMENT_LINK_ID LONG PRIMARY KEY,\");\n \t\tbuilder.append(\"BEFORE_ELEMENT_ID LONG,\");\n \t\tbuilder.append(\"AFTER_ELEMENT_ID LONG,\");\n \t\tbuilder.append(\"BEFORE_REVISION_ID LONG,\");\n \t\tbuilder.append(\"AFTER_REVISION_ID LONG,\");\n \t\tbuilder.append(\"CHANGED INTEGER\");\n \t\tbuilder.append(\")\");\n \n \t\treturn builder.toString();\n \t}", "public void addQue(String test_name,String que_type,String que,ArrayList<String> options,String ans,String points)\n\t{\n\t\t \n\t Entity xyz=new Entity(\"question\");\n\t xyz.setProperty(\"test_name\",test_name);\n\t xyz.setProperty(\"que_type\",que_type);\n\t xyz.setProperty(\"que\",que);\n\t xyz.setProperty(\"options\",options);\n\t xyz.setProperty(\"ans\",ans);\n\t xyz.setProperty(\"points\",points);\n\t ds.put(xyz);\n\t \n //For question_count and total points. Added in Test entity\t \n\t \n\t long count=0;\n\t double total=0;\n\t Filter test_nameFilter = new FilterPredicate(\"test_name\", FilterOperator.EQUAL,test_name);\n\n\t Query q = new Query(\"Test\").setFilter(test_nameFilter);\n\t\t PreparedQuery pq = ds.prepare(q);\n\t\t Entity abc=pq.asSingleEntity();\n\t\t if(abc!=null)\n\t\t {\n\t\t\t count=(long)abc.getProperty(\"que_count\")+1;\n\t\t\t total=(double)abc.getProperty(\"total_points\")+Double.parseDouble(points);\n\t\t\t abc.setProperty(\"que_count\",count);\n\t\t\t abc.setProperty(\"total_points\",total);\n\t\t ds.put(abc);\n\t\t }\n\t\t \n\t}", "private String getQueSortSQL() {\n String[] sortArr = {\"kca_title\", \"que_title\", \"ans_count\", \"que_type\", \"que_create_timestamp\", \"ans_vote_for\"};\n sort_vec = cwUtils.String2vector(sortArr, false);\n String defaultSortColumn = \"que_create_timestamp\";\n String defaultOrder = \"desc\";\n String sortSQL = dbUtils.getSortSQL(sort_vec, sort, dir, defaultSortColumn.toLowerCase(), defaultOrder);\n if (this.sort == null) {\n this.sort = defaultSortColumn;\n }\n if (this.dir == null) {\n this.dir = defaultOrder;\n }\n\n return sortSQL;\n }", "public void buildItems() {\n try (PreparedStatement prep = Database.getConnection()\n .prepareStatement(\"CREATE TABLE IF NOT\"\n + \" EXISTS items (order_id TEXT, item TEXT, FOREIGN KEY (order_id)\"\n + \" REFERENCES orders(id) ON DELETE CASCADE ON UPDATE CASCADE);\")) {\n prep.executeUpdate();\n } catch (final SQLException exc) {\n exc.printStackTrace();\n }\n }", "private void createTables() throws SQLException\r\n {\r\n createTableMenuItems();\r\n createTableOrdersWaiting();\r\n }", "@Override\n public PlainSqlQuery<T, ID> createPlainSqlQuery() {\n return null;\n }", "public void createTable(Class<?> clz) {\n\t\tcreateTable(getWritableDatabase(), clz);\n\t}", "private void refTable() {\n try {\n String s = \"select * from stock\";\n pstm = con.prepareStatement(s);\n res = pstm.executeQuery(s);\n table.setModel(DbUtils.resultSetToTableModel(res));\n\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, \"There Is No Data In Server\");\n }\n }", "public Task<DocumentReference> makePayment(PaymentTable paymentTable){\n return firebaseFirestore.collection(\"Payment\").add(paymentTable);\n }", "public PgPublicationTables() {\n this(DSL.name(\"pg_publication_tables\"), null);\n }", "public void makeSql() {\n\t\tfor(int i=0; i<arr_sql.length; i++) {\n\t\t\tarr_sql[i] = new StringBuffer();\n\t\t}\n\t\t\n\t\t/*\n\t\t * 공통코드 쿼리\n\t\t * 대리점구분 : CU006\n\t\t * 직판구분 : CU012\n\t\t * 지역 : SY006\n\t\t * 계약상태 : CU013\n\t\t * 사용유무 : SY011\n\t\t * 보증보험회사 : CU010\n\t\t * 하위대리점여부 : CU011\n\t\t */\n\t\tarr_sql[0].append (\"SELECT\t\t\t\t\t\t\t\t\t\t\\n\")\n\t\t\t\t .append (\"\t' ' head, ' ' detail, '전체' detail_nm \\n\")\n\t\t\t\t .append (\"FROM DUAL \\n\")\n\t\t\t\t .append (\"UNION ALL \\n\")\n\t\t\t\t .append (\"SELECT \\n\")\n\t\t\t\t .append (\"\tB.head, B.detail, B.detail_nm \\n\")\n\t\t\t\t .append (\"FROM \\n\")\n\t\t\t\t .append (\"\tSALES.TSY011 A, \\n\")\n\t\t\t\t .append (\"\tSALES.TSY010 B \\n\")\n\t\t\t\t .append (\"WHERE 1=1 \\n\")\n\t\t\t\t .append (\" AND A.head = B.head \\n\")\n\t\t\t\t .append (\" AND B.head = ? \\n\")\n\t\t\t\t .append (\" AND LENGTH (rtrim(B.detail)) > 0 \\n\");\n\t\t\n\t\t/*\n\t\t * 대리점 조회\n\t\t */\n\t\tarr_sql[1].append(\"SELECT T1.client_sid\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 매출처SID \t*/\n\t \t\t .append(\"\t\t ,T1.vend_cd \t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\\n\")\t/* [회계]거래처 코드 \t*/\n\t \t\t .append(\"\t\t ,T1.client_cd \t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\\n\")\t/* 매출처 코드 \t*/\n\t \t\t .append(\"\t\t ,T1.client_nm \t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\\n\")\t/* 매출처 명 \t*/\n\t \t\t .append(\"\t\t ,T1.client_gu \t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\\n\")\t/* 매출처구분 :CU005 \t*/\n\t \t\t \n\t \t\t .append(\"\t\t ,T1.agen_gu \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 대리점구분 :CU006 \t*/\n\t \t\t .append(\"\t\t ,T1.dir_yn \t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\\n\")\t/* 직판여부 :CU012 \t*/\n\t \t\t .append(\"\t\t ,T1.area_cd \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 지역코드 :SY006 \t*/\n\t \t\t .append(\"\t\t ,T1.sal_dam_sid \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 영업담당자코드[TSY410] */\n\t \t\t .append(\"\t\t ,T1.client_dam_nm \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 매출처담당자 \t*/\n\t \t\t \n\t \t\t .append(\"\t\t ,T1.tel_no \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 전화번호 \t*/\n\t \t\t .append(\"\t\t ,T1.mobile_no \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 휴대전화 \t*/\n\t \t\t .append(\"\t\t ,T1.fax_no \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* FAX번호 \t*/\n\t \t\t .append(\"\t\t ,T1.e_mail \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 이메일 \t*/\n\t \t\t .append(\"\t\t ,T1.zip_cd \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 우편번호[TSY110] */\n\t \t\t \n\t \t\t .append(\"\t\t ,T1.address1 \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 주소1 \t*/\n\t \t\t .append(\"\t\t ,T1.address2 \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 주소2 \t*/\n\t \t\t .append(\"\t\t ,T1.commi_rate \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 수수료율 \t*/\n\t \t\t .append(\"\t\t ,T1.cunt_status \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 계약상태 :CU013 \t*/\n\t \t\t .append(\"\t\t ,T1.bancod \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 은행코드 [BANKCODE] */\n\t \t\t \n\t \t\t .append(\"\t\t ,T1.bank_acc_no \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 은행계좌번호 \t*/\n\t \t\t .append(\"\t\t ,T1.bank_acct_nm \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 예금주 \t*/\n\t \t\t .append(\"\t\t ,T1.use_yn \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 사용여부 :SY011 \t*/ \n\t \t\t .append(\"\t\t ,T1.client_url\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 홈페이지 URL\t\t\t\t*/\n\t \t\t .append(\"\t\t ,T2.sal_dam_nm \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 영업담당자명 \t*/\n\t \t\t .append(\"\t\t ,T3.vend_nm \t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\\n\")\t/* 거래처명 \t*/\n\t \t\t \n\t \t\t .append(\"\t\t ,T4.bannam \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 은행명 \t*/\n\t \t\t .append(\"\t\t ,SALES.FN_DETAIL_NM ( 'CU006',T1.agen_gu) AS agen_gu_name \t\t\t\t\t\\n\")\t/* 대리점구분명 \t\t\t\t*/ \n\t \t\t .append(\"\t\t ,SALES.FN_DETAIL_NM ( 'CU012',T1.dir_yn) AS dir_yn_name \t\t\t\t\t\\n\")\t/* 직판여부명 \t\t\t\t*/ \n\t \t\t .append(\"\t\t ,SALES.FN_DETAIL_NM ( 'SY006',T1.area_cd) AS area_nm\t\t\t\t\t\t\t\\n\")\t/* 지역명 \t\t\t\t*/\n\t \t\t .append(\"\t\t ,SALES.FN_DETAIL_NM ( 'CU013',T1.cunt_status) AS cunt_status_name \t\t\t\\n\")\t/* 계약상태명 \t\t\t\t*/\n\n\t \t\t .append(\"\t\t ,SALES.FN_DETAIL_NM ( 'SY011',T1.use_yn) AS use_yn_name \t\t\t\\n\")\t/* 사용여부명 \t\t\t \t*/\n\n\t \t\t .append(\"FROM SALES.TCU030 T1 LEFT OUTER JOIN SALES.TSY410 T2 ON T1.SAL_DAM_SID = T2.SAL_DAM_SID \\n\")\n\t \t\t .append(\"\t\t LEFT OUTER JOIN ACCOUNT.GCZM_VENDER T3 ON T1.VEND_CD = T3.VEND_CD \t\t\t\t\t\\n\")\n\t \t\t .append(\"\t\t LEFT OUTER JOIN ACCOUNT.BANKCODE T4 ON T1.BANCOD = T4.BANCOD \t\t\t\t\t\\n\")\n\t \t\t .append(\"WHERE 1 = 1 \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\n\t \t\t .append(\"\t\t AND T1.client_GU = '1' \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\");\n\t\t/*\n\t\t * 계약정보 조회\n\t\t */\n\t\tarr_sql[2].append(\"SELECT T1.client_sid\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 매출처SID \t*/\n\t\t\t\t .append(\"\t\t ,T1.cont_date\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\") \t/* 계약일자 \t*/\n\t\t\t\t .append(\"\t\t ,T1.expire_date\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 만기일자 \t*/\n\t\t\t\t .append(\"\t\t ,TO_NUMBER(T1.insur_amt) AS insur_amt\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 보험료 \t*/\n\t\t\t\t .append(\"\t\t ,T1.insur_comp_cd\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 보증보험회사:CU010 \t*/\n\t\t\t\t .append(\"\t\t ,SALES.FN_DETAIL_NM ('CU010',T1.insur_comp_cd) AS insur_comp_cd_name\t\t\\n\") \t/* 보증보험회사명 \t\t*/ \n\t\t\t\t .append(\"FROM SALES.TCU031 T1 \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\n\t\t\t\t .append(\"WHERE 1=1\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\");\n\t\t \n\t\n\t\t/*\n\t\t * 지점정보 조회\n\t\t */\n\t\tarr_sql[3].append(\"SELECT T1.client_sid\t\t\t\t\t\t\t\t\t\t\t\t\\n\") \t/* 매출처SID \t\t*/\n\t\t\t\t .append(\"\t\t ,T1.branch_cd\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 지점코드 \t\t\t*/\n\t\t\t\t .append(\"\t\t ,T1.branch_nm \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\") \t/* 지점명 \t\t\t*/\n\t\t\t\t .append(\"\t\t ,T1.area_cd\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\") \t/* 지역코드:SY006 \t\t*/\n\t\t\t\t .append(\"\t\t ,T1.client_down_yn \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 하위대리점여부:CU011 \t*/\n\t\t\t\t .append(\"\t\t ,T1.empno \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 담당자 \t\t\t*/\n\t\t\t\t .append(\"\t\t ,T1.tel_no \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 전화번호 \t\t\t*/\n\t\t\t\t .append(\"\t\t ,T1.mobile_no \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 휴대폰 \t\t\t*/\n\t\t\t\t .append(\"\t\t ,T1.fax_no \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 팩스번호 \t\t\t*/\n\t\t\t\t .append(\"\t\t ,T1.branch_url \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\")\t/* 지점홈페이지 \t\t\t*/\n\t\t\t\t .append(\"\t\t ,SALES.FN_DETAIL_NM ( 'SY006', T1.area_cd) AS area_nm\t\t\t\t\t\t\t\\n\") \t/* 지역명:SY006 \t\t*/\n\t\t\t\t .append(\"\t\t ,SALES.FN_DETAIL_NM ( 'CU011',T1.client_down_yn) AS client_down_yn_name \t\\n\")\t/* 하위대리점여부명 \t\t*/\n\t\t\t\t .append(\"FROM SALES.TCU032 T1\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\");\n\t\t\n\t\t\n\t\t/*\n\t\t * 대리점 등록\n\t\t */\n\n\t\tarr_sql[4].append(\"INSERT INTO SALES.TCU030 (\")\n\t\t\t\t .append(\"\t\t\t\t client_sid \\n\")\t\n\t\t\t\t .append(\"\t\t\t\t,vend_cd \\n\")\t/* [회계]거래처 코드 \t*/\n\t\t\t\t .append(\"\t\t\t\t,client_cd \\n\")\t/* 매출처 코드 \t*/\n\t\t\t\t .append(\"\t\t\t\t,client_nm \\n\")\t/* 매출처 명 \t*/\n\t\t\t\t .append(\"\t\t\t\t,client_gu \\n\")\t/* 매출처구분 :CU005 \t*/\n\t\t\t\t .append(\"\t\t\t\t,agen_gu \\n\")\t/* 대리점구분 :CU006 \t*/\n\t\t\t\t \n\t\t\t\t .append(\"\t\t\t\t,dir_yn \\n\")\t/* 직판여부 :CU012 \t*/\n\t\t\t\t .append(\"\t\t\t\t,area_cd \\n\")\t/* 지역코드 :SY006 \t*/\n\t\t\t\t .append(\"\t\t\t\t,sal_dam_sid \\n\")\t/* 영업담당자코드[TSY410] \t*/\n\t\t\t\t .append(\"\t\t\t\t,client_dam_nm \\n\")\t/* 매출처담당자 \t*/\n\t\t\t\t .append(\"\t\t\t\t,tel_no \\n\")\t/* 전화번호 \t*/\n\t\t\t\t \n\t\t\t\t .append(\"\t\t\t\t,mobile_no \\n\")\t/* 핸드폰 \t*/\n\t\t\t\t .append(\"\t\t\t\t,fax_no \\n\")\t/* FAX번호 \t*/\n\t\t\t\t .append(\"\t\t\t\t,e_mail \\n\")\t/* 이메일 \t*/\n\t\t\t\t .append(\"\t\t\t\t,zip_cd \\n\")\t/* 소재지우편번호[TSY110] */\n\t\t\t\t .append(\"\t\t\t\t,address1 \\n\")\t/* 소재지주소1 \t*/\n\t\t\t\t \n\t\t\t\t .append(\"\t\t\t\t,address2 \\n\")\t/* 소재지주소2 \t*/\n\t\t\t\t .append(\"\t\t\t\t,commi_rate \t\\n\") \t/* 수수료율 \t*/\n\t\t\t\t .append(\"\t\t\t\t,cunt_status \\n\")\t/* 계약상태 :CU013 \t*/\n\t\t\t\t .append(\"\t\t\t\t,bancod\t\t\t\\n\") \t/* 은행코드 \t\t\t\t\t*/\n\t\t\t\t .append(\"\t\t\t\t,bank_acc_no \\n\")\t/* 은행계좌번호[BANKCODE] \t*/\n\t\t\t\t \n\t\t\t\t .append(\"\t\t\t\t,bank_acct_nm\t\\n\")\t/* 예금주 \t\t\t\t\t*/\n\t\t\t\t .append(\"\t\t\t\t,use_yn\t\t\t\\n\")\t/* 사용여부 \t\t\t\t\t*/\n\t\t\t\t\n\t\t\t\t .append(\"\t\t \t\t,u_date \t\\n\") \t/* 최종수정일자 \t*/\n\t \t\t .append(\"\t\t \t\t,u_empno \t\\n\")\t/* 최종수정자사번 \t*/\n\t \t\t .append(\"\t\t \t\t,u_ip \\n\")\t/* 최종수정IP */\t\t\t\n\t \t\t .append(\"\t\t\t\t,client_url\t\t\\n\")\t/* 홈페이지 */\n\t\t\t\t .append(\"\t\t\t)\t\t\t\t\t\\n\")\n\t\t\t\t \n\t\t\t\t .append(\"VALUES\t\t\t\t\t\t\\n\")\n\t\t\t\t .append(\"\t\t\t(\t \t\t\t\\n\")\n\t\t\t\t .append(\"\t\t\t\tSALES.SWS_TCU030_ID.NEXTVAL,?,?,?,?,?,\t\t\\n\")\t\n\t\t\t\t .append(\"\t\t\t\t?,?,?,?,?,\t\t\\n\")\n\t\t\t\t .append(\"\t\t\t\t?,?,?,?,?,\t\t\\n\")\n\t\t\t\t .append(\"\t\t\t\t?,?,?,?,?,\t\t\\n\")\n\t\t\t\t .append(\"\t\t\t\t?,?,SYSTIMESTAMP,?,?,?\t\\n\")\n\t\t\t\t .append(\"\t\t\t)\");\n\t\t\n\t\n\t\t\n\t\t/*\n\t\t * 계약정보 등록\n\t\t */\n\t\tarr_sql[5].append(\"INSERT INTO SALES.TCU031 ( \t\\n\")\n\t\t\t\t .append(\" \t client_SID\t\t\t\\n\")\t/* 매출처SID \t*/\n\t\t\t\t .append(\"\t\t ,cont_date\t\t\t\t\\n\") \t/* 계약일자 \t*/\n\t\t\t\t .append(\"\t\t ,expire_date\t\t\t\\n\")\t/* 만기일자 \t*/\n\t\t\t\t .append(\"\t\t ,insur_amt\t\t\t\t\\n\")\t/* 보험료 \t*/\n\t\t\t\t .append(\"\t\t ,insur_comp_cd\t\t\t\\n\")\t/* 보증보험회사:CU010 \t*/\n\t\t\t\t \n\t\t\t\t .append(\"\t\t ,u_date\t\t\t\t\\n\")\t/* 최종수정일자 \t*/\n\t\t\t\t .append(\"\t\t ,u_empno \t\t\t\t\\n\") \t/* 최종수정자사번 \t*/\n\t\t\t\t .append(\"\t\t ,u_ip\t\t\t\t\t\\n\")\t/* 최종수정IP \t*/\n\t\t\t\t .append(\"\t\t)\t\t\t\t\t\t\\n\")\n\t\t\t\t \n\t\t\t\t .append(\"VALUES\t\t\t\t\t\t\\n\")\n\t\t\t\t .append(\"\t\t\t(\t \t\t\t\\n\")\n\t\t\t\t .append(\"\t\t\t\t?,?,?,?,?,\t\t\\n\")\t\n\t\t\t\t .append(\"\t\t\t\tSYSTIMESTAMP,?,?\t\t\t\\n\")\n\t\t\t\t .append(\"\t\t\t)\");\n\t\t\t\t\t\n\t\t/*\n\t\t * 지점정보 등록\n\t\t */\n\t\t\n\t\tarr_sql[6].append(\"INSERT INTO SALES.TCU032 ( \t\\n\")\n\t\t\t\t .append(\"\t\t client_SID\t\t\t\\n\") \t/* 매출처SID \t\t*/\n\t\t\t\t .append(\"\t\t ,branch_cd\t\t\t\t\\n\")\t/* 지점코드 \t\t\t*/\n\t\t\t\t .append(\"\t\t ,branch_nm \t\t\t\\n\") \t/* 지점명 \t\t\t*/\n\t\t\t\t .append(\"\t\t ,area_cd\t\t\t\t\\n\") \t/* 지역코드:SY006 \t\t*/\n\t\t\t\t .append(\"\t\t ,client_down_yn \t\t\\n\")\t/* 하위대리점여부:CU011 \t*/\n\t\t\t\t \n\t\t\t\t .append(\"\t\t ,empno \t\t\t\t\\n\")\t/* 담당자 \t\t\t*/\n\t\t\t\t .append(\"\t\t ,tel_no \t\t\t\t\\n\")\t/* 전화번호 \t\t\t*/\n\t\t\t\t .append(\"\t\t ,mobile_no \t\t\t\\n\")\t/* 휴대폰 \t\t\t*/\n\t\t\t\t .append(\"\t\t ,fax_no \t\t\t\t\\n\")\t/* 팩스번호 \t\t\t*/\n\t\t\t\t .append(\"\t\t ,branch_url \t\t\t\\n\")\t/* 지점홈페이지 \t\t\t*/\n\t\t\t\t \n\t\t\t\t .append(\"\t\t ,u_date \t\t\t\t\\n\")\t/* 최종수정일자 \t\t\t*/\n\t\t\t\t .append(\"\t\t ,u_empno \t\t\t\t\\n\")\t/* 최종수정자사번 \t\t\t*/\n\t\t\t\t .append(\"\t\t ,u_ip \t\t\t\t\\n\")\t/* 최종수정IP \t\t*/\n\t\t\t\t .append(\"\t)\t\t\t\t\t\t\\n\")\n\t\t\t\t .append(\"VALUES\t\t\t\t\t\t\\n\")\n\t\t\t\t .append(\"\t\t\t(\t \t\t\t\\n\")\n\t\t\t\t .append(\"\t\t\t\t?,?,?,?,?,\t\t\\n\")\t\n\t\t\t\t .append(\"\t\t\t\t?,?,?,?,?,\t\t\\n\")\n\t\t\t\t .append(\"\t\t\t\tSYSTIMESTAMP,?,?\t\t\t\\n\")\n\t\t\t\t .append(\"\t\t\t)\");\n\t\t\n\t\t/*\n\t\t * 대리점 수정\n\t\t */\n\n\t\tarr_sql[7].append(\"UPDATE SALES.TCU030 SET \t\t\t\t\t\t\\n\")\n\t\t\t\t .append(\"\t\t vend_cd\t\t= ? \t\t\t\t\\n\")\t/* [회계]거래처 코드 \t*/\n\t\t\t\t .append(\"\t\t,client_nm\t\t= ? \t\t\t\t\\n\")\t/* 매출처 명 \t*/\n\t\t\t\t .append(\"\t\t,agen_gu\t\t= ? \t\t\t\t \t\\n\")\t/* 대리점구분 :CU006 \t*/\n\t\t\t\t .append(\"\t\t,dir_yn\t\t\t= ? \t\t\t\t\\n\")\t/* 직판여부 :CU012 \t*/\n\t\t\t\t .append(\"\t\t,area_cd \t= ? \t\t\t\t\t\\n\")\t/* 지역코드 :SY006 \t*/\n\n\t\t\t\t .append(\"\t\t,sal_dam_sid\t= ? \t\t\t\t\t\\n\")\t/* 영업담당자코드[TSY410] */\n\t\t\t\t .append(\"\t\t,client_dam_nm\t= ? \t\t\t\t\t\\n\")\t/* 매출처담당자 \t*/\n\t\t\t\t .append(\"\t\t,tel_no = ?\t\t\t\t\t\t\\n\")\t/* 전화번호 \t*/\n\t\t\t\t .append(\"\t\t,mobile_no = ?\t\t\t\t\t\t\\n\")\t/* 핸드폰 \t*/\n\t\t\t\t .append(\"\t\t,fax_no = ?\t\t\t\t\t\t\\n\")\t/* FAX번호 \t*/\n\n\t\t\t\t .append(\"\t\t,e_mail = ?\t\t\t\t\t\t\\n\")\t/* 이메일 \t*/\n\t\t\t\t .append(\"\t\t,zip_cd = ?\t\t\t\t\t\t\\n\")\t/* 소재지우편번호[TSY110] \t*/\n\t\t\t\t .append(\"\t\t,address1 = ?\t\t\t\t\t\t\\n\")\t/* 소재지주소1 \t*/\n\t\t\t\t .append(\"\t\t,address2 = ?\t\t\t\t\t\t\\n\")\t/* 소재지주소2 \t*/\n\t\t\t\t .append(\"\t\t,commi_rate \t= ?\t\t\t\t\t\t\\n\") \t/* 수수료율 \t*/\n\n\t\t\t\t .append(\"\t\t,cunt_status = ?\t\t\t\t\t\t\\n\")\t/* 계약상태 :CU013 \t*/\n\t\t\t\t .append(\"\t\t,bancod\t\t\t= ?\t\t\t\t\t\t\\n\") \t/* 은행코드\t \t\t\t\t*/\n\t\t\t\t .append(\"\t\t,bank_acc_no = ?\t\t\t\t\t\t\\n\")\t/* 은행계좌번호[BANKCODE]\t\t*/\n\t\t\t\t .append(\"\t\t,bank_acct_nm\t= ?\t\t\t\t\t\t\\n\")\t/* 예금주 \t\t\t\t\t*/\n\t\t\t\t .append(\"\t\t,use_yn\t\t\t= ?\t\t\t\t\t\t\\n\")\t/* 사용여부 \t\t\t\t\t*/\n\n\t\t\t\t .append(\"\t\t,u_date \t= SYSTIMESTAMP\t\t\\n\") \t/* 최종수정일자 \t*/\n\t \t\t .append(\"\t\t,u_empno \t= ?\t\t\t\t\t\t\\n\")\t/* 최종수정자사번 \t*/\n\t \t\t .append(\"\t\t,u_ip = ?\t\t\t\t\t\t\\n\")\t/* 최종수정IP */\n\t \t\t .append(\"\t,client_url = ?\t\t\t\t\t\t\\n\")\t/* 홈페이지 */\n\t\t\t\t .append (\"WHERE client_sid \t= ? \t\t\t\t\\n\");\n\t\t\t\t \n\t\t/*\n\t\t * 계약정보 수정\n\t\t */\n\t\tarr_sql[8].append(\"UPDATE SALES.TCU031 SET\t\t\t\t\t\t\\n\")\n\t\t\t\t .append(\"\t\t cont_date\t\t\t= ?\t\t\t\t\t\\n\") \t/* 계약일자 \t*/\n\t\t\t\t .append(\"\t\t ,expire_date\t\t= ?\t\t\t\t\t\\n\")\t/* 만기일자 \t*/\n\t\t\t\t .append(\"\t\t ,insur_amt\t\t\t= ?\t\t\t\t\t\\n\")\t/* 보험료 \t*/\n\t\t\t\t .append(\"\t\t ,insur_comp_cd\t\t= ?\t\t\t\t\t\\n\")\t/* 보증보험회사:CU010 \t*/\n\t\t\t\t \n\t\t\t\t .append(\"\t\t ,u_date\t\t\t= SYSTIMESTAMP\t\\n\")\t/* 최종수정일자 \t*/\n\t\t\t\t .append(\"\t\t ,u_empno \t\t\t= ?\t\t\t\t\t\\n\") \t/* 최종수정자사번 \t*/\n\t\t\t\t .append(\"\t\t ,u_ip\t\t\t\t= ?\t\t\t\t\t\\n\")\t/* 최종수정IP \t*/\n\t\t\t\t .append (\"WHERE client_sid \t\t= ? AND cont_date = ? \\n\");\n\t\t\t\t\n\t\t\t\t \n\t\t\t\t\t\n\t\t/*\n\t\t * 지점정보 수정\n\t\t */\n\t\t\n\t\tarr_sql[9].append(\"UPDATE SALES.TCU032 SET \t\t\t\t\t\t\t\\n\")\n\t\t\t\t .append(\"\t\t branch_nm \t\t= ?\t\t\t\t\t\t\\n\") \t/* 지점명 \t\t\t*/\n\t\t\t\t .append(\"\t\t ,area_cd\t\t\t= ?\t\t\t\t\t\t\\n\") \t/* 지역코드:SY006 \t\t*/\n\t\t\t\t .append(\"\t\t ,client_down_yn \t= ?\t\t\t\t\t\t\\n\")\t/* 하위대리점여부:CU011 \t*/\n\t\t\t\t \n\t\t\t\t .append(\"\t\t ,empno \t\t\t= ?\t\t\t\t\t\t\\n\")\t/* 담당자 \t\t\t*/\n\t\t\t\t .append(\"\t\t ,tel_no \t\t\t= ?\t\t\t\t\t\t\\n\")\t/* 전화번호 \t\t\t*/\n\t\t\t\t .append(\"\t\t ,mobile_no \t\t= ?\t\t\t\t\t\t\\n\")\t/* 휴대폰 \t\t\t*/\n\t\t\t\t .append(\"\t\t ,fax_no \t\t\t= ?\t\t\t\t\t\t\\n\")\t/* 팩스번호 \t\t\t*/\n\t\t\t\t .append(\"\t\t ,branch_url \t\t= ?\t\t\t\t\t\t\\n\")\t/* 지점홈페이지 \t\t\t*/\n\t\t\t\t \n\t\t\t\t .append(\"\t\t ,u_date \t\t\t= SYSTIMESTAMP\t\t\t\t\t\t\\n\")\t/* 최종수정일자 \t\t\t*/\n\t\t\t\t .append(\"\t\t ,u_empno \t\t\t= ?\t\t\\n\")\t/* 최종수정자사번 \t\t\t*/\n\t\t\t\t .append(\"\t\t ,u_ip \t\t\t= ?\t\t\t\t\t\t\\n\")\t/* 최종수정IP \t\t*/\n\t\t\t\t .append (\"WHERE client_sid = ? AND branch_cd \t= ?\t\t\\n\");\n\t\t\n\t\t arr_sql[10].append(\"DELETE FROM SALES.TCU030 WHERE client_sid = ?\");\t\n\t\t arr_sql[11].append(\"DELETE FROM SALES.TCU031 WHERE client_sid = ? AND cont_date = ?\");\n\t\t arr_sql[12].append(\"DELETE FROM SALES.TCU032 WHERE client_sid = ? AND branch_cd = ?\");\n\t\t \n\t\t \n\t\t /*\n\t\t * Client SID 얻어오기\n\t\t */\n\t\t\t\n\t\t\tarr_sql[13].append(\"SELECT client_sid FROM SALES.TCU030 WHERE client_cd = ?\\n\");\n\t\t\t\n\t\t/*\n\t\t * 수수료율 조회\n\t\t */\n\t\t\tarr_sql[14].append(\"SELECT\t\t\t\t\t\t\t\t\\n\")\n\t\t\t\t\t\t.append(\" T1.CLIENT_SID AS CLIENT_SID\t\\n\") /* 매출처SID */\n\t\t\t\t\t\t.append(\" ,T1.FR_DATE AS FR_DATE \t\\n\") /* 시작일자 */\n\t\t\t\t\t\t.append(\" ,T1.TO_DATE AS TO_DATE \t\\n\") /* 종료일자 */\n\t\t\t\t\t\t.append(\" ,T1.WEEKEND_YN AS WEEKEND_YN \t\\n\") /* 주말여부 */\n\t\t\t\t\t\t.append(\" ,T1.COMMI_RATE AS COMMI_RATE\t\\n\") /* 수수료율 */\n\t\t\t\t\t\t.append(\"FROM SALES.TCU033 T1 \t\\n\")\n\t\t\t\t\t\t.append(\"WHERE 1=1 \t\t\t\t\t\t\t\\n\");\n\t\t\t\t\t\t\n\t\t/*\n\t\t * 수수료율 등록\n\t\t */\n\t\t\t\n\t\t\tarr_sql[15].append(\"INSERT INTO SALES.TCU033 ( \t\\n\")\n\t\t\t\t\t\t .append(\" \t CLIENT_SID\t\t\t\\n\")\t/* 매출처SID \t*/\n\t\t\t\t\t\t .append(\"\t\t ,FR_DATE\t\t\t\t\\n\") \t/* 시작일자 \t*/\n\t\t\t\t\t\t .append(\"\t\t ,TO_DATE\t\t\t\\n\")\t/* 종료일자 \t*/\n\t\t\t\t\t\t .append(\"\t\t ,COMMI_RATE\t\t\t\t\\n\")\t/* 수수료율 \t*/\n\t\t\t\t\t\t .append(\"\t\t ,WEEKEND_YN\t\t\t\\n\")\t/* 주말여부 \t*/\n\t\t\t\t\t\t .append(\"\t\t ,I_DATE\t\t\t\t\\n\")\t/* 최종입력일자 \t*/\n\t\t\t\t\t\t .append(\"\t\t ,I_EMPNO \t\t\t\t\\n\") \t/* 최종입력자사번 \t*/\n\t\t\t\t\t\t .append(\"\t\t ,I_IP\t\t\t\t\t\\n\")\t/* 최종입력IP \t*/\t\t\t\t\t\t \n\t\t\t\t\t\t .append(\"\t\t ,u_date\t\t\t\t\\n\")\t/* 최종수정일자 \t*/\n\t\t\t\t\t\t .append(\"\t\t ,u_empno \t\t\t\t\\n\") \t/* 최종수정자사번 \t*/\n\t\t\t\t\t\t .append(\"\t\t ,u_ip\t\t\t\t\t\\n\")\t/* 최종수정IP \t*/\n\t\t\t\t\t\t .append(\"\t\t)\t\t\t\t\t\t\\n\")\n\t\t\t\t\t\t \n\t\t\t\t\t\t .append(\"VALUES\t\t\t\t\t\t\\n\")\n\t\t\t\t\t\t .append(\"\t\t\t(\t \t\t\t\\n\")\n\t\t\t\t\t\t .append(\"\t\t\t\t?,?,?,?, ?,\t\t\\n\")\t\n\t\t\t\t\t\t .append(\"\t\t\t\tSYSTIMESTAMP,?,?, SYSTIMESTAMP,?,?\t\\n\")\n\t\t\t\t\t\t .append(\"\t\t\t)\");\n\t\t/*\n\t\t * 수수료율 수정\n\t\t */\n\t\t\tarr_sql[16].append(\"UPDATE SALES.TCU033 SET\t\t\t\t\t\t\\n\") \n\t\t\t\t\t .append(\"\t\t TO_DATE\t\t\t= ?\t\t\t\t\t\\n\")\t/* 종료일자 \t*/\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t .append(\"\t\t ,COMMI_RATE\t\t= ?\t\t\t\t\t\\n\")\t/* 수수료율 \t*/\n\t\t\t\t\t .append(\"\t\t ,WEEKEND_YN\t\t= ?\t\t\t\t\t\\n\")\t/* 주말여부 \t*/\n\t\t\t\t\t \n\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t .append(\"\t\t ,u_date\t\t\t= SYSTIMESTAMP\t\\n\")\t/* 최종수정일자 \t*/\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t .append(\"\t\t ,u_empno \t\t\t= ?\t\t\t\t\t\\n\") \t/* 최종수정자사번 \t*/\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t .append(\"\t\t ,u_ip\t\t\t\t= ?\t\t\t\t\t\\n\")\t/* 최종수정IP \t*/\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t .append (\"WHERE client_sid \t\t= ? AND FR_DATE = ? AND WEEKEND_YN=? \\n\"); \n\t\t/*\n\t\t * 수수료율 삭제\n\t\t */\n\t\tarr_sql[17].append(\"DELETE FROM SALES.TCU033 WHERE client_sid = ? AND fr_date = ? AND WEEKEND_YN=? \");\t \n\t\t\t \n\n\t}", "public void createVirtualTable(){\n\n\t\t\n\t\tif(DBHandler.getConnection()==null){\n\t\t\treturn;\n\t\t}\n\n\t\tif(DBHandler.tableExists(name())){\n\t\t\treturn;\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tStatement s = DBHandler.getConnection().createStatement();\n\t\t\ts.execute(\"create virtual table \"+name()+\" using fts4(\"+struct()+\")\");\n\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\tMainFrame.print(e.getMessage());\n\t\t}\n\t}", "int createTable(HbaseObj t);", "public TableCreation(Table table) {\n this.table = table;\n }", "public static String getCreateSQLString(){\n\t\treturn \"create table \" +TABLE_NAME_FAMILY_PLANNING_RECORDS +\" ( \"\n\t\t\t\t+SERVICE_REC_ID+\" integer primary key, \"\n\t\t\t\t+FamilyPlanningServices.SERVICE_ID +\" integer, \"\n\t\t\t\t+CommunityMembers.COMMUNITY_MEMBER_ID +\" integer, \"\n\t\t\t\t+SERVICE_DATE+\" text,\"\n\t\t\t\t+SCHEDULE_DATE+\" text, \"\n\t\t\t\t+QUANTITY+\" numberic ,\"\n\t\t\t\t+SERVICE_TYPE+\" integer default 0,\"\n\t\t\t\t+DataClass.REC_STATE+ \" integer \"\n\t\t\t\t+\")\";\n\t}", "@Override\n\tpublic <T> TypedQuery<T> createQuery(String qlString, Class<T> resultClass) {\n\t\treturn null;\n\t}", "public TableObject()\r\n {\r\n\tsuper(ObjectType.Table);\r\n\tglobal = false;\r\n }", "private void createDataTable() {\n jdbcTemplate.update(\"CREATE TABLE \" + IDaoEditors.TABLE + \" (ID INT IDENTITY PRIMARY KEY, NAME VARCHAR(150) NOT NULL UNIQUE)\");\n jdbcTemplate.update(\"CREATE TABLE \" + IDaoBooks.TABLE + \" (ID INT IDENTITY PRIMARY KEY, TITLE VARCHAR(150) NOT NULL UNIQUE, YEAR INT, ISBN10 VARCHAR(20), ISBN13 VARCHAR(13), NOTE INT, PAGES_NUMBER INT, RESUME VARCHAR(2000), THE_EDITOR_FK INT, THE_KIND_FK INT, THE_LANGUAGE_FK INT, THE_LENDING_FK INT, THE_SAGA_FK INT, THE_TYPE_FK INT)\");\n jdbcTemplate.update(\"CREATE TABLE \" + IDaoBooks.BOOKS_AUTHOR_TABLE + \" (THE_BOOK_FK INT NOT NULL, THE_AUTHOR_FK INT NOT NULL)\");\n\n jdbcTemplate.update(\"CREATE INDEX BOOK_EDITOR_IDX ON \" + IDaoEditors.TABLE + \"(ID)\");\n jdbcTemplate.update(\"CREATE INDEX BOOKS_IDX ON \" + IDaoBooks.TABLE + \"(ID)\");\n }", "@Override\n public SqlSchema getTableSchema(ExecutionContext context, String tableName) throws ExecutorException {\n int execId = execIdSeq.incrementAndGet();\n Map<String, String> staticConfigs = fetchSamzaSqlConfig(execId);\n Config samzaSqlConfig = new MapConfig(staticConfigs);\n SqlSchema sqlSchema;\n try {\n SqlIOResolver ioResolver = SamzaSqlApplicationConfig.createIOResolver(samzaSqlConfig);\n SqlIOConfig sourceInfo = ioResolver.fetchSourceInfo(tableName);\n RelSchemaProvider schemaProvider =\n SamzaSqlApplicationConfig.initializePlugin(\"RelSchemaProvider\", sourceInfo.getRelSchemaProviderName(),\n samzaSqlConfig, SamzaSqlApplicationConfig.CFG_FMT_REL_SCHEMA_PROVIDER_DOMAIN,\n (o, c) -> ((RelSchemaProviderFactory) o).create(sourceInfo.getSystemStream(), c));\n sqlSchema = schemaProvider.getSqlSchema();\n } catch (SamzaException ex) {\n throw new ExecutorException(ex);\n }\n return sqlSchema;\n }", "private void setQuerySQL(Settings set) {\n SEARCH_DATA_BASE = set.getValue(\"sql.searchDataBase\");\n CREATE_DATA_BASE = set.getValue(\"sql.createDataBase\");\n SEARCH_TABLE_VACANCY = set.getValue(\"sql.searchTableVacancy\");\n CREATE_TABLE_VACANCY = set.getValue(\"sql.createTableVacancy\");\n ADD_VACANCY = set.getValue(\"sql.addVacancy\");\n COUNT = set.getValue(\"sql.count\");\n MAX_DATE = set.getValue(\"sql.maxDate\");\n }", "public PgTable(final String name) {\n this.name = name;\n }", "public void setup() {\r\n // These setters could be used to override the default.\r\n // this.setDatabasePolicy(new null());\r\n // this.setJDBCHelper(JDBCHelperFactory.create());\r\n this.setTableName(\"chm62edt_habitat_syntaxa\");\r\n this.setTableAlias(\"A\");\r\n this.setReadOnly(true);\r\n\r\n this.addColumnSpec(\r\n new CompoundPrimaryKeyColumnSpec(\r\n new StringColumnSpec(\"ID_HABITAT\", \"getIdHabitat\",\r\n \"setIdHabitat\", DEFAULT_TO_ZERO, NATURAL_PRIMARY_KEY),\r\n new StringColumnSpec(\"ID_SYNTAXA\", \"getIdSyntaxa\",\r\n \"setIdSyntaxa\", DEFAULT_TO_EMPTY_STRING,\r\n NATURAL_PRIMARY_KEY)));\r\n this.addColumnSpec(\r\n new StringColumnSpec(\"RELATION_TYPE\", \"getRelationType\",\r\n \"setRelationType\", DEFAULT_TO_NULL));\r\n this.addColumnSpec(\r\n new StringColumnSpec(\"ID_SYNTAXA_SOURCE\", \"getIdSyntaxaSource\",\r\n \"setIdSyntaxaSource\", DEFAULT_TO_EMPTY_STRING, REQUIRED));\r\n\r\n JoinTable syntaxa = new JoinTable(\"chm62edt_syntaxa B\", \"ID_SYNTAXA\",\r\n \"ID_SYNTAXA\");\r\n\r\n syntaxa.addJoinColumn(new StringJoinColumn(\"NAME\", \"setSyntaxaName\"));\r\n syntaxa.addJoinColumn(new StringJoinColumn(\"AUTHOR\", \"setSyntaxaAuthor\"));\r\n this.addJoinTable(syntaxa);\r\n\r\n JoinTable syntaxasource = new JoinTable(\"chm62edt_syntaxa_source C\",\r\n \"ID_SYNTAXA_SOURCE\", \"ID_SYNTAXA_SOURCE\");\r\n\r\n syntaxasource.addJoinColumn(new StringJoinColumn(\"SOURCE\", \"setSource\"));\r\n syntaxasource.addJoinColumn(\r\n new StringJoinColumn(\"SOURCE_ABBREV\", \"setSourceAbbrev\"));\r\n syntaxasource.addJoinColumn(new IntegerJoinColumn(\"ID_DC\", \"setIdDc\"));\r\n this.addJoinTable(syntaxasource);\r\n }" ]
[ "0.56980526", "0.55011666", "0.5471196", "0.54572314", "0.54461867", "0.5438609", "0.53995055", "0.5355348", "0.5353934", "0.5318658", "0.5318509", "0.53030014", "0.528098", "0.5231459", "0.5230199", "0.52169114", "0.51881105", "0.5169798", "0.51580167", "0.5132557", "0.5129661", "0.51266915", "0.51188", "0.5077345", "0.50701225", "0.5058507", "0.5056148", "0.50392765", "0.5037616", "0.5034405", "0.50295424", "0.5017067", "0.49963364", "0.49884772", "0.49838093", "0.49733204", "0.49625358", "0.49572617", "0.49547225", "0.49418765", "0.49399984", "0.49367154", "0.4936592", "0.4926611", "0.49197906", "0.48933542", "0.48834553", "0.48832574", "0.48750445", "0.48736215", "0.4858936", "0.4856105", "0.4855558", "0.48481467", "0.48436219", "0.48376977", "0.4831411", "0.48248884", "0.48169512", "0.48143", "0.4806962", "0.4806497", "0.48060608", "0.48054254", "0.47983557", "0.479753", "0.47941092", "0.4789658", "0.4777561", "0.4768894", "0.47683942", "0.47673097", "0.4767248", "0.47640848", "0.47615233", "0.47603244", "0.47382694", "0.47290307", "0.47281766", "0.47259775", "0.47252482", "0.4721591", "0.47203812", "0.47161222", "0.47124454", "0.47066468", "0.47066158", "0.4703903", "0.47013056", "0.46995848", "0.4698552", "0.46919486", "0.4684878", "0.46831903", "0.46820146", "0.46780968", "0.46706474", "0.46691123", "0.4667965", "0.4667581" ]
0.6034958
0
Create an aliased public.qs table reference
public Qs(String alias) { this(alias, QS); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static QueryDelegate generateTableQuery(String tableName) {\n String FROM_QUERY = \" FROM \" + tableName;\n String SELECT_QUERY=\" SELECT * \" +\n FROM_QUERY;\n String COUNT_QUERY = \"SELECT count(*) \" + FROM_QUERY;\n String CONTAINS_QUERY = \"SELECT * FROM \" + tableName + \" WHERE id = ?\";\n\n return generateQueryDelegate(SELECT_QUERY, COUNT_QUERY, CONTAINS_QUERY);\n }", "@Test\n public void testAliasedTableColumns()\n {\n assertEquals(\n runner.execute(\"SELECT * FROM orders AS t (a, b, c, d, e, f, g, h, i)\"),\n runner.execute(\"SELECT * FROM orders\"));\n }", "@Test\n public void testAliasesInFrom() throws Exception {\n String sql = \"SELECT myG.*, myH.b FROM g AS myG, h AS myH\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n Node meSymbolNode = verify(selectNode, Select.SYMBOLS_REF_NAME, 1, MultipleElementSymbol.ID);\n Node groupSymbolNode = verify(meSymbolNode, MultipleElementSymbol.GROUP_REF_NAME, GroupSymbol.ID);\n verifyProperty(groupSymbolNode, Symbol.NAME_PROP_NAME, \"myG\");\n verifyElementSymbol(selectNode, Select.SYMBOLS_REF_NAME, 2, \"myH.b\");\n\n Node fromNode = verify(queryNode, Query.FROM_REF_NAME, From.ID);\n verifyUnaryFromClauseGroup(fromNode, From.CLAUSES_REF_NAME, 1, \"myG\", \"g\");\n verifyUnaryFromClauseGroup(fromNode, From.CLAUSES_REF_NAME, 2, \"myH\", \"h\");\n \n verifySql(sql, fileNode);\n }", "AliasStatement createAliasStatement();", "PivotForClause createPivotForClause();", "@Override\n protected String getColNamesQuery(String tableName) {\n return \"SELECT t.* FROM \" + escapeTableName(tableName) + \" AS t LIMIT 1\";\n }", "public Mytable(String alias) {\n this(DSL.name(alias), MYTABLE);\n }", "public Qs() {\n this(\"qs\", null);\n }", "private static StringBuffer generateProvenanceProcedure(String query,\n\t int qIndex) {\n\n\t/*\n\t * First, we need the list of the FROM clause atoms/aliases that we will\n\t * use to augment the SELECT clause with ROWIDs. assume the query is an\n\t * SPJ Select .... From... Where .\n\t */\n\tString uQuery = query.toUpperCase();\n\n\tint fromIndex = uQuery.indexOf(\"FROM\");\n\tint whereIndex = uQuery.indexOf(\"WHERE\");\n\n\tif (whereIndex == -1) {\n\t whereIndex = uQuery.length();\n\t}\n\tString fromClause = query.substring(fromIndex + 4, whereIndex - 1)\n\t\t.trim();\n\t// System.out.println(\"From: \"+fromClause);\n\tStringTokenizer st = new StringTokenizer(fromClause, \",\");\n\n\t// Keep the list of FROM clause atoms\n\tList<String> fromAtoms = new ArrayList<String>();\n\twhile (st.hasMoreTokens()) {\n\t String thisFromAtom = st.nextToken().trim();\n\n\t // System.out.println(\"Atom:\"+thisFromAtom);\n\n\t // bug fixed\n\t // bug: didn't consider \"as\"\n\t if (thisFromAtom.contains(\"as\")) {\n\t\tStringTokenizer atomTok = new StringTokenizer(thisFromAtom,\n\t\t\t\"as\");\n\t\tString atomAlias = atomTok.nextToken();\n\t\tif (atomTok.hasMoreTokens())\n\t\t atomAlias = atomTok.nextToken();\n\t\tfromAtoms.add(atomAlias);\n\t } else if (thisFromAtom.contains(\"AS\")) {\n\t\tStringTokenizer atomTok = new StringTokenizer(thisFromAtom,\n\t\t\t\"AS\");\n\t\tString atomAlias = atomTok.nextToken();\n\t\tif (atomTok.hasMoreTokens())\n\t\t atomAlias = atomTok.nextToken();\n\t\tfromAtoms.add(atomAlias);\n\t } else {\n\t\tStringTokenizer atomTok = new StringTokenizer(thisFromAtom, \" \");\n\t\tString atomAlias = atomTok.nextToken();\n\t\tif (atomTok.hasMoreTokens())\n\t\t atomAlias = atomTok.nextToken();\n\t\tfromAtoms.add(atomAlias);\n\t }\n\n\t // original code from Bogdan\n\t // StringTokenizer atomTok = new StringTokenizer(thisFromAtom,\" \");\n\t // String atomAlias = atomTok.nextToken();\n\t // if(atomTok.hasMoreTokens())\n\t // atomAlias=atomTok.nextToken();\n\t // fromAtoms.add(atomAlias);\n\n\t}\n\n\t// System.out.println(\"FROM atoms:\"+fromAtoms);\n\n\t/*\n\t * the extension to the SELECT clause which will be used to extract the\n\t * ROWIDs of the source tuples (why-provenance)\n\t */\n\tStringBuffer selectExtension = new StringBuffer();\n\tfor (int i = 1; i <= fromAtoms.size(); i++) {\n\t String fromAtom = fromAtoms.get(i - 1);\n\t selectExtension.append(\", \" + fromAtom + \".\"\n\t\t + Parameters.ROWID_ATT_NAME);\n\t selectExtension.append(\" as src\" + i + \"_ID\");\n\t}\n\tselectExtension.append(\"\\n\\t\\t \");\n\n\t// System.out.println(\"Select extension: \"+selectExtension);\n\tStringBuffer buffer = new StringBuffer();\n\t// buffer.append(\"DELIMITER !\\n\");\n\tbuffer.append(\"CREATE PROCEDURE \" + Parameters.TRACK_PROV_PROCNAME\n\t\t+ \"()\\n\");\n\tbuffer.append(\"BEGIN\\n\\n\");\n\tbuffer.append(\"\\t declare deriv_no int default 0;\\n\");\n\tbuffer.append(\"\\t declare done int default 0;\\n\\n\");\n\n\t// declare res_id_var, src1_id_var, src2_id_var int;\n\tbuffer.append(\"\\t declare res_id_var\");\n\tfor (int i = 1; i <= fromAtoms.size(); i++) {\n\t buffer.append(\", src\" + i + \"_id_var\");\n\t}\n\tbuffer.append(\" int;\\n\");\n\t// declare prov_cursor cursor for\n\t// select __ROWID, src1_ID, src2_ID\n\t// from Q1_RES q_result\n\t// natural join\n\t// (\n\t// select r1.A as A, r1.__ROWID as src1_ID, r2.__ROWID as src2_ID\n\t// from R r1, R r2\n\t// where r1.B=r2.A\n\t// ) prov_query;\n\tbuffer.append(\"\\t declare prov_cursor cursor for\\n\");\n\tbuffer.append(\"\\t\\t select \" + Parameters.ROWID_ATT_NAME);\n\tfor (int i = 1; i <= fromAtoms.size(); i++) {\n\t buffer.append(\", src\" + i + \"_ID\");\n\t}\n\tbuffer.append(\"\\n\");\n\tbuffer.append(\"\\t\\t from \" + Parameters.QUERY_RESULT_PREFIX + qIndex\n\t\t+ Parameters.QUERY_RESULT_SUFFIX);\n\tbuffer.append(\" q_result\\n\");\n\tbuffer.append(\"\\t\\t natural join\\n\");\n\tbuffer.append(\"\\t\\t (\\n\");\n\t// the augmented query here:\n\tStringBuffer queryBuf = new StringBuffer(query);\n\tqueryBuf.insert(fromIndex, selectExtension); // right before the FROM\n\t\t\t\t\t\t // clause\n\tbuffer.append(\"\\t\\t \" + queryBuf + \"\\n\");\n\tbuffer.append(\"\\t\\t ) prov_query;\\n\\n\");\n\tbuffer.append(\"\\t declare continue handler for not found set done = 1;\\n\\n\");\n\tbuffer.append(\"\\t open prov_cursor;\\n\\n\");\n\tbuffer.append(\"\\t read_loop: loop\\n\\n\");\n\tbuffer.append(\"\\t\\t fetch prov_cursor into res_id_var\");\n\t// , src1_id_var, src2_id_var;\n\tfor (int i = 1; i <= fromAtoms.size(); i++) {\n\t buffer.append(\", src\" + i + \"_id_var\");\n\t}\n\tbuffer.append(\";\\n\\n\");\n\tbuffer.append(\"\\t\\t if done then leave read_loop;\\n\");\n\tbuffer.append(\"\\t\\t end if;\\n\\n\");\n\tfor (int i = 1; i <= fromAtoms.size(); i++) {\n\t buffer.append(\"\\t\\t insert ignore into PROV values (res_id_var,deriv_no,src\"\n\t\t + i + \"_id_var);\\n\");\n\t}\n\t// insert ignore into PROV values (res_id_var,deriv_no,src1_id_var);\n\t// insert ignore into PROV values (res_id_var,deriv_no,src2_id_var);\n\tbuffer.append(\"\\n\\t\\t set deriv_no = deriv_no + 1;\\n\\n\");\n\tbuffer.append(\"\\t end loop;\\n\\n\");\n\tbuffer.append(\"\\t close prov_cursor;\\n\\n\");\n\tbuffer.append(\"END\\n\");\n\treturn buffer;\n }", "private void appendFullTableNameAndAlias(String stageName) {\n builder.append(getFullTableName(stageName)).append(AS).append(getTableAlias(stageName));\n }", "private void appendPrimaryTableName() {\n super.appendTableName(Constants.FROM, joinQueryInputs.primaryTableName);\n }", "public String getNextTableSqlAlias() {\n return \"t\"+(aliasCounter++);\n }", "public PgPublicationTables(Name alias) {\n this(alias, PG_PUBLICATION_TABLES);\n }", "public Mytable(Name alias) {\n this(alias, MYTABLE);\n }", "private String getCloneSetLinkTableQuery() {\n \t\tfinal StringBuilder builder = new StringBuilder();\n \n \t\tbuilder.append(\"create table CLONE_SET_LINK(\");\n \t\tbuilder.append(\"CLONE_SET_LINK_ID LONG PRIMARY KEY,\");\n \t\tbuilder.append(\"BEFORE_ELEMENT_ID LONG,\");\n \t\tbuilder.append(\"AFTER_ELEMENT_ID LONG,\");\n \t\tbuilder.append(\"BEFORE_REVISION_ID LONG,\");\n \t\tbuilder.append(\"AFTER_REVISION_ID LONG,\");\n \t\tbuilder.append(\"CHANGED_ELEMENTS INTEGER,\");\n \t\tbuilder.append(\"ADDED_ELEMENTS INTEGER,\");\n \t\tbuilder.append(\"DELETED_ELEMENTS INTEGER,\");\n \t\tbuilder.append(\"CO_CHANGED_ELEMENTS INTEGER,\");\n \t\tbuilder.append(\"CODE_FRAGMENT_LINKS TEXT NOT NULL\");\n \t\tbuilder.append(\")\");\n \n \t\treturn builder.toString();\n \t}", "private static Map<String, QuickResource> setupAliases(Query query,\n PhemaElmToOmopTranslatorContext context)\n throws CorrelationException, PhemaTranslationException {\n Map<String, QuickResource> aliases = new HashMap<>();\n\n AliasedQuerySource outerAliasedExpression = query.getSource().get(0);\n Retrieve outerRetrieve = (Retrieve) outerAliasedExpression.getExpression();\n String outerResourceType = outerRetrieve.getDataType().getLocalPart();\n String outerValuesetFilter = context.getVocabularyReferenceForRetrieve(outerRetrieve);\n\n RelationshipClause innerAliasedExpression = query.getRelationship().get(0);\n Retrieve innerRetrieve = (Retrieve) innerAliasedExpression.getExpression();\n String innerResourceType = innerRetrieve.getDataType().getLocalPart();\n String innerValuesetFilter = context.getVocabularyReferenceForRetrieve(innerRetrieve);\n\n aliases.put(outerAliasedExpression.getAlias(),\n QuickResource.from(outerResourceType, outerValuesetFilter));\n aliases.put(innerAliasedExpression.getAlias(),\n QuickResource.from(innerResourceType, innerValuesetFilter));\n\n return aliases;\n }", "public PgPublicationTables(String alias) {\n this(DSL.name(alias), PG_PUBLICATION_TABLES);\n }", "public static String createSimpleCreateTableQuery(String tableName, String storageEngine, String selectQuery) {\n builder.setLength(0);\n builder.append(\"CREATE TABLE `\").append(tableName).append(\"` ENGINE = \").append(storageEngine).append(\" AS \");\n builder.append(selectQuery);\n return builder.toString();\n }", "@Test\n public void testHiddenAliasesInFrom() throws Exception {\n String sql = \"SELECT myG.*, myH.b FROM g myG, h myH\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n Node meSymbolNode = verify(selectNode, Select.SYMBOLS_REF_NAME, 1, MultipleElementSymbol.ID);\n Node groupSymbolNode = verify(meSymbolNode, MultipleElementSymbol.GROUP_REF_NAME, GroupSymbol.ID);\n verifyProperty(groupSymbolNode, Symbol.NAME_PROP_NAME, \"myG\");\n verifyElementSymbol(selectNode, Select.SYMBOLS_REF_NAME, 2, \"myH.b\");\n\n Node fromNode = verify(queryNode, Query.FROM_REF_NAME, From.ID);\n verifyUnaryFromClauseGroup(fromNode, From.CLAUSES_REF_NAME, 1, \"myG\", \"g\");\n verifyUnaryFromClauseGroup(fromNode, From.CLAUSES_REF_NAME, 2, \"myH\", \"h\");\n\n verifySql(\"SELECT myG.*, myH.b FROM g AS myG, h AS myH\", fileNode);\n }", "public String composeTableNamesQuery() {\n\t\treturn String.format(\"show tables;\");\n\t}", "FromTableJoin createFromTableJoin();", "@Test\n public void testAliasInFrom() throws Exception {\n String sql = \"SELECT myG.a FROM g AS myG\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n verifyElementSymbol(selectNode, Select.SYMBOLS_REF_NAME, \"myG.a\");\n\n Node fromNode = verify(queryNode, Query.FROM_REF_NAME, From.ID);\n verifyUnaryFromClauseGroup(fromNode, From.CLAUSES_REF_NAME, 1, \"myG\", \"g\");\n \n verifySql(sql, fileNode);\n }", "public DynamicSchemaTable(String alias) {\n this(alias, DYNAMIC_SCHEMA);\n }", "String getQueryText() {\n AdqlSyntax syntax = AdqlSyntax.getInstance();\n StringBuffer sbuf = new StringBuffer();\n if ( talias_ != null ) {\n sbuf.append( syntax.quoteIfNecessary( talias_ ) )\n .append( \".\" );\n }\n String cname = cmeta_.getName();\n sbuf.append( quote_ ? syntax.quote( cname )\n : syntax.quoteIfNecessary( cname ) );\n if ( rename_ != null ) {\n sbuf.append( \" AS \" )\n .append( syntax.quoteIfNecessary( rename_ ) );\n }\n return sbuf.toString();\n }", "public interface Sqlable {\n\n Map<String, Object> getSqlMap();\n\n String getTableName();\n\n}", "protected String generateSQL() {\n String fields = generateFieldsJSON();\n return String.format(QUERY_PATTERN, fields, esQuery.generateQuerySQL(), from, size);\n }", "public String toSolrQuery() {\n SolrMapping mapping = store.getMapping();\n String fld = mapping.getPrimaryKey();\n String q;\n if (getKey() != null) {\n q = fld + \":\" + SolrStore.escapeQueryKey(getKey().toString());\n } else {\n q = fld + \":[\";\n if (getStartKey() != null) {\n q += SolrStore.escapeQueryKey(getStartKey().toString());\n } else {\n q += \"*\";\n }\n q += \" TO \";\n if (getEndKey() != null) {\n q += SolrStore.escapeQueryKey(getEndKey().toString());\n } else {\n q += \"*\";\n }\n q += \"]\";\n }\n return q;\n }", "public interface SettingsEventQuery {\r\n public static final String[] COLUMNS = {\"keyField\", \"keyValue\"};\r\n public static final String CREATE_TABLE = (\"CREATE TABLE IF NOT EXISTS Settings(\" + COLUMNS[0] + \" TEXT, \" + COLUMNS[1] + \" TEXT )\");\r\n public static final String DROP_TABLE = \"DROP TABLE IF EXISTS Settings\";\r\n public static final int KEY_FIELD = 0;\r\n public static final int KEY_VALUE = 1;\r\n public static final String TABLE = \"Settings\";\r\n }", "PivotTable createPivotTable();", "public static final String getTopicTableCreationSQL(String shortname) {\r\n\t\tString crTopicTableSQL = \"CREATE TABLE IF NOT EXISTS dblp_topic_\" +shortname +\r\n\t\t\"(tid varchar(50) NOT NULL, \" +\r\n\t\t\" keyword varchar(255) NOT NULL, \" + \r\n\t\t\" istop tinyint UNSIGNED ZEROFILL, \" + // Is this keyword a top keyword for this topic\r\n\t\t\" PRIMARY KEY (tid,keyword)) \";\r\n\t\treturn crTopicTableSQL;\r\n\t}", "protected void generateFromClause( WrqInfo wrqInfo, SQLStatementWithParams sqlStatement ) throws BindingException\n {\n sqlStatement.append(\" FROM \");\n WrqBindingSet bs = wrqInfo.getResultingBindingSet();\n resolvedBindingSets.addAll(bs.getResolvedBindingSets());\n sqlStatement.append(wrqInfo.getSQLSelectWithParams()); \n }", "private String buildStaticViewString(Stream strm, String name) {\n\t\tString viewString = \"CREATE TEMP TABLE \"+name;\n\t\tviewString += \" AS \";\n\t\tviewString += \"SELECT * FROM \" + generateStreamData(strm, name, false) + \";\\r\\n\";\n\t\treturn viewString;\n\t}", "public CriteriaQueryTable(CriteriaQuery q) {\n myCriteriaQuery = q;\n myOriginalRestriction = q.getRestriction();\n \n if (myOriginalRestriction == null) {\n myOriginalRestriction = JPA.em().getCriteriaBuilder().conjunction();\n }\n }", "TableOrAlias createTableOrAlias();", "public void testOneTableSynAS() {\n\n String\tsql\t= \"SELECT t.AD_Table_ID, t.TableName FROM AD_Table AS t WHERE t.IsActive='Y'\";\n AccessSqlParser\tfixture\t= new AccessSqlParser(sql);\n\n assertEquals(\"AccessSqlParser[AD_Table=t|0]\", fixture.toString());\n }", "public static final String getAuthKWRelTableCreationSQL(String shortname) {\r\n\t\tString crTopicTableSQL = \"CREATE TABLE IF NOT EXISTS dblp_authkw_\" +shortname +\r\n\t\t\"(author varchar(70) NOT NULL, \" +\r\n\t\t\" keyword varchar(255) NOT NULL, \" + \r\n\t\t\" PRIMARY KEY (keyword,author)) \";\r\n\t\treturn crTopicTableSQL;\r\n\t}", "@Override\n final public String getInputRelation() {\n return \"SELECT * FROM TR1_DB1_PROPHECY_Q5_INNER\";\n }", "public From table(String table) {\r\n\t\tString alias = null;\r\n\t\tif (table.toUpperCase()\r\n\t\t\t\t.contains(\" AS \"))\r\n\t\t\ttable = table.replaceAll(\"\\\\s+[Aa][Ss]\\\\s+\", \" \");\r\n\t\tfinal String[] parts = table.split(\"\\\\s+\");\r\n\t\tif (parts.length > 1) {\r\n\t\t\ttable = parts[0];\r\n\t\t\talias = parts[1];\r\n\t\t}\r\n\t\torigins.add(new FromOrigin().table(table)\r\n\t\t\t\t.alias(alias));\r\n\t\treturn this;\r\n\t}", "@Override\n\tpublic Query createQuery(String qlString) {\n\t\treturn null;\n\t}", "public interface QtlAdaptor extends Adaptor {\n \n /**\n * Adaptor type. TYPE = \"qtl\".\n */\n final static String TYPE = \"qtl\";\n \n /**\n * Fetch Qtl by it's internalID.\n * @return Qtl with specied internalID, or null if no such Qtl exists in database.\n */\n Qtl fetch(long internalID) throws AdaptorException ;\n \n /**\n * Fetch all Qtls from database.\n * @return list of zero or more Qtls.\n */\n List fetchAll() throws AdaptorException ;\n \n /**\n * Fetch all Qtls from database with the specified trait.\n * @param trait trait affected by Qtl.\n * @return list of zero or more Qtls.\n */\n List fetchByTrait(String trait) throws AdaptorException ;\n \n\n /**\n * Fetch all Qtls from database that originally come from the specified\n * database.\n * @param sourceDatabaseName name of the source database.\n * @return list of zero or more Qtls.\n */\n List fetchBySourceDatabase(String sourceDatabaseName) throws AdaptorException ;\n \n /**\n * Fetch all Qtls from database that originally come from the specified\n * database and have the specified id.\n * @param sourceDatabaseName name of the source database.\n * @param sourceID id in the source database.\n * @return list of zero or more Qtls matching the criteria.\n */\n List fetchBySourceDatabase(String sourceDatabaseName, String sourceID) throws AdaptorException ;\n \n}", "protected Expression buildBSRJoinQuery() {\n try {\n final InputStream input = ResourceUtil.getResourceAsStream(QUERY_FILE);\n final QueryExpression query = QueryExpressionParser.parse(input);\n return query.toExpression(new ReferenceTable(catalog));\n } catch (final Exception e) {\n throw new RuntimeException(e);\n }\n }", "private String queryAllFrom(String tableName) {\n return EXTRA_ALL_FROM + tableName + EXTRA_SEMI_COLON;\n }", "SelectQuery createSelectQuery();", "Object getExplainPlan(ObjectStorage storage, Connection connection,\r\n Alias alias, String sql);", "public abstract String createQuery();", "public void setAlias(com.flexnet.opsembedded.webservices.SimpleQueryType alias) {\n this.alias = alias;\n }", "private String getCodeFragmentLinkTableQuery() {\n \t\tfinal StringBuilder builder = new StringBuilder();\n \n \t\tbuilder.append(\"create table CODE_FRAGMENT_LINK(\");\n \t\tbuilder.append(\"CODE_FRAGMENT_LINK_ID LONG PRIMARY KEY,\");\n \t\tbuilder.append(\"BEFORE_ELEMENT_ID LONG,\");\n \t\tbuilder.append(\"AFTER_ELEMENT_ID LONG,\");\n \t\tbuilder.append(\"BEFORE_REVISION_ID LONG,\");\n \t\tbuilder.append(\"AFTER_REVISION_ID LONG,\");\n \t\tbuilder.append(\"CHANGED INTEGER\");\n \t\tbuilder.append(\")\");\n \n \t\treturn builder.toString();\n \t}", "private String getCloneSetTableQuery() {\n \t\tfinal StringBuilder builder = new StringBuilder();\n \n \t\tbuilder.append(\"create table CLONE_SET(\");\n \t\tbuilder.append(\"CLONE_SET_ID LONG PRIMARY KEY,\");\n \t\tbuilder.append(\"OWNER_REVISION_ID LONG,\");\n \t\tbuilder.append(\"ELEMENTS TEXT NOT NULL,\");\n \t\tbuilder.append(\"NUMBER_OF_ELEMENTS INTEGER\");\n \t\tbuilder.append(\")\");\n \n \t\treturn builder.toString();\n \t}", "QueryType createQueryType();", "public Query query(Table table) {\r\n return new Query(this, table);\r\n }", "TableId table();", "public QueryExecution createQueryExecution(Query qry);", "public interface IQueryResolver {\n List<Field> equalCondition = new ArrayList();\n List<Field> greaterEqualCondition = new ArrayList();\n List<Field> lesserEqualCondition = new ArrayList();\n\n String getTableName();\n}", "Table getReferencedTable();", "@Override\n public PlainSqlQuery<T, ID> createPlainSqlQuery() {\n return null;\n }", "private RunQueriesEx setupQueries() {\n RunQueriesEx queries = new RunQueriesEx();\n \n //for each column in our table, update one of our lists\n for(int i = 0; i < this.dataTable.getColumnCount(); i++) {\n this.updateList(i);\n }\n \n updateEmptyLists(); //pads any lists that didn't get updates with empty strings\n \n //add a new query for each row in the table\n for(int i = 0; i < this.dataTable.getRowCount(); i++) {\n queries.add(this.createQueryFromRow(i));\n }\n \n return queries;\n }", "public static void main(String args[]){\n String sql = \"select * from TBLS limit 2\";\n String sqlComplex = \"select testpartition.filename,format_.o,title.s,identifier.o,id.o,date_.o \" +\n \"from testpartition join format_ on (testpartition.filename=format_.s) \" +\n \"join title on (testpartition.filename=title.s) \" +\n \"join identifier on (testpartition.filename=identifier.s) \" +\n \"join id on (testpartition.filename=id.s) \" +\n \"join date_ on (testpartition.filename=date_.s) \" +\n \"where testpartition.gid0=1 and testpartition.sid=2 and testpartition.fid<100000 and testpartition.pfid=0\";\n String sqlOriginal = \"select idTable.filename,format_.o,title.s,identifier.o,id.o,date_.o \" +\n \"from idTable join format_ on (idTable.filename=format_.s) \" +\n \"join title on (idTable.filename=title.s) \" +\n \"join identifier on (idTable.filename=identifier.s) \" +\n \"join id on (idTable.filename=id.s) \" +\n \"join date_ on (idTable.filename=date_.s) \" +\n \"where idTable.gid0=1 and idTable.sid=2 and idTable.fid<100000\";\n\n QueryRewrite my = new QueryRewrite(sqlOriginal);\n String sqlRewrite = my.rewrite();\n System.out.println(sqlRewrite);\n\n\n }", "public interface PathAliasHandler {\n String toAliasedColumn(FieldExpression fieldExpression);\n}", "public static final String getAuthCollabOverKWTableCreationSQL(String shortname) {\r\n\t\tString crTopicTableSQL = \"CREATE TABLE IF NOT EXISTS dblp_authcollabkw_\" +shortname +\r\n\t\t\"(keyword varchar(255) NOT NULL, \" + \r\n\t\t\"author varchar(70) NOT NULL, \" + \r\n\t\t\" collabauth varchar(70) NOT NULL, \" +\r\n\t\t\"collabcnt int NOT NULL\" +\r\n\t\t\" ) \";\r\n\t\treturn crTopicTableSQL;\r\n\t}", "public void createQuery(String s) throws HibException;", "public void testMember(){\n\r\n parser.sqltext = \"select f from t1\";\r\n assertTrue(parser.parse() == 0);\r\n assertTrue(parser.sqlstatements.get(0).joins.getJoin(0).getKind() == TBaseType.join_source_fake );\r\n assertTrue(parser.sqlstatements.get(0).joins.getJoin(0).getTable().toString().compareToIgnoreCase(\"t1\") == 0);\r\n\r\n parser.sqltext = \"select f from t as t1 join t2 on t1.f1 = t2.f1\";\r\n assertTrue(parser.parse() == 0);\r\n assertTrue(parser.sqlstatements.get(0).joins.getJoin(0).getKind() == TBaseType.join_source_table );\r\n assertTrue(parser.sqlstatements.get(0).joins.getJoin(0).getTable().toString().compareToIgnoreCase(\"t\") == 0);\r\n assertTrue(parser.sqlstatements.get(0).joins.getJoin(0).getTable().getAliasClause().toString().compareToIgnoreCase(\"t1\") == 0);\r\n\r\n\r\n parser.sqltext = \"select a_join.f1 from (a as a_alias left join a1 on a1.f1 = a_alias.f1 ) as a_join join b on a_join.f1 = b.f1;\";\r\n assertTrue(parser.parse() == 0);\r\n TJoin lcJoin = parser.sqlstatements.get(0).joins.getJoin(0);\r\n //System.out.println(lcJoin.getKind());\r\n assertTrue(lcJoin.getKind() == TBaseType.join_source_join );\r\n\r\n assertTrue(lcJoin.getJoin().toString().compareToIgnoreCase(\"(a as a_alias left join a1 on a1.f1 = a_alias.f1 )\") == 0);\r\n assertTrue(lcJoin.getJoin().getAliasClause().toString().compareToIgnoreCase(\"a_join\") == 0);\r\n assertTrue(lcJoin.getJoin().getJoinItems().getJoinItem(0).getJoinType() == EJoinType.left);\r\n\r\n assertTrue(lcJoin.getJoinItems().getJoinItem(0).getJoinType() == EJoinType.join);\r\n\r\n parser.sqltext = \"select a_join.f1 from (a as a_alias left join a1 on a1.f1 = a_alias.f1 ) as a_join\";\r\n assertTrue(parser.parse() == 0);\r\n TJoin lcJoin1 = parser.sqlstatements.get(0).joins.getJoin(0);\r\n assertTrue(lcJoin1.getKind() == TBaseType.join_source_join );\r\n assertTrue(lcJoin1.getJoin().toString().compareToIgnoreCase(\"(a as a_alias left join a1 on a1.f1 = a_alias.f1 )\") == 0);\r\n assertTrue(lcJoin1.getJoin().getAliasClause().toString().compareToIgnoreCase(\"a_join\") == 0);\r\n\r\n }", "public void createSQLQuery(String s, String returnAlias, Class<?> returnClass)\n throws HibException;", "public abstract Query<T> setQuery(String oql);", "private String getRevisionTableQuery() {\n \t\tfinal StringBuilder builder = new StringBuilder();\n \n \t\tbuilder.append(\"create table REVISION(\");\n \t\tbuilder.append(\"REVISION_ID LONG PRIMARY KEY,\");\n \t\tbuilder.append(\"REVISION_IDENTIFIER TEXT UNIQUE\");\n \t\tbuilder.append(\")\");\n \n \t\treturn builder.toString();\n \t}", "public PgTablespace(String alias) {\n this(DSL.name(alias), PG_TABLESPACE);\n }", "CampusSearchQuery generateQuery();", "TemperatureQuery createTemperatureQuery();", "public interface ISQLiteJoinTableCreator {\n\n}", "SELECT createSELECT();", "public Table<Integer, Integer, String> getAnonymizedData();", "@Test(timeout = 4000)\n public void test042() throws Throwable {\n String[] stringArray0 = new String[5];\n String string0 = SQLUtil.innerJoin(\"alter materialized viewjcsh%4%|@v9\", stringArray0, \"create materialized viewjcsh%4%|@v9\", \"\", stringArray0);\n assertEquals(\"create materialized viewjcsh%4%|@v9 as on alter materialized viewjcsh%4%|@v9.null = .null and alter materialized viewjcsh%4%|@v9.null = .null and alter materialized viewjcsh%4%|@v9.null = .null and alter materialized viewjcsh%4%|@v9.null = .null and alter materialized viewjcsh%4%|@v9.null = .null\", string0);\n }", "@Test\n public void testRightOuterJoinWithAliases() throws Exception {\n String sql = \"Select myG.a myA, myH.b from g myG right outer join h myH on myG.x=myH.x\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n verifyAliasSymbolWithElementSymbol(selectNode, Select.SYMBOLS_REF_NAME, 1, \"myA\", \"myG.a\");\n verifyElementSymbol(selectNode, Select.SYMBOLS_REF_NAME, 2, \"myH.b\");\n\n Node fromNode = verify(queryNode, Query.FROM_REF_NAME, From.ID);\n\n Node jpNode = verify(fromNode, From.CLAUSES_REF_NAME, JoinPredicate.ID);\n verifyJoin(jpNode, JoinTypeTypes.JOIN_RIGHT_OUTER);\n\n verifyUnaryFromClauseGroup(jpNode, JoinPredicate.LEFT_CLAUSE_REF_NAME, \"myG\", \"g\");\n verifyUnaryFromClauseGroup(jpNode, JoinPredicate.RIGHT_CLAUSE_REF_NAME, \"myH\", \"h\");\n\n Node criteriaNode = verify(jpNode, JoinPredicate.JOIN_CRITERIA_REF_NAME, CompareCriteria.ID);\n verifyProperty(criteriaNode, AbstractCompareCriteria.OPERATOR_PROP_NAME, CriteriaOperator.Operator.EQ.name());\n\n Node leftExpression = verify(criteriaNode, AbstractCompareCriteria.LEFT_EXPRESSION_REF_NAME, ElementSymbol.ID);\n verifyProperty(leftExpression, Symbol.NAME_PROP_NAME, \"myG.x\");\n\n Node rightExpression = verify(criteriaNode, CompareCriteria.RIGHT_EXPRESSION_REF_NAME, ElementSymbol.ID);\n verifyProperty(rightExpression, Symbol.NAME_PROP_NAME, \"myH.x\");\n \n verifySql(\"SELECT myG.a AS myA, myH.b FROM g AS myG RIGHT OUTER JOIN h AS myH ON myG.x = myH.x\", fileNode);\n }", "QueryKey createQueryKey(String name);", "AliasVariable createAliasVariable();", "public TableName name();", "@Override\n protected Map<TableUniqueName, String> tableSubstitution() {\n return ImmutableMap.of();\n }", "private void montaQuery(Publicacao object, Query q) {\t\t\n\t}", "Query query();", "SqlTables(String tableName){\n\t\t\t this.tableName = tableName; \n\t\t}", "PivotInClause createPivotInClause();", "protected Query newGraphSynonymQuery(Iterator<Query> queries) {\n BooleanQuery.Builder builder = new BooleanQuery.Builder();\n while (queries.hasNext()) {\n builder.add(queries.next(), BooleanClause.Occur.SHOULD);\n }\n BooleanQuery bq = builder.build();\n if (bq.clauses().size() == 1) {\n return bq.clauses().get(0).getQuery();\n }\n return bq;\n }", "public void createQuery(ResultSet rs, String Query) throws SQLException {\n this.data.add(new QueryConversionData(rs));\n this.queryHistory.add(Query);\n }", "public abstract String toSQL();", "public PgTablespace(Name alias) {\n this(alias, PG_TABLESPACE);\n }", "public abstract String[] createTablesStatementStrings();", "public Query() {\n\n// oriToRwt = new HashMap();\n// oriToRwt.put(); // TODO\n }", "public void testOneTableSyn() {\n\n String\tsql\t= \"SELECT t.AD_Table_ID, t.TableName FROM AD_Table t WHERE t.IsActive='Y'\";\n AccessSqlParser\tfixture\t= new AccessSqlParser(sql);\n\n assertEquals(\"AccessSqlParser[AD_Table=t|0]\", fixture.toString());\n }", "private void appendTempTableRightSideJoin(\r\n Object source,\r\n Attribute[] prototypeAttributes,\r\n MithraFastList<Attribute> nullAttributes,\r\n int pkAttributeCount,\r\n TupleTempContext tempContext,\r\n StringBuilder builder)\r\n {\r\n builder.append(tempContext.getFullyQualifiedTableName(source, this.getMithraObjectPortal().getPersisterId()));\r\n builder.append(\" t1 where \");\r\n this.constructJoin(prototypeAttributes, nullAttributes, pkAttributeCount, builder);\r\n }", "private String getQueSortSQL() {\n String[] sortArr = {\"kca_title\", \"que_title\", \"ans_count\", \"que_type\", \"que_create_timestamp\", \"ans_vote_for\"};\n sort_vec = cwUtils.String2vector(sortArr, false);\n String defaultSortColumn = \"que_create_timestamp\";\n String defaultOrder = \"desc\";\n String sortSQL = dbUtils.getSortSQL(sort_vec, sort, dir, defaultSortColumn.toLowerCase(), defaultOrder);\n if (this.sort == null) {\n this.sort = defaultSortColumn;\n }\n if (this.dir == null) {\n this.dir = defaultOrder;\n }\n\n return sortSQL;\n }", "protected void createSubQueryJoinTable() throws ODataApplicationException {\r\n try {\r\n final List<JPAOnConditionItem> left = association\r\n .getJoinTable()\r\n .getJoinColumns(); // Team -->\r\n final List<JPAOnConditionItem> right = association\r\n .getJoinTable()\r\n .getInverseJoinColumns(); // Person -->\r\n createSelectClauseJoin(subQuery, queryRoot, right);\r\n Expression<Boolean> whereCondition = createWhereByAssociation(from, queryJoinTable, left);\r\n whereCondition = cb.and(whereCondition, createWhereByAssociation(queryJoinTable, queryRoot, right));\r\n subQuery.where(applyAdditionalFilter(whereCondition));\r\n } catch (final ODataJPAModelException e) {\r\n throw new ODataJPAQueryException(e, HttpStatusCode.INTERNAL_SERVER_ERROR);\r\n }\r\n\r\n }", "public interface IQuery {\n String getTableName();\n void setParameter(String name, Object value);\n}", "public void testEmbeddedFrom() {\n\n String\tsql\t= \"SELECT t.AD_Table_ID, t.TableName, cc.CCount \" + \"FROM AD_Table t,\" + \"(SELECT COUNT(ColumnName) AS CCount FROM AD_Column) cc \" + \"WHERE t.IsActive='Y'\";\n AccessSqlParser\tfixture\t= new AccessSqlParser(sql);\n\n assertEquals(\"AccessSqlParser[AD_Column|AD_Table=t,(##)=cc|1]\", fixture.toString());\n }", "EQLDecomposition createEQLDecomposition();", "public Query advancedQuery() \n {\n return null;\n }", "private String getQuery(Predicate p, HashMap<String, String> keyObjects) {\n\tString query = \"\";\n\tString tableName = p.getName();\n\tfor (int i = 0; i < p.getVars().size(); i++) {\n\t String var = p.getVars().get(i);\n\t String propertyName = var;\n\t boolean isJoin = false;\n\t if (var.endsWith(\"*\")) {\n\t\tvar = var.substring(0, var.length() - 1);\n\t\tpropertyName = var;\n\t } else {\n\t\t// check if this var is in the hashmap\n\t\t// if it is, it is a foreign key, so I have to replace\n\t\t// the object with the one from the map\n\t\tString obj = keyObjects.get(var);\n\t\tif (obj != null) {\n\t\t var = obj;\n\t\t isJoin = true;\n\t\t}\n\t }\n\t objectURI.put(var, \"o_\" + tableName);\n\t if (isJoin)\n\t\tquery += \" ?o_\" + tableName + \" vocab:\" + tableName + \"_\"\n\t\t\t+ propertyName + \" ?\" + var + \" . \\n\";\n\t else\n\t\tquery += \" OPTIONAL { ?o_\" + tableName + \" vocab:\" + tableName\n\t\t\t+ \"_\" + propertyName + \" ?\" + var + \" . } \\n\";\n\t}\n\t// System.out.println(\"PQ=\" + query);\n\treturn query;\n }", "FromTable createFromTable();", "public String toSQL(boolean fuzzySearch){\n return toSQL();\n }", "private String getCloneGenealogyTableQuery() {\n \t\tfinal StringBuilder builder = new StringBuilder();\n \n \t\tbuilder.append(\"create table CLONE_GENEALOGY(\");\n \t\tbuilder.append(\"CLONE_GENEALOGY_ID LONG PRIMARY KEY,\");\n \t\tbuilder.append(\"START_REVISION_ID LONG,\");\n \t\tbuilder.append(\"END_REVISION_ID LONG,\");\n \t\tbuilder.append(\"CLONES TEXT NOT NULL,\");\n \t\tbuilder.append(\"CLONE_LINKS TEXT NOT NULL,\");\n \t\tbuilder.append(\"CHANGES INTEGER,\");\n \t\tbuilder.append(\"ADDITIONS INTEGER,\");\n \t\tbuilder.append(\"DELETIONS INTEGER,\");\n \t\tbuilder.append(\"DEAD INTEGER\");\n \t\tbuilder.append(\")\");\n \n \t\treturn builder.toString();\n \t}", "protected JPAQuery<T> createQuery() {\n\t\tJPAQuery<T> query = new JPAQuery<>(entityManager);\n\t\tquery.from(getDslRoot());\n\t\treturn query;\n\t}", "public void setQuery (String q)\n\t throws QueryParseException\n {\n\n\tthis.q = new Query ();\n\tthis.q.parse (q);\n\n\tthis.badQuery = false;\n\tthis.exp = null;\n\n\tthis.checkFrom ();\n\n }" ]
[ "0.57763034", "0.562692", "0.54074913", "0.54036075", "0.5355185", "0.5348665", "0.53295916", "0.5321602", "0.5294259", "0.5277284", "0.52269155", "0.52169335", "0.52042764", "0.51783496", "0.5160695", "0.51191896", "0.5115588", "0.5072912", "0.5071876", "0.50695837", "0.50664145", "0.5056446", "0.5042786", "0.5039551", "0.5032311", "0.50156647", "0.5009466", "0.4999372", "0.49990287", "0.49499363", "0.48917115", "0.48742172", "0.48549595", "0.48549503", "0.48422545", "0.48368594", "0.481696", "0.4814674", "0.48059735", "0.47995463", "0.4798703", "0.47910076", "0.47819528", "0.47673142", "0.4762639", "0.4755822", "0.4749379", "0.47486654", "0.47463962", "0.4741776", "0.47414228", "0.47350392", "0.4727718", "0.4698945", "0.46982643", "0.4686765", "0.4683584", "0.4683445", "0.467879", "0.46638626", "0.46529645", "0.46490428", "0.46429205", "0.4629149", "0.46198213", "0.46178508", "0.46122426", "0.46094322", "0.46044305", "0.46017617", "0.45924717", "0.45915633", "0.45853758", "0.4584811", "0.45816088", "0.45743746", "0.45704362", "0.45693347", "0.45681733", "0.45649636", "0.4564498", "0.455868", "0.45511797", "0.4539495", "0.45343956", "0.452839", "0.45271719", "0.45217457", "0.45196417", "0.45176277", "0.4512944", "0.45052546", "0.45051768", "0.45034346", "0.45017615", "0.44957137", "0.44935167", "0.44905466", "0.4487785", "0.4483461" ]
0.59323645
0
The class holding records for this type
@Override public Class<QsRecord> getRecordType() { return QsRecord.class; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public RecordRecord() {\n\t\tsuper(org.jooq.examples.cubrid.demodb.tables.Record.RECORD);\n\t}", "public Class<?> getRecordClass() \n\t{\n\t return recordClass ;\n\t}", "public DataRecord() {\n super(DataTable.DATA);\n }", "@Override\n public Class<Record> getRecordType() {\n return Record.class;\n }", "@Override\n public Class<Record> getRecordType() {\n return Record.class;\n }", "@Override\n public Class<Record> getRecordType() {\n return Record.class;\n }", "@Override\n public Class<Record> getRecordType() {\n return Record.class;\n }", "public Record() {\n data = new int[DatabaseManager.fieldNames.length];\n }", "@Override\n public Class<PgClassRecord> getRecordType() {\n return PgClassRecord.class;\n }", "@Override\n public Class<ModelRecord> getRecordType() {\n return ModelRecord.class;\n }", "@Override\n\tpublic java.lang.Class<org.jooq.Record> getRecordType() {\n\t\treturn __RECORD_TYPE;\n\t}", "@Override\n\tpublic java.lang.Class<org.jooq.Record> getRecordType() {\n\t\treturn __RECORD_TYPE;\n\t}", "@Override\n\tpublic java.lang.Class<org.jooq.Record> getRecordType() {\n\t\treturn __RECORD_TYPE;\n\t}", "public ARecord() {\n super(A.A);\n }", "@Override\n\tpublic java.lang.Class<org.jooq.Record> getRecordType() {\n\t\treturn org.jooq.Record.class;\n\t}", "@Override\n\tpublic java.lang.Class<org.jooq.Record> getRecordType() {\n\t\treturn org.jooq.Record.class;\n\t}", "@Override\n\tpublic java.lang.Class<org.jooq.Record> getRecordType() {\n\t\treturn org.jooq.Record.class;\n\t}", "public ObjectRecord() {\n\t\tsuper(org.jooq.test.hsqldb.generatedclasses.tables.Object.OBJECT);\n\t}", "public WERecordDataModel()\n\t{\n\t\tsuper();\n\t\tsetEqFileName(RECORD_NAME);\n\t\tinitMessages();\n\t}", "public Record toRecord() {\n return new Record().setColumns(this);\n }", "DataHRecordData() {}", "@Override\n public Class<ResourcesRecord> getRecordType() {\n return ResourcesRecord.class;\n }", "public GO_RecordType() {\n }", "public ItemRecord() {\n super(Item.ITEM);\n }", "public Record getRecord() {\n return record;\n }", "public Record getRecord() {\n return record;\n }", "@Override\n\tpublic Class<Record> getRecordType() {\n\t\treturn Record.class;\n\t}", "@Override\n\tpublic Class<Record> getRecordType() {\n\t\treturn Record.class;\n\t}", "@Override\n public Class<LinearmodelRecord> getRecordType() {\n return LinearmodelRecord.class;\n }", "@JsonProperty(\"Records\") abstract List<?> getRecords();", "public Item_Record() {\n super(Item_.ITEM_);\n }", "@Override\n public Class<MytableRecord> getRecordType() {\n return MytableRecord.class;\n }", "@Override\n protected Class<RecordType> getBoundType() {\n return RecordType.class;\n }", "@Override\n public Class<PatientRecord> getRecordType() {\n return PatientRecord.class;\n }", "public interface CollectionRecord {\n\n\t/**\n\t * Gets the id attribute of the CollectionRecord object\n\t *\n\t * @return The id value\n\t */\n\tpublic String getId();\n\n\n\t/**\n\t * Gets the setSpec attribute of the CollectionRecord object\n\t *\n\t * @return The setSpec value\n\t */\n\tpublic String getSetSpec();\n\n\n\t/**\n\t * Gets the metadataHandle attribute of the CollectionRecord object\n\t *\n\t * @param collectionSetSpec setSpec (e.g., \"dcc\")\n\t * @return The metadataHandle value\n\t * @exception Exception if there is a webservice error\n\t */\n\tpublic String getMetadataHandle(String collectionSetSpec) throws Exception;\n\n\n\t/**\n\t * Gets the handleServiceBaseUrl attribute of the CollectionRecord object\n\t *\n\t * @return The handleServiceBaseUrl value\n\t */\n\tpublic String getHandleServiceBaseUrl();\n\n\t/* \tpublic String getNativeFormat();\n\tpublic DcsDataRecord getDcsDataRecord();\n\tpublic MetaDataFramework getMetaDataFramework();\n\tpublic Document getLocalizedDocument(); */\n}", "@Override\n\tpublic Class<QuotesRecord> getRecordType() {\n\t\treturn QuotesRecord.class;\n\t}", "@Override\n public Class<AnalysisRecord> getRecordType() {\n return AnalysisRecord.class;\n }", "public Record() {\n this.symptoms = new LinkedHashSet<>();\n this.diagnoses = new LinkedHashSet<>();\n this.prescriptions = new LinkedHashSet<>();\n }", "public OpenERPRecordSet() {\r\n\t\trecords = new Vector<OpenERPRecord>();\r\n\t}", "@Override\n public Class<QuestionForBuddysRecord> getRecordType() {\n return QuestionForBuddysRecord.class;\n }", "public QuestionsRecord() {\n\t\tsuper(sooth.entities.tables.Questions.QUESTIONS);\n\t}", "public Data() {\n this.customers = new HashMap<>();\n this.orders = new HashMap<>();\n this.siteVisits = new HashMap<>();\n this.imageUploads = new HashMap<>();\n }", "public GenericData.Record serialize() {\n return null;\n }", "public GenericTcalRecord() {\n this(-1);\n }", "public StudentRecord() {\n\t\tscores = new ArrayList<>();\n\t\taverages = new double[5];\n\t}", "@Override\n public Class<CarmodelRecord> getRecordType() {\n return CarmodelRecord.class;\n }", "@Override\n public Class<MemberRecord> getRecordType() {\n return MemberRecord.class;\n }", "public BookRecord() {\n super(Book.BOOK);\n }", "@Override\n public Class<SearchLogsRecord> getRecordType() {\n return SearchLogsRecord.class;\n }", "@Override\n public Class<EasytaxTaxationsRecord> getRecordType() {\n return EasytaxTaxationsRecord.class;\n }", "public SalesRecords() {\n super();\n }", "public SongRecord(){\n\t}", "@Override\n public Class<LangsRecord> getRecordType() {\n return LangsRecord.class;\n }", "public PersonRecord(){\n\t\tlistNames = new ArrayList<String>();\n\t}", "@Override\n public Class<RoomRecord> getRecordType() {\n return RoomRecord.class;\n }", "@Override\n public Class<CalcIndicatorAccRecordInstanceRecord> getRecordType() {\n return CalcIndicatorAccRecordInstanceRecord.class;\n }", "public ArrayList<Record> getRecords() {\r\n\t\treturn records;\r\n\t}", "@Override\n public Class<CourseRecord> getRecordType() {\n return CourseRecord.class;\n }", "@Override\n public Class<CabTripDataRecord> getRecordType() {\n return CabTripDataRecord.class;\n }", "@Override\n public Class<TripsRecord> getRecordType() {\n return TripsRecord.class;\n }", "public Item_Record(Integer _Id_, String name_, String description_, String code_, Double price_, Double retailPrice_, Double costPrice_, Object _Search_, String[] _Types_, String _LastModified_, Integer _Version_) {\n super(Item_.ITEM_);\n\n set(0, _Id_);\n set(1, name_);\n set(2, description_);\n set(3, code_);\n set(4, price_);\n set(5, retailPrice_);\n set(6, costPrice_);\n set(7, _Search_);\n set(8, _Types_);\n set(9, _LastModified_);\n set(10, _Version_);\n }", "@Override\r\n\tpublic List<T> getRecords() {\n\t\treturn null;\r\n\t}", "@Override\n public Class<StudentCourseRecord> getRecordType() {\n return StudentCourseRecord.class;\n }", "@Override\n public Class<ZTest1Record> getRecordType() {\n return ZTest1Record.class;\n }", "public OfcRecordRecord() {\n\t\tsuper(org.openforis.collect.persistence.jooq.tables.OfcRecord.OFC_RECORD);\n\t}", "public Class<gDBR> getRecordClass() \n {\n return this.rcdClass;\n }", "public RecordingRepository() {\r\n recordings = new ArrayList<>();\r\n recordingMap = new HashMap<>();\r\n recordingsByMeetingIDMap = new HashMap<>();\r\n update();\r\n }", "@Override\n public Class<GchCarLifeBbsRecord> getRecordType() {\n return GchCarLifeBbsRecord.class;\n }", "@Override\n\tpublic java.lang.Class<nesi.jobs.tables.records.HourlyRecordRecord> getRecordType() {\n\t\treturn nesi.jobs.tables.records.HourlyRecordRecord.class;\n\t}", "@Override\n public Class<AccountRecord> getRecordType() {\n return AccountRecord.class;\n }", "public ExperimentRecord() {\n super(Experiment.EXPERIMENT);\n }", "public MealRecord() {\n\t\tsuper(Meal.MEAL);\n\t}", "@Override\n public Class<StaffRecord> getRecordType() {\n return StaffRecord.class;\n }", "public LateComingRecord() {\n\t\t}", "@Override\n public Class<AssessmentStudenttrainingworkflowRecord> getRecordType() {\n return AssessmentStudenttrainingworkflowRecord.class;\n }", "public UsersRecord() {\n super(Users.USERS);\n }", "@Override\n public Class<MyMenuRecord> getRecordType() {\n return MyMenuRecord.class;\n }", "public DataPersistence() {\n storage = new HashMap<>();\n idCounter = 0;\n }", "public AnswerRecord() {\n super(Answer.ANSWER);\n }", "public DatasetReader()\n\t{\n\t\treviews = new ArrayList<Review>();\n\t\tratings = new HashMap<Double,List<Double>>();\n\t\tproducts = new HashMap<String, Map<String,Double>>();\n\t\tproductRatings = new HashMap<String, List<Double>>();\n\t\treInstanceList = new ArrayList<ReviewInstance>();\n\t\treInstanceMap = new HashMap<String, ReviewInstance>();\n\t}", "@Override\n public Class<JournalEntryLineRecord> getRecordType() {\n return JournalEntryLineRecord.class;\n }", "@Override\n public Class<CommentsRecord> getRecordType() {\n return CommentsRecord.class;\n }", "@Override\n public Class<SpeedAlertsHistoryRecord> getRecordType() {\n return SpeedAlertsHistoryRecord.class;\n }", "@Override\n public Class<RatingsRecord> getRecordType() {\n return RatingsRecord.class;\n }", "@Override\n public Class<TOpLogsRecord> getRecordType() {\n return TOpLogsRecord.class;\n }", "@Override\n\tpublic java.lang.Class<net.user1.union.zz.common.model.tables.records.ZzcronRecord> getRecordType() {\n\t\treturn __RECORD_TYPE;\n\t}", "@SuppressWarnings(\"unchecked\")\n\tpublic RelationClass() {\n\t\t\n\t\tParser pars = new Parser(FILE_NAME); \t\t\t\t\t\t\t\n\t\tint bucketlength = 0;\n\t\tbucketlength = (int) (pars.getNumOfLines()*BUCKET_MULTIPLIER);\n\t\tbuckets = (Node<k,v>[]) new Node<?,?>[bucketlength];\n\t\tpars.process(this);\t\t\t\t\t\t\t\t\t\t\t\t\n\t}", "@Override\n\tpublic java.lang.Class<persistencia.tables.records.AsientoRecord> getRecordType() {\n\t\treturn persistencia.tables.records.AsientoRecord.class;\n\t}", "@Override\n public Class<StatsRecord> getRecordType() {\n return StatsRecord.class;\n }", "@Override\n\tpublic Class<QuestionRecord> getRecordType() {\n\t\treturn QuestionRecord.class;\n\t}", "public MetricSchemaRecord() { }", "public PedidoRecord() {\n super(Pedido.PEDIDO);\n }", "@Override\n public Class<DynamicSchemaRecord> getRecordType() {\n return DynamicSchemaRecord.class;\n }", "public PersonRecord() {}", "@Override\n\tpublic Class<RentalRecord> getRecordType() {\n\t\treturn RentalRecord.class;\n\t}", "public PagesRecord() {\n super(Pages.PAGES);\n }", "@Override\n public Class<AbsenceRecord> getRecordType() {\n return AbsenceRecord.class;\n }", "@Override\n public Class<RedpacketConsumingRecordsRecord> getRecordType() {\n return RedpacketConsumingRecordsRecord.class;\n }", "@Override\n\tpublic java.lang.Class<jooq.model.tables.records.TBasicSalaryRecord> getRecordType() {\n\t\treturn jooq.model.tables.records.TBasicSalaryRecord.class;\n\t}", "public YearlyRecord() {\n this.wordToCount = new HashMap<String, Integer>();\n this.wordToRank = new HashMap<String, Integer>();\n this.countToWord = new HashMap<Integer, Set<String>>();\n }" ]
[ "0.68004626", "0.66954035", "0.64103794", "0.6398801", "0.6398801", "0.6398801", "0.6398801", "0.6393993", "0.6354873", "0.6192012", "0.61258304", "0.61258304", "0.61258304", "0.6104736", "0.60470754", "0.60470754", "0.60470754", "0.6040716", "0.6029211", "0.6020949", "0.6008978", "0.60082155", "0.6006576", "0.59703285", "0.5949182", "0.5949182", "0.59396815", "0.59396815", "0.5936131", "0.5935658", "0.5895888", "0.5895527", "0.5893964", "0.5884042", "0.58751285", "0.58681023", "0.5865894", "0.5864961", "0.5855157", "0.5851545", "0.58495414", "0.58392423", "0.58338994", "0.58154637", "0.58069575", "0.57927567", "0.578939", "0.57841045", "0.5779981", "0.5753099", "0.5741735", "0.57333666", "0.57321835", "0.5731796", "0.57317585", "0.572287", "0.5720141", "0.5712233", "0.56939065", "0.56927073", "0.5685293", "0.56847894", "0.5683809", "0.56834316", "0.56828403", "0.56666017", "0.56607187", "0.56579894", "0.5648655", "0.56438047", "0.5620551", "0.561873", "0.5609984", "0.55931836", "0.55871445", "0.5586237", "0.55789423", "0.55779636", "0.55737203", "0.55702287", "0.55692416", "0.5561011", "0.5559403", "0.5543905", "0.5541634", "0.5536858", "0.5522634", "0.5517553", "0.5517258", "0.5512109", "0.5509594", "0.55070907", "0.5496529", "0.54921997", "0.5491354", "0.5486711", "0.5481696", "0.54758567", "0.5471066", "0.54659206" ]
0.59716636
23
TODO Autogenerated method stub
@Override public List<Message> getAll(Object... args) { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public int delete(int t) { return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public int add(Message t) { return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public int insert(Message t) { return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
This is the interface for the Dao for our Catalog Description tool, it handles the database access functionality of the tool
public interface CatalogDescriptionDao { public void init(); /** * Return a catalog description based on the database id * * @param id - the database id of the catalog description * @return - the CatalogDescription */ public CatalogDescription getCatalogDescription(Long id); /** * Return the active catalog description based on the course id * * @param id - the course id of the catalog description * @return - the last version of the CatalogDescription */ public CatalogDescription getCatalogDescription(String course_id); /** * Return the last version of a catalog description based on the course id * * @param id - the course id of the catalog description * @return - the last version of the CatalogDescription (null if nothing is found) */ public CatalogDescription getLastVersionCatalogDescription(String courseId); /** * Return active catalog descriptions that correspond to the given department * (can be null for all) * * @return - the list of CatalogDescription */ public List<CatalogDescription> getCatalogDescriptionsByDepartment(String department); /** * Return active catalog descriptions that correspond to the given department with flag to indicate if we return or not inactive catalog descriptions */ public List<CatalogDescription> getCatalogDescriptionsByDepartment(String department, boolean showInactives); /** * Return active catalog descriptions that correspond to the given academic career * (can be null for all) * * @return - the list of CatalogDescription */ public List<CatalogDescription> getCatalogDescriptionsByCareer(String career); /** * Return active catalog descriptions that correspond to the given academic career with flag to indicate if we return or not inactive catalog descriptions */ public List<CatalogDescription> getCatalogDescriptionsByCareer(String career, boolean showInactives); /** * Return all active catalog descriptions for certificates programs * (can be null for all) * * @return - the list of CatalogDescription */ public List<CatalogDescription> getAllCatalogDescriptionsForCertificate(); /** * Return all active catalog descriptions for certificates programs with flag to indicate if we return or not inactive catalog descriptions */ public List<CatalogDescription> getAllCatalogDescriptionsForCertificate(boolean showInactives); /** * Return active catalog descriptions that correspond to the given criteria map * (can be null for all) * * @return - the list of CatalogDescription */ public List<CatalogDescription> getCatalogDescriptions(Map<String, String> eqCriteria, Map<String, String> searchCriteria); /** * save the catalog description to the database * * @param cd - the catalog description to save * @throws StaleDataException * @throws DatabaseException */ public void saveCatalogDescription(CatalogDescription cd) throws StaleDataException, DatabaseException; /** * Return a list of Course id (used by quartz job to determine if the catalog description is already created) * * @return - the list of Course id */ public List<String> getListCourseId(); /** * @return all active catlog descriptions */ public List<CatalogDescription> getAllCatalogDescriptions(); /** * Set all catalog description to "inactive" status * */ public void setCatalogDescriptionToInactive(); /** * Get catalog description from department that have no description and which are not certificate courses * */ public List<CatalogDescription> getCatalogDescriptionsByDepartmentWithNoDescription(String department); /** * Get catalog description for certificates courses that have no description * */ public List<CatalogDescription> getAllCatalogDescriptionsForCertificatesWithNoDescription(); /** * Get all departments that have at least one catalog description with an empty description * */ public List<String> getDepartmentNameWithAtLeastOneCaWithNoDescription(); /** * return whether or not the specified Catalog Description exists. * * @param course_id - the course_id of the catalog description * @return true if the catalog description exists, false otherwise */ public boolean descriptionExists(String course_id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface DVDCategorieDAO {\n /**\n * This is the method to be used to initialize\n * database resources ie. connection.\n */\n public void setDataSource(DataSource ds);\n\n /**\n * This is the method to be used to create\n * a record in the Graduate table.\n */\n public void create(int id, DVD dvd, Categorie categorie);\n\n /**\n * This is the method to be used to list down\n * a record from the Graduate table corresponding\n * to a passed graduate id.\n */\n public DVDCategorie getDVDCategorie(int id);\n\n /**\n * This is the method to be used to list down\n * all the records from the Graduate table.\n */\n public List<DVDCategorie> listDVDCategorie();\n\n /**\n * This is the method to be used to delete\n * a record from the Graduate table corresponding\n * to a passed graduate id.\n */\n public void delete(Integer id);\n\n /**\n * This is the method to be used to update\n * a record into the Graduate table.\n */\n public void update(Integer id, DVD dvd, Categorie categorie);\n}", "public interface DeptDao {\n //动态查询\n @SelectProvider(type=DeptDynaSqlProvider.class,method = \"selectWithParam\")\n List<Dept> selectByPage(Map<String,Object> params);\n @SelectProvider(type=DeptDynaSqlProvider.class,method = \"count\")\n Integer count(Map<String,Object> params);\n @Select(\"select * from \"+DEPTTABLE+\" \")\n List<Dept> selectAllDept();\n @Select(\"select * from \"+DEPTTABLE+\" where id = #{id}\")\n Dept selectById(int id);\n @Delete(\"delete from \"+DEPTTABLE+\" where id = #{id}\")\n void deleteById(int id);\n //动态插入部门\n @InsertProvider(type=DeptDynaSqlProvider.class,method = \"insertDept\")\n void save(Dept dept);\n //动态修改部门\n @UpdateProvider(type=DeptDynaSqlProvider.class,method = \"updateDept\")\n void update(Dept dept);\n}", "public interface DatabaseTool {\r\n\r\n\t\r\n\t/**\r\n\t * Get all objects from the database. It should retrieve all information and put it into the database. It is important\r\n\t * that the name in the database and the name in the class matches. It is not case sensitive. It will default follow\r\n\t * complex objects.\r\n\t * \r\n\t * This method will close the prepared statement and the connection.\r\n\t * \r\n\t * @param The SQL query to be executed..\r\n\t * @param clazz to be retrieved.\r\n\t * @return of all classes that is retrieved.\r\n\t */\r\n\tpublic <E extends Retrievable> List<E> getObjects(String sql, Class<E> clazz);\r\n\t\r\n\t/**\r\n\t * Get a single object from the database. It should retrieve all information and put it into the database. It is important\r\n\t * that the name in the database and the name in the class matches. It is not case sensitive. It will follow complex objects.\r\n\t * \r\n\t * This method will close the prepared statement and the connection.\r\n\t * \r\n\t * @param The SQL query to be executed.\r\n\t * @param clazz to be retrieved.\r\n\t * @return a instanced object.\r\n\t */\r\n\tpublic <E extends Retrievable> E getObject(String sql, Class<E> clazz);\r\n\t\r\n\t/**\r\n\t * Get a single object from the database. It should retrieve all information and put it into the database. It is important\r\n\t * that the name in the database and the name in the class matches. It is not case sensitive. It will follow complex objects.\r\n\t * \r\n\t * This method will close the prepared statement and the connection.\r\n\t * \r\n\t * @param The SQL query to be executed.\r\n\t * @param clazz to be retrieved.\r\n\t * @param id of the object to be retrieved.\r\n\t * @return a instanced object.\r\n\t */\r\n\tpublic <E extends Retrievable> E getObject(Class<E> clazz, int id);\r\n\t\r\n\t/**\r\n\t * Set a single object from the values. It should retrieve all information and put it into the database. It is important\r\n\t * that the name in the database and the name in the class matches. It is not case sensitive. It will follow complex objects.\r\n\t * \r\n\t * This method will close the prepared statement and the connection.\r\n\t * \r\n\t * @param The SQL query to be executed.\r\n\t * @param clazz to be retrieved.\r\n\t * @return a instanced object.\r\n\t */\r\n\tpublic <E extends Retrievable> void setObject(String sql, E e);\r\n\t\r\n\t/**\r\n\t * Get all objects from the database. It should retrieve all information and put it into the database. It is important\r\n\t * that the name in the database and the name in the class matches. It is not case sensitive.\r\n\t * \r\n\t * This method will close the prepared statement and the connection.\r\n\t * \r\n\t * @param The SQL query to be executed..\r\n\t * @param clazz to be retrieved.\r\n\t * @param follow complex objects as {@link ForeignKey}, {@link OneToMany} and {@link ManyToMany} \r\n\t * @return of all classes that is retrieved.\r\n\t */\r\n\tpublic <E extends Retrievable> List<E> getObjects(String sql, Class<E> clazz, boolean follow);\r\n\t\r\n\t/**\r\n\t * Get a single object from the database. It should retrieve all information and put it into the database. It is important\r\n\t * that the name in the database and the name in the class matches. It is not case sensitive.\r\n\t * \r\n\t * This method will close the prepared statement and the connection.\r\n\t * \r\n\t * @param The SQL query to be executed.\r\n\t * @param clazz to be retrieved.\r\n\t * @param follow complex objects as {@link ForeignKey}, {@link OneToMany} and {@link ManyToMany} \r\n\t * @return a instanced object.\r\n\t */\r\n\tpublic <E extends Retrievable> E getObject(String sql, Class<E> clazz, boolean follow);\r\n\t\r\n\t/**\r\n\t * Get a single object from the database. It should retrieve all information and put it into the database. It is important\r\n\t * that the name in the database and the name in the class matches. It is not case sensitive.\r\n\t * \r\n\t * This method will close the prepared statement and the connection.\r\n\t * \r\n\t * @param The SQL query to be executed.\r\n\t * @param clazz to be retrieved.\r\n\t * @param id of the object to be retrieved.\r\n\t * @param follow complex objects as {@link ForeignKey}, {@link OneToMany} and {@link ManyToMany} \r\n\t * @return a instanced object.\r\n\t */\r\n\tpublic <E extends Retrievable> E getObject(Class<E> clazz, int id, boolean follow);\r\n\t\r\n\t/**\r\n\t * Set a single object from the values. It should retrieve all information and put it into the database. It is important\r\n\t * that the name in the database and the name in the class matches. It is not case sensitive.\r\n\t * \r\n\t * This method will close the prepared statement and the connection.\r\n\t * \r\n\t * @param The SQL query to be executed.\r\n\t * @param clazz to be retrieved.\r\n\t * @param follow complex objects as {@link ForeignKey}, {@link OneToMany} and {@link ManyToMany} \r\n\t * @return a instanced object.\r\n\t */\r\n\tpublic <E extends Retrievable> void setObject(String sql, E e, boolean follow);\r\n\t\r\n\t/**\r\n\t * This will help write a object to a persistent store. \r\n\t * \r\n\t * \r\n\t * @param The SQL query to be executed.\r\n\t * @param clazz to be retrieved.\r\n\t * @return a instanced object.\r\n\t */\r\n\tpublic <E extends Writeable> void storeObject(String sql, E e);\r\n\t\r\n\t/**\r\n\t * This will remove a object from the database. \r\n\t * \r\n\t * \r\n\t * @param The SQL query to be executed.\r\n\t * @param clazz to be retrieved.\r\n\t * @return a instanced object.\r\n\t */\r\n\tpublic <E extends Writeable> void write(String sql);\r\n\r\n\t/**\r\n\t * Read from the database. It will return a cached result set. This result set is closed\r\n\t * and does not keep connection to the database.\r\n\t * \r\n\t * @param sql to be executed.\r\n\t * @return a cached result set.\r\n\t */\r\n\tpublic <E extends Writeable> ResultSet read(CharSequence sql);\r\n\t\r\n\t/**\r\n\t * Read from the database. It will first create a prepared statement before doing the read.\r\n\t * \r\n\t * @param sql to be executed. It must contain the amount ? as the length of the objects.\r\n\t * @return a cached result set.\r\n\t */\r\n\tpublic <E extends Retrievable> ResultSet read(CharSequence sql, Object... objects);\r\n\t\r\n\tpublic <E extends Retrievable> List<E> getObjects(ResultSet resultSet, Class<E> clazz, boolean follow);\r\n\t\r\n\tpublic <E extends Retrievable> E getObject(ResultSet resultSet, Class<E> clazz, boolean follow);\r\n\t\r\n\t/**\r\n\t * @param sql that is update/insert or both\r\n\t * @param objects that is to be used in store as parameters to the sql..\r\n\t * @return number of rows updated.\r\n\t */\r\n\tpublic int write(String sql, Object... objects);\r\n\t\r\n\tpublic int writeGetID(String sql, Object... objects);\r\n\t\r\n\tpublic QueryRunner getQueryRunner();\r\n\t\r\n\tpublic Retriver getRetriver();\r\n\r\n\tpublic <E extends Retrievable> E getObject(String sql, Class<E> clazz, Object... objects);\r\n\r\n\tpublic <E extends Retrievable> List<E> getObjects(String sql, Class<E> class1, Object... objects);\r\n\r\n\tpublic <E> E getValue(final String sql, final Class<E> clazz, final String column, final Object... objects);\r\n\t\r\n\tpublic List<Object> getValues(final String sql, final Object... objects);\r\n\t\r\n\tpublic String getServer();\r\n}", "public interface DepartmentDAO {\n\n /**\n * This method is used to retrieve a list of all departments.\n *\n * @return List of generic type {@link Department}\n */\n public List<Department> getAllDepartments();\n\n /**\n * This method is used when adding a department.\n *\n * @param department of type {@link Department}\n */\n public void addDepartment(Department department);\n\n /**\n * This method is used to update the department table.\n *\n * @param department of type {@link Department}\n * @param newDeptName of type String *\n */\n public void updateDepartment(Department department, String newDeptName);\n\n /**\n * This method is used to delete departments by department number.\n *\n * @param dept_no of type integer\n */\n public void deleteDepartmentByDeptNo(int dept_no);\n\n /**\n * This method is use to delete departments by name.\n *\n * @param dept_name of type String\n */\n public void deleteDepartmentByDeptName(String dept_name);\n\n /**\n * This method is responsible for returning a department by dept_no.\n *\n * @param dept_no of type integer\n * @return ResultSet\n */\n public ResultSet getDepartmentByID(int dept_no);\n\n /**\n * This method is responsible for returning a department by dept_name\n *\n * @param dept_name of type String\n * @return ResultSet\n */\n public ResultSet getDepartmentByName(String dept_name);\n}", "public DescritoresDAO() {\n\t\t\n\t}", "public abstract DbDAO AccessToDAO();", "public interface RightInfoDAO extends BaseDAO {\n /** The name of the DAO */\n public static final String NAME = \"RightInfoDAO\";\n\n\t/**\n\t * Insert one <tt>RightInfoDTO</tt> object to DB table <tt>azdai_right_info</tt>, return primary key\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>insert into azdai_right_info(code,title,memo,gmt_create,gmt_modify) values (?, ?, ?, ?, ?)</tt>\n\t *\n\t *\t@param rightInfo\n\t *\t@return String\n\t *\t@throws DataAccessException\n\t */\t \n public String insert(RightInfoDTO rightInfo) throws DataAccessException;\n\n\t/**\n\t * Update DB table <tt>azdai_right_info</tt>.\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>update azdai_right_info set title=?, memo=?, gmt_modify='NOW' where (code = ?)</tt>\n\t *\n\t *\t@param rightInfo\n\t *\t@return int\n\t *\t@throws DataAccessException\n\t */\t \n public int update(RightInfoDTO rightInfo) throws DataAccessException;\n\n\t/**\n\t * Query DB table <tt>azdai_right_info</tt> for records.\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>select * from azdai_right_info where (code = ?)</tt>\n\t *\n\t *\t@param code\n\t *\t@return RightInfoDTO\n\t *\t@throws DataAccessException\n\t */\t \n public RightInfoDTO find(String code) throws DataAccessException;\n\n\t/**\n\t * Query DB table <tt>azdai_right_info</tt> for records.\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>select * from azdai_right_info order by code ASC</tt>\n\t *\n\t *\t@return List<RightInfoDTO>\n\t *\t@throws DataAccessException\n\t */\t \n public List<RightInfoDTO> findAll() throws DataAccessException;\n\n\t/**\n\t * Query DB table <tt>azdai_right_info</tt> for records.\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>select * from azdai_right_info order by code ASC</tt>\n\t *\n\t *\t@param userNo\n\t *\t@return List<RightInfoDTO>\n\t *\t@throws DataAccessException\n\t */\t \n public List<RightInfoDTO> findUserRights(String userNo) throws DataAccessException;\n\n\t/**\n\t * Delete records from DB table <tt>azdai_right_info</tt>.\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>delete from azdai_right_info where (code = ?)</tt>\n\t *\n\t *\t@param code\n\t *\t@return int\n\t *\t@throws DataAccessException\n\t */\t \n public int delete(String code) throws DataAccessException;\n\n}", "protected abstract Dao getDaoIntance(Context context);", "public interface DeptDao {\n\n public Dept selectDept(int id);\n\n public List<Dept> queryAll(@Param(\"tableName\") String tableName);\n\n public void login(@Param(\"name\") String name,@Param(\"password\") String password);\n}", "private DAOOfferta() {\r\n\t\ttry {\r\n\t\t\tClass.forName(driverName);\r\n\r\n\t\t\tconn = getConnection(usr, pass);\r\n\r\n\t\t\tps = conn.prepareStatement(createQuery);\r\n\r\n\t\t\tps.executeUpdate();\r\n\t\t} catch (ClassNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (ConnectionException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} finally {\r\n\t\t\t/*closeResource()*/;\r\n\t\t}\r\n\t}", "public interface DcSquadDAO {\n /**\n * Insert one <tt>DcSquadDO</tt> object to DB table <tt>dc_squad</tt>, return primary key\n *\n * <p>\n * The sql statement for this operation is <br>\n * <tt>insert into dc_squad(squad_name,squad_desc,axiser,cubers,followers,investors,status,gmt_create,gmt_modify,attention) values (?, ?, ?, ?, ?, ?, ?, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, ?)</tt>\n *\n *\t@param dcSquad\n *\t@return long\n *\t@throws DataAccessException\n */\n public long insert(DcSquadDO dcSquad) throws DataAccessException;\n\n /**\n * Query DB table <tt>dc_squad</tt> for records.\n *\n * <p>\n * The sql statement for this operation is <br>\n * <tt>select * from dc_squad</tt>\n *\n *\t@return List<DcSquadDO>\n *\t@throws DataAccessException\n */\n public List<DcSquadDO> load() throws DataAccessException;\n\n /**\n * Query DB table <tt>dc_squad</tt> for records.\n *\n * <p>\n * The sql statement for this operation is <br>\n * <tt>select * from dc_squad where (id = ?)</tt>\n *\n *\t@param id\n *\t@return DcSquadDO\n *\t@throws DataAccessException\n */\n public DcSquadDO loadById(long id) throws DataAccessException;\n\n /**\n * Query DB table <tt>dc_squad</tt> for records.\n *\n * <p>\n * The sql statement for this operation is <br>\n * <tt>select * from dc_squad where (squad_name = ?)</tt>\n *\n *\t@param squadName\n *\t@return DcSquadDO\n *\t@throws DataAccessException\n */\n public DcSquadDO loadByName(String squadName) throws DataAccessException;\n\n /**\n * Update DB table <tt>dc_squad</tt>.\n *\n * <p>\n * The sql statement for this operation is <br>\n * <tt>update dc_squad set squad_name=?, squad_desc=?, axiser=?, cubers=?, followers=?, investors=?, status=?, gmt_modify=CURRENT_TIMESTAMP where (id = ?)</tt>\n *\n *\t@param dcSquad\n *\t@return int\n *\t@throws DataAccessException\n */\n public int update(DcSquadDO dcSquad) throws DataAccessException;\n\n /**\n * Delete records from DB table <tt>dc_squad</tt>.\n *\n * <p>\n * The sql statement for this operation is <br>\n * <tt>delete from dc_squad where (id = ?)</tt>\n *\n *\t@param id\n *\t@return int\n *\t@throws DataAccessException\n */\n public int deleteById(long id) throws DataAccessException;\n\n /**\n * Query DB table <tt>dc_squad</tt> for records.\n *\n * <p>\n * The sql statement for this operation is <br>\n * <tt>select * from dc_squad where ((squad_name = ?) AND (axiser = ?) AND (cubers = ?) AND (followers = ?) AND (investors = ?) AND (status = ?) AND (gmt_create = ?) AND (gmt_modify = ?))</tt>\n *\n *\t@param squadName\n *\t@param axiser\n *\t@param cubers\n *\t@param followers\n *\t@param investors\n *\t@param status\n *\t@param gmtCreate\n *\t@param gmtModify\n *\t@param pageSize\n *\t@param pageNum\n *\t@return PageList\n *\t@throws DataAccessException\n */\n public PageList query(String squadName, String axiser, String cubers, String followers,\n String investors, String status, Date gmtCreate, Date gmtModify,\n int pageSize, int pageNum) throws DataAccessException;\n\n /**\n * Update DB table <tt>dc_squad</tt>.\n *\n * <p>\n * The sql statement for this operation is <br>\n * <tt>update dc_squad set attention=? where (id = ?)</tt>\n *\n *\t@param attention\n *\t@param id\n *\t@return int\n *\t@throws DataAccessException\n */\n public int updateAttention(long attention, long id) throws DataAccessException;\n\n}", "public interface CategoryDAO extends DAO<AbsractCategory> {\n\n /**\n * getting exactly one category specified by the given id\n *\n * @param identificaitonNumber of the category to search for\n * @return exactely one category\n * @throws PersistenceException\n */\n AbsractCategory searchByID(int identificaitonNumber) throws PersistenceException;\n\n /**\n * getting a list of all equipment categorys\n *\n * @return a list of all equipment categorys like, kurzhantel, langhantel, springschnur ...\n * @throws PersistenceException\n */\n List<EquipmentCategory> getAllEquipment() throws PersistenceException;\n\n /**\n * getting a list of all muscle groups\n *\n * @return a list of all muslce groups like, bauchmuskeln, oberschenkel, unterschenkel ...\n * @throws PersistenceException\n */\n List<MusclegroupCategory> getAllMusclegroup() throws PersistenceException;\n\n /**\n * getting a list of all trainingstypes\n *\n * @return a list of all trainingstypes: ausdauer, kraft, balance, flexibilitaet\n * @throws PersistenceException\n */\n List<TrainingsCategory> getAllTrainingstype() throws PersistenceException;\n\n}", "@Override\n public CatalogDAO getCatalogDao() {\n return daoCatalog;\n }", "public EtiquetaDao() {\n //subiendola en modo Embedded\n this.sql2o = new Sql2o(\"jdbc:h2:~/demojdbc\", \"sa\", \"\");\n createTable();\n //cargaDemo();\n }", "public interface BaseDao {\n\n int getTotalCount(SelectArgs selectArgs);\n\n List<Map<String,Object>> queryList(SelectArgs selectArgs);\n\n int addRecord (InsertArgs insertArgs);\n}", "public interface ConProcessDao {\n\n\t/**\n\t * Judgement whether the record of specified contract id is exist in the contract process table\n\t * \n\t * @param conId Contract id\n\t * @return boolean Return true if exist,otherwise return false\n\t * @throws AppException\n\t */\n\tpublic boolean isExist(int conId) throws AppException;\n\t\n\t/**\n\t * Add contract operation process information\n\t * \n\t * @param conProcess Contract process object\n\t * @return boolean Return true if successful , otherwise false \n\t * @throws AppException\n\t */\n\tpublic boolean add(ConProcess conProcess) throws AppException;\n\t\n\t/**\n\t * Query all contract ids that meet the conditions from contract process table\n\t * \n\t * @param Contract process object\n\t * @return Contract id set\n\t * @throws AppException\n\t */\n\tpublic List<Integer> getConIds(ConProcess conProcess) throws AppException;\n\t\n\t/**\n\t * Update status,content and time of contract process according to userId, userId and operation type\n\t * \n\t * @param userId User id\n\t * @param conId Contract id\n\t * @param type Operation type\n\t * @return boolean Return true if successful , otherwise false \n\t * @throws AppException\n\t */\n\tpublic boolean update(ConProcess conProcess) throws AppException;\n\t\n\t/**\n\t * Query total number of eligible records from contract process table according to contract id, operation type and its processing state\n\t * \n\t * @param con_id Contract id\n\t * @param type Operation type\n\t * @param state Processing state of Operation type\n\t * @return Total number of eligible records\n\t * @throws AppException\n\t */\n\tpublic int getTotalCount(ConProcess conProcess) throws AppException;\n\t\n\t/**\n\t * Query contract process id set according to contract id,operation type and its corresponding operation state\n\t * \n\t * @param conId Contract id\n\t * @param type Operation type \n\t * @param state Operation state that corresponding operation type\n\t * @return Contract process id set \n\t * @throws AppException\n\t */\n\tpublic List<Integer> getIds(int conId, int type, int state) throws AppException;\n\t\n\t/**\n\t * Query contract process information according to contract process\n\t * \n\t * @param id Contract id\n\t * @return Contract process object\n\t * @throws AppException\n\t */\n\tpublic ConProcess getById(int id) throws AppException;\n\t\n}", "public OnibusDAO() {}", "public interface IndentDao extends BaseDao<Indent,Integer>{\n\n /**\n * 通过订单关联查询到买家信息\n */\n void queryBuyerByIndentNO();\n}", "public interface DAOjdbc\n{\n Boolean admin_log(String u,String p) throws SQLException, ClassNotFoundException;\n Boolean add_topic(String l,String n,String r) throws SQLException, ClassNotFoundException;\n List<Topic> topic(String t) throws SQLException, ClassNotFoundException;\n List<Topic> Select_topic(String i) throws SQLException, ClassNotFoundException;\n Boolean add_tou(String p) throws SQLException, ClassNotFoundException;\n Boolean add_Info(String n,String c,String t,String m) throws SQLException, ClassNotFoundException;\n Boolean add_user(String n,String p,String pw,String t,String m) throws SQLException, ClassNotFoundException;\n User select_user(String u,String p) throws SQLException, ClassNotFoundException;\n}", "public ServiceDAO(){\n\t\t\n\t\tString[] tables = new String[]{\"CUSTOMERS\",\"PRODUCTS\"};\n\t\tfor(String table:tables){\n\t\t\tif(!checkIfDBExists(table)){\n\t\t\t\ttry{\n\t\t\t\t\tnew DerbyDataLoader().loadDataFor(table);\n\t\t\t\t}\n\t\t\t\tcatch(Exception e){\n\t\t\t\t\tlogger.error(\"Error Loading the Data into the Derby\");\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public interface ContentUpgradeDao extends EntityObjectDao{\r\n\t/**\r\n\t * 新建时检测是否名字重复\r\n\t * @param name\r\n\t * @return\r\n\t */\r\n\tboolean obtainNameExists(String name);\r\n\t\r\n\t/**\r\n\t * 更新时检测是否有重复\r\n\t * @param name\r\n\t * @param uuid\r\n\t * @return\r\n\t */\r\n\tboolean obtainNameExists(String name, String uuid);\r\n\r\n\t/**\r\n\t * 获取指定关键词和分页信息的内容升级列表\r\n\t * @param keyword 查找的关键词\r\n\t * @param startPosition 起始位置\r\n\t * @param size 获取大小\r\n\t * @return\r\n\t */\r\n\tList<ContentUpgrade> loadContentUpgrades(String keyword, int startPosition, int size);\r\n\t\r\n\t/**\r\n\t * 获取指定关键词的数量\r\n\t * @param keyword 指定关键词\r\n\t * @return\r\n\t */\r\n\tint loadAmount(String keyword);\r\n\t\r\n\t\r\n\tList<ContentUpgrade> loadAllContentUpgrades();\r\n}", "public interface ProductDao {\n\n}", "public interface TechniqueDAO extends GenericDAO<Technique, Integer> {\n\n /**\n * Finds all techniques by given technique's name.\n * @param technique technique's name\n * @return list of all techniques\n */\n public abstract List<Technique> findTechniqueByName(String technique);\n\n}", "public interface EpicsDataDao {\n\n /**\n * Delete all EPICS data for a run from the database.\n *\n * @param run the run number\n */\n public void deleteEpicsData(EpicsType epicsType, int run);\n\n /**\n * Get EPICS data by run.\n *\n * @param run the run number\n * @param epicsType the type of EPICS data (1s or 10s)\n * @return the EPICS data\n */\n List<EpicsData> getEpicsData(EpicsType epicsType, int run);\n\n /**\n * Insert a list of EPICS data into the database.\n * <p>\n * The run number comes from the header information.\n *\n * @param epicsDataList the list of EPICS data\n */\n void insertEpicsData(List<EpicsData> epicsDataList, int run);\n}", "public interface CompiereDatabase\n{\n\t/**\n\t * Get Database Name\n\t * @return database short name\n\t */\n\tpublic String getName();\n\n\t/**\n\t * Get Database Description\n\t * @return database long name and version\n\t */\n\tpublic String getDescription();\n\n\t/**\n\t * Get Database Driver\n\t * @return Driver\n\t */\n\tpublic Driver getDriver();\n\n\n\t/**\n\t * Get Standard JDBC Port\n\t * @return standard port\n\t */\n\tpublic int getStandardPort();\n\n\t/**\n\t * Get Database Connection String\n\t * @param connection Connection Descriptor\n\t * @return connection String\n\t */\n\tpublic String getConnectionURL (CConnection connection);\n\n\t/**\n\t * Supports BLOB\n\t * @return true if BLOB is supported\n\t */\n\tpublic boolean supportsBLOB();\n\n\t/**\n\t * String Representation\n\t * @return info\n\t */\n\tpublic String toString();\n\n\t/**************************************************************************\n\t * Convert an individual Oracle Style statements to target database statement syntax\n\t *\n\t * @param oraStatement oracle statement\n\t * @return converted Statement\n\t * @throws Exception\n\t */\n\tpublic String convertStatement (String oraStatement);\n\n\t/**************************************************************************\n\t * Set the RowID\n\t * @param pstmt prepared statement\n\t * @param pos position\n\t * @param rowID ROWID\n\t * @throws SQLException\n\t */\n\tpublic void setRowID (PreparedStatement pstmt, int pos, Object rowID) throws SQLException;\n\n\t/**\n\t * Get rhe RowID\n\t * @param rs result set\n\t * @param pos position\n\t * @return rowID ROWID\n\t * @throws SQLException\n\t */\n\tpublic Object getRowID (ResultSet rs, int pos) throws SQLException;\n\n\t/**\n\t * Get RowSet\n\t * \t@param rs result set\n\t * @return RowSet\n\t * @throws SQLException\n\t */\n\tpublic RowSet getRowSet (ResultSet rs) throws SQLException;\n\n\t/**\n\t * \tGet Cached Connection on Server\n\t *\t@param connection info\n\t *\t@return connection or null\n\t */\n\tpublic Connection getCachedConnection (CConnection connection);\n\n\t/**\n\t * \tCreate DataSource (Client)\n\t *\t@param connection connection\n\t *\t@return data dource\n\t */\n\tpublic DataSource createDataSource(CConnection connection);\n\n\t/**\n\t * \tCreate Pooled DataSource (Server)\n\t *\t@param connection connection\n\t *\t@return data dource\n\t */\n\tpublic ConnectionPoolDataSource createPoolDataSource(CConnection connection);\n\n}", "public interface CompiereDatabase\n{\n\t/**\n\t * Get Database Name\n\t * @return database short name\n\t */\n\tpublic String getName();\n\n\t/**\n\t * Get Database Description\n\t * @return database long name and version\n\t */\n\tpublic String getDescription();\n\n\t/**\n\t * Get Database Driver\n\t * @return Driver\n\t */\n\tpublic Driver getDriver();\n\n\n\t/**\n\t * Get Standard JDBC Port\n\t * @return standard port\n\t */\n\tpublic int getStandardPort();\n\n\t/**\n\t * Get Database Connection String\n\t * @param connection Connection Descriptor\n\t * @return connection String\n\t */\n\tpublic String getConnectionURL (CConnection connection);\n\n\t/**\n\t * Supports BLOB\n\t * @return true if BLOB is supported\n\t */\n\tpublic boolean supportsBLOB();\n\n\t/**\n\t * String Representation\n\t * @return info\n\t */\n\tpublic String toString();\n\n\t/**************************************************************************\n\t * Convert an individual Oracle Style statements to target database statement syntax\n\t *\n\t * @param oraStatement oracle statement\n\t * @return converted Statement\n\t * @throws Exception\n\t */\n\tpublic String convertStatement (String oraStatement);\n\n\t/**************************************************************************\n\t * Set the RowID\n\t * @param pstmt prepared statement\n\t * @param pos position\n\t * @param rowID ROWID\n\t * @throws SQLException\n\t */\n\tpublic void setRowID (PreparedStatement pstmt, int pos, Object rowID) throws SQLException;\n\n\t/**\n\t * Get rhe RowID\n\t * @param rs result set\n\t * @param pos position\n\t * @return rowID ROWID\n\t * @throws SQLException\n\t */\n\tpublic Object getRowID (ResultSet rs, int pos) throws SQLException;\n\n\t/**\n\t * Get RowSet\n\t * \t@param rs result set\n\t * @return RowSet\n\t * @throws SQLException\n\t */\n\tpublic RowSet getRowSet (ResultSet rs) throws SQLException;\n\n\t/**\n\t * \tGet Cached Connection on Server\n\t *\t@param connection info\n\t *\t@return connection or null\n\t */\n\tpublic Connection getCachedConnection (CConnection connection);\n\n\t/**\n\t * \tCreate DataSource (Client)\n\t *\t@param connection connection\n\t *\t@return data dource\n\t */\n\tpublic DataSource createDataSource(CConnection connection);\n\n\t/**\n\t * \tCreate Pooled DataSource (Server)\n\t *\t@param connection connection\n\t *\t@return data dource\n\t */\n\tpublic ConnectionPoolDataSource createPoolDataSource(CConnection connection);\n\n}", "public interface DaoInterface {}", "public interface HelloDao {\n\n String getName();\n\n void InsertAdCustomRelation(AdGroupSum adGroupSum);\n\n}", "public interface ProductDAO {\n\n /**\n * 添加商品\n * @param product\n */\n public void addProduct(Product product);\n\n /**\n * 分页查询\n * @param pager\n * @param fileId\n * @param fType\n * @param days1\n * @return\n */\n public Pager4EasyUI<ProductInfo> pager(Pager4EasyUI<ProductInfo> pager, String fileId, String fType);\n\n /**\n * 计数\n * @param fileId\n * @return\n */\n public int count(String fileId);\n\n /**\n * 批量添加\n */\n public void addProducts(List<Product> products);\n\n}", "public DerivedPartOfPerspectivesFKDAOJDBC() {\n \t\n }", "public interface BaseDao<T , PK> {\n\n /**\n * 获取列表\n *\n * @param queryRule\n * 查询条件\n * @return\n * @throws Exception\n */\n List<T> select(QueryRule queryRule) throws Exception;\n\n /**\n * 获取分页结果\n *\n * @param queryRule\n * 查询条件\n * @param pageNo\n * 页码\n * @param pageSize\n * 每页条数\n * @return\n * @throws Exception\n */\n Page<?> select(QueryRule queryRule , int pageNo , int pageSize) throws Exception;\n\n /**\n * 根据SQL获取列表\n *\n * @param sql\n * sql语句\n * @param args\n * 参数\n * @return\n * @throws Exception\n */\n List<Map<String , Object>> selectBySql(String sql , Object... args) throws Exception;\n\n /**\n * 根据SQL获取分页\n *\n * @param sql\n * SQL语句\n * @param param\n *\n * @param pageNo\n * 页码\n * @param pageSize\n * 每条页码数\n * @return\n * @throws Exception\n */\n Page<Map<String , Object>> selectBySqlToPage(String sql , Object[] param , int pageNo , int pageSize) throws Exception;\n\n /**\n * 删除一条记录\n * @param entity\n * entity中的id不能为空。如果id为空,其他条件不能为空。都为空不执行。\n * @return\n * @throws Exception\n */\n boolean delete(T entity) throws Exception;\n\n /**\n * 批量删除\n * @param list\n * @return 返回受影响的行数\n * @throws Exception\n */\n int deleteAll(List<T> list) throws Exception;\n\n /**\n * 插入一条记录并返回插入后的ID\n * @param entity\n * 只要entity不等于null,就执行插入\n * @return\n * @throws Exception\n */\n PK insertAndReturnId(T entity) throws Exception;\n\n /**\n * 插入一条记录,自增id\n * @param entity\n * @return\n * @throws Exception\n */\n boolean insert(T entity) throws Exception;\n\n /**\n * 批量插入\n *\n * @param list\n * @return\n * 返回受影响的行数\n * @throws Exception\n */\n int insertAll(List<T> list) throws Exception;\n\n /**\n * 修改一条记录\n * @param entity\n * entity中的ID不能为空。如果ID为空,其他条件不能为空。都为空不执行。\n * @return\n * @throws Exception\n */\n boolean update(T entity) throws Exception;\n}", "public interface ProgramaTVDAO {\n\t/**\n\t * Crea una nueva monitorización\n\t * @param titulo Título del programa\n\t * @param episodeCode Código del Episodio (ej. T01E03)\n\t * @param fechaInicio Fecha y hora de Inicio\n\t * @param fechaFin Fecha y hora de Fin\n\t * @param hashtag Hashtag que se monitorizará\n\t * @return Objeto ProgramaTV\n\t */\n\tpublic ProgramaTV crearMonitorizacion(String titulo, String episodeCode, Date fechaInicio, Date fechaFin, String hashtag);\n\n\t/**\n\t * Monitorización por clave primaria\n\t * @param primaryKey Clave primaria\n\t * @return Objeto ProgramaTV\n\t */\n\tpublic ProgramaTV programaPorId(Long primaryKey);\n\t\n\t/**\n\t * Todas las monitorizaciones que llevan el mismo hashtag\n\t * @param hashtag Hashtag\n\t * @return Lista de objetos ProgramaTV\n\t */\n\tpublic List<ProgramaTV> ProgramasPorHashtag(String hashtag);\n\t\n\t/**\n\t * Lista de monitorizaciones del mismo programa\n\t * @param titulo Título del programa\n\t * @return Lista de objetos ProgramaTV\n\t */\n\tpublic List<ProgramaTV> programasPorTitulo(String titulo);\n\t\n\t /**\n\t * Todas las monitorizaciones\n\t * @return Lists de todos los objetos ProgramaTV\n\t */\n\tpublic List<ProgramaTV> todosLosProgramas();\n\t\n\t/**\n\t * Top 5 programas más vistos\n\t * @return Array ordenado de los 5 programas más vistos\n\t */\n\tpublic ProgramaTV[] programasTop5();\n\n\t/**\n\t * Actualiza monitorizacion\n\t * @param prog Objeto ProgramaTV\n\t */\n\tpublic void updateProgramaTV(ProgramaTV prog);\n\n\n\t/**\n\t * Borra una monitorización\n\t * @param prog Clave primaria de la monitorización\n\t */\n\tpublic void deleteProgramaTV(Long prog);\n\t\n\t/**\n\t * Borra todos los programas\n\t */\n\tpublic void deleteAll();\n\t\n\n\t\n\n\t}", "public interface Useful_LinksDAO {\n public void addUseful_Links(Useful_Links useful_links) throws SQLException;\n public void updateUseful_Links(Useful_Links useful_links) throws SQLException;\n public void deleteUseful_Links(Useful_Links useful_links) throws SQLException;\n}", "public interface DAOCompanies {\n\n void create(Company company);\n boolean update (int companyId, Company company);\n Company read(int companyId);\n boolean delete(int companyId);\n void addCompanyToDeveloper(int compId, int devId);\n\n}", "public interface LeadersDao {\r\n\r\n @Select(\"select * from leaders where dept_id=#{deptId}\")\r\n List<Leaders> selectLeadersByDept(@Param(\"deptId\") Integer dept_id);\r\n \r\n @Select(\"select * from leaders where lid=#{lid}\")\r\n Leaders selectLeadersByid(@Param(\"lid\") Integer lid);\r\n\r\n @Insert(\"INSERT INTO leaders (lid,dept_id) \" +\r\n \" VALUES (#{lid},#{deptId})\")\r\n int insertLeader(@Param(\"lid\")Integer lid, @Param(\"deptId\")Integer dept_id);\r\n\r\n @Delete(\"delete from leaders where lid = #{lid}\")\r\n int deleteLeader(Integer lid);\r\n}", "@Inject\n\tpublic AbsenceDaoImpl() throws SQLException {\n\t\tsuper(Absence.class);\n\t}", "public interface TagDAO {\n\n\t/** Tag id for host country - country tag */\n\tpublic static final int HOSTCOUNTRY_COUNTRY_TAG_ID = 2001;\n\t\n\t/** Keywords associated with this dataset */\n\tpublic static final int DATA_RESOURCE_KEYWORDS = 4000;\n\t\n\tpublic static final int DATA_RESOURCE_OCCURRENCES_COUNTRY = 4100;\n\t\n\tpublic static final int DATA_RESOURCE_OCCURRENCES_BOUNDING_BOX = 4101;\n\t\n\tpublic static final int DATA_RESOURCE_OCCURRENCES_WKT_POLYGON = 4102;\n\t\n\tpublic static final int DATA_RESOURCE_OCCURRENCES_DATE_RANGE = 4120;\n\t\n\tpublic static final int DATA_RESOURCE_OCCURRENCES_MONTH = 4121;\n\t\n\tpublic static final int DATA_RESOURCE_OCCURRENCES_SPECIES = 4140;\n\t\n\tpublic static final int DATA_RESOURCE_OCCURRENCES_GENUS = 4141;\n\t\n\tpublic static final int DATA_RESOURCE_OCCURRENCES_FAMILY = 4142;\n\t\n\tpublic static final int DATA_RESOURCE_TAXONOMIC_SCOPE = 4150; \n\t\n\tpublic static final int DATA_RESOURCE_ASSOCIATED_KINGDOM = 4151;\n\n\t/** Species common names associated with this resource */\n\tpublic static final int DATA_RESOURCE_COMMON_NAMES = 4152;\n\n\t/** Indicates whether a data resource contains type records */\n\tpublic static final int DATA_RESOURCE_CONTAINS_TYPE_SPECIMENS = 4160;\n\n\t/** Names of collectors who have collected for this dataset */\n\tpublic static final int DATA_RESOURCE_COLLECTOR = 4161;\n}", "public interface TipoDao {\r\n\r\n /**\r\n * Inserta un nuevo registro en la tabla Tipos.\r\n */\r\n public TipoPk insert(Tipo dto) throws TipoDaoException;\r\n\r\n /**\r\n * Actualiza un unico registro en la tabla Tipos.\r\n */\r\n public void update(TipoPk pk, Tipo dto) throws TipoDaoException;\r\n\r\n /**\r\n * Elimina un unico registro en la tabla Tipos.\r\n */\r\n public void delete(TipoPk pk) throws TipoDaoException;\r\n\r\n /**\r\n * Retorna un unico registro en la tabla Tipos que conicida con la\r\n * primary-key especificada.\r\n */\r\n public Tipo findByPrimaryKey(TipoPk pk) throws TipoDaoException;\r\n\r\n /**\r\n * Retorna un registro de la tabla Tipos que coincida con el criterio\r\n * 'id_tipo = :idTipo'.\r\n */\r\n public Tipo findByPrimaryKey(Integer idTipo) throws TipoDaoException;\r\n\r\n /**\r\n * Retorna todos los registros de la tabla Tipos que coincidan con el\r\n * criterio 'nombre_tipo LIKE %:nombre%'.\r\n */\r\n public Tipo[] findByName(String nombre) throws TipoDaoException;\r\n\r\n /**\r\n * Retorna un registro de la tabla Tipos que coincida con el\r\n * criterio 'nombre_tipo = :nombre'.\r\n */\r\n public Tipo findByFullName(String nombre) throws TipoDaoException;\r\n\r\n /**\r\n * Retorna todas las filas de la tabla Tipos.\r\n */\r\n public Tipo[] findAll() throws TipoDaoException;\r\n\r\n /**\r\n * Retorna todos los registros de la tabla Tipos que coincidan con la\r\n * sentencia SQL especificada arbitrariamente\r\n */\r\n public Tipo[] findByDynamicSelect(String sql, Object[] sqlParams)\r\n throws TipoDaoException;\r\n\r\n /**\r\n * Retorna todos los registros de la tabla Tipos que coincidan con el WHERE\r\n * SQL especificado arbitrariamente\r\n */\r\n public Tipo[] findByDynamicWhere(String sql, Object[] sqlParams)\r\n throws TipoDaoException;\r\n\r\n /**\r\n * Sets the value of maxRows\r\n */\r\n public void setMaxRows(int maxRows);\r\n\r\n /**\r\n * Gets the value of maxRows\r\n */\r\n public int getMaxRows();\r\n\r\n /**\r\n * Retorna la conexión actual del usuario\r\n * \r\n * @return Connection\r\n */\r\n public Connection getUserConn();\r\n\r\n /**\r\n * Setea la conexión a usar con la BD\r\n * \r\n * @param userConn\r\n */\r\n public void setUserConn(Connection userConn);\r\n\r\n}", "public interface CategoryDao {\n\n /**\n * Method adds category to database\n * @param category\n */\n void addCategory(Category category);\n\n /**\n * Method updates category in database\n * @param category\n */\n void updateCategory(Category category);\n\n /**\n * Methods returns category by id\n * @param id\n * @return\n */\n Category selectCategory(long id);\n\n /**\n * Methods returns category by category name\n * @param name\n * @return category\n */\n Category selectCategory(String name);\n\n /**\n * Method returns category list\n * @return category list\n */\n List<Category> selectCategoryList();\n\n /**\n * Method deletes category by id\n * @param id\n */\n void deleteCategory(long id);\n\n /**\n * Method deletes category parameter\n * @param id\n */\n void deleteParameter(long id);\n\n /**\n * Method deletes category products\n * @param id\n */\n void deleteCategoryProducts(long id);\n\n /**\n * Method delete category parameter product details\n * @param id\n */\n void deleteCategoryParameterProductDetails(long id);\n}", "public VRpDyHlrforbeDAOImpl() {\r\n super();\r\n }", "public interface IEngineDAO extends ISpagoBIDao{\n\t\n\t\n\t/**\n\t * Loads all detail information for an engine identified by its <code>engineID</code>. All these information,\n\t * achived by a query to the DB, are stored into an <code>engine</code> object, which is\n\t * returned.\n\t * \n\t * @param engineID The id for the engine to load\n\t * \n\t * @return An <code>engine</code> object containing all loaded information\n\t * \n\t * @throws EMFUserError If an Exception occurred\n\t */\n\tpublic Engine loadEngineByID(Integer engineID) throws EMFUserError;\n\t\n\t\n\t/**\n\t * Loads all detail information for an engine identified by its <code>engineLabel</code>. All these information,\n\t * achived by a query to the DB, are stored into an <code>engine</code> object, which is\n\t * returned.\n\t * \n\t * @param engineLabel The label for the engine to load\n\t * \n\t * @return An <code>engine</code> object containing all loaded information\n\t * \n\t * @throws EMFUserError If an Exception occurred\n\t */\n\tpublic Engine loadEngineByLabel(String engineLabel) throws EMFUserError;\n\t\n\t/**\n\t * Loads all detail information for an engine identified by its <code>driver</code>. All these information,\n\t * achived by a query to the DB, are stored into an <code>engine</code> object, which is\n\t * returned.\n\t * \n\t * @param driver The name for the engine to load\n\t * \n\t * @return An <code>engine</code> object containing all loaded information\n\t * \n\t * @throws EMFUserError If an Exception occurred\n\t */\n\tpublic Engine loadEngineByDriver(String driver) throws EMFUserError;\n\t\n\t\n\t/**\n\t * Loads all detail information for all engines. For each of them, detail\n\t * information is stored into an <code>engine</code> object. After that, all engines\n\t * are stored into a <code>List</code>, which is returned.\n\t * \n\t * @return A list containing all engine objects\n\t * \n\t * @throws EMFUserError If an Exception occurred\n\t */\n\t\n\tpublic List<Engine> loadAllEngines() throws EMFUserError;\n\t\n\t\n\t/**\n\t * Loads all detail information for all engines in paged way. For each of them, detail\n\t * information is stored into an <code>engine</code> object. After that, all engines inside the paging logic\n\t * are stored into a <code>List</code>, which is returned.\n\t * \n\t * @return A list containing all engine objects\n\t * \n\t * @throws EMFUserError If an Exception occurred\n\t */\n\t\n\tpublic List<Engine> loadPagedEnginesList(Integer offset, Integer fetchSize) throws EMFUserError;\n\t\n\t\n\t/**\n\t * Loads all detail information for all engines filtered by tenant. For each of them, detail\n\t * information is stored into an <code>engine</code> object. After that, all engines\n\t * are stored into a <code>List</code>, which is returned.\n\t * \n\t * @return A list containing all engine objects\n\t * \n\t * @throws EMFUserError If an Exception occurred\n\t */\n\t\n\tpublic List<Engine> loadAllEnginesByTenant() throws EMFUserError;\n\t/**\n\t * Loads all detail information for all engines compatible to the BIObject type specified \n\t * at input and the tenant. For each of them, detail information is stored into an <code>engine</code> object.\n\t * After that, all engines are stored into a <code>List</code>, which is returned.\n\t * \n\t * @param biobjectType the biobject type\n\t * \n\t * @return A list containing all engine objects compatible with the BIObject type passed at input\n\t * \n\t * @throws EMFUserError If an Exception occurred\n\t */\n\t\n\tpublic List<Engine> loadAllEnginesForBIObjectTypeAndTenant(String biobjectType) throws EMFUserError;\n\t/**\n\t * Loads all detail information for all engines compatible to the BIObject type specified\n\t * at input. For each of them, detail information is stored into an <code>engine</code> object.\n\t * After that, all engines are stored into a <code>List</code>, which is returned.\n\t * \n\t * @param biobjectType the biobject type\n\t * \n\t * @return A list containing all engine objects compatible with the BIObject type passed at input\n\t * \n\t * @throws EMFUserError If an Exception occurred\n\t */\n\t\n\tpublic List<Engine> loadAllEnginesForBIObjectType(String biobjectType) throws EMFUserError;\n\t/**\n\t * Implements the query to modify an engine. All information needed is stored\n\t * into the input <code>engine</code> object.\n\t * \n\t * @param aEngine The object containing all modify information\n\t * \n\t * @throws EMFUserError If an Exception occurred\n\t */\n\t\n\tpublic void modifyEngine(Engine aEngine) throws EMFUserError;\n\t\n\t/**\n\t * Implements the query to insert an engine. All information needed is stored\n\t * into the input <code>engine</code> object.\n\t * \n\t * @param aEngine The object containing all insert information\n\t * \n\t * @throws EMFUserError If an Exception occurred\n\t */\n\tpublic void insertEngine(Engine aEngine) throws EMFUserError;\n\t\n\t/**\n\t * Implements the query to erase an engine. All information needed is stored\n\t * into the input <code>engine</code> object.\n\t * \n\t * @param aEngine The object containing all delete information\n\t * \n\t * @throws EMFUserError If an Exception occurred\n\t */\n\t\n\tpublic void eraseEngine(Engine aEngine) throws EMFUserError;\n\n\t/**\n\t * Tells if an engine is associated to any\n\t * BI Object. It is useful because an engine cannot be deleted\n\t * if it is used by one or more BI Objects.\n\t * \n\t * @param engineId The engine identifier\n\t * \n\t * @return True if the engine is used by one or more\n\t * objects, else false\n\t * \n\t * @throws EMFUserError If any exception occurred\n\t */\n\tpublic boolean hasBIObjAssociated (String engineId) throws EMFUserError;\n\n\n\t/**\n\t * Get all the associated Exporters\n\t * \n\t * @param engineId The engine identifier\n\t * \n\t * @return The list of associated Exporters\n\t * \n\t * @throws EMFUserError If any exception occurred\n\t */\n\tpublic List getAssociatedExporters (Engine engineId) throws EMFUserError;\n\n\t\n\t\n\tpublic Integer countEngines() throws EMFUserError;\n\n}", "public interface ReadDao {\n\n /**\n * 根据手机号码获取用户\n *\n * @param phone\n * @return\n */\n @Select(\"select * from t_user where phone=#{phone}\")\n UserModel getUserByPhone(@Param(\"phone\") String phone);\n\n /**\n * 根据用户名密码获取用户\n *\n * @param phone\n * @return\n */\n @Select(\"select * from t_user where phone=#{phone} and passwd=substr(md5(#{pwd}),9,8)\")\n UserModel getUserByPassword(@Param(\"phone\") String phone, @Param(\"pwd\") String pwd);\n\n /**\n * 根据商品名查询商品\n *\n * @return\n */\n @Select(\"select id goodsid,name,price from t_goods where name like #{name}\")\n List<Commodity> queryCommodity(@Param(\"name\") String name);\n\n /**\n * 根据关键字查询\n *\n * @param keyword\n * @param size\n * @return\n */\n @Select(\"select * from t_goods where name like #{keyword} limit 0,#{size}\")\n public List<Commodity> getCommodityByKeyword(@Param(\"keyword\") String keyword, @Param(\"size\") int size);\n\n\n /**\n * 根据ID获取商品\n *\n * @param id\n * @return\n */\n @Select(\"select * from t_goods where id=#{id}\")\n public Commodity getCommodityById(@Param(\"id\") long id);\n\n /**\n * 查询所有商品类别\n * @return\n */\n @Select(\"select id,category1,category2 from t_goods_category\")\n public List<CommodityCategory> queryCategorys();\n\n /**\n * 查询所有商品\n * @return\n */\n @Select(\"select * from t_goods\")\n public List<Commodity> queryAllCommodityes();\n\n\n /**\n * 根据父级名称获取子级名称\n *\n * @param name\n * @return\n */\n @Select(\"select * from t_goods_category where category1=#{name}\")\n public List<CommodityCategory> getCommodityCategoryByParentName(@Param(\"name\") String name);\n\n /**\n * 获取一级分类名称\n *\n * @return\n */\n @Select(\"select DISTINCT(category1) as category1 from t_goods_category\")\n public List<CommodityCategory> getParentCommodityCateory();\n}", "public interface BaseDao<T extends BaseEntity> {\r\n\t/**\r\n\t * Adds entity to database\r\n\t * \r\n\t * @param entity\r\n\t * creating entity\r\n\t */\r\n\tvoid create(T entity);\r\n\r\n\t/**\r\n\t * Gets entity from database\r\n\t * \r\n\t * @param id\r\n\t * id of entity\r\n\t * @return found entity\r\n\t */\r\n\tT read(int id);\r\n\r\n\t/**\r\n\t * Gets all certain kind entities from database\r\n\t * \r\n\t * @return List of all entities\r\n\t */\r\n\tList<T> readAll();\r\n\r\n\t/**\r\n\t * Updates entity in database\r\n\t * \r\n\t * @param entity\r\n\t * entity for update\r\n\t */\r\n\tvoid update(T entity);\r\n\r\n\t/**\r\n\t * Deletes entity from database\r\n\t * \r\n\t * @param entityId\r\n\t * id of entity\r\n\t */\r\n\tvoid delete(int entityId);\r\n\r\n\t/**\r\n\t * get values from ResultSet and set them to entity object\r\n\t * \r\n\t * @param rs\r\n\t * ResultSet object\r\n\t * \r\n\t * @return entity object\r\n\t * @throws SQLException\r\n\t * if the columnLabel is not valid;\r\n\t */\r\n\tT buidEntity(ResultSet rs) throws SQLException;\r\n}", "DepartReportDAOJDBC(DAOFactory daoFactory) {\r\n this.daoFactory = daoFactory;\r\n }", "public interface IBuyDao extends Dao<Buy> {\n\n// /** Gets the appropriate List<Executor> by period */\n// public List<Buy> getExecutorsByPeriod(int first, int second) throws PersistException;\n//\n /** Gets all Items*/\n public List<Buy> getAll() throws PersistException;\n\n public String[] getBuysListNameArray() throws PersistException;\n\n /** Gets count Buys*/\n public int getCountBuys() throws PersistException;\n\n// /** Gets Executor by name*/\n// public Buy getExecutorByName(String name) throws PersistException;\n//\n// /** Gets Executors with status Active*/\n// public List<Buy> getActiveExecutors() throws PersistException;\n}", "public interface DaoFactory {\r\n\r\n\t/**\r\n\t * Returns objects for access to account table.\r\n\t * \r\n\t * @return DAO for account table.\r\n\t */\r\n\tpublic GenericDao<Account> getAccountDao();\r\n\r\n\t/**\r\n\t * Returns objects for access to client table.\r\n\t * \r\n\t * @return DAO for client table.\r\n\t */\r\n\tpublic GenericDao<Client> getClientDao();\r\n\r\n\t/**\r\n\t * Returns objects for access to payment table.\r\n\t * \r\n\t * @return DAO for payment table.\r\n\t */\r\n\tpublic GenericDao<Payment> getPaymentDao();\r\n\r\n\t/**\r\n\t * Returns objects for access to credit card table.\r\n\t * \r\n\t * @return DAO for credit card table.\r\n\t */\r\n\tpublic GenericDao<CreditCard> getCreditCardDao();\r\n\r\n\t/**\r\n\t * Returns objects for access to authorization table.\r\n\t * \r\n\t * @return DAO for authorization table.\r\n\t */\r\n\tpublic GenericDao<Autorization> getAutorizationDao();\r\n\r\n\t/**\r\n\t * This method returns connection for accessing to database.\r\n\t * \r\n\t * @return\r\n\t */\r\n\tpublic Connection getConnection();\r\n\r\n}", "public interface ConfigurationDAO\n{\n /**\n * Export table configuration information\n * \n * @param fullTableName\n * full table name, including schema\n * @return column configurations mapped by column name\n */\n public Map<String, ColumnConfig> exportColumns(String fullTableName);\n\n /**\n * Adds column comments to column configs\n * \n * @param fullTableName\n * full table name\n * @param configs\n * ColumnConfig objects mapped to column names\n */\n public void addColumnComments(String fullTableName, Map<String, ColumnConfig> configs);\n\n /**\n * Updates table configuration based on information available from TAP tables table\n * \n * @param fullTableName\n * full name of table to update\n * @param config\n * table configuration\n * @return false if the table does not exist, else true\n */\n public boolean updateTableFromTap(String fullTableName, TableConfig config);\n\n /**\n * Updates columns configuration based on information available from TAP columns table\n * \n * @param fullTableName\n * full name of table that the columns belong to\n * @param configs\n * columns configurations\n */\n public void updateColumnsFromTap(String fullTableName, Map<String, ColumnConfig> configs);\n\n /**\n * Get index definition statements\n * \n * @param fullTableName\n * full name of table that the columns belong to\n * @return index definition statements as Strings in a List\n */\n public Map<String, String> exportIndexDefs(String fullTableName);\n\n /**\n * Get constraints information\n * \n * @param fullDbTableName\n * full database name of table that the columns belong to\n * @param constraintType\n * ConfigurationDAOImpl.FOREIGN_KEYS for foreign keys, ConfigurationDAOImpl.PRIMARY_KEYS for primary keys\n * @return Map constraint name -$gt; encoded constraint string\n */\n public Map<String, String> exportConstraints(String fullDbTableName, String constraintType);\n\n /**\n * Query for strings using the template\n * \n * @param sql\n * sql query with params placeholders\n * @param params\n * an array of params\n * @return a list of String results\n */\n public List<String> queryForStrings(String sql, Object[] params);\n\n /**\n * Get description of given table in given schema\n * \n * @param fullTableName\n * full table name\n * \n * @return table description as a String\n */\n public String exportTableDescription(String fullTableName);\n\n /**\n * Executes a statement\n * \n * @param statement\n * sql statement\n */\n public void execute(String statement);\n\n /**\n * Drops a constraint\n * \n * @param constraint\n * constraint to drop\n * @throws ConfigurationException\n * if change is not allowed\n */\n public void dropConstraint(ConstraintConfig constraint) throws ConfigurationException;\n\n /**\n * Adds a constraint\n * \n * @param constraint\n * constraint to add\n * @throws ConfigurationException\n * if change is not allowed\n */\n public void addConstraint(ConstraintConfig constraint) throws ConfigurationException;\n\n /**\n * Drops an index\n * \n * @param index\n * index to drop\n * @throws ConfigurationException\n * if change is not allowed\n */\n public void dropIndex(IndexConfig index) throws ConfigurationException;\n\n /**\n * Adds an index\n * \n * @param index\n * index to add\n * @throws ConfigurationException\n * if change is not allowed\n */\n public void addIndex(IndexConfig index) throws ConfigurationException;\n\n /**\n * Begin transaction\n */\n public void begin();\n\n /**\n * Commit transaction\n */\n public void commit();\n\n /**\n * Rollback transaction\n */\n public void rollback();\n\n /**\n * Drops column\n * \n * @param columnConfig\n * column configuration object of the column to drop\n * @throws ConfigurationException\n * if change is not allowed\n */\n public void dropColumn(ColumnConfig columnConfig) throws ConfigurationException;\n\n /**\n * Creates column\n * \n * @param columnConfig\n * column attributes\n * @throws ConfigurationException\n * if change is not allowed\n */\n public void createColumn(ColumnConfig columnConfig) throws ConfigurationException;\n\n /**\n * Updates column\n * \n * @param current\n * current column attributes\n * @param updated\n * desired column attributes\n * @throws ConfigurationException\n * if change is not allowed\n */\n public void updateColumn(ColumnConfig current, ColumnConfig updated) throws ConfigurationException;\n\n /**\n * Creates foreign key constraint\n * \n * @param constraintConfig\n * constraint configuration\n * @throws ConfigurationException\n * if change is not allowed\n */\n public void createConstraint(ConstraintConfig constraintConfig) throws ConfigurationException;\n\n /**\n * Creates index\n * \n * @param indexConfig\n * index configuration\n * @throws ConfigurationException\n * if change is not allowed\n * \n */\n public void createIndex(IndexConfig indexConfig) throws ConfigurationException;\n\n /**\n * Creates a table\n * \n * @param tableConfig\n * table configuration\n * @throws ConfigurationException\n * if change is not allowed\n */\n public void createTable(TableConfig tableConfig) throws ConfigurationException;\n\n /**\n * Delete schema from TAP metadata tables\n * \n * @param schemaConfig\n * schema configuration\n * @throws ConfigurationException\n * if change is not allowed\n */\n public void deleteTapSchema(SchemaConfig schemaConfig) throws ConfigurationException;\n\n /**\n * Create schema in TAP metadata tables\n * \n * @param schemaConfig\n * schema configuration\n * @throws ConfigurationException\n * if change is not allowed\n */\n public void createTapSchema(SchemaConfig schemaConfig) throws ConfigurationException;\n\n /**\n * Update schema in TAP metadata tables\n * \n * @param newSchema\n * schema configuration\n * @param createOnly\n * do not update the record if it exists\n * @throws ConfigurationException\n * if change is not allowed\n */\n public void updateTapSchema(SchemaConfig newSchema, boolean createOnly) throws ConfigurationException;\n\n /**\n * Delete table from TAP metadata tables\n * \n * @param tableConfig\n * table configuration\n * @throws ConfigurationException\n * if change is not allowed\n */\n public void deleteTapTable(TableConfig tableConfig) throws ConfigurationException;\n\n /**\n * Create table in TAP metadata tables\n * \n * @param tableConfig\n * table configuration\n * @throws ConfigurationException\n * if change is not allowed\n */\n public void createTapTable(TableConfig tableConfig) throws ConfigurationException;\n\n /**\n * Update table in TAP metadata tables\n * \n * @param newTable\n * table configuration\n * @param createOnly\n * do not update the record if it exists\n * @throws ConfigurationException\n * if change is not allowed\n */\n public void updateTapTable(TableConfig newTable, boolean createOnly) throws ConfigurationException;\n\n /**\n * Adds missing records and references defined by the table's keys\n * \n * @param cfgTable\n * TableConfig object to process\n * @param createOnly\n * do not update the record if it exists\n * @throws ConfigurationException\n * if change is not allowed\n */\n void updateTapTableReferences(TableConfig cfgTable, boolean createOnly) throws ConfigurationException;\n\n /* =============================================================================== */\n /* Replacements for former JPA repositories functions */\n /* =============================================================================== */\n\n /**\n * Find all TAP schemas\n * \n * @return a collection of TapSchema objects\n */\n public Collection<TapSchema> findAllSchemas();\n\n /**\n * Find all TAP tables\n * \n * @return a collection of TapTable objects\n */\n public Collection<TapTable> findAllTables();\n\n /**\n * Find a TAP schema by name\n * \n * @param schemaName\n * schema name\n * @return TapSchema object\n */\n public TapSchema findOneSchema(String schemaName);\n\n /**\n * Find all TAP columns\n * \n * @return a collection of TapColumn objects\n */\n public Collection<TapColumn> findAllColumns();\n\n /**\n * Find a TAP table by name\n * \n * @param tableName\n * column name\n * @return TapTable object\n */\n public TapTable findOneTable(String tableName);\n\n /**\n * Find all TAP key columns\n * \n * @return a collection of TapKeyColumn objects\n */\n public Collection<TapKeyColumn> findAllKeyColumns();\n\n /**\n * Find a TAP column by its key\n * \n * @param tapColumnPK\n * column key\n * @return TapColumn object\n */\n public TapColumn findOneColumn(TapColumnPK tapColumnPK);\n\n /**\n * Find all TAP keys\n * \n * @return a collection of TapKey objects\n */\n public Collection<TapKey> findAllKeys();\n\n /**\n * Get JdbcTemplate\n * \n * @return JdbcTemplate used by this DAO\n */\n public JdbcTemplate getTemplate();\n\n /**\n * Get schema name\n * \n * @return schema name of any existing table or default schema name\n */\n public String getSchema();\n\n /**\n * Make sure that TAP tables satisfy current version requirements\n * \n * @throws ConfigurationException\n * if there were configuration problems\n */\n void checkTapDbVersion() throws ConfigurationException;\n\n /**\n * Refreshes the object cache, for TAP metadata cached by the application.\n */\n public void refreshObjectCache();\n \n /**\n * Convert project codes to project ids\n * \n * @param projectCodes\n * list of project codes\n * @param schema\n * Schema of the projects table\n * @return projectIds List of project ids for codes\n */\n public List<Long> convertProjectCodesToIds(List<String> projectCodes, String schema);\n \n}", "public interface EntradaPontosDAO extends EntradaPontosSQL{\n\n}", "@SuppressWarnings(\"rawtypes\") \npublic interface EvaluetingListDAO {\n\t/**\n\t * Insert one <tt>EvaluetingListDO</tt> object to DB table <tt>evalueting_list</tt>, return primary key\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>insert into evalueting_list(form_id,project_code,customer_id,customer_name,busi_license_no,level,year,audit_time,operator,audit_status,evalueting_type,is_prosecute,evalueting_institutions,evalueting_time,audit_img,audit_opinion1,audit_opinion2,audit_opinion3,audit_opinion4,audit_opinion5,audit_opinion6,edit_status,raw_add_time) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)</tt>\n\t *\n\t *\t@param evaluetingList\n\t *\t@return long\n\t *\t@throws DataAccessException\n\t */\t \n public long insert(EvaluetingListDO evaluetingList) throws DataAccessException;\n\n\t/**\n\t * Delete records from DB table <tt>evalueting_list</tt>.\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>delete from evalueting_list where (form_id = ?)</tt>\n\t *\n\t *\t@param formId\n\t *\t@return int\n\t *\t@throws DataAccessException\n\t */\t \n public int deleteById(long formId) throws DataAccessException;\n\n\t/**\n\t * Query DB table <tt>evalueting_list</tt> for records.\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>select form_id, project_code, customer_id, customer_name, busi_license_no, level, year, audit_time, operator, audit_status, evalueting_type, is_prosecute, evalueting_institutions, evalueting_time, audit_img, audit_opinion1, audit_opinion2, audit_opinion3, audit_opinion4, audit_opinion5, audit_opinion6, edit_status, raw_add_time, raw_update_time from evalueting_list where (form_id = ?)</tt>\n\t *\n\t *\t@param formId\n\t *\t@return EvaluetingListDO\n\t *\t@throws DataAccessException\n\t */\t \n public EvaluetingListDO findById(long formId) throws DataAccessException;\n\n\t/**\n\t * Update DB table <tt>evalueting_list</tt>.\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>update evalueting_list set project_code=?, customer_id=?, customer_name=?, busi_license_no=?, level=?, year=?, audit_time=?, operator=?, audit_status=?, evalueting_type=?, is_prosecute=?, evalueting_institutions=?, evalueting_time=?, audit_img=?, audit_opinion1=?, audit_opinion2=?, audit_opinion3=?, audit_opinion4=?, audit_opinion5=?, audit_opinion6=?, edit_status=? where (form_id = ?)</tt>\n\t *\n\t *\t@param evaluetingList\n\t *\t@return int\n\t *\t@throws DataAccessException\n\t */\t \n public int updateById(EvaluetingListDO evaluetingList) throws DataAccessException;\n\n\t/**\n\t * Update DB table <tt>evalueting_list</tt>.\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>update evalueting_list set project_code=\"\" where (form_id = ?)</tt>\n\t *\n\t *\t@param formId\n\t *\t@return int\n\t *\t@throws DataAccessException\n\t */\t \n public int cleanProjCodeById(long formId) throws DataAccessException;\n\n\t/**\n\t * Query DB table <tt>evalueting_list</tt> for records.\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>select form_id, project_code, customer_id, customer_name, busi_license_no, level, year, audit_time, operator, audit_status, evalueting_type, is_prosecute, evalueting_institutions, evalueting_time, audit_img, audit_opinion1, audit_opinion2, audit_opinion3, audit_opinion4, audit_opinion5, audit_opinion6, edit_status, raw_add_time, raw_update_time from evalueting_list</tt>\n\t *\n\t *\t@param evaluetingList\n\t *\t@param limitStart\n\t *\t@param pageSize\n\t *\t@return List<EvaluetingListDO>\n\t *\t@throws DataAccessException\n\t */\t \n public List<EvaluetingListDO> findWithCondition(EvaluetingListDO evaluetingList, long limitStart, long pageSize) throws DataAccessException;\n\n\t/**\n\t * Query DB table <tt>evalueting_list</tt> for records.\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>select COUNT(*) from evalueting_list</tt>\n\t *\n\t *\t@param evaluetingList\n\t *\t@return long\n\t *\t@throws DataAccessException\n\t */\t \n public long countWithCondition(EvaluetingListDO evaluetingList) throws DataAccessException;\n\n}", "public interface IdeaCommentDao extends GenericDao<IdeaComment, Long>{\n\n\tList<IdeaComment> findIdeaCommentList(String ideaId);\n\n}", "public interface AdDao extends GenericDao<Ad, Long> {\n\n\t/**\n\t * Retourne toutes les publicité éligible\n\t * @param date\n\t * @return\n\t * @throws Exception\n\t */\n\tList<Ad> getAll(Date date)throws Exception;\n\n \n}", "public interface CProjectPurposeDAO extends JpaDao<CProjectPurpose> {\n\n\t/**\n\t * JPQL Query - findCProjectPurposeByName\n\t *\n\t */\n\tpublic Set<CProjectPurpose> findCProjectPurposeByName(String name) throws DataAccessException;\n\n\t/**\n\t * JPQL Query - findCProjectPurposeByName\n\t *\n\t */\n\tpublic Set<CProjectPurpose> findCProjectPurposeByName(String name, int startResult, int maxRows) throws DataAccessException;\n\n\t/**\n\t * JPQL Query - findCProjectPurposeByPrimaryKey\n\t *\n\t */\n\tpublic CProjectPurpose findCProjectPurposeByPrimaryKey(Integer id) throws DataAccessException;\n\n\t/**\n\t * JPQL Query - findCProjectPurposeByPrimaryKey\n\t *\n\t */\n\tpublic CProjectPurpose findCProjectPurposeByPrimaryKey(Integer id, int startResult, int maxRows) throws DataAccessException;\n\n\t/**\n\t * JPQL Query - findCProjectPurposeById\n\t *\n\t */\n\tpublic CProjectPurpose findCProjectPurposeById(Integer id_1) throws DataAccessException;\n\n\t/**\n\t * JPQL Query - findCProjectPurposeById\n\t *\n\t */\n\tpublic CProjectPurpose findCProjectPurposeById(Integer id_1, int startResult, int maxRows) throws DataAccessException;\n\n\t/**\n\t * JPQL Query - findAllCProjectPurposes\n\t *\n\t */\n\tpublic Set<CProjectPurpose> findAllCProjectPurposes() throws DataAccessException;\n\n\t/**\n\t * JPQL Query - findAllCProjectPurposes\n\t *\n\t */\n\tpublic Set<CProjectPurpose> findAllCProjectPurposes(int startResult, int maxRows) throws DataAccessException;\n\n\t/**\n\t * JPQL Query - findCProjectPurposeByNameContaining\n\t *\n\t */\n\tpublic Set<CProjectPurpose> findCProjectPurposeByNameContaining(String name_1) throws DataAccessException;\n\n\t/**\n\t * JPQL Query - findCProjectPurposeByNameContaining\n\t *\n\t */\n\tpublic Set<CProjectPurpose> findCProjectPurposeByNameContaining(String name_1, int startResult, int maxRows) throws DataAccessException;\n\n}", "public interface BasicInformationDao {\n BasicInformation insert(BasicInformation item);\n\n List<BasicInformation> query(BasicInformation item);\n\n void update(BasicInformation item);\n\n void delete(BasicInformation item);\n\n List<BasicInformation> queryByBasic_ids(List<Integer> list);\n\n}", "public interface EepHeadLoadDAO extends DAO<EepHeadLoad> {\r\n\t/**\r\n\t * Sletter alle linjer tilhørende gitt hode\r\n\t * \r\n\t * @param head\r\n\t */\r\n\tvoid deleteImportFile(EepHeadLoad head);\r\n\r\n\t/**\r\n\t * Finner alle for gitt sekvensnummer\r\n\t * \r\n\t * @param nr\r\n\t * @return alle for gitt sekvensnummer\r\n\t */\r\n\tEepHeadLoad findBySequenceNumber(Integer nr);\r\n}", "public interface SiacTAttoLeggeDao extends Dao<SiacTAttoLegge,Integer> {\n\t\n\t\n\t/**\n\t * Creates the.\n\t *\n\t * @param attoLegge the atto legge\n\t * @return the siac t atto legge\n\t */\n\tSiacTAttoLegge create(SiacTAttoLegge attoLegge);\n\n\t/* (non-Javadoc)\n\t * @see it.csi.siac.siaccommonser.integration.dao.base.Dao#update(java.lang.Object)\n\t */\n\tSiacTAttoLegge update(SiacTAttoLegge attoDiLeggeDB);\n\t\n\t/* (non-Javadoc)\n\t * @see it.csi.siac.siaccommonser.integration.dao.base.Dao#findById(java.lang.Object)\n\t */\n\tSiacTAttoLegge findById (Integer uid);\n\t\n}", "public interface EntityDAOInterface {\n}", "@SuppressWarnings(\"all\")\npublic interface I_LBR_PartnerDFe \n{\n\n /** TableName=LBR_PartnerDFe */\n public static final String Table_Name = \"LBR_PartnerDFe\";\n\n /** AD_Table_ID=1120461 */\n public static final int Table_ID = MTable.getTable_ID(Table_Name);\n\n KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);\n\n /** AccessLevel = 3 - Client - Org \n */\n BigDecimal accessLevel = BigDecimal.valueOf(3);\n\n /** Load Meta Data */\n\n /** Column name AD_Client_ID */\n public static final String COLUMNNAME_AD_Client_ID = \"AD_Client_ID\";\n\n\t/** Get Client.\n\t * Client/Tenant for this installation.\n\t */\n\tpublic int getAD_Client_ID();\n\n /** Column name AD_Org_ID */\n public static final String COLUMNNAME_AD_Org_ID = \"AD_Org_ID\";\n\n\t/** Set Organization.\n\t * Organizational entity within client\n\t */\n\tpublic void setAD_Org_ID (int AD_Org_ID);\n\n\t/** Get Organization.\n\t * Organizational entity within client\n\t */\n\tpublic int getAD_Org_ID();\n\n /** Column name BPName */\n public static final String COLUMNNAME_BPName = \"BPName\";\n\n\t/** Set BP Name\t */\n\tpublic void setBPName (String BPName);\n\n\t/** Get BP Name\t */\n\tpublic String getBPName();\n\n /** Column name Created */\n public static final String COLUMNNAME_Created = \"Created\";\n\n\t/** Get Created.\n\t * Date this record was created\n\t */\n\tpublic Timestamp getCreated();\n\n /** Column name CreatedBy */\n public static final String COLUMNNAME_CreatedBy = \"CreatedBy\";\n\n\t/** Get Created By.\n\t * User who created this records\n\t */\n\tpublic int getCreatedBy();\n\n /** Column name DateDoc */\n public static final String COLUMNNAME_DateDoc = \"DateDoc\";\n\n\t/** Set Document Date.\n\t * Date of the Document\n\t */\n\tpublic void setDateDoc (Timestamp DateDoc);\n\n\t/** Get Document Date.\n\t * Date of the Document\n\t */\n\tpublic Timestamp getDateDoc();\n\n /** Column name DateTrx */\n public static final String COLUMNNAME_DateTrx = \"DateTrx\";\n\n\t/** Set Transaction Date.\n\t * Transaction Date\n\t */\n\tpublic void setDateTrx (Timestamp DateTrx);\n\n\t/** Get Transaction Date.\n\t * Transaction Date\n\t */\n\tpublic Timestamp getDateTrx();\n\n /** Column name Description */\n public static final String COLUMNNAME_Description = \"Description\";\n\n\t/** Set Description.\n\t * Optional short description of the record\n\t */\n\tpublic void setDescription (String Description);\n\n\t/** Get Description.\n\t * Optional short description of the record\n\t */\n\tpublic String getDescription();\n\n /** Column name DocumentNote */\n public static final String COLUMNNAME_DocumentNote = \"DocumentNote\";\n\n\t/** Set Document Note.\n\t * Additional information for a Document\n\t */\n\tpublic void setDocumentNote (String DocumentNote);\n\n\t/** Get Document Note.\n\t * Additional information for a Document\n\t */\n\tpublic String getDocumentNote();\n\n /** Column name DocumentType */\n public static final String COLUMNNAME_DocumentType = \"DocumentType\";\n\n\t/** Set Document Type.\n\t * Document Type\n\t */\n\tpublic void setDocumentType (String DocumentType);\n\n\t/** Get Document Type.\n\t * Document Type\n\t */\n\tpublic String getDocumentType();\n\n /** Column name GrandTotal */\n public static final String COLUMNNAME_GrandTotal = \"GrandTotal\";\n\n\t/** Set Grand Total.\n\t * Total amount of document\n\t */\n\tpublic void setGrandTotal (BigDecimal GrandTotal);\n\n\t/** Get Grand Total.\n\t * Total amount of document\n\t */\n\tpublic BigDecimal getGrandTotal();\n\n /** Column name IsActive */\n public static final String COLUMNNAME_IsActive = \"IsActive\";\n\n\t/** Set Active.\n\t * The record is active in the system\n\t */\n\tpublic void setIsActive (boolean IsActive);\n\n\t/** Get Active.\n\t * The record is active in the system\n\t */\n\tpublic boolean isActive();\n\n /** Column name IsCancelled */\n public static final String COLUMNNAME_IsCancelled = \"IsCancelled\";\n\n\t/** Set Cancelled.\n\t * The transaction was cancelled\n\t */\n\tpublic void setIsCancelled (boolean IsCancelled);\n\n\t/** Get Cancelled.\n\t * The transaction was cancelled\n\t */\n\tpublic boolean isCancelled();\n\n /** Column name IsSOTrx */\n public static final String COLUMNNAME_IsSOTrx = \"IsSOTrx\";\n\n\t/** Set Sales Transaction.\n\t * This is a Sales Transaction\n\t */\n\tpublic void setIsSOTrx (boolean IsSOTrx);\n\n\t/** Get Sales Transaction.\n\t * This is a Sales Transaction\n\t */\n\tpublic boolean isSOTrx();\n\n /** Column name LBR_EventType */\n public static final String COLUMNNAME_LBR_EventType = \"LBR_EventType\";\n\n\t/** Set Event Type\t */\n\tpublic void setLBR_EventType (String LBR_EventType);\n\n\t/** Get Event Type\t */\n\tpublic String getLBR_EventType();\n\n /** Column name LBR_IsManifested */\n public static final String COLUMNNAME_LBR_IsManifested = \"LBR_IsManifested\";\n\n\t/** Set Manifested\t */\n\tpublic void setLBR_IsManifested (boolean LBR_IsManifested);\n\n\t/** Get Manifested\t */\n\tpublic boolean isLBR_IsManifested();\n\n /** Column name LBR_IsXMLValid */\n public static final String COLUMNNAME_LBR_IsXMLValid = \"LBR_IsXMLValid\";\n\n\t/** Set XML Valid\t */\n\tpublic void setLBR_IsXMLValid (boolean LBR_IsXMLValid);\n\n\t/** Get XML Valid\t */\n\tpublic boolean isLBR_IsXMLValid();\n\n /** Column name LBR_PartnerDFe_ID */\n public static final String COLUMNNAME_LBR_PartnerDFe_ID = \"LBR_PartnerDFe_ID\";\n\n\t/** Set Partner Doc Fiscal\t */\n\tpublic void setLBR_PartnerDFe_ID (int LBR_PartnerDFe_ID);\n\n\t/** Get Partner Doc Fiscal\t */\n\tpublic int getLBR_PartnerDFe_ID();\n\n /** Column name LBR_PartnerDFe_UU */\n public static final String COLUMNNAME_LBR_PartnerDFe_UU = \"LBR_PartnerDFe_UU\";\n\n\t/** Set LBR_PartnerDFe_UU\t */\n\tpublic void setLBR_PartnerDFe_UU (String LBR_PartnerDFe_UU);\n\n\t/** Get LBR_PartnerDFe_UU\t */\n\tpublic String getLBR_PartnerDFe_UU();\n\n /** Column name LBR_SitNF */\n public static final String COLUMNNAME_LBR_SitNF = \"LBR_SitNF\";\n\n\t/** Set NF Status.\n\t * NF Status\n\t */\n\tpublic void setLBR_SitNF (String LBR_SitNF);\n\n\t/** Get NF Status.\n\t * NF Status\n\t */\n\tpublic String getLBR_SitNF();\n\n /** Column name Processed */\n public static final String COLUMNNAME_Processed = \"Processed\";\n\n\t/** Set Processed.\n\t * The document has been processed\n\t */\n\tpublic void setProcessed (boolean Processed);\n\n\t/** Get Processed.\n\t * The document has been processed\n\t */\n\tpublic boolean isProcessed();\n\n /** Column name Processing */\n public static final String COLUMNNAME_Processing = \"Processing\";\n\n\t/** Set Process Now\t */\n\tpublic void setProcessing (boolean Processing);\n\n\t/** Get Process Now\t */\n\tpublic boolean isProcessing();\n\n /** Column name SeqNo */\n public static final String COLUMNNAME_SeqNo = \"SeqNo\";\n\n\t/** Set Sequence.\n\t * Method of ordering records;\n lowest number comes first\n\t */\n\tpublic void setSeqNo (int SeqNo);\n\n\t/** Get Sequence.\n\t * Method of ordering records;\n lowest number comes first\n\t */\n\tpublic int getSeqNo();\n\n /** Column name Updated */\n public static final String COLUMNNAME_Updated = \"Updated\";\n\n\t/** Get Updated.\n\t * Date this record was updated\n\t */\n\tpublic Timestamp getUpdated();\n\n /** Column name UpdatedBy */\n public static final String COLUMNNAME_UpdatedBy = \"UpdatedBy\";\n\n\t/** Get Updated By.\n\t * User who updated this records\n\t */\n\tpublic int getUpdatedBy();\n\n /** Column name lbr_CNPJ */\n public static final String COLUMNNAME_lbr_CNPJ = \"lbr_CNPJ\";\n\n\t/** Set CNPJ.\n\t * Used to identify Legal Entities in Brazil\n\t */\n\tpublic void setlbr_CNPJ (String lbr_CNPJ);\n\n\t/** Get CNPJ.\n\t * Used to identify Legal Entities in Brazil\n\t */\n\tpublic String getlbr_CNPJ();\n\n /** Column name lbr_CPF */\n public static final String COLUMNNAME_lbr_CPF = \"lbr_CPF\";\n\n\t/** Set CPF.\n\t * Used to identify individuals in Brazil\n\t */\n\tpublic void setlbr_CPF (String lbr_CPF);\n\n\t/** Get CPF.\n\t * Used to identify individuals in Brazil\n\t */\n\tpublic String getlbr_CPF();\n\n /** Column name lbr_DigestValue */\n public static final String COLUMNNAME_lbr_DigestValue = \"lbr_DigestValue\";\n\n\t/** Set Digest Value\t */\n\tpublic void setlbr_DigestValue (String lbr_DigestValue);\n\n\t/** Get Digest Value\t */\n\tpublic String getlbr_DigestValue();\n\n /** Column name lbr_IE */\n public static final String COLUMNNAME_lbr_IE = \"lbr_IE\";\n\n\t/** Set IE.\n\t * Used to Identify the IE (State Tax ID)\n\t */\n\tpublic void setlbr_IE (String lbr_IE);\n\n\t/** Get IE.\n\t * Used to Identify the IE (State Tax ID)\n\t */\n\tpublic String getlbr_IE();\n\n /** Column name lbr_NFeID */\n public static final String COLUMNNAME_lbr_NFeID = \"lbr_NFeID\";\n\n\t/** Set NFe ID.\n\t * Identification of NFe\n\t */\n\tpublic void setlbr_NFeID (String lbr_NFeID);\n\n\t/** Get NFe ID.\n\t * Identification of NFe\n\t */\n\tpublic String getlbr_NFeID();\n\n /** Column name lbr_NFeProt */\n public static final String COLUMNNAME_lbr_NFeProt = \"lbr_NFeProt\";\n\n\t/** Set NFe Protocol\t */\n\tpublic void setlbr_NFeProt (String lbr_NFeProt);\n\n\t/** Get NFe Protocol\t */\n\tpublic String getlbr_NFeProt();\n\n /** Column name lbr_NFeStatus */\n public static final String COLUMNNAME_lbr_NFeStatus = \"lbr_NFeStatus\";\n\n\t/** Set NFe Status.\n\t * Status of NFe\n\t */\n\tpublic void setlbr_NFeStatus (String lbr_NFeStatus);\n\n\t/** Get NFe Status.\n\t * Status of NFe\n\t */\n\tpublic String getlbr_NFeStatus();\n}", "public interface EmpDao {\n\n /**\n * 列出员工信息及部门信息\n * @return\n */\n List<Emp> listEmpsAndDept();\n\n /**\n * 根据部门名称查询员工信息(存储过程调用)\n * @param paramMap\n */\n void execProListEmpsByDeptName(Map paramMap);\n\n /**\n * 部门删除\n * @param deptNo\n * @return\n */\n int deleteById(int deptNo);\n}", "public interface GvEstadoDocumentoDAO extends GenericOracleAsignacionesDAO<GvEstadoDocumento, Long>{\n public GvEstadoDocumento buscarPorCodigo(long idEstadoDocumento);\n public GvEstadoDocumento buscarPorNombre(String descripcion);\n\tpublic List<GvEstadoDocumento> buscarGvEstadoDocumentos();\n\tpublic void guardarGvEstadoDocumento(GvEstadoDocumento gvEstadoDocumento) throws EducacionDAOException;\n}", "public interface NewsDAO {\n /**\n * method is for adding the new\n *\n * @param news - object of the class News\n * @throws DAOException - exceptions caused by DAO layer\n * @throws ConnectionPoolDataSourceException - exceptions caused by ConnectionPool\n */\n String addNew(News news) throws DAOException, ConnectionPoolDataSourceException;\n\n /**\n * method is for finding the new by category\n *\n * @param category - new's category\n * @throws DAOException - exceptions caused by DAO layer\n * @throws ConnectionPoolDataSourceException - exceptions caused by ConnectionPool\n */\n ArrayList<News> findByCategory(String category) throws DAOException, ConnectionPoolDataSourceException;\n\n /**\n * method is for finding thw new by title\n *\n * @param title - new's title\n * @throws DAOException - exceptions caused by DAO layer\n * @throws ConnectionPoolDataSourceException - exceptions caused by ConnectionPool\n */\n ArrayList<News> findByTitle(String title) throws DAOException, ConnectionPoolDataSourceException;\n\n /**\n * method is for finding the news by author\n *\n * @param author - new's author\n * @throws DAOException - exceptions caused by DAO layer\n * @throws ConnectionPoolDataSourceException - exceptions caused by ConnectionPool\n */\n ArrayList<News> findByAuthor(String author) throws DAOException, ConnectionPoolDataSourceException;\n\n /**\n * method is for finding the news by date\n *\n * @param date - new's date\n * @throws DAOException - exceptions caused by DAO layer\n * @throws ConnectionPoolDataSourceException - exceptions caused by ConnectionPool\n */\n ArrayList<News> findByDate(String date) throws DAOException, ConnectionPoolDataSourceException;\n\n /**\n * method is for init connection to the database\n *\n * @throws ConnectionPoolDataSourceException - exceptions caused by ConnectionPool\n */\n void init() throws ConnectionPoolDataSourceException;\n\n /**\n * method is for destroy connection to the database\n *\n * @throws ConnectionPoolDataSourceException - exception caused by ConnectionPool\n */\n void destroy() throws ConnectionPoolDataSourceException;\n}", "public interface ColumnDAO {\r\n public List queryObjs(Map condition) throws Exception;\r\n public List queryObjs(Map condition, int offset, int limit) throws Exception;\r\n public Column queryObj(String colid) throws Exception;\r\n public int queryCountObjs(Map condition) throws Exception;\r\n public int queryCountObj(String colid) throws Exception;\r\n public void execInsert(Column column) throws Exception;\r\n public void execUpdate(Column column) throws Exception;\r\n public void execDelete(String colid) throws Exception;\r\n}", "public interface FeedbackOptionDAO extends DAO{\r\n \r\n}", "public interface ImplementShoppingDao {\n\n\n public Shopping selectShoppingById(int id);\n\n /**\n * 通过板块plate查询Article\n *\n * @return Article对象集合\n */\npublic List<Shopping> selectShoppingAllshop();\n\n /**\n * 添加商品\n * @param shopping\n * @return\n */\n public boolean addShopping(Shopping shopping);\n}", "public interface IMAE1007DAO extends IGenericDao<MAE1007> {\n\n\tMAE1007 findDisplayByDefault(Boolean defaul);\n\n\tList<MAE1007> findDisplayByUsed(Boolean isused);\n}", "D getDao();", "public interface ReWelfareDAO {\n int deleteByPrimaryKey(Long welfareId);\n\n void insert(ReWelfare record);\n\n void insertSelective(ReWelfare record);\n\n void insertBatch(List<ReWelfare> records);\n\n ReWelfare selectByPrimaryKey(Long welfareId);\n\n int updateByPrimaryKeySelective(ReWelfare record);\n\n int updateByPrimaryKey(ReWelfare record);\n\n /**\n * 精选列表\n * @param platform\n * @return\n */\n List<ReWelfare> selectSelectionListByPlatform(int platform);\n\n /**\n * 福利\n *\n * @param platform\n * @param welfareId\n * @param welfareType\n * @return\n */\n List<ReWelfare> selectListByPlatform(int platform, Long welfareId, Integer welfareType);\n\n /**\n * 从mysql中获取福利id列表\n * @param platform 平台\n * @param welfareType 类型\n * @return\n */\n List<Long> selectWelfareIdListOrderByUpdateTimeDesc(int platform,Integer welfareType);\n}", "public interface BannerDao {\n public int insert(Banner banner) throws Exception;\n public int modifyBanner(Banner banner) throws Exception;\n public Integer selectTotalCnt(Banner banner) throws Exception;\n public List<Banner> selectBannerList(Banner banner, PagingParam pagingParam);\n public Banner selectBanner(Banner banner);\n public Banner select(Banner banner) throws Exception;\n List<Banner> selectAllList();\n\n}", "public interface TipoActividadDAO {\n \n /**\n * Funció que engloba les funcións que s'utilitzen per crear tipus d'activitat\n * @param tipoAct\n * @return String\n * @throws PersistenceException\n * @throws ClassNotFoundException \n */\n public abstract String callCrear(TipoActividad tipoAct) throws PersistenceException, ClassNotFoundException;\n \n /**\n * Verifica que no existeixi un tipus amb el mateix nom\n * @param tipoAct\n * @return int\n * @throws PersistenceException\n * @throws ClassNotFoundException \n */\n public abstract int getTipoByName(TipoActividad tipoAct) throws PersistenceException, ClassNotFoundException;\n \n /**\n * Inserta un tipus d'activitat en la base de dades\n * @param tipoAct\n * @return String\n * @throws PersistenceException\n * @throws ClassNotFoundException \n */\n public abstract String insertarTipoActividad(TipoActividad tipoAct) throws PersistenceException, ClassNotFoundException;\n \n /**\n * Agafa els tipus d'activitats que esten actius\n * @return List de TipoActividad\n * @throws PersistenceException\n * @throws ClassNotFoundException \n */\n public abstract List<TipoActividad> getTiposActividad() throws PersistenceException, ClassNotFoundException;\n \n /**\n * Agafa tots els tipus d'activitats \n * @return List de TipoActividad\n * @throws PersistenceException\n * @throws ClassNotFoundException \n */\n public abstract List<TipoActividad> getTiposActividadAdm() throws PersistenceException, ClassNotFoundException;\n \n /**\n * Seleccionar el tipo de actividad d'una actividad\n * @param activity\n * @return String\n * @throws PersistenceException\n * @throws ClassNotFoundException \n */\n public abstract String getTipoByAct(Actividad activity) throws PersistenceException, ClassNotFoundException;\n\n /**\n * Guarda la sessió del tipus d'activitat\n * @param tipoAct\n * @param pagina\n * @throws PersistenceException\n * @throws ClassNotFoundException \n */\n public abstract void guardarSession(TipoActividad tipoAct, String pagina) throws PersistenceException, ClassNotFoundException;\n \n /**\n * Funció que engloba les funcións per editar un tipus d'activitat\n * @param tipoAct\n * @return String\n * @throws PersistenceException\n * @throws ClassNotFoundException \n */\n public abstract String callEditar(TipoActividad tipoAct) throws PersistenceException, ClassNotFoundException;\n \n /**\n * Funció que permet editar el Tipus d'activitat\n * @param tipoAct\n * @return String\n * @throws PersistenceException\n * @throws ClassNotFoundException \n */\n public abstract String editarTipoActividad(TipoActividad tipoAct) throws PersistenceException, ClassNotFoundException;\n}", "public interface IKindOfDaoDao {\n\n\t/**\n\t * Create a new element.\n\t * @param exempleDirect Element to create.\n\t \t * @throws DaoException If a DAO problem occurs.\n\t */\n\tpublic void createExempleDirect(ExempleDirect exempleDirect) throws DaoException;\n\n\t/**\n\t * Update an existing element.\n\t * @param exempleDirect Element to update. \n * If the element has an id, it may use it.\n \t * @throws DaoException If a DAO problem occurs.\n\t */\n\tpublic void updateExempleDirect(ExempleDirect exempleDirect) throws DaoException;\n\n\t/**\n\t * Delete an element.\n * Only id can be used to find which element must be deleted.\n\t * @param exempleDirect Element which will be delete. \n\t \t * @throws DaoException If a DAO problem occurs.\n\t */\n\tpublic void deleteExempleDirect(ExempleDirect exempleDirect) throws DaoException;\n\n\t/**\n\t * Find all elements.\n\t * @return A list with all elements, without any filter.\n\t \t * @throws DaoException If a DAO problem occurs.\n\t */\n\tpublic Collection<ExempleDirect> findAllExempleDirects() throws DaoException;\n\n\t/**\n\t * Find one entity by its primary key.\n * @param id The PK of the entity.\n\t * @return The entity found.\n\t \t * @throws DaoException If a DAO problem occurs.\n\t */\n\tpublic ExempleDirect findExempleDirectById(String id) throws DaoException;\n\n\t//Start of user code for technicals dao access api\n\t//End of user code\n}", "public interface DAO {\n\n /* -------------------------------------------------------------------------------\n Helper method to set parser-specific override configuration parameters\n ------------------------------------------------------------------------------- */\n public void setConfiguration(Properties props);\n\n public Properties getConfiguration();\n\n /* -------------------------------------------------------------------------------\n Methods for REPORT FORMAT generation\n ------------------------------------------------------------------------------- */\n\n /**\n * MANDATORY - Must return some experiment title. In case no title\n * is provided by the search enginge's result file, a default title\n * should be returned.\n * @return \n */\n public String getExperimentTitle() throws InvalidFormatException;\n\n /**\n * OPTIONAL - Should return null in case this option is not supported\n * by the search engine.\n * @return \n */\n public String getExperimentShortLabel();\n\n /**\n * MANDATORY - As a minimal requirement the date of search and the original\n * MS data file format should be set.\n * @return \n */\n public Param getExperimentParams() throws InvalidFormatException;\n\n /**\n * OPTIONAL - Should return null in case it's not supported by the search engine.\n * @return \n */\n public String getSampleName();\n\n /**\n * OPTIONAL - Should return null in case it's not supported by the search engine.\n * @return \n */\n public String getSampleComment();\n\n /**\n * MANDATORY - As a minimal requirement the sample's species should be returned.\n * @return \n */\n public Param getSampleParams() throws InvalidFormatException;\n\n /**\n * MANDATORY - Represents the input file for the conversion.\n * @return \n */\n public SourceFile getSourceFile() throws InvalidFormatException;\n\n /**\n * OPTIONAL - Should return null in case it's not supported by the search engine.\n * @return \n */\n public Collection<Contact> getContacts();\n\n /**\n * OPTIONAL - Should return null in case it's not supported by the search engine.\n * @return \n */\n public InstrumentDescription getInstrument();\n\n /**\n * MANDATORY - The search engine's name and version.\n * @return \n */\n public Software getSoftware() throws InvalidFormatException;\n\n /**\n * OPTIONAL - Should return null in case it's not supported by the search engine.\n * @return \n */\n public Param getProcessingMethod();\n\n /**\n * OPTIONAL - Should return null in case it's not supported by the search engine.\n * @return \n */\n public Protocol getProtocol();\n\n /**\n * OPTIONAL - Should return null in case it's not supported by the search engine.\n * @return \n */\n public Collection<Reference> getReferences();\n\n //these will be written to the FASTA attributes and will be used in the FASTA section\n // if there are multiple sequence files, the search database name will be a string-delimited\n // concatenation of all the names. Idem for version.\n\n /**\n * MANDATORY - these will be written to the FASTA attributes and will be used\n * in the FASTA section if there are multiple sequence files, the search database\n * name will be a string-delimited concatenation of all the names. Idem for version.\n * @return \n */\n public String getSearchDatabaseName() throws InvalidFormatException;\n\n /**\n * MANDATORY - see getSearchDatabaseName\n * @return \n */\n public String getSearchDatabaseVersion() throws InvalidFormatException;\n\n /**\n * MANDATORY - Should return a collection of PTMs representing all PTMs that are used\n * in this search. Collection can be empty but not null.\n * @return \n */\n public Collection<PTM> getPTMs() throws InvalidFormatException;\n\n /**\n * MANDATORY - Should return a collection of DatabaseMappings that contain all search database names and versions\n * used in this search. Collection can be empty but not null.\n * @return \n */\n public Collection<DatabaseMapping> getDatabaseMappings() throws InvalidFormatException;\n\n /**\n * MANDATORY - Must return a valid SearchResultIdenfier object\n * @return \n */\n public SearchResultIdentifier getSearchResultIdentifier() throws InvalidFormatException;\n\n /**\n * MANDATORY - Must return a non-null list of all CV lookups used by the DAO\n * @return \n */\n public Collection<CV> getCvLookup() throws InvalidFormatException;\n\n /**\n * MANDATORY - Must returns a count of the number of spectra. if onlyIdentified is true, return only count\n * of identified spectra. If false, return count of all spectra.\n * @return \n */\n public int getSpectrumCount(boolean onlyIdentified) throws InvalidFormatException;\n\n /* -------------------------------------------------------------------------------\n Methods for XML output\n ------------------------------------------------------------------------------- */\n\n /**\n * returns an iterator for spectra in the source file - if onlyIdentified is true, return only identified\n * spectra. If false, return all spectra\n * @return \n */\n\n public Iterator<Spectrum> getSpectrumIterator(boolean onlyIdentified) throws InvalidFormatException;\n\n /**\n * must return -1 if no spectrum ref found\n * @return \n */\n public int getSpectrumReferenceForPeptideUID(String peptideUID) throws InvalidFormatException;\n\n /**\n * This function provides random access to the identifications.\n * It is only used in scan mode!\n *\n * @param identificationUID\n * @return\n * @throws uk.ac.ebi.pride.tools.converter.utils.InvalidFormatException\n */\n public Identification getIdentificationByUID(String identificationUID) throws InvalidFormatException;\n\n\n /* -------------------------------------------------------------------------------\n Shared methods\n ------------------------------------------------------------------------------- */\n\n /**\n * This method will return an iterator that will return individual identification objects.\n * In prescanMode the complete Identification and Peptide objects should be returned\n * <b>without</b> the peptide's fragment ion annotation. Peptide items have to contain\n * all the PTMs. <br>\n * In conversionMode (= !prescanMode) Peptide and Protein objects should <b>NOT</b> contain\n * any additional parameters and peptidePTMs should <b>NOT</b> be included. Peptide\n * FragmentIon annotations are mandatory (if applicable) in scanMode.\n * The identification iterator may return null for an identification\n * @return \n */\n public Iterator<Identification> getIdentificationIterator(boolean prescanMode) throws InvalidFormatException;\n /**\n * Sets the external spectrum file to the given filename. This function\n * is ignored by DAOs that do not require external spectrum files.\n * @param filename\n */\n public void setExternalSpectrumFile(String filename);\n\n /*\n These handlers need to be passed to the IdentificationIterator so that the identification objects can be properly\n decorated with the requested information, if available.\n */\n\n}", "public interface SectionDao extends Dao{\n}", "public interface AdvertisementsDao extends GenericDao<Advertisement>{\n\n List<Advertisement> getAll() throws DaoException;\n\n Advertisement getById(int id) throws DaoException;\n}", "public interface IDaConfigOperationDao extends GenericDao<ConfigOperation, Integer> {\n\n List<ConfigOperation> getOperations(String hospitalId, Integer status);\n\n ConfigOperation getOperation(Integer id);\n\n Integer addOperation(ConfigOperation operation);\n\n void updateOperation(ConfigOperation operation);\n\n void deleteOperation(Integer id);\n\n}", "public interface CalApptDAO {\n\n public List<CalApptBO> getAllCalAppts();\n public CalApptBO getCalApptById(int id);\n public int updateCalAppt(CalApptBO calApptBO);\n public int insertCalAppt(CalApptBO calApptBO);\n public int deleteCalAppt(int apptId);\n\n}", "public interface DAOAvaliadorInterface extends DAOGenericoInterface{\n \n /**\n * Método para listar os avaliadores cadastrados no sistema.\n * @return \n */\n public List<AvaliadorDB> listar();\n \n /**\n * Método para inserir um avaliador no sistema.\n * @param avaliador \n */\n public void inserir(AvaliadorDB avaliador);\n \n /**\n * Método para alterar um avaliador cadastrado no sistema.\n * @param avaliador \n */\n public void alterar(AvaliadorDB avaliador);\n \n}", "public interface EscalaDAO {\r\n\r\n /**\r\n * Select numero manifiesto aeat.\r\n *\r\n * @param srvcId\r\n * the srvc id\r\n * @return the string\r\n */\r\n String selectNumeroManifiestoAeat(final Long srvcId);\r\n\r\n /**\r\n * Modificacion del estado de una escala a partir del estado de sus atraques.\r\n *\r\n * @param srvcId\r\n * Identificador del servicio de escala.\r\n * @return Numero de filas modificadas.\r\n */\r\n int updateRecalcularEstado(final Long srvcId);\r\n\r\n /**\r\n * Modificacion del codigo de exencion de una escala a partir del codigo de exencion de sus atraques.\r\n *\r\n * @param srvcId\r\n * Identificador del servicio de escala.\r\n * @return Numero de filas modificadas.\r\n */\r\n int updateExencion(final Long srvcId);\r\n\r\n /**\r\n * Modificacion del tipo de estancia de una escala a partir del tipo de estancia de sus atraques.\r\n *\r\n * @param srvcId\r\n * Identificador del servicio de escala.\r\n * @return Numero de filas modificadas.\r\n */\r\n int updateEstancia(final Long srvcId);\r\n\r\n /**\r\n * Modificacion del tipo de navegacion de entrada de una escala a partir del puerto anterior.\r\n *\r\n * @param srvcId\r\n * Identificador del servicio de escala.\r\n * @return Numero de filas modificadas.\r\n */\r\n int updateNavegacionEntrada(final Long srvcId);\r\n\r\n /**\r\n * Modificacion del tipo de navegacion de salida de una escala a partir del puerto siguiente.\r\n *\r\n * @param srvcId\r\n * Identificador del servicio de escala.\r\n * @return Numero de filas modificadas.\r\n */\r\n int updateNavegacionSalida(final Long srvcId);\r\n\r\n /**\r\n * Modificacion del tipo de IVA de una escala a partir de datos de la escala.\r\n *\r\n * @param srvcId\r\n * Identificador del servicio de escala.\r\n * @return Numero de filas modificadas.\r\n */\r\n int updateTipoIva(final Long srvcId);\r\n\r\n /**\r\n * Modificacion de las fechas de inicio/fin de una escala a partir las fechas de inicio/fin de sus\r\n * atraques.\r\n *\r\n * @param srvcId\r\n * Identificador del servicio de escala.\r\n * @return Numero de filas modificadas.\r\n */\r\n int updateRecalcularFechas(final Long srvcId);\r\n}", "public interface PdbDao {\n\n /**\n * List of company codes for the given ownership codes.\n *\n * @param ownCodes map of own codes with their segments.\n * @return list of OLBCompanyMigration objects.\n * @throws PopulateDataException is thrown.\n */\n List getCompanies(OwnCodes ownCodes) throws PopulateDataException;\n\n}", "public interface AirWaybillDangerousDetailDao {\r\n \r\n public int count() throws DaoException;\r\n\r\n public int deleteById(Integer id) throws DaoException;\r\n\r\n public int insert(AirWaybillDangerousDetail airWaybillDangerousDetail) throws DaoException;\r\n\r\n public AirWaybillDangerousDetail findById(Integer id) throws DaoException;\r\n\t\r\n\tpublic int update(AirWaybillDangerousDetail airWaybillDangerousDetail) throws DaoException;\r\n\t\r\n\tpublic int countByAirWaybillDangerousDetailExample(AirWaybillDangerousDetailExample airWaybillDangerousDetailExample) throws DaoException;\r\n\t\r\n\tpublic AirWaybillDangerousDetail findByAirWaybillDangerousDetailExample(AirWaybillDangerousDetailExample airWaybillDangerousDetailExample) throws DaoException;\r\n\t\r\n public List<AirWaybillDangerousDetail> findAllByAirWaybillDangerousDetailExample(AirWaybillDangerousDetailExample airWaybillDangerousDetailExample) throws DaoException;\r\n \r\n public List<AirWaybillDangerousDetail> findAllByAirWaybillDangerousDetailExample(AirWaybillDangerousDetailExample airWaybillDangerousDetailExample, int limit) throws DaoException;\r\n \r\n public List<AirWaybillDangerousDetail> findAllByAirWaybillDangerousDetailExample(AirWaybillDangerousDetailExample airWaybillDangerousDetailExample, int offset, int limit) throws DaoException;\r\n}", "public interface Dao {\n void crud();\n}", "public interface AccommodationDao extends Dao\n{\n\n\t/**\n\t * Returns a list of AccommodationModel for the given accommodationOfferingCode\n\t *\n\t * @param accommodationOfferingCode\n\t * \t\tthe code of the AccommodationOffering to use to get the Accommodation\n\t * @return the list of AccommodationModel\n\t */\n\tList<AccommodationModel> findAccommodationForAccommodationOffering(String accommodationOfferingCode);\n\n\t/**\n\t * Returns a list of AccommodationModel for the given accommodationOfferingCode and catalogVersion\n\t *\n\t * @param accommodationOfferingCode\n\t * \t\tthe code of the AccommodationOffering to use to get the Accommodation\n\t * @param catalogVersion\n\t * \t\tthe catalog version to use to get the Accommodation\n\t * @return the list of AccommodationModel\n\t */\n\tList<AccommodationModel> findAccommodationForAccommodationOfferingAndCatalog(String accommodationOfferingCode,\n\t\t\tString catalogVersion);\n\n\t/**\n\t * Returns an object of AccommodationModel for the given accommodationOfferingCode and accommodationCode\n\t *\n\t * @param accommodationOfferingCode\n\t * \t\tthe code of the AccommodationOffering to use to get the Accommodation\n\t * @param accommodationCode\n\t * \t\tthe code of the Accommodation\n\t * @return object of AccommodationModel\n\t */\n\tAccommodationModel findAccommodationForAccommodationOffering(String accommodationOfferingCode, String accommodationCode);\n\n}", "public interface CourseDAO {\r\n\r\n \r\n public void create(Integer id, String name, String teacher, Integer studyyear);\r\n\r\n public void setDataSource(DataSource ds);\r\n\r\n\r\n public Course getCourse(Integer id);\r\n\r\n public List<Course> listCourses();\r\n\r\n public void delete(Integer id);\r\n\r\n public void updateTeacher(Integer id, String teacher);\r\n\r\n public void updateCourseName (Integer id, String name);\r\n}", "@Dao\npublic interface NoteItemDao{\n @Query(\"select * from \" + DBTables.NoteItemTable.TABLE_NAME + \" order by \" + DBTables.NoteItemTable._ID + \" ASC\")\n List<NoteItem> queryAllNotes();\n\n @Insert\n void insertNote(NoteItem noteItem);\n\n @Delete\n void deleteNote(NoteItem noteItem);\n\n @Update\n void updateNote(NoteItem noteItem);\n}", "public interface SysConfigDao extends BaseDao<SysConfig, String> {\n\t//SysConfig findByCfPlazaNoAndCfConfigNameAndCfPCNo(String cfPlazaNo, String cfConfigName, String cfPCNo);\n\n SysConfig findByCfConfigName(String cfConfigName);\n}", "public interface ResourceDAO {\n //通过资源信息获取id\n @Select(\" SELECT r.resourceId \" +\n \" FROM btl_resource r \" +\n \" WHERE r.resourceURL = #{resourceURL} \" +\n \" AND r.resourceMethodType = #{resourceMethodType} \" +\n \" AND r.systemId = #{systemId} \")\n public List<Long> findIdByResourceInfo(@Param(\"resourceURL\") String resourceURL,\n @Param(\"resourceMethodType\") int resourceMethodType,\n @Param(\"systemId\") int systemId) ;\n\n //通过资源信息和可用性获取可用id\n @Select(\" SELECT r.resourceId \" +\n \" FROM btl_resource r \" +\n \" WHERE r.resourceURL = #{resourceURL} \" +\n \" AND r.resourceMethodType = #{resourceMethodType} \" +\n \" AND r.systemId = #{systemId} \" +\n \" AND r.state = #{state} \")\n public List<Long> findIdByResourceInfoAndState(@Param(\"resourceURL\") String resourceURL,\n @Param(\"resourceMethodType\") int resourceMethodType,\n @Param(\"systemId\") int systemId,\n @Param(\"state\") int state) ;\n\n //通过ids获取资源记录\n @Select({\"<script>\" ,\n \" SELECT * \",\n \" FROM btl_resource r \",\n \" WHERE r.resourceId IN \",\n \"<foreach item='id' index='index' collection='ids' open='(' separator=',' close=')'>\",\n \"#{id}\",\n \"</foreach>\",\n \"</script>\"})\n public List<ResourceRecord> findByIds(@Param(\"ids\") List<Long> ids) ;\n\n //通过ids获取可用的资源记录\n @Select({\"<script>\" ,\n \" SELECT * \",\n \" FROM btl_resource r \",\n \" WHERE r.state = #{state} \",\n \" AND r.resourceId IN \",\n \"<foreach item='id' index='index' collection='ids' open='(' separator=',' close=')'>\",\n \"#{id}\",\n \"</foreach>\",\n \"</script>\"})\n public List<ResourceRecord> findByIdsAndState(@Param(\"ids\") List<Long> ids , @Param(\"state\") int state) ;\n\n //通过ids获取资源信息\n @Select({\"<script>\" ,\n \" SELECT r.resourceId , r.resourceURL , r.resourceMethodType , r.systemId \",\n \" FROM btl_resource r \",\n \" WHERE r.resourceId IN \",\n \"<foreach item='id' index='index' collection='ids' open='(' separator=',' close=')'>\",\n \"#{id}\",\n \"</foreach>\",\n \"</script>\"})\n public List<ResourceRecord> findIdsWithResourceInfosByIds(@Param(\"ids\") List<Long> ids) ;\n\n //通过ids获取资源名称\n @Select({\"<script>\" ,\n \" SELECT r.resourceId , r.resourceName \",\n \" FROM btl_resource r \",\n \" WHERE r.resourceId IN \",\n \"<foreach item='id' index='index' collection='ids' open='(' separator=',' close=')'>\",\n \"#{id}\",\n \"</foreach>\",\n \"</script>\"})\n public List<ResourceRecord> findIdsWithResourceNameByIds(@Param(\"ids\") List<Long> ids) ;\n\n //通过ids获取资源可用信息\n @Select({\"<script>\" ,\n \" SELECT r.resourceId , r.state \",\n \" FROM btl_resource r \",\n \" WHERE r.resourceId IN \",\n \"<foreach item='id' index='index' collection='ids' open='(' separator=',' close=')'>\",\n \"#{id}\",\n \"</foreach>\",\n \"</script>\"})\n public List<ResourceRecord> findIdsWithStateByIds(@Param(\"ids\") List<Long> ids) ;\n\n\n //获取所有处于某种状态下的资源信息\n @Select(\" SELECT r.resourceId , r.resourceURL , r.resourceMethodType , r.systemId \" +\n \" FROM btl_resource r \" +\n \" WHERE r.state = #{state} \")\n public List<ResourceRecord> findIdsWithResourceInfoByState(@Param(\"state\") int state) ;\n\n //通过名字获取资源记录(分页)\n @Select(\" SELECT * \" +\n \" FROM btl_resource r \" +\n \" WHERE r.resourceName LIKE CONCAT('%' , #{name} , '%') \" +\n \" LIMIT ${skip},${size} \")\n public List<ResourceRecord> findByNameInPage(@Param(\"name\") String name,\n @Param(\"skip\") int skip,\n @Param(\"size\") int size);\n //通过名字获取资源数\n @Select(\" SELECT count(1) \" +\n \" FROM btl_resource r \" +\n \" WHERE r.resourceName LIKE CONCAT('%' , #{name} , '%') \")\n long getCountByName(@Param(\"name\") String name);\n\n\n //获取资源树信息\n @Select(\"SELECT r.resourceId , r.resourceName , r.parentId , r.state FROM btl_resource r\")\n public List<ResourceRecord> findAllRoleIdsWithRoleNameAndParentIdAndState() ;\n\n //添加资源\n @Insert(\" INSERT IGNORE INTO btl_resource(createTime , resourceCode , resourceName , resourceURL , resourceMethodType , systemId , state , parentId , resourceMemo) \" +\n \" VALUES(now() , #{re.resourceCode} , #{re.resourceName} , #{re.resourceURL} , #{re.resourceMethodType} , #{re.systemId} , #{re.state} , #{re.parentId} , #{re.resourceMemo}) \")\n public int insertResource(@Param(\"re\") ResourceRecord re);\n\n //删除资源\n @Delete(\"DELETE FROM btl_resource WHERE resourceId=#{resourceId}\")\n public int deleteById(@Param(\"resourceId\") long resourceId);\n\n //更新资源\n @Update(\"UPDATE btl_resource SET \" +\n \" resourceCode = #{re.resourceCode} , \" +\n \" resourceName = #{re.resourceName} , \" +\n \" resourceURL = #{re.resourceURL} , \" +\n \" resourceMethodType = #{re.resourceMethodType} , \" +\n \" systemId = #{re.systemId} , \" +\n \" state = #{re.state} , \" +\n \" parentId = #{re.parentId} , \" +\n \" resourceMemo = #{re.resourceMemo} \" +\n \" WHERE resourceId = #{re.resourceId}\")\n public int updateResource(@Param(\"re\") ResourceRecord re);\n\n}", "public interface IACORecordDao extends IDao\n{\n\t/**\n\t * \n\t * @return a <code>ACORecordDataModel</code>\n\t */\n\tpublic ACORecordDataModel getACORecord();\n\n}", "public interface EmpDao {\n\n\n /**\n * 根据参数查询列表\n * @param map\n * @return\n */\n\n// select empno,ENAME,job,mgr,hiredate,sal,comm,deptno from emp\n @Select(\"<script>\" +\n \"select a.empno,a.ename,a.job,a.mgr,to_char(a.hiredate,'yyyy-mm-dd') hiredate,a.sal,a.comm,a.deptno,a.mgrname,a.dname,a.rn from \" +\n \"(select b.*,rownum rn from \" +\n \"(select e.*,d.dname from (select e1.*,e2.ename mgrname from emp e1 left join emp e2 on e1.mgr=e2.empno) e left join dept d on e.deptno=d.deptno \" +\n \"<where>\" +\n \"<if test='ename!=null'>and e.ename like '%'||#{ename}||'%' </if>\" +\n \"<if test='job!=null'>and e.job like '%'||#{job}||'%' </if>\" +\n \"</where>\" +\n \"order by empno desc) b where rownum &lt; #{end}) a where a.rn &gt; #{start}\" +\n \"</script>\")\n List<Map> getList(Map map);\n\n\n /**\n * 带条件查询总条数\n * @param map\n * @return\n */\n @Select(\"<script>\"+\n \"select count(*) from emp <where>\" +\n \"<if test='ename != null'> and ename like '%${ename}%'</if>\"+\n \"<if test='job != null'> and job like '%${job}%'</if>\"+\n \"</where></script>\")\n int getPageCount(Map map);\n /**\n * 添加\n * @param map\n * @return\n */\n// seq_emp_id.nextval,ename, job, hiredate, sal, comm,deptno\n @Insert(\"insert into emp values(seq_emp_id.nextval,#{ENAME},#{JOB},#{MGR},to_date(#{HIREDATE},'yyyy-mm-dd'),#{SAL},#{COMM},#{DEPTNO})\")\n int add(Map map);\n\n\n /**\n * 更新\n * @param map\n * @return\n */\n @Update(\"update emp set ename=#{ENAME},job=#{JOB},mgr=#{MGR},hiredate=to_date(#{HIREDATE},'yyyy-mm-dd'),sal=#{SAL},comm=#{COMM},deptno=#{DEPTNO} where empno=#{EMPNO}\")\n int update(Map map);\n\n /**\n * 删除\n * @param deptNo\n * @return\n */\n @Delete(\"delete from emp where empno=#{EMPNO}\")\n int delete(int deptNo);\n\n /**\n * 获取所有部门,用于页面数据绑定\n * @return\n */\n @Select(\"select deptno,dname from dept\")\n List<Map> getDeptType();\n\n /**\n * 获取所有职位,用于页面数据绑定\n * @return\n */\n @Select(\"select distinct(job) from emp\")\n List<Map> getJob();\n\n /**\n * 获取上司,用于页面数据绑定\n * @return\n */\n @Select(\"select empno,ename from emp where job='PRESIDENT' or job='MANAGER' or job='ANALYST'\")\n List<Map> getMgr();\n\n\n}", "public interface IDataBaseRepository {\r\n\r\n /**\r\n * Get DataBase object\r\n *\r\n * @return obj\r\n */\r\n //DataBase getDataBase();\r\n\r\n /**\r\n * Save new clothes\r\n *\r\n * @param clothes obj\r\n */\r\n void save(Clothes clothes);\r\n\r\n /**\r\n * Delete clothes\r\n *\r\n * @param clothes obj\r\n */\r\n void delete(Clothes clothes);\r\n\r\n /**\r\n * Update clothes\r\n *\r\n * @param oldClothes obj\r\n * @param newClothes ojb\r\n */\r\n void update(Clothes oldClothes, Clothes newClothes);\r\n\r\n /**\r\n * Get all clothes\r\n *\r\n * @return list\r\n */\r\n List<Clothes> getAll();\r\n\r\n /**\r\n * Get all clothes by type of the office\r\n *\r\n * @param officeType obj\r\n * @return list\r\n */\r\n List<Clothes> getByOffice(OfficeType officeType);\r\n\r\n /**\r\n * Get clothes by ID\r\n *\r\n * @param id int\r\n * @return clothes obj\r\n */\r\n Clothes getById(int id);\r\n\r\n}", "public interface ClothDao {\n /**\n * 判断衣服Id是否存在\n * @param id\n * @return boolean\n */\n boolean isClothIdExists(int id);\n /**\n * 返回图片\n * @param clothId\n * @return Clothinfostring\n */\n String getClothById(int clothId);\n /**\n * 返回图片\n * @param none\n * @return Cloth Ids\n */\n String getAllCloth();\n\n}", "public interface CustomerDao {\n\n //总条数\n public Integer customerCountByQueryVo(QueryVo vo);\n //结果集\n public List<Customer> selectCustomerListByQueryVo(QueryVo vo);\n\n //通过id查询客户\n public Customer selectCustomerById(Integer id);\n\n //通过id修改客户\n public void updateCustomerById(Customer customer);\n\n //通过id删除客户\n public void deleteCustomerById(Integer id);\n\n //通过id增加客户\n public void addCustomerById(Customer customer);\n}", "public interface DeptDao {\n void insertDept(Dept dept);\n void deleteDept(String name);\n void updateDept(Dept dept);\n List<Dept> queryAllDepts();\n}", "public interface BookDao {\n //查询所有\n List findAll();\n // 分类查询\n List findOne(String cid);\n\n // 查询书的详细信息\n Book findOnlyOne(String cid);\n\n // 加载图书\n Book load(String bid);\n\n // 添加图书\n void add(Book book);\n\n // 删除图书\n void del(String bid);\n // 编辑图书\n void edit(Book book);\n\n\n}", "public interface TEndProjectCommentDAO extends BaseDao<TEndProjectComment> {\n //获取一个教师可以评审的结题\n List<TEndProjectComment> findMyReviewEndPros(String teaCode, PageBean pageBean);\n\n int findMyReviewEndProsCount(String teaCode);\n\n List findByEndprojectcommentAdvise(Object endprojectcommentAdvise);\n\n List findByEndprojectcommentContent(Object endprojectcommentContent);\n\n List findByIsdeleted(Object isdeleted);\n}", "public interface PertenenciaDAO extends GenericDao<Pertenencia, Long> {\n\n}", "public interface ProductCategoryDao {\n\n /**\n * To add a product category object to database\n *\n * @param category object to be added\n */\n void add(ProductCategory category);\n\n /**\n * To find a product category.\n *\n * @param id ID of product category we are searching for\n * @return ProductCategory found\n * @throws IllegalArgumentException for input errors\n */\n ProductCategory find(int id)throws IllegalArgumentException;\n\n /**\n * To remove a product category\n *\n * @param id ID of product category to be removed\n * @throws IllegalArgumentException for input errors\n */\n void remove(int id)throws IllegalArgumentException;\n\n /**\n * To get all ProductCategory objects\n *\n * @return list of all ProductCategory objects stored in database\n */\n List<ProductCategory> getAll();\n\n}", "public interface CashRegisterDAO {\n public void addCashRegister(CashRegister cashRegister ) throws SQLException;\n public void updateCashRegister(CashRegister cashRegister ) throws SQLException;\n public CashRegister getCashRegisterById(Long cashregister_id) throws SQLException;\n public Collection getAllCashRegister() throws SQLException;\n public void deleteCashRegister(CashRegister cashRegister) throws SQLException;\n}", "public interface AirlineInfoDao extends ABEDao {\n\n\t/**\n\t * Method to retrieve the airline information\n\t * \n\t * @return AirlineInfoResponse\n\t * \n\t * @see\n\t * @since\n\t */\n\tpublic AirlineInfoResponse retrieveAirlineInfo(String airlineCode);\n\n\t\n\t\n}", "public interface VisitLineDao extends BaseDao<VisitLine, Long> {\n\n List<VisitLineListModel> getAllVisitLineListModel();\n\n List<VisitLineListModel> getAllVisitLineListModel(Date from, Date to);\n\n List<LabelValue> getAllVisitLineLabelValue();\n\n VisitLineListModel getVisitLineListModelByBackendId(long visitlineBackendId);\n\n VisitLine getVisitLineByBackendId(Long backendId);\n\n}", "public interface IPackageActivateDao extends IBaseDao<PackageActivate>{\n\t/**\n\t * \n\t * <p>\n\t * Title: confirmationNumber\n\t * </p>\n\t * <p>\n\t * Description:广告主确认数录入\n\t * </p>\n\t * \n\t * @param id\n\t * @param number\n\t * @throws Exception\n\t * @author lichuang\n\t * @date 2013-5-23\n\t * @return void\n\t * @version 1.0\n\t */\n\tpublic void confirmationNumber(Long id, Integer number,Integer status) throws Exception;\n\n\n\t/**\n\t * <p>\n\t * Title: statusConfirm\n\t * </p>\n\t * <p>\n\t * Description:数据分完\n\t * </p>\n\t * \n\t * @param fraction_id\n\t * @throws Exception\n\t * @author lichuang\n\t * @date 2013-5-27\n\t * @return void\n\t * @version 1.0\n\t */\n\tpublic void updateStatus(Long id,Integer status) throws Exception;\n\n\t/**\n\t * <p>\n\t * Title: statusConfirm\n\t * </p>\n\t * <p>\n\t * Description:数据分完\n\t * </p>\n\t * \n\t * @param fraction_id\n\t * @throws Exception\n\t * @author lichuang\n\t * @date 2013-5-27\n\t * @return void\n\t * @version 1.0\n\t */\n\tpublic void updateStatu(String ids, Integer status) throws Exception;\n\n\t/**\n\t * <p>\n\t * Title: submitConfirmNumber\n\t * </p>\n\t * <p>\n\t * Description:TODO\n\t * </p>\n\t * \n\t * @param ids\n\t * @author cuidd\n\t * @date 2013-7-16\n\t * @return void\n\t * @version 1.0\n\t */\n\tpublic void submitConfirmNumber(String ids);\n\n\n\t/**\n\t* <p>Title: confirmationCpd</p>\n\t* <p>Description:cpd确认的钱</p>\n\t* @param id\n\t* @param amount\n\t* @throws Exception\n\t* @author lichuang\n\t* @date 2013-8-8\n\t* @return void\n\t* @version 1.0\n\t */\n\tpublic void confirmationCpd(Long id, Double amount)throws Exception;\n\n\t/**\n\t* <p>Title: getById</p>\n\t* <p>Description:读取提交android数据</p>\n\t* @param ids\n\t* @return\n\t* @author cuidd\n\t* @date 2014年11月14日\n\t* @return List<PackageActivateAndroid>\n\t* @version 1.0\n\t */\n\tpublic PackageActivateAndroid getById(Long id)throws Exception;\n\n}", "public interface IProductDao extends IGenericDao<Product> {\n /**\n * Gets product by name.\n *\n * @param name the name of the product\n * @return the product by name\n * @throws EntityNotFoundException the entity not found exception\n */\n Product getProductByName(String name) throws EntityNotFoundException;\n}", "public interface ClerkShiftRecordDAO {\n\n int insert(ClerkShiftDO clerkShiftDO);\n\n Page<ClerkShiftVO> query(ClerkShiftBO clerkShiftBO,RowBounds build);\n}" ]
[ "0.6974688", "0.67623127", "0.67423075", "0.6740558", "0.6712477", "0.6662342", "0.66484493", "0.66007733", "0.657638", "0.652733", "0.65259933", "0.6525831", "0.6496353", "0.6486499", "0.6474804", "0.6472156", "0.64644617", "0.6453068", "0.64491904", "0.6448464", "0.64067864", "0.6402141", "0.63930917", "0.6384404", "0.6379866", "0.6379866", "0.63741463", "0.6367329", "0.6364311", "0.63631725", "0.6363064", "0.6361888", "0.6355791", "0.6354937", "0.6352164", "0.6342392", "0.63419276", "0.6321343", "0.6319799", "0.63159555", "0.63002104", "0.6299046", "0.6298583", "0.6295486", "0.6293565", "0.6284302", "0.62827206", "0.6281158", "0.6274061", "0.627131", "0.6269068", "0.6266036", "0.6262936", "0.62615854", "0.6260751", "0.6258099", "0.625196", "0.6250653", "0.62506145", "0.6248914", "0.6246814", "0.62458664", "0.62388206", "0.623665", "0.62304944", "0.622023", "0.62198603", "0.62168336", "0.62063825", "0.62007487", "0.6199682", "0.61986154", "0.61975145", "0.6197468", "0.6193919", "0.61930877", "0.61908984", "0.6190569", "0.619011", "0.6178026", "0.61778015", "0.61774546", "0.6176882", "0.61761767", "0.6175943", "0.6175276", "0.6173997", "0.617045", "0.61682844", "0.6160431", "0.61550236", "0.6154747", "0.6146482", "0.61417824", "0.6141184", "0.61405164", "0.61363274", "0.6135185", "0.61346346", "0.61344826" ]
0.7105065
0
Return a catalog description based on the database id
public CatalogDescription getCatalogDescription(Long id);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public CatalogDescription getCatalogDescription(String course_id);", "String getDescription(String uuid) throws DatabaseException;", "@java.lang.Override\n public java.lang.String getCatalogId() {\n java.lang.Object ref = catalogId_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n catalogId_ = s;\n return s;\n }\n }", "public java.lang.String getCatalogId() {\n java.lang.Object ref = catalogId_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n catalogId_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "String getCatalogName();", "public String catalog() {\n return catalogName;\n }", "public String catalog() {\n return catalogName;\n }", "java.lang.String getDatabaseId();", "@Override\n @Nonnull\n public String getDescriptionId() {\n return super.getOrCreateDescriptionId();\n }", "public static String courseDescription(long idCorso) {\n\t\tRequestContent rp = new RequestContent();\n\t\trp.type = RequestType.COURSE_DESCRIPTION;\n\t\trp.parameters = new Object[] { idCorso };\n\t\tReceiveContent rpc = sendReceive(rp);\n\t\tString descr = (String) rpc.parameters[0];\n\t\treturn descr;\n\t\t\n\t}", "public String getCatalog()\n\t{\n\t\tif (m_dbName != null)\n\t\t\treturn m_dbName;\n\t//\tlog.severe(\"Database Name not set (yet) - call getConnectionURL first\");\n\t\treturn null;\n\t}", "@Override\n\tpublic long getDescriptionId() {\n\t\treturn _scienceApp.getDescriptionId();\n\t}", "public Catalog getCatalog();", "protected abstract String getDatabaseID();", "java.lang.String getProductDescription();", "@Override\r\n\t\tpublic String getCatalog() throws SQLException {\n\t\t\treturn null;\r\n\t\t}", "public String getDescription(String id) throws IllegalArgumentException;", "public String getJdbcCatalog()\n {\n return getStringValue(DataSourceDobj.FLD_JDBC_CATALOG);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getCatalogIdBytes() {\n java.lang.Object ref = catalogId_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);\n catalogId_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "Catalog getCatalog();", "Catalog getCatalog();", "public String getDatabaseProduct();", "public CatalogDescription getLastVersionCatalogDescription(String courseId);", "public StrColumn getDatabaseIdCSD() {\n return delegate.getColumn(\"database_id_CSD\", DelegatingStrColumn::new);\n }", "public interface CatalogDescriptionDao {\r\n\r\n public void init();\r\n\r\n /**\r\n * Return a catalog description based on the database id\r\n * \r\n * @param id - the database id of the catalog description\r\n * @return - the CatalogDescription\r\n */\r\n public CatalogDescription getCatalogDescription(Long id);\r\n \r\n /**\r\n * Return the active catalog description based on the course id\r\n * \r\n * @param id - the course id of the catalog description\r\n * @return - the last version of the CatalogDescription\r\n */\r\n public CatalogDescription getCatalogDescription(String course_id);\r\n\r\n /**\r\n * Return the last version of a catalog description based on the course id\r\n * \r\n * @param id - the course id of the catalog description\r\n * @return - the last version of the CatalogDescription (null if nothing is found)\r\n */\r\n public CatalogDescription getLastVersionCatalogDescription(String courseId);\r\n\r\n \r\n /**\r\n * Return active catalog descriptions that correspond to the given department\r\n * (can be null for all)\r\n * \r\n * @return - the list of CatalogDescription\r\n */\r\n public List<CatalogDescription> getCatalogDescriptionsByDepartment(String department);\r\n \r\n /**\r\n * Return active catalog descriptions that correspond to the given department with flag to indicate if we return or not inactive catalog descriptions \r\n */\r\n public List<CatalogDescription> getCatalogDescriptionsByDepartment(String department, boolean showInactives);\r\n \r\n \r\n /**\r\n * Return active catalog descriptions that correspond to the given academic career\r\n * (can be null for all)\r\n * \r\n * @return - the list of CatalogDescription\r\n */\r\n public List<CatalogDescription> getCatalogDescriptionsByCareer(String career);\r\n \r\n /**\r\n * Return active catalog descriptions that correspond to the given academic career with flag to indicate if we return or not inactive catalog descriptions\r\n */\r\n public List<CatalogDescription> getCatalogDescriptionsByCareer(String career, boolean showInactives);\r\n \r\n \r\n /**\r\n * Return all active catalog descriptions for certificates programs\r\n * (can be null for all)\r\n * \r\n * @return - the list of CatalogDescription\r\n */\r\n \r\n public List<CatalogDescription> getAllCatalogDescriptionsForCertificate();\r\n \r\n /**\r\n * Return all active catalog descriptions for certificates programs with flag to indicate if we return or not inactive catalog descriptions\r\n */\r\n \r\n public List<CatalogDescription> getAllCatalogDescriptionsForCertificate(boolean showInactives);\r\n \r\n \r\n /**\r\n * Return active catalog descriptions that correspond to the given criteria map\r\n * (can be null for all)\r\n * \r\n * @return - the list of CatalogDescription\r\n */\r\n public List<CatalogDescription> getCatalogDescriptions(Map<String, String> eqCriteria, Map<String, String> searchCriteria);\r\n\r\n /**\r\n * save the catalog description to the database\r\n * \r\n * @param cd - the catalog description to save\r\n * @throws StaleDataException\r\n * @throws DatabaseException\r\n */\r\n public void saveCatalogDescription(CatalogDescription cd)\r\n\t throws StaleDataException, DatabaseException;\r\n\r\n /**\r\n * Return a list of Course id (used by quartz job to determine if the catalog description is already created)\r\n * \r\n * @return - the list of Course id\r\n */\r\n public List<String> getListCourseId();\r\n \r\n \r\n /** \r\n * @return all active catlog descriptions\r\n */\r\n public List<CatalogDescription> getAllCatalogDescriptions();\r\n \r\n \r\n /**\r\n * Set all catalog description to \"inactive\" status\r\n * \r\n */\r\n public void setCatalogDescriptionToInactive();\r\n \r\n /**\r\n * Get catalog description from department that have no description and which are not certificate courses\r\n * \r\n */\r\n public List<CatalogDescription> getCatalogDescriptionsByDepartmentWithNoDescription(String department);\r\n \r\n \r\n /**\r\n * Get catalog description for certificates courses that have no description\r\n * \r\n */\r\n public List<CatalogDescription> getAllCatalogDescriptionsForCertificatesWithNoDescription();\r\n \r\n /**\r\n * Get all departments that have at least one catalog description with an empty description\r\n * \r\n */\r\n public List<String> getDepartmentNameWithAtLeastOneCaWithNoDescription();\r\n \r\n \r\n /**\r\n * return whether or not the specified Catalog Description exists.\r\n * \r\n * @param course_id - the course_id of the catalog description\r\n * @return true if the catalog description exists, false otherwise\r\n */\r\n public boolean descriptionExists(String course_id);\r\n}", "public com.google.protobuf.ByteString getCatalogIdBytes() {\n java.lang.Object ref = catalogId_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);\n catalogId_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@WebMethod(operationName = \"getCatalog\")\n @WebResult(name=\"String\")\n public List<String> getCatalog(@WebParam(name = \"id\") String id) throws ClassNotFoundException, SQLException { \n return Database.getListCatalog(id);\n }", "WfCfgModuleCatalog selectByPrimaryKey(Long catalogId);", "public String getCatalogGuid() {\n\t\treturn catalogGuid;\n\t}", "public static String getDescription(int id) {\n return ACTION_DETAILS[id][DESC_DETAIL_INDEX];\n }", "public String getDescription(Context context)\n\t\t{\n\t\t\tif (descriptionId == 0)\n\t\t\t\treturn null;\n\n\t\t\treturn context.getString(descriptionId);\n\t\t}", "public com.google.cloud.bigquery.biglake.v1alpha1.Catalog getCatalog() {\n if (catalogBuilder_ == null) {\n return catalog_ == null\n ? com.google.cloud.bigquery.biglake.v1alpha1.Catalog.getDefaultInstance()\n : catalog_;\n } else {\n return catalogBuilder_.getMessage();\n }\n }", "public Builder setCatalogId(java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n catalogId_ = value;\n bitField0_ |= 0x00000004;\n onChanged();\n return this;\n }", "@Override\n\tpublic LegouResult getDesc(long id) {\n\t\tTbItemDesc tbItemDesc = tbItemDescMapper.selectByPrimaryKey(id);\n\t\t\n\t\treturn LegouResult.ok(tbItemDesc);\n\t}", "protected abstract String getId(String description);", "@Override\n\tpublic String getCatalogName(int arg0) throws SQLException {\n\t\treturn null;\n\t}", "public abstract String getSummaryForDatabase();", "public List<CatalogDescription> getAllCatalogDescriptionsForCertificate();", "public String toString() {\r\n\t\treturn this.id +\": \" + this.description;\r\n\t}", "public String getAccountDescription(String elementId) {\n String sqlQuery = \"\", name = \"\";\n PreparedStatement st = null;\n ResultSet rs = null;\n try {\n sqlQuery = \" SELECT C_ELEMENTVALUE.name as name FROM C_ELEMENTVALUE WHERE C_ELEMENTVALUE_ID = ? AND C_ELEMENTVALUE.ISACTIVE = 'Y'\";\n st = conn.prepareStatement(sqlQuery);\n st.setString(1, elementId);\n rs = st.executeQuery();\n if (rs.next()) {\n name = rs.getString(\"name\");\n\n }\n } catch (Exception e) {\n log4j.error(\"Exception in getOrgs()\", e);\n }\n return name;\n }", "@java.lang.Override\n public com.google.cloud.bigquery.biglake.v1alpha1.Catalog getCatalog() {\n return catalog_ == null\n ? com.google.cloud.bigquery.biglake.v1alpha1.Catalog.getDefaultInstance()\n : catalog_;\n }", "private RLabel getDbProductLabel() {\n if (dbProductLabel == null) {\n dbProductLabel = new RLabel();\n dbProductLabel.setText(\"<%= ivy.cms.co(\\\"/Dialogs/about/databaseProduct\\\") %>\");\n dbProductLabel.setStyleProperties(\"{/insetsTop \\\"2\\\"}\");\n dbProductLabel.setName(\"dbProductLabel\");\n }\n return dbProductLabel;\n }", "String description();", "String description();", "String description();", "String description();", "String description();", "String description();", "String description();", "String description();", "String description();", "String description();", "String description();", "String description();", "private String getDetail(final String dbBookId) {\n\t\tDB db = connectionManager.getConnection();\n\t\tDBCollection coll = db.getCollection(TableName.BOOKS);\n\t\tDBObject obj = coll.findOne(QueryCriteria.getById(dbBookId));\n\t\t\n\t\tif (obj != null) {\n\t\t\tobj.put(\"href\", Server.getBaseUrl() +\"/books/\" + dbBookId);\n\t\t\treplaceCollectionUuidsWObjRefs(obj);\n\t\t}\n\n\t\treturn obj != null ? obj.toString() : \"{'notFound':'\" + dbBookId + \"'}\";\n\t}", "public Description(long desc_id) throws Exception {\n\t\tDB.Select(\"SELECT * from Descriptions where id=\" + desc_id, new SelectReader() {\n\t\t\tpublic void Read(ResultSet rs) throws Exception\n\t\t\t{\n\t\t\t\tif (rs.next()) {\n\t\t\t\t\tid = desc_id;\n\t\t\t\t\ttext = rs.getString(\"text\");\n\t\t\t\t\tapproved = rs.getBoolean(\"approved\");\n\t\t\t\t\tdiscarded = rs.getBoolean(\"discarded\");\n\t\t\t\t\tuser_nusp = rs.getLong(\"user_nusp\");\n\t\t\t\t\timage_id = rs.getLong(\"image_id\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tthrow new Exception(\"Descrição inexistente\");\n\t\t\t}\n\t\t});\n\t}", "public Optional<String> getDescription(final String id) {\n return Optional.ofNullable(this.registeredPlugins.get(id))\n .map(meta -> meta.description);\n }", "@Transient\n @Override\n public Integer getId()\n {\n return this.conservDescriptionId;\n }", "public void catalogToTextArea(Catalog theCatalog, JTextArea textArea) {\n textArea.setText(\"CONTENTS OF CATALOG:\\n\\n\");\n for (int CDNum = 0; CDNum < theCatalog.getNumItems(); CDNum++) {\n CD cd = (CD) theCatalog.getItem(CDNum);\n // display the title, composer and performer for the CD\n textArea.append(cd.displayStringWithTag() + \"\\n\");\n // display all the tracks, indented using a tab character\n for (int trackNum = 0; trackNum < cd.getNumTracks(); trackNum++) {\n textArea.append(\"\\t\" + cd.getTrack(trackNum) + \"\\n\");\n } // end for trackNum\n } // end for CDNum\n }", "public java.lang.String getStrCatalog()\n\t{\n\t\treturn strCatalog;\n\t}", "public List<CatalogDescription> getCatalogDescriptionsByDepartment(String department);", "private void showCourseCatalogue()\r\n {\r\n \tCourseCatalogue courseCat = this.getDBManager().getCourseCat();\r\n \tthis.getClientOut().printf(\"SUCCESS\\n%s\\n\", courseCat.toString());\r\n \tthis.getClientOut().flush();\r\n }", "public String getCatalogName() {\r\n\t\treturn this.tableMetaDataContext.getCatalogName();\r\n\t}", "String getDescriptionKey();", "private String ddlString(String database, String name) {\n StringBuffer location = new StringBuffer();\n location.append(\"ddl/\").append(database).append(\"/\").append(name);\n\n InputStream resource = Thread.currentThread().getContextClassLoader().getResourceAsStream(location.toString());\n\n if (resource == null) {\n throw new CayenneRuntimeException(\"Can't find DDL file: \" + location);\n }\n\n BufferedReader in = new BufferedReader(new InputStreamReader(resource));\n StringBuffer buf = new StringBuffer();\n try {\n String line = null;\n while ((line = in.readLine()) != null) {\n buf.append(line).append('\\n');\n }\n } catch (IOException e) {\n throw new CayenneRuntimeException(\"Error reading DDL file: \" + location);\n } finally {\n\n try {\n in.close();\n } catch (IOException e) {\n\n }\n }\n return buf.toString();\n }", "private void makeDescription() {\n List switchInfo = InteractDB.getTheList(InteractDB.getFromDB(\"SwitchInfo\", idSwitch.toString()));\n\n DescriptionGen descr = new DescriptionGen(switchInfo);\n description = descr.getDescription();\n }", "public String getDatabaseName()\n {\n return \"product\";\n }", "public String getDetailString()\n {\n String msg = \"{0}, database: {1}, schema: {2}\";\n String unspec = \"<not specified>\";\n String db = StringUtils.isBlank(m_database) ? unspec : m_database;\n String orig = StringUtils.isBlank(m_origin) ? unspec : m_origin;\n return MessageFormat.format(msg, m_jdbcUrl, db, orig);\n }", "public String getDescription(){\n return getString(KEY_DESCRIPTION);\n }", "public static String getObjectDetailDescription(Context ctx, ObjectDetail element) {\n String body = \"\";\n\n if (element.bIsDevice) {\n body = ctx.getString(R.string.od_serial) + \" \" + element.serial\n + \"\\n\" + ctx.getString(R.string.od_location) + \" \" + element.location\n + \"\\n\" + ctx.getString(R.string.od_osver) + \" \" + element.ver\n + \"\\n\" + ctx.getString(R.string.od_updated) + \" \" + Utils.unNormalizeDate(ctx, element.installDate);\n } else {\n body = ctx.getString(R.string.od_version) + \" \" + element.ver\n + \"\\n\" + ctx.getString(R.string.od_installdate) + \" \" + Utils.unNormalizeDate(ctx, element.installDate)\n + \"\\n\" + ctx.getString(R.string.od_count) + \" \" + DBUtils.countApp(ctx, element.pkg);\n }\n return body;\n }", "java.lang.String getDesc();", "public abstract String getDB2ProductTypeTestSql();", "public abstract String getDescription ( );", "public ProductCatalog getCatalog() throws RemoteException;", "private void updateCatalogId() throws TranslationException\n {\n\tString sql = \"SELECT MAX(id) FROM \" + PropertyLookup.getCatalogsTableName();\n\ttry\n\t{\n\t sqlConnector.closeConnection();\n\t ResultSet result = sqlConnector.executeQuery(sql);\n\n\t // We assume the last id added is the id of our catalog.\n\t // If the table is empty something went wrong.\n\t if(result.first())\n\t\tcatalogId = result.getInt(1);\n\t else\n\t\tthrow new TranslationException(\"Error retrieving the catalog id\");\n\t}\n\tcatch(SQLException e)\n\t{\n\t throw new TranslationException(\"Error retrieving the catalog id\", e);\n\t}\n\tfinally\n\t{\n\t sqlConnector.closeConnection();\n\t}\n }", "@Override\n public Cursor getEnvironmentRecordForID(int id) {\n final SQLiteDatabase db = this.helper.getReadableDatabase();\n return db.query(\"environments_with_addons\", COLUMNS_ENVIRONMENT_DETAILS, \"id = \" + id, null, null, null, null);\n }", "@Override\n public String getStringFromDatabase(int objectID) {\n return \"From Class one result\"+objectID;\n }", "@Override\n public CatalogDAO getCatalogDao() {\n return daoCatalog;\n }", "String getDisplay_description();", "String getDetailedDescription() {\n return context.getString(detailedDescription);\n }", "String getDescription() {\n if (description == null) {\n return null;\n }\n if (basicControl) {\n return String.format(\"%s %s\", context.getString(description), context.getString(R.string.basicControl));\n }\n return context.getString(description);\n }", "public void displayDatabaseInfo() {\n SQLiteDatabase db = this.getReadableDatabase();\r\n\r\n String[] projection = {\r\n StoreEntry._ID,\r\n StoreEntry.COLUMN_PRODUCT_NAME,\r\n StoreEntry.COLUMN_PRODUCT_QUANTITY,\r\n StoreEntry.COLUMN_PRODUCT_PRICE,\r\n StoreEntry.COLUMN_PRODUCT_SUPPLIER_NAME,\r\n StoreEntry.COLUMN_PRODUCT_SUPPLIER_PHONE };\r\n\r\n Cursor cursor = db.query(\r\n StoreEntry.TABLE_NAME, // The table to query\r\n projection, // The columns to return\r\n null, // The columns for the WHERE clause\r\n null, // The values for the WHERE clause\r\n null, // Don't group the rows\r\n null, // Don't filter by row groups\r\n null); // The sort order\r\n\r\n try {\r\n\r\n int idColumnIndex = cursor.getColumnIndex(StoreEntry._ID);\r\n int nameColumnIndex = cursor.getColumnIndex(StoreEntry.COLUMN_PRODUCT_NAME);\r\n\r\n while (cursor.moveToNext()) {\r\n\r\n int currentID = cursor.getInt(idColumnIndex);\r\n String currentName = cursor.getString(nameColumnIndex);\r\n\r\n Log.v(currentID + \"\", currentName + \"\");\r\n }\r\n } finally {\r\n cursor.close();\r\n }\r\n }", "public abstract String description();", "public abstract String description();", "public void consulterCatalog() {\n\t\t\n\t}", "public abstract String getDatabaseName();", "String getDesc();", "public String getDatabaseName()\n {\n return \"assetdr\";\n }", "public static String getArtNameByID(int id) {\n try {\n Statement statement = Connector.getConnection().createStatement();\n String query = \"SELECT * FROM Arts WHERE artId = \" + id + \"\";\n ResultSet rs = statement.executeQuery(query);\n if (rs.next()) {\n return rs.getString(2);\n } else {\n return null;\n }\n } catch (SQLException e) {\n Logger.getLogger(ArtDAO.class.getName()).log(Level.SEVERE, null, e);\n return null;\n }\n }", "public void fromDatabase(int id) {\r\n \r\n \t\tRationaleDB db = RationaleDB.getHandle();\r\n \t\tConnection conn = db.getConnection();\r\n \r\n \t\tthis.id = id;\r\n \r\n \t\tStatement stmt = null;\r\n \t\tResultSet rs = null;\r\n \t\tString findQuery = \"\";\r\n \t\ttry {\r\n \t\t\tstmt = conn.createStatement();\r\n \r\n \t\t\tfindQuery = \"SELECT * FROM \" + \"alternatives where id = \"\r\n \t\t\t+ new Integer(id).toString();\r\n \t\t\t// *** System.out.println(findQuery);\r\n \t\t\trs = stmt.executeQuery(findQuery);\r\n \r\n \t\t\tif (rs.next()) {\r\n \t\t\t\tname = RationaleDBUtil.decode(rs.getString(\"name\"));\r\n \t\t\t\trs.close();\r\n \t\t\t\tthis.fromDatabase(name);\r\n \t\t\t}\r\n \r\n \t\t} catch (SQLException ex) {\r\n \t\t\t// handle any errors\r\n \t\t\tRationaleDB.reportError(ex, \"Alternative.fromDatabase(int)\",\r\n \t\t\t\t\tfindQuery);\r\n \t\t} finally {\r\n \t\t\tRationaleDB.releaseResources(stmt, rs);\r\n \t\t}\r\n \r\n \t}", "public StoreDescription getDescription() throws RemoteException;", "public List<String> dispProduct(String id);", "public String description();", "CatalogDatabase getDatabase(String databaseName)\n throws DatabaseNotExistException, CatalogException;", "@java.lang.Override\n public com.google.cloud.bigquery.biglake.v1alpha1.CatalogOrBuilder getCatalogOrBuilder() {\n return catalog_ == null\n ? com.google.cloud.bigquery.biglake.v1alpha1.Catalog.getDefaultInstance()\n : catalog_;\n }", "@Override public String toString() {\n Lookup.Template template = new Lookup.Template<CatalogReader>(CatalogReader.class);\n Lookup.Result result = getUserCatalogsLookup().lookup(template); \n return \"CatalogSettings[ global-scope: \" + result.allInstances() + \n \", project-scope: \" + mountedCatalogs + \" ]\";\n }", "private static void writeCatalog(XMLStreamWriter w, RepositoryConnection con)\n\t\tthrows XMLStreamException {\n\t\tString cat = \"http://data.gov.be/catalog\";\n\n\t\tw.writeStartElement(\"rdf:RDF\");\n\t\twritePrefixes(w);\n\n\t\tw.writeStartElement(\"dcat:Catalog\");\n\t\tw.writeAttribute(\"dct:identifier\", cat);\n\t\tw.writeAttribute(\"rdf:about\", cat);\n\n\t\tIRI uri = con.getValueFactory().createIRI(cat);\n\t\twriteGeneric(w, con, uri);\n\t\twriteReferences(w, con, uri, FOAF.HOMEPAGE, \"foaf:homepage\");\n\t\twriteReferences(w, con, uri, DCTERMS.LICENSE, \"dct:license\");\n\t\twriteDatasets(w, con);\n\t\twriteDataservices(w, con);\n\t\tw.writeEndElement();\n\n\t\twriteAgents(w, con);\n\n\t\twriteLocations(w, con);\n\t\n\t\twriteDocuments(w, con, DCTERMS.PROVENANCE, \"dct:ProvenanceStatement\");\n\t\twriteDocuments(w, con, DCTERMS.LICENSE, \"dct:LicenseDocument\");\n\t\twriteDocuments(w, con, DCTERMS.RIGHTS, \"dct:RightsStatement\");\n\t\twriteDocuments(w, con, DCTERMS.CONFORMS_TO, \"dct:Standard\");\n\n\t\twriteConcepts(w, con, DCTERMS.ACCESS_RIGHTS, \"dct:RightsStatement\");\n\t\twriteConcepts(w, con, DCTERMS.ACCRUAL_PERIODICITY, \"dct:Frequency\");\n\t\twriteConcepts(w, con, DCTERMS.LANGUAGE, \"dct:LinguisticSystem\");\n\t\twriteConcepts(w, con, DCTERMS.FORMAT, \"dct:MediaTypeOrExtent\");\n\t\twriteConcepts(w, con, DCTERMS.TYPE, \"skos:Concept\");\n\t\twriteConcepts(w, con, DCAT.MEDIA_TYPE, \"dct:MediaType\");\n\t\twriteConcepts(w, con, DCAT.COMPRESS_FORMAT, \"dct:MediaType\");\n\t\twriteConcepts(w, con, DCAT.THEME, \"skos:Concept\");\n\n\t\tw.writeEndElement();\n\t}", "public String toString() {\n\t\treturn String.format(\"%s\\nID: %d\\nDescription: %s\\n\", name.toUpperCase(), id, description); \n\t}", "public String DRAResStatement(int DRAResID) throws SQLException, Exception {\n\t\tString desc = \"\";\n\t\t\n\t\tString query = \"SELECT * from tblDRARes where ResID = \" + DRAResID;\n\t\tConnection con = null;\n\t\tStatement st = null;\n\t\tResultSet rs = null;\n\t\n\n\t\ttry{\n\t\t\tcon=ConnectionBean.getConnection();\n\t\t\tst=con.createStatement();\n\t\t\trs=st.executeQuery(query);\n\t\t\tif(rs.next())\n\t\t\t\tdesc = rs.getString(\"Resource\");\n\t\t\t\n\t\t\t\n\t\t}catch(Exception e){\n\t\t\tSystem.out.println(\"DevelpmentResources.java - DRAResStatement - \"+e);\n\t\t}finally{\n\t\t\tConnectionBean.closeRset(rs); //Close ResultSet\n\t\t\tConnectionBean.closeStmt(st); //Close statement\n\t\t\tConnectionBean.close(con); //Close connection\n\n\t\t}\t\t\t\n\t\t\n\t\t\n\t\treturn desc;\n\t}", "String getDescription();" ]
[ "0.6985693", "0.63434124", "0.62806773", "0.6173461", "0.615499", "0.61361915", "0.61361915", "0.609453", "0.6076964", "0.60639834", "0.6061679", "0.60565436", "0.6037405", "0.60330135", "0.59848505", "0.59806687", "0.5980502", "0.596432", "0.5932714", "0.59315866", "0.59315866", "0.59161794", "0.5865011", "0.5799568", "0.578527", "0.5775858", "0.57518184", "0.5728184", "0.5722871", "0.57015634", "0.56934243", "0.56925344", "0.5683787", "0.56750375", "0.5657153", "0.55638665", "0.5560282", "0.5551363", "0.55177987", "0.5497944", "0.5489812", "0.5472639", "0.54711944", "0.54711944", "0.54711944", "0.54711944", "0.54711944", "0.54711944", "0.54711944", "0.54711944", "0.54711944", "0.54711944", "0.54711944", "0.54711944", "0.5456233", "0.54418766", "0.54281974", "0.5413415", "0.5412792", "0.53961724", "0.5385775", "0.53664094", "0.53519636", "0.53454036", "0.53436965", "0.5341772", "0.533822", "0.5334752", "0.5317956", "0.53154695", "0.5314708", "0.5295096", "0.5293403", "0.52878237", "0.52878106", "0.5286079", "0.5273111", "0.52719545", "0.52714664", "0.5246822", "0.52389544", "0.5234858", "0.52254134", "0.52254134", "0.5223918", "0.5208533", "0.52054393", "0.52035767", "0.52008057", "0.5192536", "0.51908594", "0.51873326", "0.5170486", "0.51679796", "0.51598775", "0.5158406", "0.515741", "0.51551795", "0.51540864", "0.51520514" ]
0.8045004
0
Return the active catalog description based on the course id
public CatalogDescription getCatalogDescription(String course_id);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public CatalogDescription getCatalogDescription(Long id);", "public static String courseDescription(long idCorso) {\n\t\tRequestContent rp = new RequestContent();\n\t\trp.type = RequestType.COURSE_DESCRIPTION;\n\t\trp.parameters = new Object[] { idCorso };\n\t\tReceiveContent rpc = sendReceive(rp);\n\t\tString descr = (String) rpc.parameters[0];\n\t\treturn descr;\n\t\t\n\t}", "public CatalogDescription getLastVersionCatalogDescription(String courseId);", "public Course getCourseById(String id);", "private void showCourseCatalogue()\r\n {\r\n \tCourseCatalogue courseCat = this.getDBManager().getCourseCat();\r\n \tthis.getClientOut().printf(\"SUCCESS\\n%s\\n\", courseCat.toString());\r\n \tthis.getClientOut().flush();\r\n }", "public String getCourseDesc() {\n return courseDesc;\n }", "public boolean descriptionExists(String course_id);", "@GetMapping(\"/findCourseDetailsWithCourseID/{courseId}\")\n\tpublic ResponseEntity<?> getCourse(@PathVariable(\"courseId\") int id) {\n\t\t// UniversityStaffMember staff=universityService.viewStaff(sid);\n\t\tCourse c = courseService.viewCourse(id);\n\t\tif (c == null)\n\t\t\tthrow new DataNotFoundException(\"Request\", \"course with id \" + id + \" not found.\");\n\t\telse\n\t\t\treturn new ResponseEntity<Course>(c, HttpStatus.OK);\n\t}", "public String displayCourse(){\n return \"\\tCourse Id: \" + id + \"\\n\" +\n \"\\tCourse Name: \" + name + \"\\n\" +\n \"\\tCourse Description: \" + description + \"\\n\" +\n \"\\tCourse Teacher(s): \" + teacherString() + \"\\n\";\n }", "public CourseVo getCourseInfo(Integer courseId) {\n\t\treturn (CourseVo) courseVoMapper.getCourseInfo(courseId);\n\t}", "Map<String, String> fetchCourseDetails(String courseId);", "public Optional<Course> getCourse(String id) {\n//\t\treturn topics.stream().filter(t -> t.getId().equals(id)).findFirst().get();\n\t\treturn courseRepository.findById(id);\n\t}", "private Course getCourse(String courseId) {\n MongoCollection<Course> courseMongoCollection = mongoDatabase.getCollection(\"course\", Course.class);\n return courseMongoCollection.find(eq(\"_id\", new ObjectId(courseId))).first();\n }", "@Override\n\tpublic Course getCourse(String id) {\n\t\treturn null;\n\t}", "public String getCourseId() {\n return courseId;\n }", "public Course getCourseById(int id) {\n\t\treturn null;\n\t}", "public Course getCourseById(int id) {\n\t\treturn this.getHibernateTemplate().get(Course.class, id);\n\t}", "public String getIdCourse() {\n\t\t\treturn idCourse;\n\t\t}", "public Optional<Course> getCourse(String id) {\n\t\treturn courseRepository.findById(id);\n\t}", "public String getCourseId() {\n\t\treturn courseId;\n\t}", "public String toString() {\n return \"\"+courseID;\n }", "public List<Courses> courseInfo(String courseid) {\n\t\t\n\t\tList<Courses> courselist = new ArrayList<Courses>();\n\t\t\n\t\tMongoConnection mongocon = new MongoConnection();\n\t\tDBCursor resultcursor = mongocon.getDBObject(\"courseid\", courseid, \"Course\");\n\t\tif(resultcursor.hasNext()){\n\t\t\tDBObject theObj = resultcursor.next();\n\t\t\t\n\t\t\tCourses courses = new Courses();\n\t\t\tcourses.setCourseCategory((String)theObj.get(\"courseCategory\"));\n\t\t\tcourses.setCourseDescription((String)theObj.get(\"courseDescription\"));\n\t\t\tcourses.setCourseFee((String)theObj.get(\"courseFee\"));\n\t\t\tcourses.setCourseid((String)theObj.get(\"courseid\"));\n\t\t\tcourses.setCourseimageid((String)theObj.get(\"courseimageid\"));\n\t\t\tcourses.setCourseName((String)theObj.get(\"courseName\"));\n\t\t\tcourses.setCourseownerid((String)theObj.get(\"courseownerid\"));\n\t\t\tString[] partners = ((String)theObj.get(\"coursePartners\")).split(\",\");\n\t\t\tcourses.setCoursePartners(partners);\n\t\t\t//String[] reviews = ((String)theObj.get(\"courseReview\")).split(\",\");\n\t\t\tcourses.setCourseReview((String)theObj.get(\"courseReview\"));\n\t\t\tString[] sponsors = ((String)theObj.get(\"courseSponsors\")).split(\",\");\n\t\t\tcourses.setCourseSponsors(sponsors);\n\t\t\tString[] faqids = ((String)theObj.get(\"FAQid\")).split(\",\");\n\t\t\tcourses.setFAQid(faqids) ;\n\t\t\t\n\t\t\tcourselist.add(courses);\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\n\t\t/*\n\t\t * for(int i=0;i<courseinfo.size();i++){ Courses corselst =\n\t\t * courseinfo.get(i); courselist.add(corselst.getCoursename());\n\t\t * courselist.add(corselst.getCourseid());\n\t\t * courselist.add(corselst.getCourseCategory());\n\t\t * courselist.add(corselst.getCourseDescription());\n\t\t * courselist.add(corselst.getCourseFee());\n\t\t * courselist.add(corselst.getCourseimageid());\n\t\t * courselist.add(corselst.getTimeduration());\n\t\t * courselist.add(corselst.getFAQ());\n\t\t * \n\t\t * \n\t\t * ApplicationContext ctx1 = new\n\t\t * AnnotationConfigApplicationContext(SpringMongoConfig.class);\n\t\t * MongoOperations mongoOperation1 = (MongoOperations)\n\t\t * ctx1.getBean(\"mongoTemplate\");\n\t\t * \n\t\t * //User Details Query query1 = new Query(); //\n\t\t * query2.addCriteria(Criteria.where(\"courseOwner\").is(\"dog\").and(\"age\")\n\t\t * .is(40)); query1.addCriteria(Criteria.where(\"userid\").is(\n\t\t * \"572f7777bc22c22add92894e\")); List<Profile> profileinfo =\n\t\t * (List<Profile>) mongoOperation1.find(query1, Profile.class); for(int\n\t\t * j=0;j<profileinfo.size();j++){\n\t\t * \n\t\t * Profile prof = profileinfo.get(j);\n\t\t * \n\t\t * courselist.add(prof.getAboutme());\n\t\t * courselist.add(prof.getProfileThumbnailid());\n\t\t * courselist.add(prof.getCoursesids());\n\t\t * courselist.add(prof.getEmailid());\n\t\t * courselist.add(prof.getExperience());\n\t\t * courselist.add(prof.getFollowers());\n\t\t * \n\t\t * }\n\t\t * \n\t\t * \n\t\t * //Partners details String[] coursePartners =\n\t\t * corselst.getCoursePartners(); for(int\n\t\t * m=0;m<coursePartners.length;m++){\n\t\t * \n\t\t * List partners;\n\t\t * \n\t\t * Query query2 = new Query(); //\n\t\t * query2.addCriteria(Criteria.where(\"courseOwner\").is(\"dog\").and(\"age\")\n\t\t * .is(40));\n\t\t * query2.addCriteria(Criteria.where(\"companyid\").is(coursePartners[m]))\n\t\t * ; partners = (List<Company>) mongoOperation.find(query2,\n\t\t * Company.class);\n\t\t * \n\t\t * if(partners.isEmpty()){ Query query3 = new Query(); //\n\t\t * query2.addCriteria(Criteria.where(\"courseOwner\").is(\"dog\").and(\"age\")\n\t\t * .is(40));\n\t\t * query3.addCriteria(Criteria.where(\"organizationID\").is(coursePartners\n\t\t * [m])); partners = (List<Organization>) mongoOperation.find(query1,\n\t\t * Organization.class);\n\t\t * \n\t\t * for(int n=0;n<partners.size();n++){ Organization org = (Organization)\n\t\t * partners.get(n); courselist.add(org.getOrganizationID());\n\t\t * courselist.add(org.getOrglogoid()); }\n\t\t * \n\t\t * \n\t\t * }else{ for(int n=0;n<partners.size();n++){ Company company =\n\t\t * (Company) partners.get(n); courselist.add(company.getCompanyid());\n\t\t * courselist.add(company.getCompanylogoid()); } }\n\t\t * \n\t\t * }\n\t\t * \n\t\t * \n\t\t * \n\t\t * //Sponsor details String[] courseSponsors =\n\t\t * corselst.getCourseSponsors(); for(int\n\t\t * o=0;o<courseSponsors.length;o++){\n\t\t * \n\t\t * List sponsors;\n\t\t * \n\t\t * Query query2 = new Query(); //\n\t\t * query2.addCriteria(Criteria.where(\"courseOwner\").is(\"dog\").and(\"age\")\n\t\t * .is(40));\n\t\t * query2.addCriteria(Criteria.where(\"companyid\").is(courseSponsors[o]))\n\t\t * ; sponsors = (List<Company>) mongoOperation.find(query1,\n\t\t * Company.class);\n\t\t * \n\t\t * if(sponsors.isEmpty()){ Query query3 = new Query(); //\n\t\t * query2.addCriteria(Criteria.where(\"courseOwner\").is(\"dog\").and(\"age\")\n\t\t * .is(40));\n\t\t * query3.addCriteria(Criteria.where(\"organizationID\").is(courseSponsors\n\t\t * [o])); sponsors = (List<Organization>) mongoOperation.find(query1,\n\t\t * Organization.class);\n\t\t * \n\t\t * for(int n=0;n<sponsors.size();n++){ Organization org = (Organization)\n\t\t * sponsors.get(n); courselist.add(org.getOrganizationID());\n\t\t * courselist.add(org.getOrglogoid()); }\n\t\t * \n\t\t * \n\t\t * }else{ for(int n=0;n<sponsors.size();n++){ Company company =\n\t\t * (Company) sponsors.get(n); courselist.add(company.getCompanyid());\n\t\t * courselist.add(company.getCompanylogoid()); } }\n\t\t * \n\t\t * }\n\t\t * \n\t\t * //Review details\n\t\t * \n\t\t * }\n\t\t */\n\n\t\tSystem.out.println(\"courseinfo >>.\" + courselist);\n\n\t\treturn courselist;\n\n\t}", "public Course getCourse(String id) {\n\t\treturn courseRepository.findById(id).orElseThrow(() -> new ResourceNotFoundException(id));\n\t}", "public String getCourseID() {\r\n return COURSE_ID;\r\n }", "private void viewCourse() {\n Scanner sc = new Scanner(System.in);\n System.out.print(\"ID of the course to be viewed: \");\n Long id = Long.parseLong(sc.next());\n\n Course c = ctrl.getCourse(id);\n if (c != null)\n System.out.println(c.toString());\n else\n System.out.println(\"Course with this ID doesn't exist!\");\n }", "public List<String>ViewCourseDAO(int id) {\n\t\tList<String> courses = new ArrayList<String>();\n\t\ttry {\n stmt = connection.prepareStatement(SqlQueries.ViewAssignCourse);\n stmt.setInt(1, id);\n stmt.execute();\t \n ResultSet rs =stmt.executeQuery();\n while(rs.next())\n {\n \tcourses.add(rs.getString(1));\n }\n } catch(Exception ex){\n \tlogger.error(ex.getMessage());\n \n }finally{\n \t//close resources\n \tDBUtil.closeStmt(stmt);\n }\n\treturn courses ;\n\t}", "public Course getCourse(String id) {\n int idx = getCourseIdx(id); \r\n if (idx < 0)\r\n return null; \r\n return courses.get(idx);\r\n }", "public Course getCourse(String id) {\n\t\treturn courseRepo.findById(id).orElse(new Course());\n\t\t\n\t}", "private void viewActiveCourseList() {\n boolean detailed = yesNoQuestion(\"Would you like to look at the detailed version? (just names if no)\");\n\n System.out.println(\"The current active courses are:\\n \");\n for (int i = 0; i < activeCourseList.size(); i++) {\n if (detailed) {\n System.out.println((i + 1) + \":\");\n detailedCoursePrint(activeCourseList.get(i));\n } else {\n System.out.println((i + 1) + \": \" + activeCourseList.get(i).getName());\n }\n }\n\n }", "public List<Course> getCourseByCid(int id) {\n\t\treturn null;\n\t}", "public String toString() {\r\n return COURSE_ID + \"-\" + COURSE_NAME;\r\n }", "@Override\n\tpublic CourseModel selectCourse(String id_course) {\n\t\tlog.info(\"CourseServiceRest\");\n\t\treturn courseDAO.selectCourse(id_course);\n\t}", "public List<CatalogDescription> getAllCatalogDescriptionsForCertificate();", "@Override\n\tpublic Map<String, Object> findCourseById(int id) {\n\t\treturn cd.findCourseById(id);\n\t}", "public int getCourseId()\n {\n return this.courseId;\n }", "public String getcourse() {\n\t\treturn course;\n\t}", "public void printCourseDetails()\n {\n // put your code here\n System.out.println(\"Course \" + codeNo + \" - \" + title);\n }", "public String getCourse() {\n return courseName;\n }", "@AutoEscape\n\tpublic String getCourse();", "private Course findCourseByName(String id) {\n for (Course course : mySchool.courses) {\n if (course.courseName.equals(id)) {\n return course;\n }\n }\n return null;\n }", "java.lang.String getCourseName();", "public String toString() {\r\n \treturn \"Course: \"+courseName+\"|\"+cid+\"|\"+start+\"|\"+end+\"|\"+modules.size()+\" modules\";\r\n }", "String getDescription() {\n if (description == null) {\n return null;\n }\n if (basicControl) {\n return String.format(\"%s %s\", context.getString(description), context.getString(R.string.basicControl));\n }\n return context.getString(description);\n }", "public interface CatalogDescriptionDao {\r\n\r\n public void init();\r\n\r\n /**\r\n * Return a catalog description based on the database id\r\n * \r\n * @param id - the database id of the catalog description\r\n * @return - the CatalogDescription\r\n */\r\n public CatalogDescription getCatalogDescription(Long id);\r\n \r\n /**\r\n * Return the active catalog description based on the course id\r\n * \r\n * @param id - the course id of the catalog description\r\n * @return - the last version of the CatalogDescription\r\n */\r\n public CatalogDescription getCatalogDescription(String course_id);\r\n\r\n /**\r\n * Return the last version of a catalog description based on the course id\r\n * \r\n * @param id - the course id of the catalog description\r\n * @return - the last version of the CatalogDescription (null if nothing is found)\r\n */\r\n public CatalogDescription getLastVersionCatalogDescription(String courseId);\r\n\r\n \r\n /**\r\n * Return active catalog descriptions that correspond to the given department\r\n * (can be null for all)\r\n * \r\n * @return - the list of CatalogDescription\r\n */\r\n public List<CatalogDescription> getCatalogDescriptionsByDepartment(String department);\r\n \r\n /**\r\n * Return active catalog descriptions that correspond to the given department with flag to indicate if we return or not inactive catalog descriptions \r\n */\r\n public List<CatalogDescription> getCatalogDescriptionsByDepartment(String department, boolean showInactives);\r\n \r\n \r\n /**\r\n * Return active catalog descriptions that correspond to the given academic career\r\n * (can be null for all)\r\n * \r\n * @return - the list of CatalogDescription\r\n */\r\n public List<CatalogDescription> getCatalogDescriptionsByCareer(String career);\r\n \r\n /**\r\n * Return active catalog descriptions that correspond to the given academic career with flag to indicate if we return or not inactive catalog descriptions\r\n */\r\n public List<CatalogDescription> getCatalogDescriptionsByCareer(String career, boolean showInactives);\r\n \r\n \r\n /**\r\n * Return all active catalog descriptions for certificates programs\r\n * (can be null for all)\r\n * \r\n * @return - the list of CatalogDescription\r\n */\r\n \r\n public List<CatalogDescription> getAllCatalogDescriptionsForCertificate();\r\n \r\n /**\r\n * Return all active catalog descriptions for certificates programs with flag to indicate if we return or not inactive catalog descriptions\r\n */\r\n \r\n public List<CatalogDescription> getAllCatalogDescriptionsForCertificate(boolean showInactives);\r\n \r\n \r\n /**\r\n * Return active catalog descriptions that correspond to the given criteria map\r\n * (can be null for all)\r\n * \r\n * @return - the list of CatalogDescription\r\n */\r\n public List<CatalogDescription> getCatalogDescriptions(Map<String, String> eqCriteria, Map<String, String> searchCriteria);\r\n\r\n /**\r\n * save the catalog description to the database\r\n * \r\n * @param cd - the catalog description to save\r\n * @throws StaleDataException\r\n * @throws DatabaseException\r\n */\r\n public void saveCatalogDescription(CatalogDescription cd)\r\n\t throws StaleDataException, DatabaseException;\r\n\r\n /**\r\n * Return a list of Course id (used by quartz job to determine if the catalog description is already created)\r\n * \r\n * @return - the list of Course id\r\n */\r\n public List<String> getListCourseId();\r\n \r\n \r\n /** \r\n * @return all active catlog descriptions\r\n */\r\n public List<CatalogDescription> getAllCatalogDescriptions();\r\n \r\n \r\n /**\r\n * Set all catalog description to \"inactive\" status\r\n * \r\n */\r\n public void setCatalogDescriptionToInactive();\r\n \r\n /**\r\n * Get catalog description from department that have no description and which are not certificate courses\r\n * \r\n */\r\n public List<CatalogDescription> getCatalogDescriptionsByDepartmentWithNoDescription(String department);\r\n \r\n \r\n /**\r\n * Get catalog description for certificates courses that have no description\r\n * \r\n */\r\n public List<CatalogDescription> getAllCatalogDescriptionsForCertificatesWithNoDescription();\r\n \r\n /**\r\n * Get all departments that have at least one catalog description with an empty description\r\n * \r\n */\r\n public List<String> getDepartmentNameWithAtLeastOneCaWithNoDescription();\r\n \r\n \r\n /**\r\n * return whether or not the specified Catalog Description exists.\r\n * \r\n * @param course_id - the course_id of the catalog description\r\n * @return true if the catalog description exists, false otherwise\r\n */\r\n public boolean descriptionExists(String course_id);\r\n}", "@GetMapping(\"/course-resources/{id}\")\n @Timed\n public ResponseEntity<CourseResource> getCourseResource(@PathVariable Long id) {\n log.debug(\"REST request to get CourseResource : {}\", id);\n CourseResource courseResource = courseResourceService.findOne(id);\n return ResponseUtil.wrapOrNotFound(Optional.ofNullable(courseResource));\n }", "java.lang.String getProductDescription();", "@RequestMapping(value = \"course\", method = RequestMethod.GET)\n public String course(Model model, @RequestParam int id){\n Course cor = courseDao.findOne(id);\n List<Recipe> recipes = cor.getRecipes();\n model.addAttribute(\"recipes\", recipes);\n model.addAttribute(\"title\", cor.getCourseName() + \" recipes\");\n return \"recipe/list-under\";\n }", "public Course(int id, String name, String description) {\n this.id = id;\n this.name = name;\n this.description = description;\n this.teachers = new ArrayList<>();\n }", "public Course getCourse(String courseId) {\n return courses.get(courseId);\n }", "public Optional<Course> findById(int courseId) {\n\t\treturn crepo.findById(courseId);\r\n\t}", "public String getCourse() {\n\t\treturn Course;\n\t}", "public String getCourseName(String course_id) throws SQLException {\n\n String courseName = null;\n String query = String.format(\"SELECT * FROM course WHERE course_id = '%s'\", course_id);\n Statement statement = connection.createStatement();\n try {\n ResultSet result = statement.executeQuery(query);\n if(result.next()){\n courseName = result.getString(\"course_title\");\n }\n return courseName;\n }\n catch (SQLException e) {\n return \"No course for now\";\n }\n\n }", "public Course findCourseById(String courseid) {\n\t\tCourse course=new Course();\n\t\tcourse.setCourseId(Integer.parseInt(courseid));\n\t\tList<Course> courses=courseDao.findByExample(course);\n\t\tif(courses.size()==0)\n\t\t\treturn null;\n\t\treturn courses.get(0);\n\t}", "public void courseInfo() {\n\t\tList<Course> unfinishedCourses = super.getUnfinishedCourses();\n\t\tList<Course> finishedCourses = super.getFinishedCourses();\n\n\t\tString retStr = \"Unfinished Courses: \";\n\t\tfor (int i = 0; i < unfinishedCourses.size(); i++) {\n \tretStr += unfinishedCourses.get(i);\n \tif (i != unfinishedCourses.size()-1) {\n\t\t\t\tretStr += \", \";\n \t}\n\t\t}\n\t\tretStr += \"\\nFinished Courses: \";\n\t\tfor (int i = 0; i < finishedCourses.size(); i++) {\n \tretStr += finishedCourses.get(i);\n \tif (i != finishedCourses.size()-1) {\n\t\t\t\tretStr += \", \";\n \t}\n\t\t}\n\t\tretStr += \"\\nHP: \" + this.hp;\n\t\tSystem.out.println(retStr);\n\t}", "@ResponseBody\n @RequestMapping(value=\"/rqstdcourse\", method=RequestMethod.GET)\n public Course courseById(@RequestParam(\"ID\") String id){\n dbManager.initializeDatabase();\n int ID =Integer.parseInt(id);\n Course rqstdcourse = dbManager.getCourseById(ID);\n dbManager.closeDatabase();\n return rqstdcourse;\n }", "public void setCourseId(String courseId) {\n this.courseId = courseId;\n }", "private void viewSavedCourseList() {\n boolean detailed = yesNoQuestion(\"Would you like to look at the detailed version? (just names if no)\");\n\n System.out.println(\"The current active courses are:\\n \");\n for (int i = 0; i < courseList.getCourseList().size(); i++) {\n if (detailed) {\n System.out.println((i + 1) + \":\");\n detailedCoursePrint(courseList.getCourseList().get(i));\n } else {\n System.out.println((i + 1) + \": \" + courseList.getCourseList().get(i).getName());\n }\n }\n }", "public int getCourseID() {\n return courseID;\n }", "public String getCourseName(){//getCourseName body start\n\t\treturn CourseName;\n\t}", "public Long getIdCourse() {\n return idCourse;\n }", "public String getDescription(String id) throws IllegalArgumentException;", "@Override\n\tpublic String getCourseId() \n\t{\n\t\treturn null;\n\t}", "public static String getDescription(int id) {\n return ACTION_DETAILS[id][DESC_DETAIL_INDEX];\n }", "public String getcDescription() {\n return cDescription;\n }", "@GET\n\t@Path(\"{id}\")\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic Response findCourseById(@PathParam(\"id\") Long id,\n @Context Request request) throws ApplicationException {\n\n Course course = courseService.findById(id);\n\n Resource<Course> resource = new Resource<>(course);\n Link selfRel = entityLinks.linkToSingleResource(Course.class, course.getId()).withSelfRel();\n resource.add(selfRel);\n\n CacheControl cc = getCacheControl();\n\n EntityTag tag = new EntityTag(Integer.toString(course.hashCode()));\n Date lastUpdated = course.getUpdatedAt();\n\n Response.ResponseBuilder responseBuilder = request.evaluatePreconditions(lastUpdated, tag);\n\n if (responseBuilder != null) {\n responseBuilder.cacheControl(cc);\n return responseBuilder.build();\n }\n responseBuilder = Response.ok(resource);\n responseBuilder.cacheControl(cc);\n responseBuilder.tag(tag);\n return responseBuilder.build();\n\t}", "public long getCourseId() {\n return _courseImage.getCourseId();\n }", "public com.ms3.training.services.model.Course fetchByCourseId(long courseId)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;", "protected String getCourseID(){\n sharedPref = getSharedPreferences(AppCSTR.PREF_NAME, Context.MODE_PRIVATE);\n //Log.d(\"ID\", sharedPref.getString(\"id\", null));\n return sharedPref.getString(AppCSTR.ACCOUNT_COURSE, null);\n }", "@Override\n\tpublic long getDescriptionId() {\n\t\treturn _scienceApp.getDescriptionId();\n\t}", "@Override\n @Nonnull\n public String getDescriptionId() {\n return super.getOrCreateDescriptionId();\n }", "public String getCourseCode() {\r\n\t\treturn this.courseCode;\r\n\t}", "private void getCourseList(){\r\n\r\n CourseDAO courseDAO = new CourseDAO(Statistics.this);\r\n List<Course> courseList= courseDAO.readListofCourses();\r\n for(Course course: courseList) {\r\n courses.add(course.getName());\r\n }\r\n\r\n }", "public Catalog getCatalog();", "public List<CatalogDescription> getCatalogDescriptionsByDepartment(String department);", "java.lang.String getDesc();", "private static String[] getActualCoursesDetailInfo(ActualCourse actualCourse) {\n String startTime = DateHandlerUtils.dateToString(DateFormatConstants.YYYY_MM_DD_HH_MM, actualCourse.getCourseStartTime());\n String endTime = DateHandlerUtils.dateToString(DateFormatConstants.HH_MM, actualCourse.getCourseEndTime());\n String time = startTime + EmailConstant.MIDDLE_LINE + endTime;\n String[] data = new String[] { replaceNullDataToTBD(actualCourse.getCourseName()), replaceNullDataToTBD(actualCourse.getCourseRoomNum()),\n replaceNullDataToTBD(time), replaceNullDataToTBD(actualCourse.getCourseTrainer()) };\n return data;\n }", "public String getCourseName() {\n return this.courseName;\n }", "public Course getCourseFomCache(String courseId) {\n return courseIdToCourse.get(courseId);\n }", "public Course(int id, String title) {\n this.id = id;\n this.title = title;\n }", "public String getCourseCode() {\n return courseCode;\n }", "@Override\r\n\tpublic Course getCourse(int cid) {\n\t\ttry {\r\n\t\t\tCourse dummy=new Course();\r\n\t\t\tdummy.setCid(cid);\r\n\t\t\tif(allCoursesList.contains(dummy))\r\n\t\t\t{\r\n\t\t\t\tint index=allCoursesList.indexOf(dummy);\r\n\t\t\t\treturn allCoursesList.get(index);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tConnection connection=DBConnection.getConnection();\r\n\t\t\tString sqlQuery=\"select * from \"+TABLECourse+\" where \"+COLcid+\" = ?\";\r\n\t\t\tPreparedStatement pst;\r\n\t\t\tpst = connection.prepareStatement(sqlQuery);\r\n\t\t\tpst.setInt(1, cid);\r\n\t\t\tpst.executeQuery();\r\n\t\t\tResultSet rs=pst.getResultSet();\r\n\t\t\t\r\n\t\t\tif(rs.next()==false)\r\n\t\t\t{\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t\tString name=rs.getString(COLcname);\r\n\t\t\tint duration=rs.getInt(COLduration);\r\n\t\t\tint fees=rs.getInt(COLfees);\r\n\t\t\t\r\n\t\t\tCourse course =new Course(cid,name,duration,fees);\r\n\t\t\tallCoursesList.add(course);\r\n\t\t\treturn course;\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn null;\r\n\t\t\r\n\t\t\r\n\t}", "Course selectByPrimaryKey(Integer cid);", "String getDesc();", "public void printCourseInfo() {\r\n\t\r\n\tString temp =CoursesList.get(0);\r\n\tSystem.out.println(temp);\r\n}", "public String getCourseName()\n {\n return courseName;\n }", "public String getDescription(Context context)\n\t\t{\n\t\t\tif (descriptionId == 0)\n\t\t\t\treturn null;\n\n\t\t\treturn context.getString(descriptionId);\n\t\t}", "public String getCourseName() {\r\n return COURSE_NAME;\r\n }", "private void viewCourses() {\n Iterable<Course> courses = ctrl.getCourseRepo().findAll();\n courses.forEach(System.out::println);\n }", "public Course getCourse() {\n return course; //XXX-CHANGE-XXX\n }", "public void setCatalogDescriptionToInactive();", "public String getCourseName() {\n return courseName;\n }", "@GET\n\t@Path(\"{programId}/course\")\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic List<Course> getCoursesforProgram(@PathParam(\"programId\") String progId){\n\t\treturn ProgramService.getInstance().getCourseForProgram(progId);\n\t}", "public String getCourses() {\n return courses;\n }", "private static String courseLine()\n {\n return String.format(STR_FORMAT_1 + STR_FORMAT_2, COURSE_STR, COURSE);\n }", "public Course get(Course course) {\n\t\tString sql = \"SELECT * FROM course WHERE Cour_ID = ?\";\n\t\ttry {\n\t\t\tconn = dataSource.getConnection();\n\t\t\tsmt = conn.prepareStatement(sql);\n\t\t\tsmt.setInt(1, course.getCourId());\n\t\t\trs = smt.executeQuery();\n\t\t\tif(rs.next()){\t\t\t\t\n\t\t\t\tcourse.setCourName(rs.getString(\"Cour_Name\"));\n\t\t\t\tcourse.setCourSemester(rs.getInt(\"Cour_Semester\"));\n\t\t\t\tcourse.setCourObligatory(rs.getString(\"Cour_Obligatory\"));\n\t\t\t\tcourse.setCourBriefIntro(rs.getString(\"Cour_BriefIntro\"));\n//\t\t\t\tcomment.setComUploadDate(rs.getDate(\"Com_Upload_Date\"));\n\t\t\t\tcourse.getCourseCate().setCourCateId(rs.getInt(\"CourCate_ID\"));\n\t\t\t\t\n\t\t\t}\n\t\t\trs.close();\n\t\t\tsmt.close();\n \n\t\t} catch (SQLException e) {\n\t\t\tthrow new RuntimeException(e);\n \n\t\t} finally {\n\t\t\tif (conn != null) {\n\t\t\t\ttry {\n\t\t\t\t\tconn.close();\n\t\t\t\t} catch (SQLException e) {}\n\t\t\t}\n\t\t}\n\t\treturn course;\n\t}", "@Override\n\tpublic String setCourseId() {\n\t\treturn null;\n\t}", "public String getCourseCode() {\n\t\treturn CourseCode;\n\t}", "@RequestMapping(value=\"/schedulecourse{idvalue}\", method=RequestMethod.GET)\n public ModelAndView displayScheduleCourse(@PathVariable(value = \"idvalue\") String id){\n\n //initialise the database and try to parse the sent id\n dbManager.initializeDatabase();\n int ID=0;\n try{\n ID=Integer.parseInt(id);\n }\n catch (Exception e){\n //there was no id sent\n }\n\n //get all the courses and store them in a hashmap\n HashMap< Integer, String > courseList = new HashMap<>();\n LinkedList<Course> courses=dbManager.getCourseList();\n for(Course courseInList:courses){\n courseList.put(courseInList.getId(),courseInList.getTitle());\n }\n\n //get the ExistingCourse by the sent id or default (blank) one\n //will be implemented later\n //Course course=dbManager.getCourseById(ID);\n dbManager.closeDatabase();\n\n //set the view attributes and return\n ModelAndView mv=new ModelAndView(\"schedulecourse\", \"command\",new ExistingCourse());\n// mv.addObject(\"classroomlist\", classroomList);\n// mv.addObject(\"trainerlist\",trainerList);\n mv.addObject(\"courselist\", courseList);\n return mv;\n }", "public String getCourseName(){\n return courseName;\n }", "@Override\npublic ArrayList<String> courses() {\n\tArrayList<String> studentCourses = new ArrayList<String>();\n\tstudentCourses.add(\"CMPE - 273\");\n\tstudentCourses.add(\"CMPE - 206\");\n\tstudentCourses.add(\"CMPE - 277\");\n\tSystem.out.println(this.name+\" has take these courses\");\n\tfor(int i = 0 ; i < studentCourses.size() ; i++){\n\t\tSystem.out.println( studentCourses.get(i));\n\t}\n\treturn null;\n}" ]
[ "0.76591295", "0.7381388", "0.695169", "0.6756628", "0.67454964", "0.6693955", "0.66057634", "0.6536646", "0.64276594", "0.6408539", "0.6364653", "0.62720686", "0.6268885", "0.62509537", "0.6248473", "0.6240574", "0.6232762", "0.62023956", "0.61908245", "0.6188555", "0.618449", "0.61751497", "0.61741143", "0.6141464", "0.61305237", "0.6125927", "0.61192656", "0.6092303", "0.6088172", "0.6052033", "0.60428345", "0.59977186", "0.59969276", "0.593079", "0.5928045", "0.59197235", "0.59140337", "0.5904161", "0.5894271", "0.58694184", "0.5859251", "0.5846403", "0.5815428", "0.58137465", "0.5786837", "0.57828003", "0.5780009", "0.5776515", "0.57752174", "0.57654727", "0.5764823", "0.5764013", "0.5760751", "0.575855", "0.57379866", "0.5736399", "0.57290584", "0.57268876", "0.57159555", "0.571095", "0.56983304", "0.5697196", "0.5689555", "0.5689109", "0.5680982", "0.56748766", "0.56655765", "0.5663021", "0.56573457", "0.5654645", "0.56460196", "0.5640842", "0.56388974", "0.56016475", "0.55972934", "0.55942583", "0.55931306", "0.55887425", "0.55881864", "0.5574345", "0.55722666", "0.55645216", "0.5562533", "0.5560689", "0.5556437", "0.55556613", "0.55555314", "0.5554015", "0.5552874", "0.5549627", "0.55480725", "0.55457187", "0.55433095", "0.5539199", "0.5532866", "0.5527838", "0.5513636", "0.55064195", "0.5496016", "0.54945326" ]
0.86854446
0
Return the last version of a catalog description based on the course id
public CatalogDescription getLastVersionCatalogDescription(String courseId);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public CatalogDescription getCatalogDescription(String course_id);", "public CatalogDescription getCatalogDescription(Long id);", "private void updateCatalogId() throws TranslationException\n {\n\tString sql = \"SELECT MAX(id) FROM \" + PropertyLookup.getCatalogsTableName();\n\ttry\n\t{\n\t sqlConnector.closeConnection();\n\t ResultSet result = sqlConnector.executeQuery(sql);\n\n\t // We assume the last id added is the id of our catalog.\n\t // If the table is empty something went wrong.\n\t if(result.first())\n\t\tcatalogId = result.getInt(1);\n\t else\n\t\tthrow new TranslationException(\"Error retrieving the catalog id\");\n\t}\n\tcatch(SQLException e)\n\t{\n\t throw new TranslationException(\"Error retrieving the catalog id\", e);\n\t}\n\tfinally\n\t{\n\t sqlConnector.closeConnection();\n\t}\n }", "public static String courseDescription(long idCorso) {\n\t\tRequestContent rp = new RequestContent();\n\t\trp.type = RequestType.COURSE_DESCRIPTION;\n\t\trp.parameters = new Object[] { idCorso };\n\t\tReceiveContent rpc = sendReceive(rp);\n\t\tString descr = (String) rpc.parameters[0];\n\t\treturn descr;\n\t\t\n\t}", "String getLatestVersion(long padId);", "public VersionedContent retrieveLatest(String namespace, String id) throws StageException;", "public long latestVersion(String namespace, String id) throws StageException;", "@Override\n\tpublic String findLatestVersion(String curversion) {\n\t\treturn versionDao.findLatestVersion(curversion);\n\t}", "public CourseVo getCourseInfo(Integer courseId) {\n\t\treturn (CourseVo) courseVoMapper.getCourseInfo(courseId);\n\t}", "@Query(value = \"select max(sec_id) from section where course_id = ?1\",nativeQuery = true)\n Optional<Integer> currentSecId(Long courseId);", "private Course getCourse(String courseId) {\n MongoCollection<Course> courseMongoCollection = mongoDatabase.getCollection(\"course\", Course.class);\n return courseMongoCollection.find(eq(\"_id\", new ObjectId(courseId))).first();\n }", "ArtifactIdentifier getLatestVersion();", "public Course getCourseById(String id);", "public Optional<Course> getCourse(String id) {\n//\t\treturn topics.stream().filter(t -> t.getId().equals(id)).findFirst().get();\n\t\treturn courseRepository.findById(id);\n\t}", "@Query(value = \"select max(sec_no) from section where course_id = ?1\",nativeQuery = true)\n Optional<Integer> currentSecNo(Long courseId);", "public interface CatalogDescriptionDao {\r\n\r\n public void init();\r\n\r\n /**\r\n * Return a catalog description based on the database id\r\n * \r\n * @param id - the database id of the catalog description\r\n * @return - the CatalogDescription\r\n */\r\n public CatalogDescription getCatalogDescription(Long id);\r\n \r\n /**\r\n * Return the active catalog description based on the course id\r\n * \r\n * @param id - the course id of the catalog description\r\n * @return - the last version of the CatalogDescription\r\n */\r\n public CatalogDescription getCatalogDescription(String course_id);\r\n\r\n /**\r\n * Return the last version of a catalog description based on the course id\r\n * \r\n * @param id - the course id of the catalog description\r\n * @return - the last version of the CatalogDescription (null if nothing is found)\r\n */\r\n public CatalogDescription getLastVersionCatalogDescription(String courseId);\r\n\r\n \r\n /**\r\n * Return active catalog descriptions that correspond to the given department\r\n * (can be null for all)\r\n * \r\n * @return - the list of CatalogDescription\r\n */\r\n public List<CatalogDescription> getCatalogDescriptionsByDepartment(String department);\r\n \r\n /**\r\n * Return active catalog descriptions that correspond to the given department with flag to indicate if we return or not inactive catalog descriptions \r\n */\r\n public List<CatalogDescription> getCatalogDescriptionsByDepartment(String department, boolean showInactives);\r\n \r\n \r\n /**\r\n * Return active catalog descriptions that correspond to the given academic career\r\n * (can be null for all)\r\n * \r\n * @return - the list of CatalogDescription\r\n */\r\n public List<CatalogDescription> getCatalogDescriptionsByCareer(String career);\r\n \r\n /**\r\n * Return active catalog descriptions that correspond to the given academic career with flag to indicate if we return or not inactive catalog descriptions\r\n */\r\n public List<CatalogDescription> getCatalogDescriptionsByCareer(String career, boolean showInactives);\r\n \r\n \r\n /**\r\n * Return all active catalog descriptions for certificates programs\r\n * (can be null for all)\r\n * \r\n * @return - the list of CatalogDescription\r\n */\r\n \r\n public List<CatalogDescription> getAllCatalogDescriptionsForCertificate();\r\n \r\n /**\r\n * Return all active catalog descriptions for certificates programs with flag to indicate if we return or not inactive catalog descriptions\r\n */\r\n \r\n public List<CatalogDescription> getAllCatalogDescriptionsForCertificate(boolean showInactives);\r\n \r\n \r\n /**\r\n * Return active catalog descriptions that correspond to the given criteria map\r\n * (can be null for all)\r\n * \r\n * @return - the list of CatalogDescription\r\n */\r\n public List<CatalogDescription> getCatalogDescriptions(Map<String, String> eqCriteria, Map<String, String> searchCriteria);\r\n\r\n /**\r\n * save the catalog description to the database\r\n * \r\n * @param cd - the catalog description to save\r\n * @throws StaleDataException\r\n * @throws DatabaseException\r\n */\r\n public void saveCatalogDescription(CatalogDescription cd)\r\n\t throws StaleDataException, DatabaseException;\r\n\r\n /**\r\n * Return a list of Course id (used by quartz job to determine if the catalog description is already created)\r\n * \r\n * @return - the list of Course id\r\n */\r\n public List<String> getListCourseId();\r\n \r\n \r\n /** \r\n * @return all active catlog descriptions\r\n */\r\n public List<CatalogDescription> getAllCatalogDescriptions();\r\n \r\n \r\n /**\r\n * Set all catalog description to \"inactive\" status\r\n * \r\n */\r\n public void setCatalogDescriptionToInactive();\r\n \r\n /**\r\n * Get catalog description from department that have no description and which are not certificate courses\r\n * \r\n */\r\n public List<CatalogDescription> getCatalogDescriptionsByDepartmentWithNoDescription(String department);\r\n \r\n \r\n /**\r\n * Get catalog description for certificates courses that have no description\r\n * \r\n */\r\n public List<CatalogDescription> getAllCatalogDescriptionsForCertificatesWithNoDescription();\r\n \r\n /**\r\n * Get all departments that have at least one catalog description with an empty description\r\n * \r\n */\r\n public List<String> getDepartmentNameWithAtLeastOneCaWithNoDescription();\r\n \r\n \r\n /**\r\n * return whether or not the specified Catalog Description exists.\r\n * \r\n * @param course_id - the course_id of the catalog description\r\n * @return true if the catalog description exists, false otherwise\r\n */\r\n public boolean descriptionExists(String course_id);\r\n}", "public static Optional<String> getDescription(int conceptId, StampCoordinate stampCoordinate, LanguageCoordinate languageCoordinate) \n\t{\n\t\tOptional<LatestVersion<DescriptionSememe<?>>> desc = Get.conceptService()\n\t\t\t.getSnapshot(stampCoordinate == null ? Get.configurationService().getDefaultStampCoordinate() : stampCoordinate,\n\t\t\t\t\t\tlanguageCoordinate == null ? Get.configurationService().getDefaultLanguageCoordinate() : languageCoordinate)\n\t\t\t\t\t.getDescriptionOptional(conceptId);\n\t\t\n\t\treturn desc.isPresent() ? Optional.of(desc.get().value().getText()) : Optional.empty();\n\t}", "public String getCourseDesc() {\n return courseDesc;\n }", "@GetMapping(\"/findCourseDetailsWithCourseID/{courseId}\")\n\tpublic ResponseEntity<?> getCourse(@PathVariable(\"courseId\") int id) {\n\t\t// UniversityStaffMember staff=universityService.viewStaff(sid);\n\t\tCourse c = courseService.viewCourse(id);\n\t\tif (c == null)\n\t\t\tthrow new DataNotFoundException(\"Request\", \"course with id \" + id + \" not found.\");\n\t\telse\n\t\t\treturn new ResponseEntity<Course>(c, HttpStatus.OK);\n\t}", "public boolean descriptionExists(String course_id);", "public long addOrUpdateCourse(Course course) {\n\t\tSQLiteDatabase db = this.getWritableDatabase();\n\t\tContentValues values = new ContentValues();\n\t\tvalues.put(COURSE_C_VERSIONID, course.getVersionId());\n\t\tvalues.put(COURSE_C_TITLE, course.getTitleJSONString());\n\t\tvalues.put(COURSE_C_LOCATION, course.getLocation());\n\t\tvalues.put(COURSE_C_SHORTNAME, course.getShortname());\n\t\tvalues.put(COURSE_C_LANGS, course.getLangsJSONString());\n\t\tvalues.put(COURSE_C_IMAGE, course.getImageFile());\n\t\tvalues.put(COURSE_C_GROUP, course.getCourseGroup());\n\t\tvalues.put(COURSE_C_DATE, getDate());\n\n\t\tif (!this.isInstalled(course.getShortname())) {\n\t\t\tLog.v(TAG, \"Record added\");\n\t\t\treturn db.insertOrThrow(COURSE_TABLE, null, values);\n\t\t} else if(this.toUpdate(course.getShortname(), course.getVersionId())){\n\t\t\tlong toUpdate = this.getCourseID(course.getShortname());\n\t\t\tif (toUpdate != 0) {\n\t\t\t\tdb.update(COURSE_TABLE, values, COURSE_C_ID + \"=\" + toUpdate, null);\n\t\t\t\t// remove all the old activities\n\t\t\t\tString s = ACTIVITY_C_COURSEID + \"=?\";\n\t\t\t\tString[] args = new String[] { String.valueOf(toUpdate) };\n\t\t\t\tdb.delete(ACTIVITY_TABLE, s, args);\n\t\t\t\treturn toUpdate;\n\t\t\t}\n\t\t} \n\t\t\n\t\treturn -1;\n\t\t\n\t}", "@Override\n public Course getByMaxId() {\n Course result = null;\n String statement = FINDBYMAXID;\n ResultSet rs = data.makeStatement(statement);\n try {\n while(rs.next()){\n result = new Course(rs.getInt(\"id\"),rs.getString(\"title\"),rs.getString(\"stream\"),\n rs.getString(\"type\"),rs.getDate(\"start_date\").toLocalDate(),rs.getDate(\"end_date\").toLocalDate());\n }\n } catch (SQLException ex) {\n System.out.println(\"Problem with CourseDao.getByMaxId()\");\n }\n finally{\n data.closeConnections(rs,data.statement,data.conn);\n }\n return result;\n }", "public Optional<Course> findById(int courseId) {\n\t\treturn crepo.findById(courseId);\r\n\t}", "@GET\n\t@Path(\"{id}\")\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic Response findCourseById(@PathParam(\"id\") Long id,\n @Context Request request) throws ApplicationException {\n\n Course course = courseService.findById(id);\n\n Resource<Course> resource = new Resource<>(course);\n Link selfRel = entityLinks.linkToSingleResource(Course.class, course.getId()).withSelfRel();\n resource.add(selfRel);\n\n CacheControl cc = getCacheControl();\n\n EntityTag tag = new EntityTag(Integer.toString(course.hashCode()));\n Date lastUpdated = course.getUpdatedAt();\n\n Response.ResponseBuilder responseBuilder = request.evaluatePreconditions(lastUpdated, tag);\n\n if (responseBuilder != null) {\n responseBuilder.cacheControl(cc);\n return responseBuilder.build();\n }\n responseBuilder = Response.ok(resource);\n responseBuilder.cacheControl(cc);\n responseBuilder.tag(tag);\n return responseBuilder.build();\n\t}", "@Override\n\tpublic Course getCourse(String id) {\n\t\treturn null;\n\t}", "private void showCourseCatalogue()\r\n {\r\n \tCourseCatalogue courseCat = this.getDBManager().getCourseCat();\r\n \tthis.getClientOut().printf(\"SUCCESS\\n%s\\n\", courseCat.toString());\r\n \tthis.getClientOut().flush();\r\n }", "public String editLongDesc(){\r\n \tString nextView= null;\r\n \tthis.getLog().info(\"editLongDesc()\");\r\n \t\r\n \tif(selectedAlgorithmID >= 0){\r\n \t\tthis.getLog().info(\"+ selected algorithm:\" + selectedAlgorithm.getDisplayShortName());\r\n\t \t\tnextView = \"editB_LongDescription\";\r\n \t}else{\r\n \t\tFacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_WARN, \"Error\" , \"<br />Please select an algorithm to edit.\"));\t\r\n \t}\r\n \t\r\n \tthis.getLog().info(\"+ nextView:\" + nextView); \r\n\t\treturn nextView;\r\n }", "public Course getCourse(String id) {\n int idx = getCourseIdx(id); \r\n if (idx < 0)\r\n return null; \r\n return courses.get(idx);\r\n }", "public Course getCourseById(int id) {\n\t\treturn null;\n\t}", "public Course getLastCourse() {\n return lastCourse;\n }", "@Override\n\tpublic List<CourseVideo> getCourseVideo(int courseid) {\n\t\tSession session = DataBaseHelper.getSession();\n\t\tsession.clear();\n\t\tList list = session.createSQLQuery(\"select * from coursevideo where courseid=\"+courseid).list();\n\t\tList<CourseVideo> courseVideos;\n\t\tif (list.size() == 0) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\tcourseVideos = new ArrayList<>();\n\t\t\tfor (int i = 0; i < list.size(); i++) {\n\t\t\t\tObject[] obj = (Object[]) list.get(i);\n\t\t\t\tCourseVideo courseVideo = new CourseVideo();\n\t\t\t\tcourseVideo.setId((Integer)obj[0]);\n\t\t\t\tcourseVideo.setCourseid((Integer)obj[1]);\n\t\t\t\tcourseVideo.setCoursename((String)obj[2]);\n\t\t\t\tcourseVideo.setCourseurl((String)obj[3]);\n\t\t\t\tcourseVideos.add(courseVideo);\n\t\t\t}\n\t\t\treturn courseVideos;\n\t\t}\n\t}", "public Optional<Course> getCourse(String id) {\n\t\treturn courseRepository.findById(id);\n\t}", "@Override\n\tpublic CourseModel selectCourse(String id_course) {\n\t\tlog.info(\"CourseServiceRest\");\n\t\treturn courseDAO.selectCourse(id_course);\n\t}", "long getCurrentRevision();", "public Course getCourse(String id) {\n\t\treturn courseRepository.findById(id).orElseThrow(() -> new ResourceNotFoundException(id));\n\t}", "public List<Courses> courseInfo(String courseid) {\n\t\t\n\t\tList<Courses> courselist = new ArrayList<Courses>();\n\t\t\n\t\tMongoConnection mongocon = new MongoConnection();\n\t\tDBCursor resultcursor = mongocon.getDBObject(\"courseid\", courseid, \"Course\");\n\t\tif(resultcursor.hasNext()){\n\t\t\tDBObject theObj = resultcursor.next();\n\t\t\t\n\t\t\tCourses courses = new Courses();\n\t\t\tcourses.setCourseCategory((String)theObj.get(\"courseCategory\"));\n\t\t\tcourses.setCourseDescription((String)theObj.get(\"courseDescription\"));\n\t\t\tcourses.setCourseFee((String)theObj.get(\"courseFee\"));\n\t\t\tcourses.setCourseid((String)theObj.get(\"courseid\"));\n\t\t\tcourses.setCourseimageid((String)theObj.get(\"courseimageid\"));\n\t\t\tcourses.setCourseName((String)theObj.get(\"courseName\"));\n\t\t\tcourses.setCourseownerid((String)theObj.get(\"courseownerid\"));\n\t\t\tString[] partners = ((String)theObj.get(\"coursePartners\")).split(\",\");\n\t\t\tcourses.setCoursePartners(partners);\n\t\t\t//String[] reviews = ((String)theObj.get(\"courseReview\")).split(\",\");\n\t\t\tcourses.setCourseReview((String)theObj.get(\"courseReview\"));\n\t\t\tString[] sponsors = ((String)theObj.get(\"courseSponsors\")).split(\",\");\n\t\t\tcourses.setCourseSponsors(sponsors);\n\t\t\tString[] faqids = ((String)theObj.get(\"FAQid\")).split(\",\");\n\t\t\tcourses.setFAQid(faqids) ;\n\t\t\t\n\t\t\tcourselist.add(courses);\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\n\t\t/*\n\t\t * for(int i=0;i<courseinfo.size();i++){ Courses corselst =\n\t\t * courseinfo.get(i); courselist.add(corselst.getCoursename());\n\t\t * courselist.add(corselst.getCourseid());\n\t\t * courselist.add(corselst.getCourseCategory());\n\t\t * courselist.add(corselst.getCourseDescription());\n\t\t * courselist.add(corselst.getCourseFee());\n\t\t * courselist.add(corselst.getCourseimageid());\n\t\t * courselist.add(corselst.getTimeduration());\n\t\t * courselist.add(corselst.getFAQ());\n\t\t * \n\t\t * \n\t\t * ApplicationContext ctx1 = new\n\t\t * AnnotationConfigApplicationContext(SpringMongoConfig.class);\n\t\t * MongoOperations mongoOperation1 = (MongoOperations)\n\t\t * ctx1.getBean(\"mongoTemplate\");\n\t\t * \n\t\t * //User Details Query query1 = new Query(); //\n\t\t * query2.addCriteria(Criteria.where(\"courseOwner\").is(\"dog\").and(\"age\")\n\t\t * .is(40)); query1.addCriteria(Criteria.where(\"userid\").is(\n\t\t * \"572f7777bc22c22add92894e\")); List<Profile> profileinfo =\n\t\t * (List<Profile>) mongoOperation1.find(query1, Profile.class); for(int\n\t\t * j=0;j<profileinfo.size();j++){\n\t\t * \n\t\t * Profile prof = profileinfo.get(j);\n\t\t * \n\t\t * courselist.add(prof.getAboutme());\n\t\t * courselist.add(prof.getProfileThumbnailid());\n\t\t * courselist.add(prof.getCoursesids());\n\t\t * courselist.add(prof.getEmailid());\n\t\t * courselist.add(prof.getExperience());\n\t\t * courselist.add(prof.getFollowers());\n\t\t * \n\t\t * }\n\t\t * \n\t\t * \n\t\t * //Partners details String[] coursePartners =\n\t\t * corselst.getCoursePartners(); for(int\n\t\t * m=0;m<coursePartners.length;m++){\n\t\t * \n\t\t * List partners;\n\t\t * \n\t\t * Query query2 = new Query(); //\n\t\t * query2.addCriteria(Criteria.where(\"courseOwner\").is(\"dog\").and(\"age\")\n\t\t * .is(40));\n\t\t * query2.addCriteria(Criteria.where(\"companyid\").is(coursePartners[m]))\n\t\t * ; partners = (List<Company>) mongoOperation.find(query2,\n\t\t * Company.class);\n\t\t * \n\t\t * if(partners.isEmpty()){ Query query3 = new Query(); //\n\t\t * query2.addCriteria(Criteria.where(\"courseOwner\").is(\"dog\").and(\"age\")\n\t\t * .is(40));\n\t\t * query3.addCriteria(Criteria.where(\"organizationID\").is(coursePartners\n\t\t * [m])); partners = (List<Organization>) mongoOperation.find(query1,\n\t\t * Organization.class);\n\t\t * \n\t\t * for(int n=0;n<partners.size();n++){ Organization org = (Organization)\n\t\t * partners.get(n); courselist.add(org.getOrganizationID());\n\t\t * courselist.add(org.getOrglogoid()); }\n\t\t * \n\t\t * \n\t\t * }else{ for(int n=0;n<partners.size();n++){ Company company =\n\t\t * (Company) partners.get(n); courselist.add(company.getCompanyid());\n\t\t * courselist.add(company.getCompanylogoid()); } }\n\t\t * \n\t\t * }\n\t\t * \n\t\t * \n\t\t * \n\t\t * //Sponsor details String[] courseSponsors =\n\t\t * corselst.getCourseSponsors(); for(int\n\t\t * o=0;o<courseSponsors.length;o++){\n\t\t * \n\t\t * List sponsors;\n\t\t * \n\t\t * Query query2 = new Query(); //\n\t\t * query2.addCriteria(Criteria.where(\"courseOwner\").is(\"dog\").and(\"age\")\n\t\t * .is(40));\n\t\t * query2.addCriteria(Criteria.where(\"companyid\").is(courseSponsors[o]))\n\t\t * ; sponsors = (List<Company>) mongoOperation.find(query1,\n\t\t * Company.class);\n\t\t * \n\t\t * if(sponsors.isEmpty()){ Query query3 = new Query(); //\n\t\t * query2.addCriteria(Criteria.where(\"courseOwner\").is(\"dog\").and(\"age\")\n\t\t * .is(40));\n\t\t * query3.addCriteria(Criteria.where(\"organizationID\").is(courseSponsors\n\t\t * [o])); sponsors = (List<Organization>) mongoOperation.find(query1,\n\t\t * Organization.class);\n\t\t * \n\t\t * for(int n=0;n<sponsors.size();n++){ Organization org = (Organization)\n\t\t * sponsors.get(n); courselist.add(org.getOrganizationID());\n\t\t * courselist.add(org.getOrglogoid()); }\n\t\t * \n\t\t * \n\t\t * }else{ for(int n=0;n<sponsors.size();n++){ Company company =\n\t\t * (Company) sponsors.get(n); courselist.add(company.getCompanyid());\n\t\t * courselist.add(company.getCompanylogoid()); } }\n\t\t * \n\t\t * }\n\t\t * \n\t\t * //Review details\n\t\t * \n\t\t * }\n\t\t */\n\n\t\tSystem.out.println(\"courseinfo >>.\" + courselist);\n\n\t\treturn courselist;\n\n\t}", "public Long readLatestVersionId(final Artifact artifact);", "public Course getCourse(String id) {\n\t\treturn courseRepo.findById(id).orElse(new Course());\n\t\t\n\t}", "public String getCourseId() {\n return courseId;\n }", "@Override\n\tpublic long getDescriptionId() {\n\t\treturn _scienceApp.getDescriptionId();\n\t}", "public StrColumn getRevisionDescription() {\n return delegate.getColumn(\"revision_description\", DelegatingStrColumn::new);\n }", "public V getLatest() {\n return lastItemOfList(versions);\n }", "private void viewCourse() {\n Scanner sc = new Scanner(System.in);\n System.out.print(\"ID of the course to be viewed: \");\n Long id = Long.parseLong(sc.next());\n\n Course c = ctrl.getCourse(id);\n if (c != null)\n System.out.println(c.toString());\n else\n System.out.println(\"Course with this ID doesn't exist!\");\n }", "@java.lang.Override\n public java.lang.String getCatalogId() {\n java.lang.Object ref = catalogId_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n catalogId_ = s;\n return s;\n }\n }", "public java.lang.String getLast_version() {\n return last_version;\n }", "public String getCourseName(String course_id) throws SQLException {\n\n String courseName = null;\n String query = String.format(\"SELECT * FROM course WHERE course_id = '%s'\", course_id);\n Statement statement = connection.createStatement();\n try {\n ResultSet result = statement.executeQuery(query);\n if(result.next()){\n courseName = result.getString(\"course_title\");\n }\n return courseName;\n }\n catch (SQLException e) {\n return \"No course for now\";\n }\n\n }", "Commit getLastCommitDetails(Object requestBody) throws VersionControlException;", "public String getLastReleaseValue() {\n \treturn resolver.getLastReleaseValue();\n }", "public java.lang.String getCatalogId() {\n java.lang.Object ref = catalogId_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n catalogId_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public String getCourseId() {\n\t\treturn courseId;\n\t}", "public static String getVersion()\n {\n return \"$Id$\";\n }", "public GeobatchRunInfo getLastRunInfo(String... compositeId) {\n return getLastRunInfoCache(generateDecription(compositeId));\n }", "public Course getCourseById(int id) {\n\t\treturn this.getHibernateTemplate().get(Course.class, id);\n\t}", "public abstract String getRevision();", "String indexBlackLabVersion();", "public int getLastVersion() {\n return emlVersion - 1;\n }", "public Integer getLastVersion(Game record) {\n return getGameService().findOne(record.getId()).getVersion();\n }", "long currentRevision();", "public long getCourseId() {\n return _courseImage.getCourseId();\n }", "long getVersionNumber();", "private org.eclipse.aether.version.Version getLastVersion()\n\t\t\tthrows MojoExecutionException {\n\n\t\t// build the artifact description with version range from 0 up to (non\n\t\t// inclusive) current version\n\n\t\tString artifactDescription = ARTIFACT_DESCRIPTION.replace(\"groupId\",\n\t\t\t\tgroupId);\n\t\tartifactDescription = artifactDescription.replace(\"artifactId\", name);\n\t\tartifactDescription = artifactDescription.replace(\"version\", version);\n\n\t\tArtifact artifact = new DefaultArtifact(artifactDescription);\n\t\tgetLog().info(\n\t\t\t\tString.format(\"searching for artifacts in range %s\",\n\t\t\t\t\t\tartifactDescription));\n\t\tVersionRangeRequest rangeRequest = new VersionRangeRequest();\n\t\trangeRequest.setArtifact(artifact);\n\t\trangeRequest.setRepositories(projectRepos);\n\n\t\tVersionRangeResult rangeResult;\n\t\ttry {\n\t\t\trangeResult = repoSystem.resolveVersionRange(repoSession,\n\t\t\t\t\trangeRequest);\n\t\t\tList<org.eclipse.aether.version.Version> versions = rangeResult\n\t\t\t\t\t.getVersions();\n\t\t\tgetLog().debug(\n\t\t\t\t\tString.format(\"found versions %s\",\n\t\t\t\t\t\t\trangeResult.getVersions()));\n\t\t\t// could not find a previous version\n\t\t\tif (versions.isEmpty()) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\torg.eclipse.aether.version.Version lastVersion = versions\n\t\t\t\t\t.get(versions.size() - 1);\n\t\t\tgetLog().debug(String.format(\"previous version is %s\", lastVersion));\n\t\t\treturn lastVersion;\n\n\t\t} catch (VersionRangeResolutionException e) {\n\t\t\tthrow new MojoExecutionException(\"could not calculate versions\", e);\n\t\t}\n\n\t}", "public int getCourseId()\n {\n return this.courseId;\n }", "@Override\n\tpublic LegouResult getDesc(long id) {\n\t\tTbItemDesc tbItemDesc = tbItemDescMapper.selectByPrimaryKey(id);\n\t\t\n\t\treturn LegouResult.ok(tbItemDesc);\n\t}", "public com.ms3.training.services.model.Course fetchByCourseId(long courseId)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;", "public static String getVersion() {\n\n try {\n //Open file\n ClassLoader classLoader = new ResourceLoader().getClass().getClassLoader();\n File file = new File(classLoader.getResource(RELEASE_NOTES).getFile());\n //Read File Content\n String content = new String(Files.readAllBytes(file.toPath()));\n content = content.split(\"VERSION \")[1]; //version number comes after VERSION\n content = content.split(\"\\n\")[0]; //and before the next new line\n return content;\n } catch (IOException ex) {\n Logger.getLogger(ResourceLoader.class.getName()).log(Level.SEVERE, null, ex);\n return null;\n }\n\n }", "public String getcourse() {\n\t\treturn course;\n\t}", "@Override\n public String getCurrentRevision(String id) {\n return \"\\\"\" + documentService.getCurrentRevision(id) + \"\\\"\";\n }", "public String toString() {\n return \"\"+courseID;\n }", "java.lang.String getProductDescription();", "Long getVersion();", "public com.google.protobuf.ByteString getCatalogIdBytes() {\n java.lang.Object ref = catalogId_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);\n catalogId_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public List<CatalogDescription> getAllCatalogDescriptionsForCertificate();", "public Course getCourseFomCache(String courseId) {\n return courseIdToCourse.get(courseId);\n }", "public Course get(Course course) {\n\t\tString sql = \"SELECT * FROM course WHERE Cour_ID = ?\";\n\t\ttry {\n\t\t\tconn = dataSource.getConnection();\n\t\t\tsmt = conn.prepareStatement(sql);\n\t\t\tsmt.setInt(1, course.getCourId());\n\t\t\trs = smt.executeQuery();\n\t\t\tif(rs.next()){\t\t\t\t\n\t\t\t\tcourse.setCourName(rs.getString(\"Cour_Name\"));\n\t\t\t\tcourse.setCourSemester(rs.getInt(\"Cour_Semester\"));\n\t\t\t\tcourse.setCourObligatory(rs.getString(\"Cour_Obligatory\"));\n\t\t\t\tcourse.setCourBriefIntro(rs.getString(\"Cour_BriefIntro\"));\n//\t\t\t\tcomment.setComUploadDate(rs.getDate(\"Com_Upload_Date\"));\n\t\t\t\tcourse.getCourseCate().setCourCateId(rs.getInt(\"CourCate_ID\"));\n\t\t\t\t\n\t\t\t}\n\t\t\trs.close();\n\t\t\tsmt.close();\n \n\t\t} catch (SQLException e) {\n\t\t\tthrow new RuntimeException(e);\n \n\t\t} finally {\n\t\t\tif (conn != null) {\n\t\t\t\ttry {\n\t\t\t\t\tconn.close();\n\t\t\t\t} catch (SQLException e) {}\n\t\t\t}\n\t\t}\n\t\treturn course;\n\t}", "public void saveCatalogDescription(CatalogDescription cd)\r\n\t throws StaleDataException, DatabaseException;", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "@java.lang.Override\n public com.google.protobuf.ByteString getCatalogIdBytes() {\n java.lang.Object ref = catalogId_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);\n catalogId_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public Course findCourseById(String courseid) {\n\t\tCourse course=new Course();\n\t\tcourse.setCourseId(Integer.parseInt(courseid));\n\t\tList<Course> courses=courseDao.findByExample(course);\n\t\tif(courses.size()==0)\n\t\t\treturn null;\n\t\treturn courses.get(0);\n\t}", "String offerVersion();", "public String getCourseID() {\r\n return COURSE_ID;\r\n }", "@Override\n @Nonnull\n public String getDescriptionId() {\n return super.getOrCreateDescriptionId();\n }", "public String getDescription(String id) throws IllegalArgumentException;", "long getVersion();", "long getVersion();", "long getVersion();", "long getVersion();", "protected String getCourseID(){\n sharedPref = getSharedPreferences(AppCSTR.PREF_NAME, Context.MODE_PRIVATE);\n //Log.d(\"ID\", sharedPref.getString(\"id\", null));\n return sharedPref.getString(AppCSTR.ACCOUNT_COURSE, null);\n }", "Map<String, String> fetchCourseDetails(String courseId);", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();" ]
[ "0.75348413", "0.6551076", "0.61867493", "0.61174434", "0.59100443", "0.58928686", "0.5889623", "0.56906873", "0.5662976", "0.56302863", "0.55159855", "0.5484567", "0.5453539", "0.5373622", "0.53730553", "0.53623295", "0.53479975", "0.5311538", "0.5274847", "0.52636474", "0.52544767", "0.5250937", "0.52491105", "0.52386504", "0.52327555", "0.5227355", "0.5211004", "0.5208192", "0.5199364", "0.5198644", "0.517683", "0.51716113", "0.51635695", "0.51543605", "0.5138987", "0.51245105", "0.51193726", "0.5108944", "0.5099716", "0.5098969", "0.5095847", "0.5091834", "0.5085237", "0.5080127", "0.5076622", "0.50620794", "0.50582534", "0.5056507", "0.50560933", "0.5052374", "0.5047724", "0.50468147", "0.5045973", "0.50328517", "0.5022584", "0.5019159", "0.5018927", "0.5017692", "0.50172263", "0.50127447", "0.4993105", "0.49858207", "0.49828622", "0.4976413", "0.4975633", "0.49621063", "0.49606615", "0.49586216", "0.49539068", "0.49509045", "0.49468294", "0.49399027", "0.49320415", "0.4912679", "0.49086964", "0.49037698", "0.49037698", "0.49037698", "0.49037698", "0.49037698", "0.49037698", "0.49037698", "0.49037698", "0.49024573", "0.48945037", "0.48849797", "0.48829666", "0.48816043", "0.48717326", "0.48680905", "0.48680905", "0.48680905", "0.48680905", "0.4853424", "0.4836701", "0.48339853", "0.48339853", "0.48339853", "0.48339853", "0.48339853" ]
0.9081302
0
Return active catalog descriptions that correspond to the given department (can be null for all)
public List<CatalogDescription> getCatalogDescriptionsByDepartment(String department);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<CatalogDescription> getCatalogDescriptionsByDepartmentWithNoDescription(String department);", "public List<CatalogDescription> getCatalogDescriptionsByDepartment(String department, boolean showInactives);", "public List<String> getDepartmentNameWithAtLeastOneCaWithNoDescription();", "public ResultSet getDepartmentByName(String dept_name);", "public Departmentdetails getDepartmentByName(String departmentName);", "public TreeMap<String, Course> getDepartmentCourses(String dept) {\n TreeMap<String, Course> map = new TreeMap<>();\n\n for (Course c : courses.values()) {\n if (c.getCourseId().contains(dept)) {\n map.put(c.getCourseId(), c);\n }\n }\n\n return map;\n }", "public List<Department> getAllDepartments();", "Department findByShortName(String name);", "public Departments getDeptTable();", "public List<Departmentdetails> getDepartmentDetails();", "public String getDepartment() {\r\n return department;\r\n }", "public String GetDept()\r\n {\r\n return Department;\r\n }", "public String getDepartment() {\n return department;\n }", "public String getDepartment() {\n return department;\n }", "public String getDepartment() {\n return department;\n }", "public String getDepartment() {\n return department;\n }", "public String getDepartment() {\n return department;\n }", "public void setDepartment(String department) {\n this.department = department;\n }", "public synchronized String getDepartment()\r\n {\r\n return department;\r\n }", "public CatalogDescription getCatalogDescription(String course_id);", "public String getDepartment() {\r\n\t\treturn department;\r\n\t}", "public String getDepartment() {\r\n\t\treturn department;\r\n\t}", "public String getDepartment() {\r\n\t\treturn department;\r\n\t}", "private String getDepartmentString() {\n String[] departments = contact.getDepartment().split(\"\\\\$\");\n String result = \"\";\n for (String dept : departments)\n result += dept.replace('~', ',') + \"\\n\";\n return result;\n }", "public Department getDepartmentByAbbreviation(String abbreviation) {\n Connection connect = null;\n if (abbreviation == null || abbreviation.equalsIgnoreCase(\"\")) {\n throw new IllegalArgumentException(\"Can't read a degree from the Database using id less than one\");\n } else {\n try {\n connect = DBConnection.getConnection();\n Statement stmt = connect.createStatement();\n String query = \"SELECT * FROM \" + TABLE\n + \" WHERE \" + PKEY + \"=\\'\" + abbreviation + \"\\' \";\n rs = stmt.executeQuery(query);\n connect.commit();\n while (rs.next()) {\n return new Department(rs.getString(\"abbreviation\"), rs.getString(\"title\"), rs.getString(\"url_moodle\"), rs.getString(\"token\"));\n }\n } catch (SQLException ex) {\n ex.printStackTrace();\n throw new RuntimeException(\"Read Query failed!\");\n } finally {\n DBConnection.releaseConnection(connect);\n }\n }\n return null;\n }", "public static List getAlumniByDept(String department)\n { \n session=SessionFact.getSessionFact().openSession();\n List li=session.createQuery(\"from Alumni_data where department=:department\").setString(\"department\", department).list();\n session.close();\n return li;\n }", "public void setDepartment(String department) {\r\n\t\tthis.department = department;\r\n\t}", "public static List getDeptList() \n {\n session=SessionFact.getSessionFact().openSession();\n List li=session.createQuery(\"select department from Alumni_data group by department\").list();\n session.close();\n return li;\n }", "public String getDepartment(){\n\t\treturn departName;\n\t}", "public void setDepartment(String department) {\r\n\t\tthis.department=department;\r\n\t}", "private String setDepartment() {\n\t\tSystem.out.println(\"Department codes\\n1 for Sales \\n2 for Development \"\n\t\t\t\t+ \"\\n3 for Accounting \\n0 for Other\\nEnter the department code: \");\n\t\tScanner sc = new Scanner(System.in);\n\t\tint deptChoice = sc.nextInt();\n\t\tsc.close();\n\t\tif (deptChoice == 1) return \"sales\";\n\t\telse if (deptChoice == 2) return \"development\";\n\t\telse if (deptChoice == 3) return \"accounting\";\n\t\telse return \"other\";\n\t}", "public CatalogDescription getCatalogDescription(Long id);", "@Override\n\tpublic List<DeptInf> findAllDept() {\n\t\tDeptInfExample example = new DeptInfExample();\n\t\tList<DeptInf> list = deptMapper.selectByExample(example);\n\t\treturn list;\n\t}", "public ResultSet getDepartmentByID(int dept_no);", "@Override\r\n public Dept deptDetailList(int dept_seq) {\n return sqlSession.selectOne(\"deptDAO.deptDetailList\", dept_seq);\r\n }", "@Override\n public List<Department> getAllDepartments() {\n return null;\n }", "@SuppressWarnings(\"unchecked\")\r\n\t@Override\r\n\tpublic List<String> getDept() {\n\t\treturn getSqlMapClientTemplate().queryForList(\"R_ALARM_LOG.getDept\");\r\n\t}", "@Override\r\n\tpublic List<Department> getAllDepartments() {\n\t\treturn deptRepo.findAll();\r\n\t}", "@Override\n public Department getDepartment(int departmentId) {\n return null;\n }", "public String getDepartment() {\n return departmentField.getText();\n }", "public Department getDepartment() {\n return department;\n }", "public List<GLJournalApprovalVO> getDepartmentfromuniquecode(String OrgId, String ClientId,\n String deptId) {\n String sqlQuery = \"\";\n PreparedStatement st = null;\n ResultSet rs = null;\n List<GLJournalApprovalVO> list = null;\n try {\n list = new ArrayList<GLJournalApprovalVO>();\n sqlQuery = \" select f.c_salesregion_id,sal.name from fact_acct f join c_salesregion sal on sal.c_salesregion_id = f.c_salesregion_id WHERE f.AD_ORG_ID IN (\"\n + OrgId + \") \" + \" AND f.AD_CLIENT_ID IN (\" + ClientId\n + \") AND f.em_efin_uniquecode IN ('\" + deptId\n + \"') and f.c_bpartner_id is not null and f.c_salesregion_id is not null and f.c_project_id is not null and f.c_campaign_id is not null and f.c_activity_id is not null and f.user1_id is not null and f.user2_id is not null limit 1\";\n st = conn.prepareStatement(sqlQuery);\n rs = st.executeQuery();\n while (rs.next()) {\n GLJournalApprovalVO VO = new GLJournalApprovalVO();\n VO.setId(rs.getString(1));\n VO.setName(rs.getString(2));\n list.add(VO);\n }\n } catch (Exception e) {\n log4j.error(\"Exception in getOrgs()\", e);\n }\n return list;\n }", "public static void listDept() {\n\t\t// loop thru all department obj of the deptInfo list\n\t\tfor (Department dept : deptInfo) {\n\t\t\tSystem.out.println(dept.getDeptId() + dept.getDeptName() + dept.getDeptPhoneNum());\n\t\t}\n\t}", "public String getEmployeeDepartment(){\n return profile.getDepartment();\n }", "public String getDepartmentCode()\r\n\t{\r\n\t\treturn getDepartmentCode( getSession().getSessionContext() );\r\n\t}", "public Department findByNameDepartment(String nameDepartment);", "@Override\n\t/**\n\t * Lista los empleados de un departamento dada su id y lo guardamos en department.\n\t */\n\tpublic List<Employees> listadoPorDepartamento(Object department) {\n\t\tList<Employees> ls = null;\n\n\t\tls = ((SQLQuery) sm.obtenerSesionNueva().createQuery(\n\t\t\t\tInstruccionesSQL.CONSULTAR_EMPLEADOS_X_DEPARTAMENTOS\n\t\t\t\t\t\t+ department)).addEntity(Employees.class).list();\n\n\t\treturn ls;\n\t}", "public void setDepartment(String dept) {\r\n\t\tdepartment = dept;\r\n\t}", "public String getDepartmentCode(final SessionContext ctx)\r\n\t{\r\n\t\treturn (String)getProperty( ctx, DEPARTMENTCODE);\r\n\t}", "public static int selectDepartment() {\r\n\t\tSystem.out.println(\"ENTER THE DEPARTMENT\");\r\n\t\tSystem.out.println(\"1.MECH\");\r\n\t\tSystem.out.println(\"2.CIVIL\");\r\n\t\tSystem.out.println(\"3.CSE\");\r\n\t\treturn 0;\r\n\t}", "private Department getDepartment(String departmentName)\n {\n for(Department department:humanPlayer.getDepartments())\n {\n if(department.getName().equals(departmentName))\n {\n return department;\n }\n }\n return null;\n }", "public static Department getDepartment() {\n\t\treturn Departments.getDepartment(\"Computing Science\");\n\t}", "public HasChangeHandlers getDepartmentCombo() {\n\t\treturn componentCurricularCourseIdentification.getDepartmentCombo();\n\t}", "public List<Department> findAll(){\n\t\treturn departmentRepository.findAll();\n\t}", "public String getDeptForCode(String code) {\n return departmentMap.get(code);\n }", "@Override\r\n public List<Dept> deptList() {\n return sqlSession.selectList(\"deptDAO.deptList\");\r\n }", "public List<Department> getAllDepartments()\n\t\t{\n\t\t\treturn departmentRepository.findAll();\n\t\t}", "public String[] departmentNames(){\r\n int size = this.listOfDepartments.size();\r\n String[] deps = new String[size];\r\n for(int i = 0; i < size; i++){\r\n deps[i] = this.listOfDepartments.get(i);\r\n }\r\n return deps;\r\n }", "public String getDept() {\n return dept;\n }", "public String getDept() {\n return dept;\n }", "public static List<Department> getListDepartment() throws ParserConfigurationException {\n List<Department> listDepartments = new ArrayList<>();\n String filePath = \"src/task2/department.xml\";\n File file = new File(filePath);\n DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();\n DocumentBuilder docBuilder;\n try {\n docBuilder = docFactory.newDocumentBuilder();\n Document doc = docBuilder.parse(file);\n doc.getDocumentElement().normalize();\n NodeList nodeList = doc.getElementsByTagName(\"department\");\n for (int i = 0; i < nodeList.getLength(); i++) {\n listDepartments.add(getDepartment(nodeList.item(i)));\n }\n return listDepartments;\n } catch (ParserConfigurationException | SAXException | IOException e) {\n System.out.println(\"Error: \" + e.getMessage());\n }\n return null;\n }", "public void setDepartment(Department department) {\n this.department = department;\n }", "@Override\r\n\tpublic List<Department> getAllDepartment() {\n\t\tString hql = \"from Department\";\r\n\t\treturn (List<Department>) getHibernateTemplate().find(hql);\r\n\t}", "private Department selectDepartment()\n {\n Department selectedDepartment = null;\n if(listViewSelectedHospital != null){\n listViewSelectedHospital = listViewSelectedHospital.trim();\n String hospitalName = listViewSelectedHospital.split(\" \")[0];\n selectedDepartment = getDepartment(hospitalName);\n }\n return selectedDepartment;\n }", "String getDeptType();", "public void setDepartment(Department d) {\r\n department = d;\r\n }", "@Override\n\tpublic List<?> selectDepartment() throws Exception {\n\t\treturn deptMapperr.selectDepartment();\n\t}", "public com.hps.july.persistence.Department getDepartments() throws Exception {\n\tDepartmentAccessBean bean = constructDepartments();\n\tif (bean != null)\n\t return (Department)bean.getEJBRef();\n\telse\n\t return null;\n\n}", "public Department getSingleDepartment(String department) {\n\n /*\n * Use the ConnectionFactory to retrieve an open\n * Hibernate Session.\n *\n */\n Session session = ConnectionFactory.getInstance().getSession();\n List results = null;\n try {\n\n results = session.find(\"from Department as department where department.department = ?\",\n new Object[]{department},\n new Type[]{Hibernate.STRING});\n\n\n\n } /*\n * If the object is not found, i.e., no Item exists with the\n * requested id, we want the method to return null rather\n * than throwing an Exception.\n *\n */ catch (ObjectNotFoundException onfe) {\n return null;\n } catch (HibernateException e) {\n /*\n * All Hibernate Exceptions are transformed into an unchecked\n * RuntimeException. This will have the effect of causing the\n * user's request to return an error.\n *\n */\n System.err.println(\"Hibernate Exception\" + e.getMessage());\n throw new RuntimeException(e);\n } /*\n * Regardless of whether the above processing resulted in an Exception\n * or proceeded normally, we want to close the Hibernate session. When\n * closing the session, we must allow for the possibility of a Hibernate\n * Exception.\n *\n */ finally {\n if (session != null) {\n try {\n session.close();\n } catch (HibernateException e) {\n System.err.println(\"Hibernate Exception\" + e.getMessage());\n throw new RuntimeException(e);\n }\n\n }\n }\n if (results.isEmpty()) {\n return null;\n } else {\n return (Department) results.get(0);\n }\n\n }", "public String getCourseDept() {\n return this.courseDept;\n }", "void getAllDeparments(Vector<Integer> departmentIDs, Vector<String> departmentCodes, Vector<Integer> categoryIDs, String empresa);", "private String setDepartment() {\r\n\t\tSystem.out.println(\"New worker: \" + firstName + \".Department Codes\\n1 for Sales\\n2 for Development\\n3 for Accounting\\n0 for none\\nEnter department code:\");\r\n\t\tScanner in=new Scanner(System.in);\r\n\t\tint depChoice=in.nextInt();\r\n\t\tif(depChoice == 1) {\r\n\t\t\treturn \"sales\";\r\n\t\t}\r\n\t\telse if(depChoice == 2) {\r\n\t\t\treturn \"dev\";\r\n\t\t}\r\n\t\telse if (depChoice == 3) {\r\n\t\t\treturn \"acct\";\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\t}", "public TreeControlI getDepartments() {\n\t\treturn cts.getTree(cts.ROOT,true,\"dep.do?method=select&id=\",\"select\");\n\t}", "public String getDepartmentName() {\n return departmentName;\n }", "public String getDepartmentid() {\n return departmentid;\n }", "public javax.swing.JComboBox getDeptCombo() {\n return deptCombo;\n }", "private String setDepartment() {\r\n\t\tSystem.out.print(\"Enter the Department:\\n1. For sales\\n2. For Development\\n3. For Accounting\\n0. For none\\n\");\r\n\t\tScanner in = new Scanner(System.in);\r\n\t\tint choice = in.nextInt();\r\n\t\tif(choice == 1) { return \"sales\"; }\r\n\t\telse if(choice == 2) { return \"dev\"; }\r\n\t\telse if(choice == 3) { return \"acctg\"; }\r\n\t\telse { return \"\"; }\r\n\t}", "public List<CourseObject> GetAllDepartmentCourses(int dept_id){\r\n String sql = \"SELECT * FROM COURSE WHERE DEPARTMENT_ID = ?\";\r\n List<CourseObject> courseObjectList = null;\r\n try{\r\n courseObjectList = jdbcTemplate.query(sql,new Object[]{dept_id},new BeanPropertyRowMapper(CourseObject.class));\r\n }catch (Exception e){\r\n e.printStackTrace();\r\n }\r\n return courseObjectList;\r\n }", "@Override\r\n\t\tpublic String toString() {\r\n\t\t\tswitch(this) {\r\n\t\t\tcase SALES: return \"Sales\";\r\n\t\t\tcase MKTG: return \"Marketing\";\r\n\t\t\tcase HMRS: return \"Human Resources\";\r\n\t\t\tcase FINA: return \"Finance\";\r\n\t\t\tcase INTE: return \"Information Tecnology\";\r\n\t\t\t\tdefault: return \"Unknown Department\"; \r\n\t\t\t\r\n\t\t\t\r\n\t\t\t}\r\n\t\t}", "public String getSubDepartmentCode()\r\n\t{\r\n\t\treturn getSubDepartmentCode( getSession().getSessionContext() );\r\n\t}", "public void setDepartment(String department) {\n if(department==null){\n department = \"\";\n }\n this.department = department;\n }", "private List<Department> pamDepts(Long deptId) {\n \n PersistenceManager pm = PMF.get().getPersistenceManager();\n depts = new ArrayList<Department>();\n // add primary dept\n Department dPrimary = pm.getObjectById(Department.class, deptId);\n depts.add(dPrimary); \n // primary dept's mutual aid depts\n String dMutualAid = dPrimary.getmutualAid();\n if (dMutualAid.length() != 0) {\n \n if (dMutualAid.contains(\",\")) {\n String[] maDepts = dMutualAid.split(\", \", -1);\n for (int i=0; i< maDepts.length; i++) {\n Long maDeptId = Long.valueOf(maDepts[i]);\n Department dMAs = pm.getObjectById(Department.class, maDeptId);\n if (dMAs != null) {\n depts.add(dMAs);\n }\n }\n } else {\n Department dMAsolo = pm.getObjectById(Department.class, Long.valueOf((dMutualAid).trim()));\n if (dMAsolo != null) {\n depts.add(dMAsolo);\n }\n }\n } \n System.out.println(\"Depts Qty: \" + depts.size());\n System.out.println(\"Exit: pamDepts\");\n return depts;\n }", "public List<Department> getAllDepartments() {\n return this.departmentDao.findAll();\n }", "@Test\n\tvoid testGetDepartmentsByCrit() {\n\t\tDepartmentDAO ddao = new DepartmentDAO();\n\t\tList<Department> ls = ddao.getDepartmentsByCrit();\n\t\tIterator<Department> it = ls.iterator();\n\n\t\twhile (it.hasNext()) {\n\t\t\tDepartment dpt = it.next();\n\t\t\tSystem.out.println(dpt.getDepartment_name() + \" \" + dpt.getLocation_id() + \" \" + dpt.getManager_id());\n\t\t}\n\t\t// assertEquals(203, ls.get(0).getManager_id());\n\t}", "public Department getDepartmentById(Integer id);", "public ResponseEntity<BasicApiResponse<List<DepartmentResponse>>> getDepartments() {\n //Getting All The list of departments\n List<DepartmentModel> departmentModels = departmentRepository.findAll();\n\n List<DepartmentResponse> departmentResponses = new ArrayList<>();\n //Converting Department model to department response for sending in frontend\n for (DepartmentModel departmentModel : departmentModels) {\n DepartmentResponse departmentResponse = new DepartmentResponse(departmentModel.getId(),\n departmentModel.getName(), departmentModel.getActive());\n departmentResponses.add(departmentResponse);\n }\n\n if (departmentModels.isEmpty()) {\n //If No department found\n throw new ResponseStatusException(HttpStatus.NOT_FOUND, \"No Departments Found\");\n } else {\n //If department found\n return new ResponseEntity<>(new BasicApiResponse<>(200, \"Departments Found\",\n departmentResponses), HttpStatus.OK);\n }\n\n }", "public Department findDepartment(Department department) {\n\t\treturn (Department)getHibernateTemplate().find(String.valueOf(department.getIdDepartment())).get(0);\n\t}", "public List<CatalogDescription> getCatalogDescriptions(Map<String, String> eqCriteria, Map<String, String> searchCriteria);", "public static String findDepartmentColorCode(String department) {\n String dept;\n if (department == null) {\n return \"#FFFFFF\";\n } else {\n dept = department.toLowerCase();\n }\n if (\"treasury\".equals(dept)) {\n return \"#0a8141\";\n } else if (\"department of the treasurer\".equals(dept)) {\n return \"#0a8141\";\n } else if (\"secretarial\".equals(dept)) {\n return \"#3a53a5\";\n } else if (\"department of the secretary\".equals(dept)) {\n return \"#3953a4\"; // Not sure which color code is correct, this is from 2016\n// return \"#3a53a5\";\n } else if (\"relations\".equals(dept)) {\n return \"#f282b4\";\n } else if (\"publicity\".equals(dept)) {\n return \"#e0e0e0\";\n } else if (\"programming\".equals(dept)) {\n return \"#6b52a2\";\n } else if (\"operations\".equals(dept)) {\n return \"#ec2426\";\n } else if (\"membership\".equals(dept)) {\n return \"#f57f20\";\n } else if (\"infrastructure\".equals(dept)) {\n return \"#414242\";\n } else if (\"chair\".equals(dept)) {\n return \"#f99f1d\";\n } else if (\"department of the chair\".equals(dept)) {\n return \"#f99f1d\";\n } else {\n System.out.println(\"Warning, couldn't find color code for \" + department);\n return \"#FFFFFF\";\n }\n }", "public String getDeptName() {\r\n return deptName;\r\n }", "@Override\n\tpublic List<Organization> getDepartmentDetails(Integer parentorgcode)throws Exception {\n\t\n\t\t\n\t\treturn organizationDAO.getDepartmentDetails(parentorgcode);\n\t\t\n\t\t\n\t}", "private List<Department> getDepartments()\n\t\t\tthrows FileNotFoundException, ClassNotFoundException, IOException, SQLException {\n\t\tList<Department> departments = new ArrayList<Department>();\n\t\tStatement statement = connection.createStatement();\n\t\tString sql = \"SELECT * FROM Department\";\n\t\tResultSet resultSet = statement.executeQuery(sql);\n\t\twhile (resultSet.next()) {\n\t\t\tDepartment department = new Department();\n\t\t\tdepartment.setId(resultSet.getInt(\"DepartmentId\"));\n\t\t\tdepartment.setName(resultSet.getString(\"DepartmentName\"));\n\t\t\tdepartments.add(department);\n\t\t}\n\t\treturn departments;\n\n\t}", "Dept findByDeptId(Long deptId);", "public ArrayList<Department> getAllDepartments() {\n ArrayList<Department> toReturn = new ArrayList<Department>();\n Connection connect = null;\n try {\n connect = DBConnection.getConnection();\n Statement stmt = connect.createStatement();\n rs = stmt.executeQuery(\"SELECT * FROM \" + TABLE + \" order by title\");\n connect.commit();\n while (rs.next()) {\n Department b = getDepartmentFromResultSet(rs);\n toReturn.add(b);\n }\n\n } catch (SQLException e) {\n e.printStackTrace();\n } finally {\n DBConnection.releaseConnection(connect);\n }\n return toReturn;\n }", "public String getDeptName() {\n return deptName;\n }", "public String getDeptName() {\n return deptName;\n }", "@Override\n\t\t\tpublic List<Dept> findAll() {\n\t\t\t\treturn null;\n\t\t\t}", "public void setDepartment(String department) {\n this.department = department == null ? null : department.trim();\n }", "@Override\n public List<Departament> getDepartaments() {\n Query qry = getSession().createQuery(\"from Departament d order by upper(d.name)\");\n return qry.list();\n }", "@Override\n\tpublic List<DeptInf> findDept(DeptInf dept, PageModel pageModel) {\n\t\tDeptInfExample example = new DeptInfExample();\n\t\tList<DeptInf> list = deptMapper.selectByExample(example);\n\t\tint recordCount = list.size();\n\t\tpageModel.setRecordCount(recordCount);\n\t\tif (recordCount != 0) {\n\t\t\tList<DeptInf> depts = new ArrayList<>();\n\t\t\tif (pageModel.getPageSize() * pageModel.getPageIndex() < recordCount) {\n\t\t\t\tfor (int i = pageModel.getFirstLimitParam(); i < pageModel.getPageSize()\n\t\t\t\t\t\t* pageModel.getPageIndex(); i++) {\n\t\t\t\t\tdepts.add(list.get(i));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (int i = pageModel.getFirstLimitParam(); i < recordCount; i++) {\n\t\t\t\t\tdepts.add(list.get(i));\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn depts;\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}" ]
[ "0.7759926", "0.73062557", "0.6709993", "0.6217898", "0.6206769", "0.6081181", "0.6025229", "0.5923406", "0.59230363", "0.5922058", "0.5894154", "0.5865995", "0.58406454", "0.58406454", "0.58406454", "0.58406454", "0.58406454", "0.5803246", "0.57494074", "0.5746679", "0.57429034", "0.57429034", "0.57429034", "0.57267624", "0.57171375", "0.5708543", "0.5694609", "0.567652", "0.56721836", "0.566486", "0.56617826", "0.5657723", "0.565737", "0.56523776", "0.564853", "0.56121755", "0.56070185", "0.55947906", "0.55418944", "0.5540604", "0.55354947", "0.55342835", "0.5530216", "0.5525555", "0.55139923", "0.55023134", "0.5471274", "0.54455817", "0.5442488", "0.5437064", "0.54326934", "0.542451", "0.5421543", "0.54215115", "0.54212004", "0.542118", "0.5406261", "0.53966767", "0.5389575", "0.5389575", "0.5386456", "0.53833073", "0.5376833", "0.5371758", "0.5358716", "0.5355232", "0.5355176", "0.53499544", "0.53468394", "0.53350943", "0.5325657", "0.5322264", "0.5320568", "0.5307341", "0.530647", "0.53026736", "0.5291533", "0.5266888", "0.52490944", "0.52433366", "0.5240392", "0.5226189", "0.52258146", "0.5224421", "0.5210416", "0.52074265", "0.5197813", "0.5187183", "0.51803666", "0.51782215", "0.51653767", "0.51506275", "0.5147127", "0.5140499", "0.51331925", "0.51331925", "0.51287", "0.51280516", "0.5116299", "0.5110419" ]
0.8319667
0
Return active catalog descriptions that correspond to the given department with flag to indicate if we return or not inactive catalog descriptions
public List<CatalogDescription> getCatalogDescriptionsByDepartment(String department, boolean showInactives);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<CatalogDescription> getCatalogDescriptionsByDepartment(String department);", "public List<CatalogDescription> getCatalogDescriptionsByDepartmentWithNoDescription(String department);", "public List<String> getDepartmentNameWithAtLeastOneCaWithNoDescription();", "public ResultSet getDepartmentByName(String dept_name);", "public List<Departmentdetails> getDepartmentDetails();", "public Departmentdetails getDepartmentByName(String departmentName);", "public Departments getDeptTable();", "public void setCatalogDescriptionToInactive();", "public TreeMap<String, Course> getDepartmentCourses(String dept) {\n TreeMap<String, Course> map = new TreeMap<>();\n\n for (Course c : courses.values()) {\n if (c.getCourseId().contains(dept)) {\n map.put(c.getCourseId(), c);\n }\n }\n\n return map;\n }", "private String setDepartment() {\n\t\tSystem.out.println(\"Department codes\\n1 for Sales \\n2 for Development \"\n\t\t\t\t+ \"\\n3 for Accounting \\n0 for Other\\nEnter the department code: \");\n\t\tScanner sc = new Scanner(System.in);\n\t\tint deptChoice = sc.nextInt();\n\t\tsc.close();\n\t\tif (deptChoice == 1) return \"sales\";\n\t\telse if (deptChoice == 2) return \"development\";\n\t\telse if (deptChoice == 3) return \"accounting\";\n\t\telse return \"other\";\n\t}", "boolean getDesc();", "public List<Department> getAllDepartments();", "public String GetDept()\r\n {\r\n return Department;\r\n }", "boolean isSetDesc();", "@Test\n @IfProfileValue(name=\"dept-test-group\", values={\"all\",\"department\"})\n public void _2_2_1_getAllDept() throws Exception {\n this.mockMvc.perform(get(\"/api/v1.0/companies/\"+\n c_1.getId().toString()+\n \"/departments\")\n .header(AUTHORIZATION,ACCESS_TOKEN))\n .andDo(print())\n .andExpect(status().isOk())\n .andExpect(jsonPath(\"$._embedded.departments\",hasSize(4)));\n }", "public String getDepartment() {\r\n return department;\r\n }", "public ResultSet getDepartmentByID(int dept_no);", "public static List getAlumniByDept(String department)\n { \n session=SessionFact.getSessionFact().openSession();\n List li=session.createQuery(\"from Alumni_data where department=:department\").setString(\"department\", department).list();\n session.close();\n return li;\n }", "@Override\r\n public Dept deptDetailList(int dept_seq) {\n return sqlSession.selectOne(\"deptDAO.deptDetailList\", dept_seq);\r\n }", "public synchronized String getDepartment()\r\n {\r\n return department;\r\n }", "public String checkDepartment(String departmentName);", "public static int selectDepartment() {\r\n\t\tSystem.out.println(\"ENTER THE DEPARTMENT\");\r\n\t\tSystem.out.println(\"1.MECH\");\r\n\t\tSystem.out.println(\"2.CIVIL\");\r\n\t\tSystem.out.println(\"3.CSE\");\r\n\t\treturn 0;\r\n\t}", "@SuppressWarnings(\"unchecked\")\r\n\t@Override\r\n\tpublic List<String> getDept() {\n\t\treturn getSqlMapClientTemplate().queryForList(\"R_ALARM_LOG.getDept\");\r\n\t}", "public String getDepartment() {\n return department;\n }", "public String getDepartment() {\n return department;\n }", "public String getDepartment() {\n return department;\n }", "public String getDepartment() {\n return department;\n }", "public String getDepartment() {\n return department;\n }", "public void setDepartment(String department) {\n this.department = department;\n }", "public HasChangeHandlers getDepartmentCombo() {\n\t\treturn componentCurricularCourseIdentification.getDepartmentCombo();\n\t}", "private String setDepartment() {\r\n\t\tSystem.out.println(\"New worker: \" + firstName + \".Department Codes\\n1 for Sales\\n2 for Development\\n3 for Accounting\\n0 for none\\nEnter department code:\");\r\n\t\tScanner in=new Scanner(System.in);\r\n\t\tint depChoice=in.nextInt();\r\n\t\tif(depChoice == 1) {\r\n\t\t\treturn \"sales\";\r\n\t\t}\r\n\t\telse if(depChoice == 2) {\r\n\t\t\treturn \"dev\";\r\n\t\t}\r\n\t\telse if (depChoice == 3) {\r\n\t\t\treturn \"acct\";\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\t}", "public ResponseEntity<BasicApiResponse<List<DepartmentResponse>>> getDepartments() {\n //Getting All The list of departments\n List<DepartmentModel> departmentModels = departmentRepository.findAll();\n\n List<DepartmentResponse> departmentResponses = new ArrayList<>();\n //Converting Department model to department response for sending in frontend\n for (DepartmentModel departmentModel : departmentModels) {\n DepartmentResponse departmentResponse = new DepartmentResponse(departmentModel.getId(),\n departmentModel.getName(), departmentModel.getActive());\n departmentResponses.add(departmentResponse);\n }\n\n if (departmentModels.isEmpty()) {\n //If No department found\n throw new ResponseStatusException(HttpStatus.NOT_FOUND, \"No Departments Found\");\n } else {\n //If department found\n return new ResponseEntity<>(new BasicApiResponse<>(200, \"Departments Found\",\n departmentResponses), HttpStatus.OK);\n }\n\n }", "public void selectOptionInDepartment(String department, String optionsLinkText) {\r\n\t\tint departmentCode;\r\n\t\tint optionsListCode;\r\n\t\tswitch (department) {\r\n\t\tcase \"Amazon Prime\":\r\n\t\t\tdepartmentCode = 1;\r\n\t\t\toptionsListCode = 1;\r\n\t\t\tbreak;\r\n\t\tcase \"Amazon Prime Video\":\r\n\t\t\tdepartmentCode = 2;\r\n\t\t\toptionsListCode = 2;\r\n\t\t\tbreak;\r\n\t\tcase \"Prime Music\":\r\n\t\t\tdepartmentCode = 3;\r\n\t\t\toptionsListCode = 3;\r\n\t\t\tbreak;\r\n\t\tcase \"Savings Programs\":\r\n\t\t\tdepartmentCode = 4;\r\n\t\t\toptionsListCode = 4;\r\n\t\t\tbreak;\r\n\t\tcase \"Appstore for Android\":\r\n\t\t\tdepartmentCode = 5;\r\n\t\t\toptionsListCode = 5;\r\n\t\t\tbreak;\r\n\t\tcase \"Echo & Alexa\":\r\n\t\t\tdepartmentCode = 7;\r\n\t\t\toptionsListCode = 6;\r\n\t\t\tbreak;\r\n\t\tcase \"Fire Tablets & Fire TV\":\r\n\t\t\tdepartmentCode = 8;\r\n\t\t\toptionsListCode = 7;\r\n\t\t\tbreak;\r\n\t\tcase \"Kindle\":\r\n\t\t\tdepartmentCode = 9;\r\n\t\t\toptionsListCode = 8;\r\n\t\t\tbreak;\r\n\t\tcase \"Books & Audible\":\r\n\t\t\tdepartmentCode = 11;\r\n\t\t\toptionsListCode = 9;\r\n\t\t\tbreak;\r\n\t\tcase \"Video Games & Twitch Prime\":\r\n\t\t\tdepartmentCode = 12;\r\n\t\t\toptionsListCode = 10;\r\n\t\t\tbreak;\r\n\t\tcase \"Music, Movies & TV Shows\":\r\n\t\t\tdepartmentCode = 13;\r\n\t\t\toptionsListCode = 11;\r\n\t\t\tbreak;\r\n\t\tcase \"Electronics\":\r\n\t\t\tdepartmentCode = 14;\r\n\t\t\toptionsListCode = 12;\r\n\t\t\tbreak;\r\n\t\tcase \"Home, Garden, Pets & Tools\":\r\n\t\t\tdepartmentCode = 15;\r\n\t\t\toptionsListCode = 13;\r\n\t\t\tbreak;\r\n\t\tcase \"Grocery & Whole Foods Market\":\r\n\t\t\tdepartmentCode = 16;\r\n\t\t\toptionsListCode = 14;\r\n\t\t\tbreak;\r\n\t\tcase \"Health & Beauty\":\r\n\t\t\tdepartmentCode = 17;\r\n\t\t\toptionsListCode = 15;\r\n\t\t\tbreak;\r\n\t\tcase \"Toys, Kids, Baby & STEM\":\r\n\t\t\tdepartmentCode = 18;\r\n\t\t\toptionsListCode = 16;\r\n\t\t\tbreak;\r\n\t\tcase \"Clothing, Shoes & Jewelry\":\r\n\t\t\tdepartmentCode = 19;\r\n\t\t\toptionsListCode = 17;\r\n\t\t\tbreak;\r\n\t\tcase \"Handmade\":\r\n\t\t\tdepartmentCode = 20;\r\n\t\t\toptionsListCode = 18;\r\n\t\t\tbreak;\r\n\t\tcase \"Sports & Outdoors\":\r\n\t\t\tdepartmentCode = 21;\r\n\t\t\toptionsListCode = 19;\r\n\t\t\tbreak;\r\n\t\tcase \"Automotive & Industrial\":\r\n\t\t\tdepartmentCode = 22;\r\n\t\t\toptionsListCode = 20;\r\n\t\t\tbreak;\r\n\t\tcase \"Boutiques Francophones\":\r\n\t\t\tdepartmentCode = 23;\r\n\t\t\toptionsListCode = 21;\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tdepartmentCode = 1;\r\n\t\t\toptionsListCode = 1;\r\n\t\t\tLog.info(\" The given Department Name: \" + department\r\n\t\t\t\t\t+ \" is either incorrect or is not defined in the method: selectDepartmentByHoveringMouse\"\r\n\t\t\t\t\t+ \" of NavBarAmazonHomePage.class,Please Check.\");\r\n\t\t}\r\n\r\n\t\tWebElement desiredDepartment = driver.findElement(By.cssSelector(\r\n\t\t\t\t\"#nav-flyout-shopAll > div.nav-template.nav-flyout-content.nav-tpl-itemList > span:nth-child(\"\r\n\t\t\t\t\t\t+ departmentCode + \")\"));\r\n\t\tseHoverOnElement(NavBarAmazonHomePage.get().btnNavbarShopByDepartment, \"btnNavbarShopByDepartment\");\r\n\t\tseWaitForClickableWebElement(driver, desiredDepartment, 20);\r\n\t\tseHoverOnElement(desiredDepartment, department);\r\n\t\tselectOptionByLinkText(optionsListCode, optionsLinkText);\r\n\t}", "public List<GLJournalApprovalVO> getDepartmentfromuniquecode(String OrgId, String ClientId,\n String deptId) {\n String sqlQuery = \"\";\n PreparedStatement st = null;\n ResultSet rs = null;\n List<GLJournalApprovalVO> list = null;\n try {\n list = new ArrayList<GLJournalApprovalVO>();\n sqlQuery = \" select f.c_salesregion_id,sal.name from fact_acct f join c_salesregion sal on sal.c_salesregion_id = f.c_salesregion_id WHERE f.AD_ORG_ID IN (\"\n + OrgId + \") \" + \" AND f.AD_CLIENT_ID IN (\" + ClientId\n + \") AND f.em_efin_uniquecode IN ('\" + deptId\n + \"') and f.c_bpartner_id is not null and f.c_salesregion_id is not null and f.c_project_id is not null and f.c_campaign_id is not null and f.c_activity_id is not null and f.user1_id is not null and f.user2_id is not null limit 1\";\n st = conn.prepareStatement(sqlQuery);\n rs = st.executeQuery();\n while (rs.next()) {\n GLJournalApprovalVO VO = new GLJournalApprovalVO();\n VO.setId(rs.getString(1));\n VO.setName(rs.getString(2));\n list.add(VO);\n }\n } catch (Exception e) {\n log4j.error(\"Exception in getOrgs()\", e);\n }\n return list;\n }", "private String getDepartmentString() {\n String[] departments = contact.getDepartment().split(\"\\\\$\");\n String result = \"\";\n for (String dept : departments)\n result += dept.replace('~', ',') + \"\\n\";\n return result;\n }", "String getDeptType();", "public void setDepartment(String department) {\r\n\t\tthis.department = department;\r\n\t}", "public void setDepartment(String department) {\r\n\t\tthis.department=department;\r\n\t}", "private String setDepartment() {\r\n\t\tSystem.out.print(\"Enter the Department:\\n1. For sales\\n2. For Development\\n3. For Accounting\\n0. For none\\n\");\r\n\t\tScanner in = new Scanner(System.in);\r\n\t\tint choice = in.nextInt();\r\n\t\tif(choice == 1) { return \"sales\"; }\r\n\t\telse if(choice == 2) { return \"dev\"; }\r\n\t\telse if(choice == 3) { return \"acctg\"; }\r\n\t\telse { return \"\"; }\r\n\t}", "public Department getDepartmentByAbbreviation(String abbreviation) {\n Connection connect = null;\n if (abbreviation == null || abbreviation.equalsIgnoreCase(\"\")) {\n throw new IllegalArgumentException(\"Can't read a degree from the Database using id less than one\");\n } else {\n try {\n connect = DBConnection.getConnection();\n Statement stmt = connect.createStatement();\n String query = \"SELECT * FROM \" + TABLE\n + \" WHERE \" + PKEY + \"=\\'\" + abbreviation + \"\\' \";\n rs = stmt.executeQuery(query);\n connect.commit();\n while (rs.next()) {\n return new Department(rs.getString(\"abbreviation\"), rs.getString(\"title\"), rs.getString(\"url_moodle\"), rs.getString(\"token\"));\n }\n } catch (SQLException ex) {\n ex.printStackTrace();\n throw new RuntimeException(\"Read Query failed!\");\n } finally {\n DBConnection.releaseConnection(connect);\n }\n }\n return null;\n }", "public String getEmployeeDepartment(){\n return profile.getDepartment();\n }", "@Test\n\tvoid testGetDepartmentsByCrit() {\n\t\tDepartmentDAO ddao = new DepartmentDAO();\n\t\tList<Department> ls = ddao.getDepartmentsByCrit();\n\t\tIterator<Department> it = ls.iterator();\n\n\t\twhile (it.hasNext()) {\n\t\t\tDepartment dpt = it.next();\n\t\t\tSystem.out.println(dpt.getDepartment_name() + \" \" + dpt.getLocation_id() + \" \" + dpt.getManager_id());\n\t\t}\n\t\t// assertEquals(203, ls.get(0).getManager_id());\n\t}", "public List<CatalogDescription> getAllCatalogDescriptionsForCertificate(boolean showInactives);", "Department findByShortName(String name);", "@Test\n @IfProfileValue(name=\"dept-test-group\", values={\"all\",\"department\"})\n public void _2_2_2_getDept() throws Exception {\n this.mockMvc.perform(get(\"/api/v1.0/companies/\"+\n d_1_1.getCompany()+\n \"/departments/\"+\n d_1_1.getId().toString())\n .header(AUTHORIZATION,ACCESS_TOKEN))\n .andDo(print())\n .andExpect(status().isOk())\n .andExpect(jsonPath(\"$.id\",is(d_1_1.getId().toString())))\n .andExpect(jsonPath(\"$.name\",is(d_1_1.getName())))\n .andExpect(jsonPath(\"$.description\",is(d_1_1.getDescription())))\n .andExpect(jsonPath(\"$.parent\",is(d_1_1.getParent().toString())))\n .andExpect(jsonPath(\"$.company\",is(d_1_1.getCompany().toString())))\n .andExpect(jsonPath(\"$._links.roles.href\",endsWith(\n d_1_1.getCompany()+\"/departments/\"\n +d_1_1.getId().toString()+\"/roles\")));\n }", "public static List getDeptList() \n {\n session=SessionFact.getSessionFact().openSession();\n List li=session.createQuery(\"select department from Alumni_data group by department\").list();\n session.close();\n return li;\n }", "public boolean isDepartmentScoped()\n {\n return false;\n }", "public String getDepartment() {\r\n\t\treturn department;\r\n\t}", "public String getDepartment() {\r\n\t\treturn department;\r\n\t}", "public String getDepartment() {\r\n\t\treturn department;\r\n\t}", "@Override\n\tpublic List<DeptInf> findAllDept() {\n\t\tDeptInfExample example = new DeptInfExample();\n\t\tList<DeptInf> list = deptMapper.selectByExample(example);\n\t\treturn list;\n\t}", "public ArrayList<String> getAllDepartments()\r\n/* 70: */ {\r\n/* 71: 60 */ String sql = \"select department from t_department\";\r\n/* 72: */ \r\n/* 73: 62 */ ArrayList<String> deptNameArr = new ArrayList();\r\n/* 74: */ try\r\n/* 75: */ {\r\n/* 76: 64 */ this.ct = new ConnDb().getConn();\r\n/* 77: 65 */ this.ps = this.ct.prepareStatement(sql);\r\n/* 78: 66 */ this.rs = this.ps.executeQuery();\r\n/* 79: 67 */ while (this.rs.next())\r\n/* 80: */ {\r\n/* 81: 68 */ String deptName = new String(this.rs.getString(1));\r\n/* 82: 69 */ deptNameArr.add(deptName);\r\n/* 83: */ }\r\n/* 84: 71 */ return deptNameArr;\r\n/* 85: */ }\r\n/* 86: */ catch (Exception e)\r\n/* 87: */ {\r\n/* 88: 74 */ e.printStackTrace();\r\n/* 89: 75 */ return null;\r\n/* 90: */ }\r\n/* 91: */ finally\r\n/* 92: */ {\r\n/* 93: 77 */ closeSourse();\r\n/* 94: */ }\r\n/* 95: */ }", "public List<CatalogDescription> getCatalogDescriptionsByCareer(String career, boolean showInactives);", "boolean hasCampaignDescription();", "public Department getDepartment() {\n return department;\n }", "@Override\r\n\t\tpublic String toString() {\r\n\t\t\tswitch(this) {\r\n\t\t\tcase SALES: return \"Sales\";\r\n\t\t\tcase MKTG: return \"Marketing\";\r\n\t\t\tcase HMRS: return \"Human Resources\";\r\n\t\t\tcase FINA: return \"Finance\";\r\n\t\t\tcase INTE: return \"Information Tecnology\";\r\n\t\t\t\tdefault: return \"Unknown Department\"; \r\n\t\t\t\r\n\t\t\t\r\n\t\t\t}\r\n\t\t}", "public String getDepartment(){\n\t\treturn departName;\n\t}", "public interface CatalogDescriptionDao {\r\n\r\n public void init();\r\n\r\n /**\r\n * Return a catalog description based on the database id\r\n * \r\n * @param id - the database id of the catalog description\r\n * @return - the CatalogDescription\r\n */\r\n public CatalogDescription getCatalogDescription(Long id);\r\n \r\n /**\r\n * Return the active catalog description based on the course id\r\n * \r\n * @param id - the course id of the catalog description\r\n * @return - the last version of the CatalogDescription\r\n */\r\n public CatalogDescription getCatalogDescription(String course_id);\r\n\r\n /**\r\n * Return the last version of a catalog description based on the course id\r\n * \r\n * @param id - the course id of the catalog description\r\n * @return - the last version of the CatalogDescription (null if nothing is found)\r\n */\r\n public CatalogDescription getLastVersionCatalogDescription(String courseId);\r\n\r\n \r\n /**\r\n * Return active catalog descriptions that correspond to the given department\r\n * (can be null for all)\r\n * \r\n * @return - the list of CatalogDescription\r\n */\r\n public List<CatalogDescription> getCatalogDescriptionsByDepartment(String department);\r\n \r\n /**\r\n * Return active catalog descriptions that correspond to the given department with flag to indicate if we return or not inactive catalog descriptions \r\n */\r\n public List<CatalogDescription> getCatalogDescriptionsByDepartment(String department, boolean showInactives);\r\n \r\n \r\n /**\r\n * Return active catalog descriptions that correspond to the given academic career\r\n * (can be null for all)\r\n * \r\n * @return - the list of CatalogDescription\r\n */\r\n public List<CatalogDescription> getCatalogDescriptionsByCareer(String career);\r\n \r\n /**\r\n * Return active catalog descriptions that correspond to the given academic career with flag to indicate if we return or not inactive catalog descriptions\r\n */\r\n public List<CatalogDescription> getCatalogDescriptionsByCareer(String career, boolean showInactives);\r\n \r\n \r\n /**\r\n * Return all active catalog descriptions for certificates programs\r\n * (can be null for all)\r\n * \r\n * @return - the list of CatalogDescription\r\n */\r\n \r\n public List<CatalogDescription> getAllCatalogDescriptionsForCertificate();\r\n \r\n /**\r\n * Return all active catalog descriptions for certificates programs with flag to indicate if we return or not inactive catalog descriptions\r\n */\r\n \r\n public List<CatalogDescription> getAllCatalogDescriptionsForCertificate(boolean showInactives);\r\n \r\n \r\n /**\r\n * Return active catalog descriptions that correspond to the given criteria map\r\n * (can be null for all)\r\n * \r\n * @return - the list of CatalogDescription\r\n */\r\n public List<CatalogDescription> getCatalogDescriptions(Map<String, String> eqCriteria, Map<String, String> searchCriteria);\r\n\r\n /**\r\n * save the catalog description to the database\r\n * \r\n * @param cd - the catalog description to save\r\n * @throws StaleDataException\r\n * @throws DatabaseException\r\n */\r\n public void saveCatalogDescription(CatalogDescription cd)\r\n\t throws StaleDataException, DatabaseException;\r\n\r\n /**\r\n * Return a list of Course id (used by quartz job to determine if the catalog description is already created)\r\n * \r\n * @return - the list of Course id\r\n */\r\n public List<String> getListCourseId();\r\n \r\n \r\n /** \r\n * @return all active catlog descriptions\r\n */\r\n public List<CatalogDescription> getAllCatalogDescriptions();\r\n \r\n \r\n /**\r\n * Set all catalog description to \"inactive\" status\r\n * \r\n */\r\n public void setCatalogDescriptionToInactive();\r\n \r\n /**\r\n * Get catalog description from department that have no description and which are not certificate courses\r\n * \r\n */\r\n public List<CatalogDescription> getCatalogDescriptionsByDepartmentWithNoDescription(String department);\r\n \r\n \r\n /**\r\n * Get catalog description for certificates courses that have no description\r\n * \r\n */\r\n public List<CatalogDescription> getAllCatalogDescriptionsForCertificatesWithNoDescription();\r\n \r\n /**\r\n * Get all departments that have at least one catalog description with an empty description\r\n * \r\n */\r\n public List<String> getDepartmentNameWithAtLeastOneCaWithNoDescription();\r\n \r\n \r\n /**\r\n * return whether or not the specified Catalog Description exists.\r\n * \r\n * @param course_id - the course_id of the catalog description\r\n * @return true if the catalog description exists, false otherwise\r\n */\r\n public boolean descriptionExists(String course_id);\r\n}", "@Test\n @IfProfileValue(name=\"dept-test-group\", values={\"all\",\"department\"})\n public void _2_2_3_getSubDept() throws Exception {\n this.mockMvc.perform(get(\"/api/v1.0/companies/\"+\n d_1.getCompany()+\n \"/departments?parent=\"+\n d_1.getId().toString())\n .header(AUTHORIZATION,ACCESS_TOKEN))\n .andDo(print())\n .andExpect(status().isOk())\n .andExpect(jsonPath(\"$._embedded.departments\",hasSize(2)))\n .andExpect(jsonPath(\"$._embedded.departments[0].parent\",is(d_1.getId().toString())));\n }", "public boolean definesDepartmentScope()\n {\n return false;\n }", "public String getSubDepartmentCode()\r\n\t{\r\n\t\treturn getSubDepartmentCode( getSession().getSessionContext() );\r\n\t}", "void getAllDeparments(Vector<Integer> departmentIDs, Vector<String> departmentCodes, Vector<Integer> categoryIDs, String empresa);", "public String getDepartmentCode(final SessionContext ctx)\r\n\t{\r\n\t\treturn (String)getProperty( ctx, DEPARTMENTCODE);\r\n\t}", "public String getDepartmentCode()\r\n\t{\r\n\t\treturn getDepartmentCode( getSession().getSessionContext() );\r\n\t}", "private Criteria buildInactiveCriteria(){\r\n Criteria criteria = new Criteria();\r\n criteria.addEqualTo(KRADPropertyConstants.ACTIVE, false);\r\n\r\n return criteria;\r\n }", "@Override\n\tpublic List<?> selectDepartment() throws Exception {\n\t\treturn deptMapperr.selectDepartment();\n\t}", "List<ChartBean> returnEmployeeCommunityServicesByDepartmentInstituteCenter();", "public List getInwDepartCompetences(InwDepartCompetence inwDepartCompetence);", "@Override\n\tpublic boolean departmentUpdate(DepartmentForm departmentForm, int orgCode, HttpSession session, HttpServletRequest request) throws Exception {\n\t\tString category = departmentForm.getSpecificLevel();\n\n\t\t/*\n\t\t * List<State> stateList = null; stateList = new ArrayList<State>();\n\t\t * State state = new State(); StatePK statePK = null; statePK = new\n\t\t * StatePK(stateCode, stateVersion); stateList =\n\t\t * stateDao.getStateList(\"from State s where s.statePK.stateCode=\" +\n\t\t * stateCode + \" and s.statePK.stateVersion=\" + stateVersion +\n\t\t * \" and isactive=true\");\n\t\t */\n\n\t\t/*\n\t\t * Organization organizationbean = null; Organization\n\t\t * organizationbeanisActive = null;\n\t\t */\n\n\t\tSession session1 = null;\n\t\tTransaction tx1 = null;\n\t\tsession1 = sessionFactory.openSession();\n\t\ttx1 = session1.beginTransaction();\n\t\ttry {\n\t\t\tif (category.equalsIgnoreCase(\"S\")) {\n\t\t\t\t// stateVersion =\n\t\t\t\t// stateDao.getCurrentVersionbyStateCode(stateCode);\n\t\t\t\tInteger orgVersion = organizationDAO.getMaxOrganizationVersion(departmentForm.getOrgCode());\n\t\t\t\tOrganizationPK orgpk = new OrganizationPK(departmentForm.getOrgCode(), orgVersion);\n\t\t\t\torganizationDAO.updateDepartment(departmentForm, orgpk, session1);\n\t\t\t} else {\n\n\t\t\t\t// List<OrgLocatedAtLevels>\n\t\t\t\t// orgLocatedAtLevelsList=session1.createSQLQuery(\"select orgLocatedLevelCode from OrgLocatedAtLevels where olc=\"+orgCode+\" and locatedAtLevel='\"+category.charAt(0)+\"' and isactive=true\").list();\n\t\t\t\t// Integer\n\t\t\t\t// orgLocatedCode=Integer.parseInt(session1.createQuery(\"select orgLocatedLevelCode from OrgLocatedAtLevels where olc=\"+orgCode+\" and locatedAtLevel='\"+category.charAt(0)+\"' and isactive=true\").uniqueResult().toString());\n\t\t\t\tOrgLocatedAtLevels orgLocatedAtLevelsupdate = (OrgLocatedAtLevels) session1.get(OrgLocatedAtLevels.class, orgCode);\n\t\t\t\torgLocatedAtLevelsupdate.setOrgLevelSpecificName(departmentForm.getDeptNamecr());\n\t\t\t\torgLocatedAtLevelsupdate.setOrgLevelSpecificNameLocal(departmentForm.getDeptNameLocal());\n\t\t\t\torgLocatedAtLevelsupdate.setOrgLevelSpecificShortName(departmentForm.getShortDeptName());\n\t\t\t\tsession1.update(orgLocatedAtLevelsupdate);\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * if (departmentForm.isCorrection()== true) { OrganizationPK orgpk\n\t\t\t * = new OrganizationPK(departmentForm.getOrgCode(),orgVersion);\n\t\t\t * \n\t\t\t * organizationDAO.updateDepartment(departmentForm,orgpk, session1);\n\t\t\t * \n\t\t\t * }\n\t\t\t */\n\t\t\t/*\n\t\t\t * else if (departmentForm.isCorrection()== false) { OrganizationPK\n\t\t\t * orgpk2 = new\n\t\t\t * OrganizationPK(departmentForm.getOrgCode(),orgVersion);\n\t\t\t * organizationDAO\n\t\t\t * .updateisActive(organizationbeanisActive,orgpk2,session1); if\n\t\t\t * (orgVersion == 0) { orgVersion = orgVersion+1; } else {\n\t\t\t * orgVersion = orgVersion + 1; } OrganizationPK orgpk = new\n\t\t\t * OrganizationPK(departmentForm.getOrgCode(),orgVersion);\n\t\t\t * OrganizationType organizationType1=new OrganizationType(1); //1\n\t\t\t * is Organisation Type Code for Ministry\n\t\t\t * organizationbean.setOrganizationType(organizationType1);\n\t\t\t * organizationbean.setOrgNameLocal(\"\");\n\t\t\t * organizationbean.setOrganizationPK(orgpk);\n\t\t\t * organizationbean.setOrgName(departmentForm.getDeptName());\n\t\t\t * organizationbean.setShortName(departmentForm.getShortDeptName());\n\t\t\t * // organizationbean.setIslocalbodyspecific(departmentForm.\n\t\t\t * isLocalBodySpecific()); //\n\t\t\t * organizationbean.setOrgTypeCode(ministryForm.getOrgTypeCode());\n\t\t\t * // organizationbean.setLocalBodyType(localBodyType);\n\t\t\t * organizationbean.setOrgLevel('C'); ///pending.....\n\t\t\t * organizationbean.setIsactive(true);\n\t\t\t * organizationDAO.saveWithSession(organizationbean, session1);\n\t\t\t * govtOrderService.saveGovernmentOrder(\n\t\t\t * departmentForm.getOrderNo(), departmentForm.getOrderDate(),\n\t\t\t * departmentForm.getOrdereffectiveDate(),\n\t\t\t * departmentForm.getGazPubDate(), \"LGT\",\n\t\t\t * departmentForm.getOrderPath\n\t\t\t * (),departmentForm.getFilePath(),request);\n\t\t\t * \n\t\t\t * //\n\t\t\t * localGovtTypeDAO.SetGovermentOrderEntity(localBodyTypecode,'G');\n\t\t\t * \n\t\t\t * }\n\t\t\t */\n\t\t\ttx1.commit();\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tLOG.error(\"Exception-->\"+e);\n\t\t\ttx1.rollback();\n\t\t\treturn false;\n\t\t} finally {\n\t\t\tif (session1 != null && session1.isOpen()) {\n\t\t\t\tsession1.clear();\n\t\t\t\tsession1.close();\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn true;\n\t}", "public ArrayList<Department> getAllDep(String yuanxi)\r\n/* 16: */ {\r\n/* 17: 17 */ String sql = \"select * from t_department where yuanxi= '\" + yuanxi + \"'\";\r\n/* 18: 18 */ ArrayList<Department> al = new ArrayList();\r\n/* 19: 19 */ Department d = null;\r\n/* 20: */ try\r\n/* 21: */ {\r\n/* 22: 21 */ this.ct = new ConnDb().getConn();\r\n/* 23: 22 */ this.ps = this.ct.prepareStatement(sql);\r\n/* 24: 23 */ this.rs = this.ps.executeQuery();\r\n/* 25: 24 */ while (this.rs.next())\r\n/* 26: */ {\r\n/* 27: 25 */ d = new Department(this.rs.getInt(1), this.rs.getString(2));\r\n/* 28: 26 */ al.add(d);\r\n/* 29: */ }\r\n/* 30: 28 */ return al;\r\n/* 31: */ }\r\n/* 32: */ catch (Exception e)\r\n/* 33: */ {\r\n/* 34: 31 */ e.printStackTrace();\r\n/* 35: 32 */ return null;\r\n/* 36: */ }\r\n/* 37: */ finally\r\n/* 38: */ {\r\n/* 39: 34 */ closeSourse();\r\n/* 40: */ }\r\n/* 41: */ }", "@Override\r\n public List<Dept> deptList() {\n return sqlSession.selectList(\"deptDAO.deptList\");\r\n }", "public String getIsCatalog() {\n return isCatalog;\n }", "public static String findDepartmentColorCode(String department) {\n String dept;\n if (department == null) {\n return \"#FFFFFF\";\n } else {\n dept = department.toLowerCase();\n }\n if (\"treasury\".equals(dept)) {\n return \"#0a8141\";\n } else if (\"department of the treasurer\".equals(dept)) {\n return \"#0a8141\";\n } else if (\"secretarial\".equals(dept)) {\n return \"#3a53a5\";\n } else if (\"department of the secretary\".equals(dept)) {\n return \"#3953a4\"; // Not sure which color code is correct, this is from 2016\n// return \"#3a53a5\";\n } else if (\"relations\".equals(dept)) {\n return \"#f282b4\";\n } else if (\"publicity\".equals(dept)) {\n return \"#e0e0e0\";\n } else if (\"programming\".equals(dept)) {\n return \"#6b52a2\";\n } else if (\"operations\".equals(dept)) {\n return \"#ec2426\";\n } else if (\"membership\".equals(dept)) {\n return \"#f57f20\";\n } else if (\"infrastructure\".equals(dept)) {\n return \"#414242\";\n } else if (\"chair\".equals(dept)) {\n return \"#f99f1d\";\n } else if (\"department of the chair\".equals(dept)) {\n return \"#f99f1d\";\n } else {\n System.out.println(\"Warning, couldn't find color code for \" + department);\n return \"#FFFFFF\";\n }\n }", "public TreeControlI getDepartments() {\n\t\treturn cts.getTree(cts.ROOT,true,\"dep.do?method=select&id=\",\"select\");\n\t}", "@Override\n public List<Department> getAllDepartments() {\n return null;\n }", "public boolean isSetDepartment() {\n return this.department != null;\n }", "public void setDepartment(String dept) {\r\n\t\tdepartment = dept;\r\n\t}", "private List<Department> pamDepts(Long deptId) {\n \n PersistenceManager pm = PMF.get().getPersistenceManager();\n depts = new ArrayList<Department>();\n // add primary dept\n Department dPrimary = pm.getObjectById(Department.class, deptId);\n depts.add(dPrimary); \n // primary dept's mutual aid depts\n String dMutualAid = dPrimary.getmutualAid();\n if (dMutualAid.length() != 0) {\n \n if (dMutualAid.contains(\",\")) {\n String[] maDepts = dMutualAid.split(\", \", -1);\n for (int i=0; i< maDepts.length; i++) {\n Long maDeptId = Long.valueOf(maDepts[i]);\n Department dMAs = pm.getObjectById(Department.class, maDeptId);\n if (dMAs != null) {\n depts.add(dMAs);\n }\n }\n } else {\n Department dMAsolo = pm.getObjectById(Department.class, Long.valueOf((dMutualAid).trim()));\n if (dMAsolo != null) {\n depts.add(dMAsolo);\n }\n }\n } \n System.out.println(\"Depts Qty: \" + depts.size());\n System.out.println(\"Exit: pamDepts\");\n return depts;\n }", "public String getDepartmentid() {\n return departmentid;\n }", "public Department employeeDepartment(String employeeName) {\n\n String departmentOfEmployee = \"\";\n\n try {\n Connection conn = ConnectToSqlDB.connectToSqlDatabase();\n String query = \"SELECT * FROM employees;\";\n\n ConnectToSqlDB.statement = conn.createStatement();\n\n ConnectToSqlDB.resultSet = ConnectToSqlDB.statement.executeQuery(query);\n\n while (ConnectToSqlDB.resultSet.next()) {\n int idField = ConnectToSqlDB.resultSet.getInt(\"employee_id\");\n String nameField = ConnectToSqlDB.resultSet.getString(\"employee_name\");\n String salaryField = ConnectToSqlDB.resultSet.getString(\"employee_salary\");\n String departmentField = ConnectToSqlDB.resultSet.getString(\"department\");\n\n if (nameField.equals(employeeName)) {\n departmentOfEmployee = departmentField;\n }\n }\n\n } catch (SQLException e) {\n e.printStackTrace();\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n catch (ClassNotFoundException e) {\n e.printStackTrace();\n }\n System.out.print(\"This employee belongs to the following department: \");\n if (departmentOfEmployee.equals(Department.Executive.toString())) {\n return Department.Executive;\n }\n if (departmentOfEmployee.equals(Department.Development.toString())) {\n return Department.Development;\n }\n if (departmentOfEmployee.equals(Department.Accounting.toString())) {\n return Department.Accounting;\n }\n if (departmentOfEmployee.equals(Department.Human_Resources.toString())) {\n return Department.Human_Resources;\n }\n else return Department.No_Department;\n\n }", "private Department selectDepartment()\n {\n Department selectedDepartment = null;\n if(listViewSelectedHospital != null){\n listViewSelectedHospital = listViewSelectedHospital.trim();\n String hospitalName = listViewSelectedHospital.split(\" \")[0];\n selectedDepartment = getDepartment(hospitalName);\n }\n return selectedDepartment;\n }", "boolean hasDescription();", "boolean hasDescription();", "boolean hasDescription();", "protected Department getDepartmentData(JCheckBox chcBox) {\r\n if (chcBox.isSelected()) {\r\n departmentsNumber++;\r\n }\r\n\r\n int discount = (departmentsNumber > 1) ? 18 : 0;\r\n int cost = determineCost(chcBox);\r\n\r\n Department department = new Department.Builder()\r\n .name(chcBox.getText())\r\n .cost(cost)\r\n .discount(discount)\r\n .build();\r\n\r\n return department;\r\n }", "List<DvdCategory> getCategory(Boolean status) throws DvdStoreException;", "boolean isSetDescription();", "boolean isSetDescription();", "public boolean IsExistById(Department d) {\n\t\treturn false;\n\t}", "public void setDepartment(Department d) {\r\n department = d;\r\n }", "@Override\r\n\tpublic List<Department> getAllDepartments() {\n\t\treturn deptRepo.findAll();\r\n\t}", "public InwDepartCompetence getInwDepartCompetence(final String id);", "public CatalogDescription getCatalogDescription(String course_id);", "public CatalogDescription getCatalogDescription(Long id);", "@Override\n\t/**\n\t * Lista los empleados de un departamento dada su id y lo guardamos en department.\n\t */\n\tpublic List<Employees> listadoPorDepartamento(Object department) {\n\t\tList<Employees> ls = null;\n\n\t\tls = ((SQLQuery) sm.obtenerSesionNueva().createQuery(\n\t\t\t\tInstruccionesSQL.CONSULTAR_EMPLEADOS_X_DEPARTAMENTOS\n\t\t\t\t\t\t+ department)).addEntity(Employees.class).list();\n\n\t\treturn ls;\n\t}", "public List<CourseObject> GetAllDepartmentCourses(int dept_id){\r\n String sql = \"SELECT * FROM COURSE WHERE DEPARTMENT_ID = ?\";\r\n List<CourseObject> courseObjectList = null;\r\n try{\r\n courseObjectList = jdbcTemplate.query(sql,new Object[]{dept_id},new BeanPropertyRowMapper(CourseObject.class));\r\n }catch (Exception e){\r\n e.printStackTrace();\r\n }\r\n return courseObjectList;\r\n }", "public void setDepartment(Department department) {\n this.department = department;\n }", "public String getDept() {\n return dept;\n }", "public String getDept() {\n return dept;\n }", "public ResponseEntity<BasicApiResponse<DepartmentResponse>> getDepartmentById(Long departmentId) {\n Optional<DepartmentModel> departmentModelOptional = departmentRepository.findById(departmentId);\n\n //Checking if the Department is available\n if(departmentModelOptional.isPresent()){\n //If department found\n DepartmentModel departmentModel = departmentModelOptional.get();\n\n DepartmentResponse departmentResponse = new DepartmentResponse(departmentModel.getId(),\n departmentModel.getName(), departmentModel.getActive());\n\n return new ResponseEntity<>(new BasicApiResponse<>(200,\"Department Found\",departmentResponse),\n HttpStatus.OK);\n }\n else {\n //If No department found\n throw new ResponseStatusException(HttpStatus.NOT_FOUND, \"No Department found with ID: \" + departmentId);\n }\n }" ]
[ "0.70286894", "0.68025994", "0.61806524", "0.5372958", "0.5362601", "0.5347438", "0.53429115", "0.53239036", "0.53201157", "0.5306003", "0.52901095", "0.52743846", "0.52358925", "0.5162535", "0.5147727", "0.5092126", "0.5091662", "0.5087652", "0.5085672", "0.5081993", "0.5081196", "0.50728357", "0.50309986", "0.5027481", "0.5027481", "0.5027481", "0.5027481", "0.5027481", "0.50243837", "0.5015623", "0.5007224", "0.50012", "0.49946007", "0.49879265", "0.49858376", "0.49790522", "0.49783325", "0.4973093", "0.49720958", "0.4961557", "0.4948254", "0.49416703", "0.493909", "0.4930369", "0.4927512", "0.4925199", "0.49232182", "0.490089", "0.490089", "0.490089", "0.48854548", "0.48844066", "0.48834953", "0.4880608", "0.48751032", "0.48707458", "0.4866604", "0.48593283", "0.4851398", "0.48444802", "0.48389438", "0.48377672", "0.48370254", "0.48310015", "0.47914028", "0.47791082", "0.4774486", "0.47731975", "0.47573057", "0.47569478", "0.47469535", "0.47444814", "0.47409317", "0.4738434", "0.47335437", "0.47271934", "0.47266388", "0.47264394", "0.47247684", "0.47231403", "0.47210377", "0.47151226", "0.47151226", "0.47151226", "0.47146648", "0.4708348", "0.47051808", "0.47051808", "0.46934187", "0.46927762", "0.4690329", "0.46678486", "0.4649178", "0.46327922", "0.46203554", "0.46196768", "0.4615811", "0.4608026", "0.4608026", "0.4605515" ]
0.7277418
0
Return active catalog descriptions that correspond to the given academic career (can be null for all)
public List<CatalogDescription> getCatalogDescriptionsByCareer(String career);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<CatalogDescription> getCatalogDescriptionsByCareer(String career, boolean showInactives);", "public CatalogDescription getCatalogDescription(String course_id);", "public List<CatalogDescription> getCatalogDescriptionsByDepartment(String department, boolean showInactives);", "public List<CatalogDescription> getCatalogDescriptionsByDepartment(String department);", "public List<String> getDepartmentNameWithAtLeastOneCaWithNoDescription();", "public Catalogue getCatalogue() {\n return catalogue;\n }", "@Override\r\n protected void generateDescription ()\r\n {\r\n String[] descriptions = {\r\n \"Advice about the law!\", \"A financial master!\", \"Technologically amazing!\",\r\n \"People's savior!\", \"To serve for the people!\", \"A beast of a rider!\",\r\n \"All-sport mighty!\"\r\n };\r\n\r\n for (int j = 0; j < CAREERS.length; j++)\r\n if (CAREERS[j].equalsIgnoreCase (name))\r\n description = descriptions[j];\r\n }", "public List<CatalogDescription> getAllCatalogDescriptionsForCertificate(boolean showInactives);", "public List<CatalogDescription> getAllCatalogDescriptionsForCertificate();", "public void showCatalogue() {\n for (Record r : cataloue) {\n System.out.println(r);\n }\n }", "public Catalog getCatalog();", "@Override\r\n\tpublic Catalogue getCatalogue() {\n\t\treturn null;\r\n\t}", "public String getCourses() throws CustomExceptions.InvalidInputException {\n Collections.sort(courses);\n StringBuilder builder = new StringBuilder();\n if (!courses.isEmpty()) {\n for (CurriculumItem course : courses) {\n builder.append(String.format(\"|--[%1s] %13s -----|\\n\",\n getCurriculumItemCompletionStatus(course),\n Manipulators.getCurriculumItemAsShortString(course)));\n }\n } else {\n return \"No courses found for Academic Term: \" + name;\n }\n return builder.toString();\n }", "public List<CatalogDescription> getCatalogDescriptionsByDepartmentWithNoDescription(String department);", "Catalog getCatalog();", "Catalog getCatalog();", "public abstract co\n\t\t.com\n\t\t.telefonica\n\t\t.atiempo\n\t\t.ejb\n\t\t.eb\n\t\t.Catalogo_causalLocal getCatalogo_causal();", "public String[] getCourses();", "public CatalogDescription getCatalogDescription(Long id);", "public ArrayList<CareerCards> getCollegeCareerCardDeck(){\n\t\treturn collegeCareerCardDeck;\n\t}", "public String getCategoriaDescripcion();", "private void viewActiveCourseList() {\n boolean detailed = yesNoQuestion(\"Would you like to look at the detailed version? (just names if no)\");\n\n System.out.println(\"The current active courses are:\\n \");\n for (int i = 0; i < activeCourseList.size(); i++) {\n if (detailed) {\n System.out.println((i + 1) + \":\");\n detailedCoursePrint(activeCourseList.get(i));\n } else {\n System.out.println((i + 1) + \": \" + activeCourseList.get(i).getName());\n }\n }\n\n }", "@Override\n\tpublic List<Culture> ViewCourse() {\n\t\treturn null;\n\t}", "public ArrayList getCourses();", "public List<CatalogDescription> getCatalogDescriptions(Map<String, String> eqCriteria, Map<String, String> searchCriteria);", "public String getCourseDesc() {\n return courseDesc;\n }", "private void showCourseCatalogue()\r\n {\r\n \tCourseCatalogue courseCat = this.getDBManager().getCourseCat();\r\n \tthis.getClientOut().printf(\"SUCCESS\\n%s\\n\", courseCat.toString());\r\n \tthis.getClientOut().flush();\r\n }", "public String getCitation();", "public static String courseDescription(long idCorso) {\n\t\tRequestContent rp = new RequestContent();\n\t\trp.type = RequestType.COURSE_DESCRIPTION;\n\t\trp.parameters = new Object[] { idCorso };\n\t\tReceiveContent rpc = sendReceive(rp);\n\t\tString descr = (String) rpc.parameters[0];\n\t\treturn descr;\n\t\t\n\t}", "@Override\npublic ArrayList<String> courses() {\n\tArrayList<String> studentCourses = new ArrayList<String>();\n\tstudentCourses.add(\"CMPE - 273\");\n\tstudentCourses.add(\"CMPE - 206\");\n\tstudentCourses.add(\"CMPE - 277\");\n\tSystem.out.println(this.name+\" has take these courses\");\n\tfor(int i = 0 ; i < studentCourses.size() ; i++){\n\t\tSystem.out.println( studentCourses.get(i));\n\t}\n\treturn null;\n}", "public interface CatalogDescriptionDao {\r\n\r\n public void init();\r\n\r\n /**\r\n * Return a catalog description based on the database id\r\n * \r\n * @param id - the database id of the catalog description\r\n * @return - the CatalogDescription\r\n */\r\n public CatalogDescription getCatalogDescription(Long id);\r\n \r\n /**\r\n * Return the active catalog description based on the course id\r\n * \r\n * @param id - the course id of the catalog description\r\n * @return - the last version of the CatalogDescription\r\n */\r\n public CatalogDescription getCatalogDescription(String course_id);\r\n\r\n /**\r\n * Return the last version of a catalog description based on the course id\r\n * \r\n * @param id - the course id of the catalog description\r\n * @return - the last version of the CatalogDescription (null if nothing is found)\r\n */\r\n public CatalogDescription getLastVersionCatalogDescription(String courseId);\r\n\r\n \r\n /**\r\n * Return active catalog descriptions that correspond to the given department\r\n * (can be null for all)\r\n * \r\n * @return - the list of CatalogDescription\r\n */\r\n public List<CatalogDescription> getCatalogDescriptionsByDepartment(String department);\r\n \r\n /**\r\n * Return active catalog descriptions that correspond to the given department with flag to indicate if we return or not inactive catalog descriptions \r\n */\r\n public List<CatalogDescription> getCatalogDescriptionsByDepartment(String department, boolean showInactives);\r\n \r\n \r\n /**\r\n * Return active catalog descriptions that correspond to the given academic career\r\n * (can be null for all)\r\n * \r\n * @return - the list of CatalogDescription\r\n */\r\n public List<CatalogDescription> getCatalogDescriptionsByCareer(String career);\r\n \r\n /**\r\n * Return active catalog descriptions that correspond to the given academic career with flag to indicate if we return or not inactive catalog descriptions\r\n */\r\n public List<CatalogDescription> getCatalogDescriptionsByCareer(String career, boolean showInactives);\r\n \r\n \r\n /**\r\n * Return all active catalog descriptions for certificates programs\r\n * (can be null for all)\r\n * \r\n * @return - the list of CatalogDescription\r\n */\r\n \r\n public List<CatalogDescription> getAllCatalogDescriptionsForCertificate();\r\n \r\n /**\r\n * Return all active catalog descriptions for certificates programs with flag to indicate if we return or not inactive catalog descriptions\r\n */\r\n \r\n public List<CatalogDescription> getAllCatalogDescriptionsForCertificate(boolean showInactives);\r\n \r\n \r\n /**\r\n * Return active catalog descriptions that correspond to the given criteria map\r\n * (can be null for all)\r\n * \r\n * @return - the list of CatalogDescription\r\n */\r\n public List<CatalogDescription> getCatalogDescriptions(Map<String, String> eqCriteria, Map<String, String> searchCriteria);\r\n\r\n /**\r\n * save the catalog description to the database\r\n * \r\n * @param cd - the catalog description to save\r\n * @throws StaleDataException\r\n * @throws DatabaseException\r\n */\r\n public void saveCatalogDescription(CatalogDescription cd)\r\n\t throws StaleDataException, DatabaseException;\r\n\r\n /**\r\n * Return a list of Course id (used by quartz job to determine if the catalog description is already created)\r\n * \r\n * @return - the list of Course id\r\n */\r\n public List<String> getListCourseId();\r\n \r\n \r\n /** \r\n * @return all active catlog descriptions\r\n */\r\n public List<CatalogDescription> getAllCatalogDescriptions();\r\n \r\n \r\n /**\r\n * Set all catalog description to \"inactive\" status\r\n * \r\n */\r\n public void setCatalogDescriptionToInactive();\r\n \r\n /**\r\n * Get catalog description from department that have no description and which are not certificate courses\r\n * \r\n */\r\n public List<CatalogDescription> getCatalogDescriptionsByDepartmentWithNoDescription(String department);\r\n \r\n \r\n /**\r\n * Get catalog description for certificates courses that have no description\r\n * \r\n */\r\n public List<CatalogDescription> getAllCatalogDescriptionsForCertificatesWithNoDescription();\r\n \r\n /**\r\n * Get all departments that have at least one catalog description with an empty description\r\n * \r\n */\r\n public List<String> getDepartmentNameWithAtLeastOneCaWithNoDescription();\r\n \r\n \r\n /**\r\n * return whether or not the specified Catalog Description exists.\r\n * \r\n * @param course_id - the course_id of the catalog description\r\n * @return true if the catalog description exists, false otherwise\r\n */\r\n public boolean descriptionExists(String course_id);\r\n}", "public List<CatalogDescription> getAllCatalogDescriptionsForCertificatesWithNoDescription();", "public ArrayList<String> getAutorInformation(){\n // If there is no autor information\n if (indiceAutorInformation == -1){\n return null;\n }\n\n // Declare ArrayList\n ArrayList<String> autorInformation = new ArrayList<>();\n\n // Get information from third Child\n NodeList nList_name = documentsEntrys.get(indiceAutorInformation).getElementsByTagName(\"family\");\n NodeList nList_IDNumber = documentsEntrys.get(indiceAutorInformation).getElementsByTagName(\"identifier\");\n NodeList nList_personList = documentsEntrys.get(indiceAutorInformation).getElementsByTagName(\"address\");\n NodeList nList_telecom = documentsEntrys.get(indiceAutorInformation).getElementsByTagName(\"telecom\");\n NodeList nList_creationDate = documentsEntrys.get(indiceMetaInformation).getElementsByTagName(\"date\"); // creation date is on the composition, the first <entry>, block\n\n //The arrayList contains information about residence of the autor\n // [0] => street\n // [1] => post code\n // [2] => city\n ArrayList<String> address = searchInterleavedHierarchy(nList_personList, \"line\");\n\n // get full name of author\n if(nList_name.getLength() != 0){\n autorInformation.add(0, ((Element) nList_name.item(0)).getAttribute(VALUE));\n } else {\n autorInformation.add(0, EMPTYSTRING);\n //logger.log(Level.INFO, \"The name of the author ist unknown!\");\n }\n\n // get life long doctor number\n String lifelongAutorNumber = util.XML.searchHierarchyByTagAndAttribute(nList_IDNumber, SYSTEM, VALUE, \"http://kbv.de/LANR\", VALUE, VALUE);\n if(!util.String.isEmpty(lifelongAutorNumber)) {\n autorInformation.add(1, lifelongAutorNumber);\n } else {\n autorInformation.add(1, EMPTYSTRING);\n //logger.log(Level.INFO, \"The life long doctor number of the author is unknown!\");\n }\n\n // get street\n if(address.size() != 0) {\n autorInformation.add(2, address.get(0));\n } else {\n autorInformation.add(2, EMPTYSTRING);\n //logger.log(Level.INFO, \"The street of author is unknown!\");\n }\n\n // get post code\n if(address.size() >= 1) {\n autorInformation.add(3, address.get(1));\n } else {\n autorInformation.add(3, EMPTYSTRING);\n //logger.log(Level.INFO, \"The post code of author is unknown!\");\n }\n\n // get city\n if(address.size() >= 2) {\n autorInformation.add(4, address.get(2));\n } else {\n autorInformation.add(4, EMPTYSTRING);\n //logger.log(Level.INFO, \"The city of author is unknown!\");\n }\n\n // Get telephone number\n String telephoneNumber = util.XML.searchHierarchyByTagAndAttribute(nList_telecom, \"system\", VALUE,\"phone\", VALUE, VALUE);\n if(!util.String.isEmpty(telephoneNumber)) {\n autorInformation.add(5, telephoneNumber);\n } else {\n autorInformation.add(5, EMPTYSTRING);\n //logger.log(Level.INFO, \"The phone number of autor is unknown!\");\n }\n\n // Get eMail\n String eMail = util.XML.searchHierarchyByTagAndAttribute(nList_telecom, \"system\", VALUE, \"email\", VALUE, VALUE);\n if(!util.String.isEmpty(eMail)) {\n autorInformation.add(6, eMail);\n } else {\n autorInformation.add(6, EMPTYSTRING);\n //logger.log(Level.INFO, \"The eMail of autor is unknown!\");\n }\n\n // Get creation date\n if(nList_creationDate.getLength() != 0){\n autorInformation.add(7, ((Element) nList_creationDate.item(0)).getAttribute(VALUE));\n } else {\n autorInformation.add(7, EMPTYSTRING);\n //logger.log(Level.INFO, \"The creation date of bmp is unknown!\");\n }\n\n // get pharmacy ID\n String pharmacyID = util.XML.searchHierarchyByTagAndAttribute(nList_IDNumber, SYSTEM, VALUE, \"http://kbv.de/IDF\", VALUE, VALUE);\n if(!util.String.isEmpty(pharmacyID)) {\n autorInformation.add(8, pharmacyID);\n } else {\n autorInformation.add(8, EMPTYSTRING);\n //logger.log(Level.INFO, \"The pharmacy ID is unknown!\");\n }\n\n // get hospital ID\n String hospitalID = util.XML.searchHierarchyByTagAndAttribute(nList_IDNumber, SYSTEM, VALUE, \"http://kbv.de/KIK\", VALUE, VALUE);\n if(!util.String.isEmpty(hospitalID)) {\n autorInformation.add(9, hospitalID);\n } else {\n autorInformation.add(9, EMPTYSTRING);\n //logger.log(Level.INFO, \"The hospital ID is unknown!\");\n }\n\n return autorInformation;\n }", "public String catalog() {\n return catalogName;\n }", "public String catalog() {\n return catalogName;\n }", "public String getColl(){\n return this.college;\n }", "public Set<Course> getCoursesWithLearner(UserProfile learner)\n\t{\n\t\tSet<Course> rVal = null;\n\n\t\tif ((learner.getPermLevel() == UserProfile.STUDENT) || (learner.getPermLevel() == UserProfile.TA))\n\t\t{\n\t\t\trVal = new HashSet<Course>();\n\n\t\t\tfor (Connector e : network)\n\t\t\t{\n\t\t\t\tif (e.relationship == COURSE_LEARNER_RELATIONSHIP)\n\t\t\t\t{\n\t\t\t\t\tif (e.person.equals(learner))\n\t\t\t\t\t{\n\t\t\t\t\t\trVal.add(getCourse(e.courseCRN));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn rVal;\n\t}", "public abstract String[] getDescriptions();", "public String getCourses() {\n return courses;\n }", "@SuppressWarnings(\"CallToThreadDumpStack\")\r\n public void listadoOfertasAcademicas() {\r\n this.sessionProyecto.getOfertaAcademicas().clear();\r\n this.sessionProyecto.getFilterOfertaAcademicas().clear();\r\n try {\r\n for (Carrera carrera : sessionProyecto.getCarreras()) {\r\n for (ProyectoCarreraOferta pco : proyectoCarreraOfertaService.buscar(\r\n new ProyectoCarreraOferta(null, carrera.getId(), null, Boolean.TRUE))) {\r\n OfertaAcademica ofertaAcademica = ofertaAcademicaService.find(pco.getOfertaAcademicaId());\r\n if (!this.sessionProyecto.getOfertaAcademicas().contains(ofertaAcademica)) {\r\n this.sessionProyecto.getOfertaAcademicas().add(ofertaAcademica);\r\n }\r\n }\r\n }\r\n sessionProyecto.setFilterOfertaAcademicas(this.sessionProyecto.getOfertaAcademicas());\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n }", "java.util.List<hr.domain.ResumeDBOuterClass.Education> \n getEducationsList();", "public Cursor fetchAllCourses() {\r\nreturn database.query(DATABASE_TABLE, new String[] { KEY_ROWID, KEY_CATEGORY, KEY_COURSENAME, KEY_ASSIGNMENTNAME, KEY_DESCRIPTION, KEY_DUEDATE, KEY_COMPLETED }, null, null, null,\r\nnull, null);\r\n}", "public ArrayList<String> getExemptionCoursesList() {\r\n\t\treturn exemptionCoursesList;\r\n\t}", "public String getCourseAcademy() {\n return courseAcademy;\n }", "public java.lang.String getCA() {\n return CA;\n }", "public void howToGetASubject(String cCode){\n\t\t//CODE HERE\n\t\t\n\t\tfor (RegCourse course:registeredCourses){\n\t\t\tif(course.getCourseCode().equals(cCode)){\n\t\t\t\t\n\t\t\t\tif(this.findAccum(course)+(1-this.findFullAccum(course))<0.8){\n\t\t\t\t\tSystem.out.println(\"You can't get A for this subject\");\n\t\t\t\t}else {\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.printf(\"You need %.2f score more to get an A for this subject\\n\",(0.8-this.findAccum(course))*100);\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public List<CpAppliedJob> getAllDetails() {\n\n\t\tList<CpAppliedJob> details = new ArrayList<CpAppliedJob>();\n\t\ttry {\n\t\t\tdetailRepository.findAll().forEach(details::add);\n\t\t} catch (NullPointerException e) {\n\t\t\tSystem.out.println(e);\n\t\t}\n\t\treturn details;\n\n\t}", "public Lecturers getLecTable();", "public List<SermCit> getCits(){\n return citations;\n }", "public java.util.List<hr.domain.ResumeDBOuterClass.Education> getEducationsList() {\n return educations_;\n }", "public T caseCatalog(Catalog object) {\n\t\treturn null;\n\t}", "public java.lang.String getStrCatalog()\n\t{\n\t\treturn strCatalog;\n\t}", "private void getCourseList(){\r\n\r\n CourseDAO courseDAO = new CourseDAO(Statistics.this);\r\n List<Course> courseList= courseDAO.readListofCourses();\r\n for(Course course: courseList) {\r\n courses.add(course.getName());\r\n }\r\n\r\n }", "public ArrayList<CareerCards> getCareerCardDeck(){\n\t\treturn careerCardDeck;\n\t}", "public List<HabilitacaoAcademicaDTO> getAllHabsAcademicas(String emailFreelancer) throws SQLException {\n List<HabilitacaoAcademica> habilitacoesAcademicas = repositorioFreelancer.getAllHabsAcademicas(emailFreelancer);\n List<HabilitacaoAcademicaDTO> habilitacoesAcademicasDTO = new ArrayList<>();\n\n for (HabilitacaoAcademica habilitacaoAcademica : habilitacoesAcademicas) {\n habilitacoesAcademicasDTO.add((HabilitacaoAcademicaDTO) habilitacaoAcademica.toDTO());\n }\n return habilitacoesAcademicasDTO;\n }", "public List<Course> getCourse() {\n\t\treturn null;\n\t}", "public CatalogManager getCatalogManager() {\n return cm;\n }", "private Object getAnomizedCategory() {\r\n\tString categorie = (String) record.get(\"categorie\");\r\n\tif (categorie != null) {\r\n\t switch (categorie) {\r\n\t case \"AD\":\r\n\t case \"CO\":\r\n\t case \"FI\":\r\n\t case \"IBL\":\r\n\t case \"KI\":\r\n\t case \"KL\":\r\n\t case \"VO\":\r\n\t\tbreak;\r\n\t default:\r\n\t\tcategorie = null;\r\n\t\tbreak;\r\n\t }\r\n\t}\r\n\r\n\treturn categorie;\r\n }", "public String getIsCatalog() {\n return isCatalog;\n }", "public String getcDescription() {\n return cDescription;\n }", "public String getAffiliatedResearchers() {\r\n return this.affiliatedResearchers;\r\n }", "public java.util.List<hr.domain.ResumeDBOuterClass.Education> getEducationsList() {\n if (educationsBuilder_ == null) {\n return java.util.Collections.unmodifiableList(educations_);\n } else {\n return educationsBuilder_.getMessageList();\n }\n }", "java.lang.String getAuthorities(int index);", "public Vector<CourseSubject> getCourses() throws IOException{\n\n\t\tVector<CourseSubject> coursesVector = new Vector<CourseSubject>();\t\n\t\tString sourceLine = \"\";\n\t\tString content = \"\";\t\n\t\t\n\t\tInputStreamReader pageInput = new InputStreamReader(address.openStream());\n\t\tBufferedReader source = new BufferedReader(pageInput);\n\t\twhile( (sourceLine = source.readLine()) != null){\n\t\t\tcontent += sourceLine + \"\\n\";\n\t\t}\n\t\tPattern style = null;\n\t\tPattern p = null;\n\t\tString regex0 = \"\";\t\t// required for the split\n\t\tString regex1 = \"\";\t\t// required for the split\n\t\t\n\t\tswitch (flag) {\t// dependent on different schools\n \tcase 0:\n \t\tregex0 = \"<div class=\\\"ws-course-title\\\"><a href.*?>\";\n \t\tstyle = Pattern.compile(\"<div class=\\\"ws-course-title\\\"><a href.*?>.*?</a></div>\");\n \t\tp = Pattern.compile(\"<a href=\\\".*?skinId=2169\\\">\");\n \t\tregex1 = \"</a></div>\";\n \tbreak;\n }\n\t\t\n\n Matcher mstyle = style.matcher(content);\n String address = null;\n Matcher pstyle = null;\n if( p != null)\n \tpstyle = p.matcher(content);\n \n String tag = \"\";\n String[] str = null;\n // need to change counter for Stanford mstyle has more values then pstyle\n int counter = 0;\n boolean done = false;\n while (mstyle.find() ){\n \tdone = pstyle.find();\n \ttag = mstyle.group();\n \tstr = tag.split(regex0, 3);\n \tif(str.length != 1)\n \t\tstr = str[str.length-1].split(regex1, 3);\t\t// str[0] holds the name of the course\n \tCourseSubject courseSub = new CourseSubject(str[0], null);\t\t// no subclasses yet.\n \t\n \tif(flag == 3){\t\t// for berkeley\n \t\taddress = str[0].trim().replace(' ', '+');\n \t\taddress = cleanURL(address, flag);\n \t}\n \telse{\n \t\tif(flag == 2 && (counter < 9 || !done) )\t// done for stanford\n \t\t\taddress = \"http://www.fail.com\";\t// fail this will be removed in linkedcoursesApp\n \t\telse\n \t\t\taddress = pstyle.group();\n \t\taddress = cleanURL(address, flag);\n \t}\n \tcourseSub.setURL(new URL(address));\n \t\n \tcoursesVector.add(courseSub);\n \tcounter++;\n }\n \n\t\tpageInput.close();\n\t\tsource.close();\n\t\treturn coursesVector;\n\t}", "private List<String[]> getCourseEntries() {\n \n List<String[]> list = new LinkedList<String[]>();\n \n String courseCodes = courseEntries.getText();\n StringBuilder temp = new StringBuilder();\n if (courseCodes.length() > 0) {\n \n String[] container = new String[2];\n \n for (int i = 0; i < courseCodes.length() + 1; i++) {\n \n //add the subjectCode to the container array\n if (courseCodes.length() > i && courseCodes.charAt(i) == ' ') {\n\n container[0] = temp.toString();\n temp = new StringBuilder();\n }\n //add text to the string builder\n else if (courseCodes.length() > i && courseCodes.charAt(i) != ';') {\n \n temp.append(courseCodes.charAt(i));\n }\n //add the container object with subjectCode and courseNumber to the list.\n else {\n\n container[1] = temp.toString();\n list.add(container);\n temp = new StringBuilder();\n container = new String[2];\n }\n }\n }\n \n return list;\n }", "public List<Assignment> getAllAssignment(long academic_id) throws Exception {\n\t\tList<Assignment> academics = new ArrayList<Assignment>();\n\n\t\ttry{\n\t\t\tCursor cursor = database.query(MySQLiteHelper.TABLE_ASSIGNMENT,\n\t\t\t\t\tallColumns, MySQLiteHelper.ASSIGNMENT_ACADEMIC + \" = \" + academic_id,\n\t\t\t\t\tnull, null, null, null);\n\n\t\t\tcursor.moveToFirst();\n\t\t\twhile (!cursor.isAfterLast()) {\n\t\t\t\tAssignment data_assignment = cursorToAssignment(cursor);\n\t\t\t\tacademics.add(data_assignment);\n\t\t\t\tcursor.moveToNext();\n\t\t\t}\n\t\t\t// Make sure to close the cursor\n\t\t\tcursor.close();\n\t\t\treturn academics;\n\t\t}\n\t\tcatch (Exception e){\n\t\t\tthrow e;\n\t\t}\n\t}", "public Set<Cdss4NsarLabor> getLabResults();", "public IFuture<ItemInfo[]> getCatalog()\n\t{\n\t\tfinal Future<ItemInfo[]> ret = new Future<ItemInfo[]>();\n\t\tShopCapa shop = (ShopCapa)capa.getPojoCapability();\n\t\tret.setResult(shop.getCatalog().toArray(new ItemInfo[shop.getCatalog().size()]));\n\t\treturn ret;\n\t}", "java.lang.String getDesc();", "public void consulterCatalog() {\n\t\t\n\t}", "public ACommunity getCisInformation(String client, String cisId);", "public ArrayList<Course> getCoursesInField(){\r\n\t\treturn CourseFieldController.getFieldCourses(this);\r\n\t}", "public int getCareerId() {\n return careerId;\n }", "public org.chartacaeli.model.CatalogADC7118 getCatalogADC7118() {\n return this.catalogADC7118;\n }", "public abstract java.lang.String getAcma_descripcion();", "public String getResearchDescription() {\r\n return this.researchDescription;\r\n }", "String getCatalogName();", "public ArrayList<String> getRequestedCourses()\n\t{\n\t\treturn requestedCourses;\n\t}", "@AutoEscape\n\tpublic String getCourse();", "public String getAcademicRequirements() {\r\n return academicRequirements;\r\n }", "List<ChartBean> returnResearchFundingByDepartmentInstituteCenter();", "@ZAttr(id=-1)\n public String[] getDescription() {\n return getMultiAttr(Provisioning.A_description);\n }", "public static String getAbstractSection(String abstractContent, Configuration c){\n String abstractSection = \"<h2>Abstract</h2><p>\";\n if(abstractContent!=null && !\"\".equals(abstractContent)){\n abstractSection+=abstractContent;\n }\n else{\n abstractSection+=\"Here goes the abstract. A couple of sentences summarizing the ontology and its prupose.</p>\\n\"\n + \"<p style=\\\"text-align: center;\\\"> <b> Here you should point to the owl encoding of your ontology</b>\";\n }\n abstractSection+=\"</p>\\n\";\n //citation info\n if(!\"\".equals(c.getCiteAs()) && c.getCiteAs()!=null){\n abstractSection+=\"<p><strong>Cite as:</strong></br>\\n\"+c.getCiteAs()+\"\\n</p>\";\n }\n return abstractSection;\n }", "public StringDt getClinicalInformation() { \n\t\tif (myClinicalInformation == null) {\n\t\t\tmyClinicalInformation = new StringDt();\n\t\t}\n\t\treturn myClinicalInformation;\n\t}", "String getDesc();", "List<ChartBean> returnEmployeeCommunityServicesByDepartmentInstituteCenter();", "@Override\r\n\tpublic List<Courses> getCourses() {\n\t\treturn coursesdao.findAll();\r\n\t}", "public String getCategoryDescription() {\n return categoryDesc;\n }", "public void printCourseInfo() {\r\n\t\r\n\tString temp =CoursesList.get(0);\r\n\tSystem.out.println(temp);\r\n}", "@Override\n\tpublic List<Categoryb> GetCategpryb() {\n\t\treturn null;\n\t}", "public String categoryList(CategoryDetails c);", "public org.chartacaeli.model.CatalogADC1239H getCatalogADC1239H() {\n return this.catalogADC1239H;\n }", "public abstract List<Course> getByFilter(HashMap<String, String> filter);", "public ResultSet getElectiveOfferedCourses(String term, int id) {\n\t\tResultSet rset = null;\n\t\tString sql = null;\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\tsql = \"SELECT dept, title, num, altYear \" + \n\t\t\t\t \"FROM Required AS R, Course AS C, Student AS S \" + \n\t\t\t\t \"WHERE S.s_id = ? AND S.major = R.d_type AND C.term = ? AND elective = true AND c_num = num AND c_dept = dept;\";\n\t\t\t\n\t\t\tPreparedStatement pstmt = conn.prepareStatement(sql);\n\t\t\t\n\t\t\tpstmt.clearParameters();\n\t\t\tpstmt.setInt(1, id);\n\t\t\tpstmt.setString(2, term);\n\t\t\t\n\t\t\trset = pstmt.executeQuery();\n\t\t\t\n\t\t}catch (SQLException e) {\n\t\t\tSystem.out.println(\"createStatement \" + e.getMessage() + sql);\n\n\t\t}\n\t\t\n\t\treturn rset;\n\t}", "public Courses getCourseTable();", "@Override\n public ArrayList<QuestionBean> ObtainOfficialExam(int course_id) {\n return null;\n }", "public YFCDocument getCalendarDetails(String organizationCode, String calenderId) {\n\t\tYFCDocument calenderList = invokeYantraApi(XMLLiterals.GET_CALENDAR_LIST, \n\t\t\t\tgetCalendarDetailsInDoc(organizationCode,calenderId),getCalendarListTempDoc());\n\t\tif(calenderList.getDocumentElement().hasChildNodes()) {\n\t\t\tYFCDocument calenderDetailDoc = invokeYantraApi(XMLLiterals.GET_CALENDAR_DETAILS, \n\t\t\t\t\tgetCalendarDetailsInDoc(organizationCode,calenderId),getCalendarDetailsTemplDoc());\n\t\t\tgetCalenderListForException(calenderDetailDoc);\n\t\t\t}\n\t\treturn calenderList;\n\t}", "private void testAccessibleDescription(Component comp, AccessibleContext comp_AC) {\n String desc = comp_AC.getAccessibleDescription();\n \n // LOG ONLY -/\n if(debugLog) System.err.println(LOG_CAPTION+\" - <testAccessibleDescription()> - accessibleDescription=\"+desc);\n \n if (testSettings.AP_accessibleDescription && (desc == null)){\n noDesc.add(comp);\n }\n }", "@Override\n\tpublic java.lang.String getDescription() {\n\t\treturn _lineaGastoCategoria.getDescription();\n\t}", "java.util.List<java.lang.String>\n getAuthoritiesList();" ]
[ "0.7002294", "0.5807886", "0.5679376", "0.5570579", "0.5519729", "0.54029906", "0.53729856", "0.5357579", "0.5324921", "0.5299711", "0.5284157", "0.526164", "0.5144043", "0.5135239", "0.51319414", "0.51319414", "0.51276875", "0.51177716", "0.5091748", "0.5027244", "0.50014746", "0.49883184", "0.49784812", "0.49766853", "0.49732393", "0.4917229", "0.49097615", "0.489856", "0.4870095", "0.48651072", "0.48344186", "0.48237094", "0.4815928", "0.48137575", "0.48137575", "0.48022044", "0.47965872", "0.4791429", "0.4787496", "0.47865486", "0.4785611", "0.47802734", "0.47642878", "0.4749725", "0.47291154", "0.47173917", "0.4707588", "0.46920264", "0.4672897", "0.46727386", "0.46663514", "0.4659678", "0.46530917", "0.46501678", "0.46366084", "0.46329296", "0.46209252", "0.4604815", "0.45942977", "0.4592419", "0.45894748", "0.4581243", "0.45676786", "0.45607385", "0.45560423", "0.45551726", "0.45548996", "0.45536196", "0.45476377", "0.45424238", "0.4534144", "0.4533452", "0.4529749", "0.45253456", "0.4523662", "0.45216736", "0.45090204", "0.45035028", "0.4501656", "0.4500989", "0.44983974", "0.44932", "0.44907928", "0.4490347", "0.44740948", "0.4470527", "0.44680375", "0.4460086", "0.44579893", "0.44574472", "0.4455199", "0.44547787", "0.44546372", "0.44540554", "0.44521797", "0.4450563", "0.4447662", "0.4447128", "0.44444776", "0.44425842" ]
0.75584483
0
Return active catalog descriptions that correspond to the given academic career with flag to indicate if we return or not inactive catalog descriptions
public List<CatalogDescription> getCatalogDescriptionsByCareer(String career, boolean showInactives);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<CatalogDescription> getCatalogDescriptionsByDepartment(String department, boolean showInactives);", "public List<CatalogDescription> getCatalogDescriptionsByCareer(String career);", "public List<CatalogDescription> getAllCatalogDescriptionsForCertificate(boolean showInactives);", "public void setCatalogDescriptionToInactive();", "public String getIsCatalog() {\n return isCatalog;\n }", "boolean getDesc();", "private void viewActiveCourseList() {\n boolean detailed = yesNoQuestion(\"Would you like to look at the detailed version? (just names if no)\");\n\n System.out.println(\"The current active courses are:\\n \");\n for (int i = 0; i < activeCourseList.size(); i++) {\n if (detailed) {\n System.out.println((i + 1) + \":\");\n detailedCoursePrint(activeCourseList.get(i));\n } else {\n System.out.println((i + 1) + \": \" + activeCourseList.get(i).getName());\n }\n }\n\n }", "public List<String> getDepartmentNameWithAtLeastOneCaWithNoDescription();", "public CatalogDescription getCatalogDescription(String course_id);", "public List<CatalogDescription> getCatalogDescriptionsByDepartment(String department);", "@Override\r\n protected void generateDescription ()\r\n {\r\n String[] descriptions = {\r\n \"Advice about the law!\", \"A financial master!\", \"Technologically amazing!\",\r\n \"People's savior!\", \"To serve for the people!\", \"A beast of a rider!\",\r\n \"All-sport mighty!\"\r\n };\r\n\r\n for (int j = 0; j < CAREERS.length; j++)\r\n if (CAREERS[j].equalsIgnoreCase (name))\r\n description = descriptions[j];\r\n }", "boolean isSetDesc();", "public List<CatalogDescription> getCatalogDescriptionsByDepartmentWithNoDescription(String department);", "public List<CatalogDescription> getAllCatalogDescriptionsForCertificate();", "public interface CatalogDescriptionDao {\r\n\r\n public void init();\r\n\r\n /**\r\n * Return a catalog description based on the database id\r\n * \r\n * @param id - the database id of the catalog description\r\n * @return - the CatalogDescription\r\n */\r\n public CatalogDescription getCatalogDescription(Long id);\r\n \r\n /**\r\n * Return the active catalog description based on the course id\r\n * \r\n * @param id - the course id of the catalog description\r\n * @return - the last version of the CatalogDescription\r\n */\r\n public CatalogDescription getCatalogDescription(String course_id);\r\n\r\n /**\r\n * Return the last version of a catalog description based on the course id\r\n * \r\n * @param id - the course id of the catalog description\r\n * @return - the last version of the CatalogDescription (null if nothing is found)\r\n */\r\n public CatalogDescription getLastVersionCatalogDescription(String courseId);\r\n\r\n \r\n /**\r\n * Return active catalog descriptions that correspond to the given department\r\n * (can be null for all)\r\n * \r\n * @return - the list of CatalogDescription\r\n */\r\n public List<CatalogDescription> getCatalogDescriptionsByDepartment(String department);\r\n \r\n /**\r\n * Return active catalog descriptions that correspond to the given department with flag to indicate if we return or not inactive catalog descriptions \r\n */\r\n public List<CatalogDescription> getCatalogDescriptionsByDepartment(String department, boolean showInactives);\r\n \r\n \r\n /**\r\n * Return active catalog descriptions that correspond to the given academic career\r\n * (can be null for all)\r\n * \r\n * @return - the list of CatalogDescription\r\n */\r\n public List<CatalogDescription> getCatalogDescriptionsByCareer(String career);\r\n \r\n /**\r\n * Return active catalog descriptions that correspond to the given academic career with flag to indicate if we return or not inactive catalog descriptions\r\n */\r\n public List<CatalogDescription> getCatalogDescriptionsByCareer(String career, boolean showInactives);\r\n \r\n \r\n /**\r\n * Return all active catalog descriptions for certificates programs\r\n * (can be null for all)\r\n * \r\n * @return - the list of CatalogDescription\r\n */\r\n \r\n public List<CatalogDescription> getAllCatalogDescriptionsForCertificate();\r\n \r\n /**\r\n * Return all active catalog descriptions for certificates programs with flag to indicate if we return or not inactive catalog descriptions\r\n */\r\n \r\n public List<CatalogDescription> getAllCatalogDescriptionsForCertificate(boolean showInactives);\r\n \r\n \r\n /**\r\n * Return active catalog descriptions that correspond to the given criteria map\r\n * (can be null for all)\r\n * \r\n * @return - the list of CatalogDescription\r\n */\r\n public List<CatalogDescription> getCatalogDescriptions(Map<String, String> eqCriteria, Map<String, String> searchCriteria);\r\n\r\n /**\r\n * save the catalog description to the database\r\n * \r\n * @param cd - the catalog description to save\r\n * @throws StaleDataException\r\n * @throws DatabaseException\r\n */\r\n public void saveCatalogDescription(CatalogDescription cd)\r\n\t throws StaleDataException, DatabaseException;\r\n\r\n /**\r\n * Return a list of Course id (used by quartz job to determine if the catalog description is already created)\r\n * \r\n * @return - the list of Course id\r\n */\r\n public List<String> getListCourseId();\r\n \r\n \r\n /** \r\n * @return all active catlog descriptions\r\n */\r\n public List<CatalogDescription> getAllCatalogDescriptions();\r\n \r\n \r\n /**\r\n * Set all catalog description to \"inactive\" status\r\n * \r\n */\r\n public void setCatalogDescriptionToInactive();\r\n \r\n /**\r\n * Get catalog description from department that have no description and which are not certificate courses\r\n * \r\n */\r\n public List<CatalogDescription> getCatalogDescriptionsByDepartmentWithNoDescription(String department);\r\n \r\n \r\n /**\r\n * Get catalog description for certificates courses that have no description\r\n * \r\n */\r\n public List<CatalogDescription> getAllCatalogDescriptionsForCertificatesWithNoDescription();\r\n \r\n /**\r\n * Get all departments that have at least one catalog description with an empty description\r\n * \r\n */\r\n public List<String> getDepartmentNameWithAtLeastOneCaWithNoDescription();\r\n \r\n \r\n /**\r\n * return whether or not the specified Catalog Description exists.\r\n * \r\n * @param course_id - the course_id of the catalog description\r\n * @return true if the catalog description exists, false otherwise\r\n */\r\n public boolean descriptionExists(String course_id);\r\n}", "public List<CatalogDescription> getAllCatalogDescriptionsForCertificatesWithNoDescription();", "private void showCourseCatalogue()\r\n {\r\n \tCourseCatalogue courseCat = this.getDBManager().getCourseCat();\r\n \tthis.getClientOut().printf(\"SUCCESS\\n%s\\n\", courseCat.toString());\r\n \tthis.getClientOut().flush();\r\n }", "public Catalog getCatalog();", "public void printActiveCourses() \n {\n for (String c: courses.keySet()) \n {\n if (courses.get(c).getActive()) \n {\n System.out.println(courses.get(c)); \n }\n }\n }", "boolean isSetDescription();", "boolean isSetDescription();", "boolean hasCampaignDescription();", "public abstract String[] getDescriptions();", "boolean hasDescription();", "boolean hasDescription();", "boolean hasDescription();", "public List<CatalogDescription> getCatalogDescriptions(Map<String, String> eqCriteria, Map<String, String> searchCriteria);", "boolean hasPageCategoryDescription();", "@ZAttr(id=-1)\n public String[] getDescription() {\n return getMultiAttr(Provisioning.A_description);\n }", "public void showCatalogue() {\n for (Record r : cataloue) {\n System.out.println(r);\n }\n }", "private void testAccessibleDescription(Component comp, AccessibleContext comp_AC) {\n String desc = comp_AC.getAccessibleDescription();\n \n // LOG ONLY -/\n if(debugLog) System.err.println(LOG_CAPTION+\" - <testAccessibleDescription()> - accessibleDescription=\"+desc);\n \n if (testSettings.AP_accessibleDescription && (desc == null)){\n noDesc.add(comp);\n }\n }", "public IFuture<ItemInfo[]> getCatalog()\n\t{\n\t\tfinal Future<ItemInfo[]> ret = new Future<ItemInfo[]>();\n\t\tShopCapa shop = (ShopCapa)capa.getPojoCapability();\n\t\tret.setResult(shop.getCatalog().toArray(new ItemInfo[shop.getCatalog().size()]));\n\t\treturn ret;\n\t}", "public CatalogDescription getCatalogDescription(Long id);", "List<ExamPackage> getListIsComing();", "Catalog getCatalog();", "Catalog getCatalog();", "public void setIsCatalog(String isCatalog) {\n this.isCatalog = isCatalog;\n }", "boolean isSetCit();", "private void viewSavedCourseList() {\n boolean detailed = yesNoQuestion(\"Would you like to look at the detailed version? (just names if no)\");\n\n System.out.println(\"The current active courses are:\\n \");\n for (int i = 0; i < courseList.getCourseList().size(); i++) {\n if (detailed) {\n System.out.println((i + 1) + \":\");\n detailedCoursePrint(courseList.getCourseList().get(i));\n } else {\n System.out.println((i + 1) + \": \" + courseList.getCourseList().get(i).getName());\n }\n }\n }", "Boolean getAccruedInterest();", "public boolean descriptionExists(String course_id);", "public String getCategoriaDescripcion();", "public final boolean modstate_has_catalog () {\n\t\treturn modstate >= MODSTATE_CATALOG;\n\t}", "public List<Interview> getActiveInterviews() {\n QueryBase query = new AccessibleInterviews(getDefaultAdminUser(), 2, \n \"desc\", null, 0, Integer.MAX_VALUE);\n \n List<InterviewFilter> filters = new ArrayList<InterviewFilter>(1);\n InterviewFilter filter = new ByActive();\n filter.include(\"true\");\n filters.add(filter);\n \n QueryFilterListBinder filteredQuery = \n new QueryFilterListBinder(query, filters);\n filteredQuery.init(2, \"desc\", 0, Integer.MAX_VALUE);\n QueryResult result = filteredQuery.executeQuery();\n \n return result.getList();\n }", "@Override\n\tpublic boolean getIsActive();", "HashMap<String, String> getAdditionalDescriptions();", "public boolean getInfoJacuzzi() {\n\t\tif (this.accommodationType.equals(TYPEpresidential) && this.getAccommodationNumber() == 114) {\n\t\t\treturn true;\n\t\t} else if (this.accommodationType.equals(TYPEfamily) && this.getAccommodationNumber() == 113) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\n\t}", "public List<CatalogueCompatableResource> toResources(List<Catalogue> catalogueList,Long merchantNo,String cusLoyaltyId){\n List<CatalogueCompatableResource> catalogueCompatableResourcesList = new ArrayList<CatalogueCompatableResource>();\n\n\n\n\n\n for(Catalogue catalogue:catalogueList){\n\n Integer customerHasPoint =0;\n\n CatalogueCompatableResource catalogueCompatableResource =new CatalogueCompatableResource();\n\n catalogueCompatableResource.setCat_prd_no(catalogue.getCatProductNo()==null?0L:catalogue.getCatProductNo());\n\n String catPrdCategoryText =\"\";\n\n //for setting product category test\n if(catalogue.getCatCategory() !=null){\n\n int catCategory = catalogue.getCatCategory();\n\n //getting coded value for catcategory\n CodedValue codedValue = codedValueService.findByCdvIndexAndCdvCodeValue(CodedValueIndex.CATALOGUE_PRODUCT_CATEGORY,catCategory);\n\n if(codedValue !=null){\n\n catPrdCategoryText =codedValue.getCdvCodeLabel();\n }\n\n }\n\n\n\n catalogueCompatableResource.setCat_prd_category_text(catPrdCategoryText);\n\n catalogueCompatableResource.setCat_prd_category(catalogue.getCatCategory()==null?0:catalogue.getCatCategory());\n\n catalogueCompatableResource.setCat_prd_code(catalogue.getCatProductCode()==null?\"\":catalogue.getCatProductCode());\n\n catalogueCompatableResource.setCat_prd_desc(catalogue.getCatDescription() == null ? \"\" : catalogue.getCatDescription());\n\n catalogueCompatableResource.setCat_prd_long_desc(catalogue.getCatLongDescription()==null?\"\":catalogue.getCatLongDescription());\n\n\n\n // Check if the image exists\n Image image = catalogue.getImage();\n\n //get the imageUrl\n String imageUrl = environment.getProperty(\"IMAGE_PATH_URL\");\n\n\n //If the image is set, then we need to set the image path\n if ( image != null ) {\n\n // Get the image path\n String imagePath = imageService.getPathForImage(image, ImagePathType.MOBILE);\n\n // Set the imagePath\n catalogueCompatableResource.setCat_image(imageUrl + imagePath);\n\n\n }\n\n catalogueCompatableResource.setCat_image_id(catalogue.getCatProductImage()==null?0L:catalogue.getCatProductImage());\n\n catalogueCompatableResource.setCat_rwd_points(catalogue.getCatNumPoints()==null?0.0:catalogue.getCatNumPoints());\n\n catalogueCompatableResource.setCat_cash(catalogue.getCatPartialCash()==null?0.0:catalogue.getCatPartialCash());\n\n //find reward balance\n CustomerRewardBalance customerRewardBalance =customerRewardBalanceService.findByCrbLoyaltyIdAndCrbMerchantNoAndCrbRewardCurrency(cusLoyaltyId,merchantNo,catalogue.getCatRewardCurrencyId());\n\n if(customerRewardBalance !=null){\n\n Double rewardBalance = customerRewardBalance.getCrbRewardBalance();\n\n if(rewardBalance !=null){\n\n\n //check customer has balance if its true set 1 otherwise set o\n if(rewardBalance>=catalogue.getCatNumPoints()){\n\n customerHasPoint =1;\n }\n }\n\n catalogueCompatableResource.setCat_rwd_balance(rewardBalance==null?0.0:rewardBalance);\n\n\n\n\n }\n\n catalogueCompatableResource.setCat_rwd_currency(catalogue.getCatRewardCurrencyId()==null?0:catalogue.getCatRewardCurrencyId());\n\n //for setting merchant name\n Merchant merchant = merchantService.findByMerMerchantNo(merchantNo);\n\n if(merchant !=null){\n\n catalogueCompatableResource.setCat_merchant_name(merchant.getMerMerchantName()==null?\"\":merchant.getMerMerchantName());\n }\n\n\n catalogueCompatableResource.setCat_has_balance(customerHasPoint);\n\n catalogueCompatableResourcesList.add(catalogueCompatableResource);\n\n\n\n\n }\n\n\n return catalogueCompatableResourcesList;\n\n }", "public abstract co\n\t\t.com\n\t\t.telefonica\n\t\t.atiempo\n\t\t.ejb\n\t\t.eb\n\t\t.Catalogo_causalLocal getCatalogo_causal();", "public Vector<CourseSubject> getCourses() throws IOException{\n\n\t\tVector<CourseSubject> coursesVector = new Vector<CourseSubject>();\t\n\t\tString sourceLine = \"\";\n\t\tString content = \"\";\t\n\t\t\n\t\tInputStreamReader pageInput = new InputStreamReader(address.openStream());\n\t\tBufferedReader source = new BufferedReader(pageInput);\n\t\twhile( (sourceLine = source.readLine()) != null){\n\t\t\tcontent += sourceLine + \"\\n\";\n\t\t}\n\t\tPattern style = null;\n\t\tPattern p = null;\n\t\tString regex0 = \"\";\t\t// required for the split\n\t\tString regex1 = \"\";\t\t// required for the split\n\t\t\n\t\tswitch (flag) {\t// dependent on different schools\n \tcase 0:\n \t\tregex0 = \"<div class=\\\"ws-course-title\\\"><a href.*?>\";\n \t\tstyle = Pattern.compile(\"<div class=\\\"ws-course-title\\\"><a href.*?>.*?</a></div>\");\n \t\tp = Pattern.compile(\"<a href=\\\".*?skinId=2169\\\">\");\n \t\tregex1 = \"</a></div>\";\n \tbreak;\n }\n\t\t\n\n Matcher mstyle = style.matcher(content);\n String address = null;\n Matcher pstyle = null;\n if( p != null)\n \tpstyle = p.matcher(content);\n \n String tag = \"\";\n String[] str = null;\n // need to change counter for Stanford mstyle has more values then pstyle\n int counter = 0;\n boolean done = false;\n while (mstyle.find() ){\n \tdone = pstyle.find();\n \ttag = mstyle.group();\n \tstr = tag.split(regex0, 3);\n \tif(str.length != 1)\n \t\tstr = str[str.length-1].split(regex1, 3);\t\t// str[0] holds the name of the course\n \tCourseSubject courseSub = new CourseSubject(str[0], null);\t\t// no subclasses yet.\n \t\n \tif(flag == 3){\t\t// for berkeley\n \t\taddress = str[0].trim().replace(' ', '+');\n \t\taddress = cleanURL(address, flag);\n \t}\n \telse{\n \t\tif(flag == 2 && (counter < 9 || !done) )\t// done for stanford\n \t\t\taddress = \"http://www.fail.com\";\t// fail this will be removed in linkedcoursesApp\n \t\telse\n \t\t\taddress = pstyle.group();\n \t\taddress = cleanURL(address, flag);\n \t}\n \tcourseSub.setURL(new URL(address));\n \t\n \tcoursesVector.add(courseSub);\n \tcounter++;\n }\n \n\t\tpageInput.close();\n\t\tsource.close();\n\t\treturn coursesVector;\n\t}", "List<CodeCategory> getCodeCategories(boolean retrieveCodes)\n throws DAOException;", "private Criteria buildInactiveCriteria(){\r\n Criteria criteria = new Criteria();\r\n criteria.addEqualTo(KRADPropertyConstants.ACTIVE, false);\r\n\r\n return criteria;\r\n }", "public interface LdCDef extends Classification {\n\n /** The empty array for no sisters. */\n String[] EMPTY_SISTERS = new String[]{};\n\n /** The empty map for no sub-items. */\n @SuppressWarnings(\"unchecked\")\n Map<String, Object> EMPTY_SUB_ITEM_MAP = (Map<String, Object>)Collections.EMPTY_MAP;\n\n /**\n * はいいいえを示す\n */\n public enum YesNo implements LdCDef {\n /** y */\n y(\"y\", \"y\", EMPTY_SISTERS)\n ,\n /** n */\n n(\"n\", \"n\", EMPTY_SISTERS)\n ;\n private static final Map<String, YesNo> _codeValueMap = new HashMap<String, YesNo>();\n static {\n for (YesNo value : values()) {\n _codeValueMap.put(value.code().toLowerCase(), value);\n for (String sister : value.sisters()) { _codeValueMap.put(sister.toLowerCase(), value); }\n }\n }\n private String _code; private String _alias; private String[] _sisters;\n private YesNo(String code, String alias, String[] sisters)\n { _code = code; _alias = alias; _sisters = sisters; }\n public String code() { return _code; } public String alias() { return _alias; }\n private String[] sisters() { return _sisters; }\n public Map<String, Object> subItemMap() { return EMPTY_SUB_ITEM_MAP; }\n public ClassificationMeta meta() { return LdCDef.DefMeta.YesNo; }\n\n public boolean inGroup(String groupName) {\n return false;\n }\n\n /**\n * Get the classification by the code. (CaseInsensitive)\n * @param code The value of code, which is case-insensitive. (NullAllowed: if null, returns null)\n * @return The instance of the corresponding classification to the code. (NullAllowed: if not found, returns null)\n */\n public static YesNo codeOf(Object code) {\n if (code == null) { return null; }\n if (code instanceof YesNo) { return (YesNo)code; }\n return _codeValueMap.get(code.toString().toLowerCase());\n }\n\n /**\n * Get the classification by the name (also called 'value' in ENUM world).\n * @param name The string of name, which is case-sensitive. (NullAllowed: if null, returns null)\n * @return The instance of the corresponding classification to the name. (NullAllowed: if not found, returns null)\n */\n public static YesNo nameOf(String name) {\n if (name == null) { return null; }\n try { return valueOf(name); } catch (RuntimeException ignored) { return null; }\n }\n\n /**\n * Get the list of all classification elements. (returns new copied list)\n * @return The list of all classification elements. (NotNull)\n */\n public static List<YesNo> listAll() {\n return new ArrayList<YesNo>(Arrays.asList(values()));\n }\n\n /**\n * Get the list of classification elements in the specified group. (returns new copied list) <br />\n * @param groupName The string of group name, which is case-sensitive. (NullAllowed: if null, returns empty list)\n * @return The list of classification elements in the group. (NotNull)\n */\n public static List<YesNo> groupOf(String groupName) {\n return new ArrayList<YesNo>(4);\n }\n\n @Override public String toString() { return code(); }\n }\n\n /**\n * 蔵書の状態を示す\n */\n public enum CollectionStatus implements LdCDef {\n /** NOR: 通常状態を示す */\n NOR(\"NOR\", \"NOR\", EMPTY_SISTERS)\n ,\n /** WAT: 待ち状態を示す */\n WAT(\"WAT\", \"WAT\", EMPTY_SISTERS)\n ,\n /** OUT: 貸し出し中を示す */\n OUT(\"OUT\", \"OUT\", EMPTY_SISTERS)\n ;\n private static final Map<String, CollectionStatus> _codeValueMap = new HashMap<String, CollectionStatus>();\n static {\n for (CollectionStatus value : values()) {\n _codeValueMap.put(value.code().toLowerCase(), value);\n for (String sister : value.sisters()) { _codeValueMap.put(sister.toLowerCase(), value); }\n }\n }\n private String _code; private String _alias; private String[] _sisters;\n private CollectionStatus(String code, String alias, String[] sisters)\n { _code = code; _alias = alias; _sisters = sisters; }\n public String code() { return _code; } public String alias() { return _alias; }\n private String[] sisters() { return _sisters; }\n public Map<String, Object> subItemMap() { return EMPTY_SUB_ITEM_MAP; }\n public ClassificationMeta meta() { return LdCDef.DefMeta.CollectionStatus; }\n\n public boolean inGroup(String groupName) {\n return false;\n }\n\n /**\n * Get the classification by the code. (CaseInsensitive)\n * @param code The value of code, which is case-insensitive. (NullAllowed: if null, returns null)\n * @return The instance of the corresponding classification to the code. (NullAllowed: if not found, returns null)\n */\n public static CollectionStatus codeOf(Object code) {\n if (code == null) { return null; }\n if (code instanceof CollectionStatus) { return (CollectionStatus)code; }\n return _codeValueMap.get(code.toString().toLowerCase());\n }\n\n /**\n * Get the classification by the name (also called 'value' in ENUM world).\n * @param name The string of name, which is case-sensitive. (NullAllowed: if null, returns null)\n * @return The instance of the corresponding classification to the name. (NullAllowed: if not found, returns null)\n */\n public static CollectionStatus nameOf(String name) {\n if (name == null) { return null; }\n try { return valueOf(name); } catch (RuntimeException ignored) { return null; }\n }\n\n /**\n * Get the list of all classification elements. (returns new copied list)\n * @return The list of all classification elements. (NotNull)\n */\n public static List<CollectionStatus> listAll() {\n return new ArrayList<CollectionStatus>(Arrays.asList(values()));\n }\n\n /**\n * Get the list of classification elements in the specified group. (returns new copied list) <br />\n * @param groupName The string of group name, which is case-sensitive. (NullAllowed: if null, returns empty list)\n * @return The list of classification elements in the group. (NotNull)\n */\n public static List<CollectionStatus> groupOf(String groupName) {\n return new ArrayList<CollectionStatus>(4);\n }\n\n @Override public String toString() { return code(); }\n }\n\n /**\n * 登録モジュールタイプ\n */\n public enum RegisterModuleType implements LdCDef {\n /** Online: Online Module */\n Online(\"OLN\", \"Online\", EMPTY_SISTERS)\n ,\n /** Batch: Batch Module */\n Batch(\"BTC\", \"Batch\", EMPTY_SISTERS)\n ;\n private static final Map<String, RegisterModuleType> _codeValueMap = new HashMap<String, RegisterModuleType>();\n static {\n for (RegisterModuleType value : values()) {\n _codeValueMap.put(value.code().toLowerCase(), value);\n for (String sister : value.sisters()) { _codeValueMap.put(sister.toLowerCase(), value); }\n }\n }\n private String _code; private String _alias; private String[] _sisters;\n private RegisterModuleType(String code, String alias, String[] sisters)\n { _code = code; _alias = alias; _sisters = sisters; }\n public String code() { return _code; } public String alias() { return _alias; }\n private String[] sisters() { return _sisters; }\n public Map<String, Object> subItemMap() { return EMPTY_SUB_ITEM_MAP; }\n public ClassificationMeta meta() { return LdCDef.DefMeta.RegisterModuleType; }\n\n public boolean inGroup(String groupName) {\n return false;\n }\n\n /**\n * Get the classification by the code. (CaseInsensitive)\n * @param code The value of code, which is case-insensitive. (NullAllowed: if null, returns null)\n * @return The instance of the corresponding classification to the code. (NullAllowed: if not found, returns null)\n */\n public static RegisterModuleType codeOf(Object code) {\n if (code == null) { return null; }\n if (code instanceof RegisterModuleType) { return (RegisterModuleType)code; }\n return _codeValueMap.get(code.toString().toLowerCase());\n }\n\n /**\n * Get the classification by the name (also called 'value' in ENUM world).\n * @param name The string of name, which is case-sensitive. (NullAllowed: if null, returns null)\n * @return The instance of the corresponding classification to the name. (NullAllowed: if not found, returns null)\n */\n public static RegisterModuleType nameOf(String name) {\n if (name == null) { return null; }\n try { return valueOf(name); } catch (RuntimeException ignored) { return null; }\n }\n\n /**\n * Get the list of all classification elements. (returns new copied list)\n * @return The list of all classification elements. (NotNull)\n */\n public static List<RegisterModuleType> listAll() {\n return new ArrayList<RegisterModuleType>(Arrays.asList(values()));\n }\n\n /**\n * Get the list of classification elements in the specified group. (returns new copied list) <br />\n * @param groupName The string of group name, which is case-sensitive. (NullAllowed: if null, returns empty list)\n * @return The list of classification elements in the group. (NotNull)\n */\n public static List<RegisterModuleType> groupOf(String groupName) {\n return new ArrayList<RegisterModuleType>(4);\n }\n\n @Override public String toString() { return code(); }\n }\n\n /**\n * 更新モジュールタイプ\n */\n public enum UpdateModuleType implements LdCDef {\n /** Online: Online Module */\n Online(\"OLN\", \"Online\", EMPTY_SISTERS)\n ,\n /** Batch: Batch Module */\n Batch(\"BTC\", \"Batch\", EMPTY_SISTERS)\n ;\n private static final Map<String, UpdateModuleType> _codeValueMap = new HashMap<String, UpdateModuleType>();\n static {\n for (UpdateModuleType value : values()) {\n _codeValueMap.put(value.code().toLowerCase(), value);\n for (String sister : value.sisters()) { _codeValueMap.put(sister.toLowerCase(), value); }\n }\n }\n private String _code; private String _alias; private String[] _sisters;\n private UpdateModuleType(String code, String alias, String[] sisters)\n { _code = code; _alias = alias; _sisters = sisters; }\n public String code() { return _code; } public String alias() { return _alias; }\n private String[] sisters() { return _sisters; }\n public Map<String, Object> subItemMap() { return EMPTY_SUB_ITEM_MAP; }\n public ClassificationMeta meta() { return LdCDef.DefMeta.UpdateModuleType; }\n\n public boolean inGroup(String groupName) {\n return false;\n }\n\n /**\n * Get the classification by the code. (CaseInsensitive)\n * @param code The value of code, which is case-insensitive. (NullAllowed: if null, returns null)\n * @return The instance of the corresponding classification to the code. (NullAllowed: if not found, returns null)\n */\n public static UpdateModuleType codeOf(Object code) {\n if (code == null) { return null; }\n if (code instanceof UpdateModuleType) { return (UpdateModuleType)code; }\n return _codeValueMap.get(code.toString().toLowerCase());\n }\n\n /**\n * Get the classification by the name (also called 'value' in ENUM world).\n * @param name The string of name, which is case-sensitive. (NullAllowed: if null, returns null)\n * @return The instance of the corresponding classification to the name. (NullAllowed: if not found, returns null)\n */\n public static UpdateModuleType nameOf(String name) {\n if (name == null) { return null; }\n try { return valueOf(name); } catch (RuntimeException ignored) { return null; }\n }\n\n /**\n * Get the list of all classification elements. (returns new copied list)\n * @return The list of all classification elements. (NotNull)\n */\n public static List<UpdateModuleType> listAll() {\n return new ArrayList<UpdateModuleType>(Arrays.asList(values()));\n }\n\n /**\n * Get the list of classification elements in the specified group. (returns new copied list) <br />\n * @param groupName The string of group name, which is case-sensitive. (NullAllowed: if null, returns empty list)\n * @return The list of classification elements in the group. (NotNull)\n */\n public static List<UpdateModuleType> groupOf(String groupName) {\n return new ArrayList<UpdateModuleType>(4);\n }\n\n @Override public String toString() { return code(); }\n }\n\n public enum DefMeta implements ClassificationMeta {\n /** はいいいえを示す */\n YesNo\n ,\n /** 蔵書の状態を示す */\n CollectionStatus\n ,\n /** 登録モジュールタイプ */\n RegisterModuleType\n ,\n /** 更新モジュールタイプ */\n UpdateModuleType\n ;\n public String classificationName() {\n return name(); // same as definition name\n }\n\n public Classification codeOf(Object code) {\n if (\"YesNo\".equals(name())) { return LdCDef.YesNo.codeOf(code); }\n if (\"CollectionStatus\".equals(name())) { return LdCDef.CollectionStatus.codeOf(code); }\n if (\"RegisterModuleType\".equals(name())) { return LdCDef.RegisterModuleType.codeOf(code); }\n if (\"UpdateModuleType\".equals(name())) { return LdCDef.UpdateModuleType.codeOf(code); }\n throw new IllegalStateException(\"Unknown definition: \" + this); // basically unreachable\n }\n\n public Classification nameOf(String name) {\n if (\"YesNo\".equals(name())) { return LdCDef.YesNo.valueOf(name); }\n if (\"CollectionStatus\".equals(name())) { return LdCDef.CollectionStatus.valueOf(name); }\n if (\"RegisterModuleType\".equals(name())) { return LdCDef.RegisterModuleType.valueOf(name); }\n if (\"UpdateModuleType\".equals(name())) { return LdCDef.UpdateModuleType.valueOf(name); }\n throw new IllegalStateException(\"Unknown definition: \" + this); // basically unreachable\n }\n\n public List<Classification> listAll() {\n if (\"YesNo\".equals(name())) { return toClassificationList(LdCDef.YesNo.listAll()); }\n if (\"CollectionStatus\".equals(name())) { return toClassificationList(LdCDef.CollectionStatus.listAll()); }\n if (\"RegisterModuleType\".equals(name())) { return toClassificationList(LdCDef.RegisterModuleType.listAll()); }\n if (\"UpdateModuleType\".equals(name())) { return toClassificationList(LdCDef.UpdateModuleType.listAll()); }\n throw new IllegalStateException(\"Unknown definition: \" + this); // basically unreachable\n }\n\n public List<Classification> groupOf(String groupName) {\n if (\"YesNo\".equals(name())) { return toClassificationList(LdCDef.YesNo.groupOf(groupName)); }\n if (\"CollectionStatus\".equals(name())) { return toClassificationList(LdCDef.CollectionStatus.groupOf(groupName)); }\n if (\"RegisterModuleType\".equals(name())) { return toClassificationList(LdCDef.RegisterModuleType.groupOf(groupName)); }\n if (\"UpdateModuleType\".equals(name())) { return toClassificationList(LdCDef.UpdateModuleType.groupOf(groupName)); }\n throw new IllegalStateException(\"Unknown definition: \" + this); // basically unreachable\n }\n\n @SuppressWarnings(\"unchecked\")\n private List<Classification> toClassificationList(List<?> clsList) {\n return (List<Classification>)clsList;\n }\n\n public ClassificationCodeType codeType() {\n if (\"YesNo\".equals(name())) { return ClassificationCodeType.String; }\n if (\"CollectionStatus\".equals(name())) { return ClassificationCodeType.String; }\n if (\"RegisterModuleType\".equals(name())) { return ClassificationCodeType.String; }\n if (\"UpdateModuleType\".equals(name())) { return ClassificationCodeType.String; }\n return ClassificationCodeType.String; // as default\n }\n\n public ClassificationUndefinedHandlingType undefinedHandlingType() {\n if (\"YesNo\".equals(name())) { return ClassificationUndefinedHandlingType.EXCEPTION; }\n if (\"CollectionStatus\".equals(name())) { return ClassificationUndefinedHandlingType.EXCEPTION; }\n if (\"RegisterModuleType\".equals(name())) { return ClassificationUndefinedHandlingType.EXCEPTION; }\n if (\"UpdateModuleType\".equals(name())) { return ClassificationUndefinedHandlingType.EXCEPTION; }\n return ClassificationUndefinedHandlingType.LOGGING; // as default\n }\n }\n}", "private static void statACricri() {\n \tSession session = new Session();\n \tNSTimestamp dateRef = session.debutAnnee();\n \tNSArray listAffAnn = EOAffectationAnnuelle.findAffectationsAnnuelleInContext(session.ec(), null, null, dateRef);\n \tLRLog.log(\">> listAffAnn=\"+listAffAnn.count() + \" au \" + DateCtrlConges.dateToString(dateRef));\n \tlistAffAnn = LRSort.sortedArray(listAffAnn, \n \t\t\tEOAffectationAnnuelle.INDIVIDU_KEY + \".\" + EOIndividu.NOM_KEY);\n \t\n \tEOEditingContext ec = new EOEditingContext();\n \tCngUserInfo ui = new CngUserInfo(new CngDroitBus(ec), new CngPreferenceBus(ec), ec, new Integer(3065));\n \tStringBuffer sb = new StringBuffer();\n \tsb.append(\"service\").append(ConstsPrint.CSV_COLUMN_SEPARATOR);\n \tsb.append(\"agent\").append(ConstsPrint.CSV_COLUMN_SEPARATOR);\n \tsb.append(\"contractuel\").append(ConstsPrint.CSV_COLUMN_SEPARATOR);\n \tsb.append(\"travaillees\").append(ConstsPrint.CSV_COLUMN_SEPARATOR);\n \tsb.append(\"conges\").append(ConstsPrint.CSV_COLUMN_SEPARATOR);\n \tsb.append(\"dues\").append(ConstsPrint.CSV_COLUMN_SEPARATOR);\n \tsb.append(\"restant\");\n \tsb.append(ConstsPrint.CSV_NEW_LINE);\n \t\n \n \tfor (int i = 0; i < listAffAnn.count(); i++) {\n \t\tEOAffectationAnnuelle itemAffAnn = (EOAffectationAnnuelle) listAffAnn.objectAtIndex(i);\n \t\t//\n \t\tEOEditingContext edc = new EOEditingContext();\n \t\t//\n \t\tNSArray array = EOAffectationAnnuelle.findSortedAffectationsAnnuellesForOidsInContext(\n \t\t\t\tedc, new NSArray(itemAffAnn.oid()));\n \t\t// charger le planning pour forcer le calcul\n \t\tPlanning p = Planning.newPlanning((EOAffectationAnnuelle) array.objectAtIndex(0), ui, dateRef);\n \t\t// quel les contractuels\n \t\t//if (p.affectationAnnuelle().individu().isContractuel(p.affectationAnnuelle())) {\n \t\ttry {p.setType(\"R\");\n \t\tEOCalculAffectationAnnuelle calcul = p.affectationAnnuelle().calculAffAnn(\"R\");\n \t\tint minutesTravaillees3112 = calcul.minutesTravaillees3112().intValue();\n \t\tint minutesConges3112 = calcul.minutesConges3112().intValue();\n \t\t\n \t\t// calcul des minutes dues\n \t\tint minutesDues3112 = /*0*/ 514*60;\n \t\t/*\tNSArray periodes = p.affectationAnnuelle().periodes();\n \t\tfor (int j=0; j<periodes.count(); j++) {\n \t\t\tEOPeriodeAffectationAnnuelle periode = (EOPeriodeAffectationAnnuelle) periodes.objectAtIndex(j);\n \t\tminutesDues3112 += periode.valeurPonderee(p.affectationAnnuelle().minutesDues(), septembre01, decembre31);\n \t\t}*/\n \t\tsb.append(p.affectationAnnuelle().structure().libelleCourt()).append(ConstsPrint.CSV_COLUMN_SEPARATOR);\n \t\tsb.append(p.affectationAnnuelle().individu().nomComplet()).append(ConstsPrint.CSV_COLUMN_SEPARATOR);\n \t\tsb.append(p.affectationAnnuelle().individu().isContractuel(p.affectationAnnuelle())?\"O\":\"N\").append(ConstsPrint.CSV_COLUMN_SEPARATOR);\n \t\tsb.append(TimeCtrl.stringForMinutes(minutesTravaillees3112)).append(ConstsPrint.CSV_COLUMN_SEPARATOR);\n \t\tsb.append(TimeCtrl.stringForMinutes(minutesConges3112)).append(ConstsPrint.CSV_COLUMN_SEPARATOR);\n \t\tsb.append(TimeCtrl.stringForMinutes(minutesDues3112)).append(ConstsPrint.CSV_COLUMN_SEPARATOR);\n \t\tsb.append(TimeCtrl.stringForMinutes(minutesTravaillees3112 - minutesConges3112 - minutesDues3112)).append(ConstsPrint.CSV_NEW_LINE);\n \t\tLRLog.log((i+1)+\"/\"+listAffAnn.count() + \" (\" + p.affectationAnnuelle().individu().nomComplet() + \")\");\n \t\t} catch (Throwable e) {\n \t\t\te.printStackTrace();\n \t\t}\n \t\tedc.dispose();\n \t\t//}\n \t}\n \t\n\t\tString fileName = \"/tmp/stat_000_\"+listAffAnn.count()+\".csv\";\n \ttry {\n\t\t\tBufferedWriter fichier = new BufferedWriter(new FileWriter(fileName));\n\t\t\tfichier.write(sb.toString());\n\t\t\tfichier.close();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\tLRLog.log(\"writing \" + fileName);\n\t\t}\n }", "public Catalogue getCatalogue() {\n return catalogue;\n }", "public MultiViewDescription getActiveDescription() {\n \treturn currentEditor;\n }", "boolean hasExternalAttributionCredit();", "public boolean getActive();", "public boolean getActive();", "private Criteria buildActiveCriteria(){\r\n Criteria criteria = new Criteria();\r\n criteria.addEqualTo(KRADPropertyConstants.ACTIVE, true);\r\n\r\n return criteria;\r\n }", "public Cursor fetchAllCourses() {\r\nreturn database.query(DATABASE_TABLE, new String[] { KEY_ROWID, KEY_CATEGORY, KEY_COURSENAME, KEY_ASSIGNMENTNAME, KEY_DESCRIPTION, KEY_DUEDATE, KEY_COMPLETED }, null, null, null,\r\nnull, null);\r\n}", "public static String getCatalogTitleList(Connection con, loginProfile prof, WizbiniLoader wizbini)\n throws SQLException, cwSysMessage{\n boolean checkStatus = false;\n aeCatalog cat = new aeCatalog();\n String xml = null;\n try{\n xml = cat.getTitleListAsXML(con, prof, checkStatus, null, wizbini);\n }catch(qdbException e){\n throw new SQLException(e.getMessage());\n }\n return xml;\n }", "@Override\r\n\tpublic boolean isValid(String code, ConstraintValidatorContext theConstaint) {\r\n \r\n titles = customerService.getTitles();\r\n \r\n for(String i : titles)\r\n {\r\n \tSystem.out.println(i);\r\n }\r\n //descriptions = ec.getDescriptions();\r\n for(String i : titles)\r\n {\r\n\t result = code.equals(i);\r\n\t\tif(code != null)\t\t\r\n\t\t\tresult = code.equals(i);\r\n\t\telse\r\n\t\t\tresult = true;\r\n\t\tif(result == true)\r\n\t\t\tbreak;\r\n }\r\n\t\treturn result;\r\n\t}", "public List<CMCourse> getCMCourses(String startsWith) {\r\n\tlong start = System.currentTimeMillis();\r\n\tlog.debug(\"getCMCourses that starts with \" + startsWith);\r\n\tList<CMCourse> cmCourses = new ArrayList<CMCourse>();\r\n\tSet<CourseSet> courseSets = courseManagementService.getCourseSets();\r\n\tSet<CourseOffering> courseOffs = null;\r\n\tSet<Section> sections = null;\r\n\tCourseSet courseSet = null;\r\n\tCourseOffering courseOff = null;\r\n\tString courseOffEid = null;\r\n\tSection courseS = null;\r\n\tif (courseSets == null)\r\n\t return null;\r\n\tList<AcademicSession> acadSessions =\r\n\t\tcourseManagementService.getCurrentAcademicSessions();\r\n\tDate endDate = null;\r\n\tDate startDate = null;\r\n\r\n\tfor (AcademicSession acadSession : acadSessions) {\r\n\r\n\t for (Iterator<CourseSet> cSets = courseSets.iterator(); cSets\r\n\t\t .hasNext();) {\r\n\t\tcourseSet = cSets.next();\r\n\t\tcourseOffs =\r\n\t\t\tcourseManagementService.findCourseOfferings(\r\n\t\t\t\tcourseSet.getEid(), acadSession.getEid());\r\n\t\tfor (Iterator<CourseOffering> cOffs = courseOffs.iterator(); cOffs\r\n\t\t\t.hasNext();) {\r\n\t\t courseOff = cOffs.next();\r\n\t\t courseOffEid = courseOff.getEid();\r\n\t\t sections =\r\n\t\t\t courseManagementService.getSections(courseOffEid);\r\n\t\t if (courseOffEid.startsWith(startsWith)) {\r\n\t\t\tfor (Iterator<Section> cSs = sections.iterator(); cSs\r\n\t\t\t\t.hasNext();) {\r\n\t\t\t courseS = cSs.next();\r\n\t\t\t String courseTitle =\r\n\t\t\t\t courseManagementService.getCanonicalCourse(\r\n\t\t\t\t\t courseOff.getCanonicalCourseEid())\r\n\t\t\t\t\t .getTitle();\r\n\t\t\t String courseSId = courseS.getEid();\r\n\t\t\t String session =\r\n\t\t\t\t courseOff.getAcademicSession().getTitle();\r\n\t\t\t String sigle = courseOff.getCanonicalCourseEid();\r\n\t\t\t String section =\r\n\t\t\t\t (SHARABLE_SECTION.equals(courseSId\r\n\t\t\t\t\t .substring(courseSId.length() - 2,\r\n\t\t\t\t\t\t courseSId.length()))) ? SHARABLE_SECTION\r\n\t\t\t\t\t : courseSId.substring(\r\n\t\t\t\t\t\t courseSId.length() - 3,\r\n\t\t\t\t\t\t courseSId.length());\r\n\r\n\t\t\t String instructorsString = \"\";\r\n\t\t\t int studentNumber = -1;\r\n\t\t\t EnrollmentSet enrollmentSet =\r\n\t\t\t\t courseS.getEnrollmentSet();\r\n\t\t\t if (enrollmentSet != null) {\r\n\t\t\t\t// Retrieve official instructors\r\n\t\t\t\tSet<String> instructors =\r\n\t\t\t\t\tenrollmentSet.getOfficialInstructors();\r\n\t\t\t\tUser user = null;\r\n\t\t\t\tString name = null;\r\n\t\t\t\tfor (String instructor : instructors) {\r\n\t\t\t\t try {\r\n\t\t\t\t\tuser =\r\n\t\t\t\t\t\tuserDirectoryService\r\n\t\t\t\t\t\t\t.getUserByEid(instructor);\r\n\t\t\t\t\tname = user.getDisplayName();\r\n\t\t\t\t\tinstructorsString += name + \" & \";\r\n\t\t\t\t } catch (UserNotDefinedException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t }\r\n\t\t\t\t}\r\n\t\t\t\t// retrieve student number\r\n\t\t\t\tSet<Enrollment> enrollments =\r\n\t\t\t\t\tcourseManagementService\r\n\t\t\t\t\t\t.getEnrollments(enrollmentSet\r\n\t\t\t\t\t\t\t.getEid());\r\n\t\t\t\tif (enrollments != null)\r\n\t\t\t\t studentNumber = enrollments.size();\r\n\t\t\t }\r\n\t\t\t if (!instructorsString.equals(\"\"))\r\n\t\t\t\tinstructorsString =\r\n\t\t\t\t\tinstructorsString.substring(0,\r\n\t\t\t\t\t\tinstructorsString.length() - 3);\r\n\r\n\t\t\t CMCourse cmCourse = new CMCourse();\r\n\t\t\t cmCourse.setId(courseS.getEid());\r\n\t\t\t cmCourse.setSession(session);\r\n\t\t\t cmCourse.setName(courseTitle);\r\n\t\t\t cmCourse.setSigle(sigle);\r\n\t\t\t cmCourse.setSection(section);\r\n\t\t\t cmCourse.setInstructor(instructorsString);\r\n\t\t\t cmCourse.setStudentNumber(studentNumber);\r\n\t\t\t cmCourses.add(cmCourse);\r\n\t\t\t}\r\n\t\t }\r\n\t\t}\r\n\t }\r\n\t}\r\n\tlog.debug(\"getCMCourses \" + elapsed(start) + \" for \" + cmCourses.size()\r\n\t\t+ \" courses\");\r\n\treturn cmCourses;\r\n }", "public String getCourseDesc() {\n return courseDesc;\n }", "@Override\n\tpublic List<TypeContratEmployee> GetallContratEmployee(Boolean a) {\n\t\treturn rep.lister_type(a);\n\t}", "java.lang.String getDesc();", "public java.lang.String getStrCatalog()\n\t{\n\t\treturn strCatalog;\n\t}", "public List<IndicatorCriteria> getIndicatorCriterias();", "public StyledDocument getDynamicDescription() {\n\t\tStyledDocument doc = new StyledDocument() ;\n\t\tIterator i = thisInstance.getInstanceClass().getAllAttributes().iterator() ;\n\t\tif ( i.hasNext() ) {\n\t\t\tSimpleAttributeSet s2 = new SimpleAttributeSet();\n\t\t\tStyleConstants.setFontFamily(s2, \"Times New Roman\");\n\t\t\tStyleConstants.setFontSize(s2, 14);\n\t\t\tStyleConstants.setBold(s2, true);\n\t\t\tStyleConstants.setForeground(s2, Color.black);\n\t\t\tStyledElement element2 = new StyledElement( \"List of Attributes\\n\" , s2) ;\n\t\t\tdoc.addStyle( element2 ) ;\n\t\t\t\n\t\t\twhile (i.hasNext()) {\n\t\t\t\t\n\t\t\t\tAttribute attribute = (Attribute)i.next() ;\n\t\t\t\tAttributeNode attributeNode = new AttributeNode( attribute, thisInstance , null ) ;\n\t\t\t\tStyledDocument styledDoc1 = attributeNode.getStyledDocument() ;\n\t\t\t\tStyledDocument styledDoc2 = attributeNode.getDynamicDescription() ;\n\t\t\t\tdoc.addStyle( StyledElement.getTab() ) ; \n\t\t\t\tdoc.addStyle( StyledElement.getTab() ) ; \n\t\t\t\tdoc.append(styledDoc1) ;\n\t\t\t\tdoc.addStyle( StyledElement.getTab() ) ; \n\t\t\t\tdoc.addStyle( StyledElement.getTab() ) ; \n\t\t\t\tdoc.append(styledDoc2) ;\n\t\t\t}\n\t\t}\n\t\treturn doc;\n\t}", "public String getCourses() throws CustomExceptions.InvalidInputException {\n Collections.sort(courses);\n StringBuilder builder = new StringBuilder();\n if (!courses.isEmpty()) {\n for (CurriculumItem course : courses) {\n builder.append(String.format(\"|--[%1s] %13s -----|\\n\",\n getCurriculumItemCompletionStatus(course),\n Manipulators.getCurriculumItemAsShortString(course)));\n }\n } else {\n return \"No courses found for Academic Term: \" + name;\n }\n return builder.toString();\n }", "String getDesc();", "String getDescription() {\n if (description == null) {\n return null;\n }\n if (basicControl) {\n return String.format(\"%s %s\", context.getString(description), context.getString(R.string.basicControl));\n }\n return context.getString(description);\n }", "@Override\npublic ArrayList<String> courses() {\n\tArrayList<String> studentCourses = new ArrayList<String>();\n\tstudentCourses.add(\"CMPE - 273\");\n\tstudentCourses.add(\"CMPE - 206\");\n\tstudentCourses.add(\"CMPE - 277\");\n\tSystem.out.println(this.name+\" has take these courses\");\n\tfor(int i = 0 ; i < studentCourses.size() ; i++){\n\t\tSystem.out.println( studentCourses.get(i));\n\t}\n\treturn null;\n}", "@Override\n\tpublic String getDesc() {\n\t\treturn auto.getDesc() + AC_DESCRIPTION;\n\t}", "public ArrayList<Course> getCoursesAreActiveIn(LocalDate date){\n ArrayList<Course> allCourses = new ArrayList();\n String statement = GET_COURSES_ARE_ACTIVE_IN;\n ResultSet rs = data.makePreparedStatement(statement,new Object[]{(Object) date,(Object) date});\n try {\n while(rs.next()){\n Course course = new Course(rs.getInt(\"id\"),rs.getString(\"title\"),rs.getString(\"stream\"),\n rs.getString(\"type\"),rs.getDate(\"start_date\").toLocalDate(),rs.getDate(\"end_date\").toLocalDate());\n allCourses.add(course);\n }\n } catch (SQLException ex) {\n System.out.println(\"Problem with CourseDao.getCoursesAreActiveIn()\");\n }finally{\n data.closeConnections(rs,data.ps, data.conn);\n }\n return allCourses;\n }", "boolean getCampaignDescriptionNull();", "@java.lang.Override\n public boolean hasCatalog() {\n return catalog_ != null;\n }", "private boolean canPrintContratEngagement(ContratDTO c)\r\n\t{\n\t\tif (new EditionSpeService().needEngagement(c.modeleContratId)==false)\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tswitch (peMesContrats.canPrintContratEngagement)\r\n\t\t{\r\n\t\tcase TOUJOURS:\r\n\t\t\treturn true;\r\n\t\t\t\r\n\t\tcase JAMAIS:\r\n\t\t\treturn false;\r\n\t\t\t\r\n\t\tcase APRES_DATE_FIN_DES_INSCRIPTIONS:\r\n\t\t\tDate dateRef = DateUtils.getDateWithNoTime();\r\n\t\t\treturn dateRef.after(c.dateFinInscription);\r\n\r\n\t\tdefault:\r\n\t\t\tthrow new AmapjRuntimeException();\r\n\t\t}\r\n\t}", "String getSlingDescription();", "@SuppressWarnings(\"unchecked\")\r\n\tpublic List<String> getCustomerActiveMatureSet() {\r\n\t\treturn (List<String>)getHibernateTemplate().find(\"SELECT DISTINCT customerName FROM CardIssue WHERE status='Active' or status='Matured'\");\r\n\t}", "public List<New> listByActiveCiteria(String active);", "public Boolean isAvisCourtier() {\r\n return avisCourtier;\r\n }", "public SortedSet<Concert> getActiveConcerts()//\t\t--> Returnerer alle aktive konserter registrert på dette lokalet.\n\t{\n\t\tGregorianCalendar calender = (GregorianCalendar)Calendar.getInstance();\n\t\tcalender = Utilities.getCleanDate(calender);\n\n\t\tConcert c = new Concert(calender);\n\t\tSortedSet<Concert> active = concerts.tailSet(c);\n\n\t\tif(active.isEmpty())\n\t\t\treturn null;\n\n\t\treturn active;\n\t}", "java.util.List<hr.domain.ResumeDBOuterClass.Education> \n getEducationsList();", "public boolean isIncludingDescription() {\n return includingDescription;\n }", "boolean hasRecommendation();", "public String getcDescription() {\n return cDescription;\n }", "public void Case20(){\n System.out.println(\"Testing Case 20\");\n for(int z=1; z<=7; z++) {\n activeProd();\n if(z==1) {\n byName();\n }\n else if(z==2){\n byShortName();\n }\n else if(z==3){\n byItemCode();\n }\n else if(z==4){\n byDescription();\n }\n else if(z==5){\n byBrand();\n }\n else if(z==6){\n byKeyword();\n }\n else if(z==7){\n byPrincipal();\n }\n clear();\n }\n System.out.println(\"Case 20 Done\");\n }", "protected abstract boolean approvedForClass(Course c);", "public ArrayList<String> getAutorInformation(){\n // If there is no autor information\n if (indiceAutorInformation == -1){\n return null;\n }\n\n // Declare ArrayList\n ArrayList<String> autorInformation = new ArrayList<>();\n\n // Get information from third Child\n NodeList nList_name = documentsEntrys.get(indiceAutorInformation).getElementsByTagName(\"family\");\n NodeList nList_IDNumber = documentsEntrys.get(indiceAutorInformation).getElementsByTagName(\"identifier\");\n NodeList nList_personList = documentsEntrys.get(indiceAutorInformation).getElementsByTagName(\"address\");\n NodeList nList_telecom = documentsEntrys.get(indiceAutorInformation).getElementsByTagName(\"telecom\");\n NodeList nList_creationDate = documentsEntrys.get(indiceMetaInformation).getElementsByTagName(\"date\"); // creation date is on the composition, the first <entry>, block\n\n //The arrayList contains information about residence of the autor\n // [0] => street\n // [1] => post code\n // [2] => city\n ArrayList<String> address = searchInterleavedHierarchy(nList_personList, \"line\");\n\n // get full name of author\n if(nList_name.getLength() != 0){\n autorInformation.add(0, ((Element) nList_name.item(0)).getAttribute(VALUE));\n } else {\n autorInformation.add(0, EMPTYSTRING);\n //logger.log(Level.INFO, \"The name of the author ist unknown!\");\n }\n\n // get life long doctor number\n String lifelongAutorNumber = util.XML.searchHierarchyByTagAndAttribute(nList_IDNumber, SYSTEM, VALUE, \"http://kbv.de/LANR\", VALUE, VALUE);\n if(!util.String.isEmpty(lifelongAutorNumber)) {\n autorInformation.add(1, lifelongAutorNumber);\n } else {\n autorInformation.add(1, EMPTYSTRING);\n //logger.log(Level.INFO, \"The life long doctor number of the author is unknown!\");\n }\n\n // get street\n if(address.size() != 0) {\n autorInformation.add(2, address.get(0));\n } else {\n autorInformation.add(2, EMPTYSTRING);\n //logger.log(Level.INFO, \"The street of author is unknown!\");\n }\n\n // get post code\n if(address.size() >= 1) {\n autorInformation.add(3, address.get(1));\n } else {\n autorInformation.add(3, EMPTYSTRING);\n //logger.log(Level.INFO, \"The post code of author is unknown!\");\n }\n\n // get city\n if(address.size() >= 2) {\n autorInformation.add(4, address.get(2));\n } else {\n autorInformation.add(4, EMPTYSTRING);\n //logger.log(Level.INFO, \"The city of author is unknown!\");\n }\n\n // Get telephone number\n String telephoneNumber = util.XML.searchHierarchyByTagAndAttribute(nList_telecom, \"system\", VALUE,\"phone\", VALUE, VALUE);\n if(!util.String.isEmpty(telephoneNumber)) {\n autorInformation.add(5, telephoneNumber);\n } else {\n autorInformation.add(5, EMPTYSTRING);\n //logger.log(Level.INFO, \"The phone number of autor is unknown!\");\n }\n\n // Get eMail\n String eMail = util.XML.searchHierarchyByTagAndAttribute(nList_telecom, \"system\", VALUE, \"email\", VALUE, VALUE);\n if(!util.String.isEmpty(eMail)) {\n autorInformation.add(6, eMail);\n } else {\n autorInformation.add(6, EMPTYSTRING);\n //logger.log(Level.INFO, \"The eMail of autor is unknown!\");\n }\n\n // Get creation date\n if(nList_creationDate.getLength() != 0){\n autorInformation.add(7, ((Element) nList_creationDate.item(0)).getAttribute(VALUE));\n } else {\n autorInformation.add(7, EMPTYSTRING);\n //logger.log(Level.INFO, \"The creation date of bmp is unknown!\");\n }\n\n // get pharmacy ID\n String pharmacyID = util.XML.searchHierarchyByTagAndAttribute(nList_IDNumber, SYSTEM, VALUE, \"http://kbv.de/IDF\", VALUE, VALUE);\n if(!util.String.isEmpty(pharmacyID)) {\n autorInformation.add(8, pharmacyID);\n } else {\n autorInformation.add(8, EMPTYSTRING);\n //logger.log(Level.INFO, \"The pharmacy ID is unknown!\");\n }\n\n // get hospital ID\n String hospitalID = util.XML.searchHierarchyByTagAndAttribute(nList_IDNumber, SYSTEM, VALUE, \"http://kbv.de/KIK\", VALUE, VALUE);\n if(!util.String.isEmpty(hospitalID)) {\n autorInformation.add(9, hospitalID);\n } else {\n autorInformation.add(9, EMPTYSTRING);\n //logger.log(Level.INFO, \"The hospital ID is unknown!\");\n }\n\n return autorInformation;\n }", "public ArrayList getCourses();", "protected Criteria buildActiveCriteria() {\r\n Criteria criteria = new Criteria();\r\n criteria.addEqualTo(KRADPropertyConstants.ACTIVE, true);\r\n\r\n return criteria;\r\n }", "@Override\r\n\tpublic StudentProgramInfo getActiveStudentProgramInformation(Student studentSearchDTO) throws StudentServiceException {\r\n\t\tList<StudentProgramInfo> studentProgramInfoList = getStudentProgramInformation(studentSearchDTO);\r\n\t\tStudentProgramInfo stdProgramInfo= new StudentProgramInfo();\r\n\t\tif(studentProgramInfoList.size()>0){\r\n\t\t\tfor(StudentProgramInfo stdProgInfo : studentProgramInfoList) {\r\n\t\t\t\tString enrollmentStatus = stdProgInfo.getEnrollmentStatus();\r\n\t\t\t\tif(enrollmentStatus!=null && (enrollmentStatus.equalsIgnoreCase(\"Active\") ||enrollmentStatus.equalsIgnoreCase(\"Conditionally Accepted\") )) {\r\n\t\t\t\t\treturn stdProgInfo;\r\n\t\t\t\t}\r\n\t\t\t}\r\n \t\t\treturn studentProgramInfoList.get(0);\r\n\t\t}\r\n\t\tstdProgramInfo.setProgramOfStudyId(\"N/A\");\r\n\t\tstdProgramInfo.setEnrollmentStatus(\"N/A\");\r\n\t\tstdProgramInfo.setProgramCode(\"N/A\");\r\n\t\tstdProgramInfo.setProgramVersionCode(\"N/A\");\r\n\t\t//Using ProgramVersion from the service for the programName\r\n\t\tstdProgramInfo.setProgramName(\"N/A\");\r\n\t\tstdProgramInfo.setStateCode(\"N/A\");\r\n\t\tstdProgramInfo.setCatalogCode(\"N/A\");\r\n\t\t\r\n\t\t//stdProgramInfo.setStudentCrmId(student.getCrmId());\r\n\t\t//stdProgramInfo.setProgramOfStudyStatus(pos.getProgramOfStudyStatus());\r\n\t\t//stdProgramInfo.setExpectedStartDate(pos.getExpectedStartDate());\r\n\t\t//need to see how to get catalogcode and state code\r\n \t\treturn stdProgramInfo;\r\n\t}", "public MapList getActiveCRs(Context context, String[] args) throws Exception {\n\n Pattern relationship_pattern = new Pattern(TigerConstants.RELATIONSHIP_PSS_SUBPROGRAMPROJECT);\n relationship_pattern.addPattern(TigerConstants.RELATIONSHIP_PSS_CONNECTEDPCMDATA);\n\n Pattern type_pattern = new Pattern(TigerConstants.TYPE_PSS_CHANGEREQUEST);\n type_pattern.addPattern(TigerConstants.TYPE_PSS_PROGRAMPROJECT);\n\n Pattern finalType = new Pattern(TigerConstants.TYPE_PSS_CHANGEREQUEST);\n try {\n\n StringList slselectObjStmts = getSLCTableSelectables(context);\n\n Map programMap = (Map) JPO.unpackArgs(args);\n String strProgProjId = (String) programMap.get(\"objectId\");\n // TIGTK-16801 : 30-08-2018 : START\n boolean bAdminOrPMCMEditAllow = isAdminOrPMCMofRelatedPP(context, strProgProjId);\n StringBuffer sbWhereBuffer = new StringBuffer();\n sbWhereBuffer.append(\"(type==\\\"\");\n sbWhereBuffer.append(TigerConstants.TYPE_PSS_CHANGEREQUEST);\n sbWhereBuffer.append(\"\\\"&&current!=\\\"\");\n sbWhereBuffer.append(TigerConstants.STATE_REJECTED_CR);\n sbWhereBuffer.append(\"\\\")\");\n // TIGTK-16801 : 30-08-2018 : END\n\n DomainObject domainObj = DomainObject.newInstance(context, strProgProjId);\n\n MapList mapList = domainObj.getRelatedObjects(context, relationship_pattern.getPattern(), // relationship pattern\n type_pattern.getPattern(), // object pattern\n slselectObjStmts, // object selects\n null, // relationship selects\n false, // to direction\n true, // from direction\n (short) 0, // recursion level\n sbWhereBuffer.toString(), // object where clause\n null, (short) 0, false, // checkHidden\n true, // preventDuplicates\n (short) 1000, // pageSize\n finalType, // Postpattern\n null, null, null);\n\n // TIGTK_3961:Sort CR data according to CR state :23/1/2017:Rutuja Ekatpure:Start\n if (mapList.size() > 0) {\n // return sortCRListByState(context, mapList);\n MapList mlReturn = sortCRListByState(context, mapList);\n\n // PCM2.0 Spr4:TIGTK-6894:19/9/2017:START\n\n Iterator<Map<String, String>> itrCR = mlReturn.iterator();\n while (itrCR.hasNext()) {\n Map tempMap = itrCR.next();\n String strCRId = (String) tempMap.get(DomainConstants.SELECT_ID);\n MapList mlIA = getImpactAnalysis(context, strCRId);\n\n String strIAId = \"\";\n if (!mlIA.isEmpty()) {\n Map mpIA = (Map) mlIA.get(0);\n strIAId = (String) mpIA.get(DomainConstants.SELECT_ID);\n }\n tempMap.put(\"LatestRevIAObjectId\", strIAId);\n // TIGTK-16801 : 30-08-2018 : START\n tempMap.put(\"bAdminOrPMCMEditAllow\", bAdminOrPMCMEditAllow);\n // TIGTK-16801 : 30-08-2018 : END\n }\n return mlReturn;\n // PCM2.0 Spr4:TIGTK-6894:19/9/2017:END\n\n } else {\n return mapList;\n }\n // TIGTK_3961:Sort CR data according to CR state :23/1/2017:Rutuja Ekatpure:End\n\n } catch (Exception ex) {\n logger.error(\"Error in getActiveCRs: \", ex);\n throw ex;\n }\n }", "public abstract int getGuideDescription();", "public static ArrayList<CustomerInfoBean> getCutomers_onActive(int onloan,\r\n\t\t\tint oncash) {\r\n\t\tCustomerInfoBean bean = null;\r\n\t\tSystem.out.println(\"Onloan \" + onloan + \" oncsah \" + oncash);\r\n\t\t// if(onloan==0 && oncash==0){querycon=\"\";}\r\n\t\t//\r\n\t\t// if(onloan==1){querycon=\"and sld.payement_option=1\";}\r\n\t\t// else if (oncash==1){querycon=\"and sld.payement_option=0\";} else\r\n\t\t// {querycon=\"\";}\r\n\t\t// // if((onloan==1) && (oncash==1)){querycon=\"and sld.payement_option=0\r\n\t\t// or sld.payement_option=1\";} else {querycon=\"\";}\r\n\t\tArrayList<CustomerInfoBean> customerList = new ArrayList<CustomerInfoBean>();\r\n\t\tString monthlyIncome;\r\n\t\tint applianceId, customerId, salesmanId, status;\r\n\t\tString customerName, cnicNo, phoneNo, district, gsmNumber, salesmanName, applianceName;\r\n\t\tboolean state;\r\n\t\ttry {\r\n\t\t\tConnection con = connection.Connect.getConnection();\r\n\t\t\tString query = \"SELECT cs.customer_id ,cs.customer_name, cs.customer_cnic ,cs.customer_phone, c.city_name, cs.customer_monthly_income, \\n\"\r\n\t\t\t\t\t+ \" a.appliance_GSMno, a.appliance_status, s.salesman_name ,sld.payement_option, a.appliance_id, s.salesman_id, \\n\"\r\n\t\t\t\t\t+ \" a.appliance_name, cs.status FROM eligibility e\\n\"\r\n\t\t\t\t\t+ \" JOIN appliance a ON e.appliance_id =a.appliance_id \\n\"\r\n\t\t\t\t\t+ \" JOIN salesman s ON e.salesman_id =s.salesman_id \\n\"\r\n\t\t\t\t\t+ \" JOIN customer cs ON e.customer_id = cs.customer_id \\n\"\r\n\t\t\t\t\t+ \" JOIN sold_to sld ON cs.customer_id=sld.customer_id\\n\"\r\n\t\t\t\t\t+ \" JOIN city c ON cs.customer_city=c.city_id\\n\"\r\n\t\t\t\t\t+ \" WHERE a.appliance_status=1;\";\r\n\t\t\tPreparedStatement stmt = con.prepareStatement(query);\r\n\t\t\tSystem.out.print(query);\r\n\t\t\tResultSet rs = stmt.executeQuery();\r\n\t\t\twhile (rs.next()) {\r\n\t\t\t\tcustomerId = rs.getInt(1);\r\n\t\t\t\tcustomerName = rs.getString(2);\r\n\t\t\t\tcnicNo = rs.getString(3);\r\n\t\t\t\tphoneNo = rs.getString(4);\r\n\t\t\t\tdistrict = rs.getString(5);\r\n\t\t\t\tmonthlyIncome = rs.getString(6);\r\n\t\t\t\tgsmNumber = rs.getString(7);\r\n\t\t\t\tstate = rs.getBoolean(8);\r\n\t\t\t\tsalesmanName = rs.getString(9);\r\n\r\n\t\t\t\tapplianceId = rs.getInt(11);\r\n\t\t\t\tsalesmanId = rs.getInt(12);\r\n\t\t\t\tapplianceName = rs.getString(13);\r\n\t\t\t\tstatus = rs.getInt(14);\r\n\t\t\t\tbean = new CustomerInfoBean();\r\n\t\t\t\tbean.setCustomerName(customerName);\r\n\t\t\t\tbean.setCnicNo(cnicNo);\r\n\t\t\t\tbean.setDistrict(district);\r\n\t\t\t\tbean.setGsmNumber(gsmNumber);\r\n\t\t\t\tbean.setMonthlyIncome(monthlyIncome);\r\n\r\n\t\t\t\tbean.setState(state);\r\n\t\t\t\tbean.setSalesmanName(salesmanName);\r\n\t\t\t\tbean.setPhoneNo(phoneNo);\r\n\t\t\t\tbean.setSalesamanId(salesmanId);\r\n\t\t\t\tbean.setApplianceId(applianceId);\r\n\t\t\t\tbean.setCustomerId(customerId);\r\n\t\t\t\tbean.setApplianceName(applianceName);\r\n\t\t\t\tbean.setStatus(status);\r\n\t\t\t\tcustomerList.add(bean);\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t\tlogger.error(\"\", e);\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn customerList;\r\n\t}", "public CatalogDescription getLastVersionCatalogDescription(String courseId);", "private void GetDetailAnalysisText() {\n\t\tMap<Integer, ArrayList<ReportPluDayComboModifier>> combMap = getCombItemMap(this.comb);\n\n\t\tComparatorPluDayItem comparatorPluDayItem = new ComparatorPluDayItem();\n\t\tCollections.sort(reportPluDayItems, comparatorPluDayItem);\n//\t\tList<ReportPluDayItem> cop = new ArrayList<ReportPluDayItem>();\n\t\tint allQty = 0;\n\t\tBigDecimal allAmount = BH.getBD(ParamConst.DOUBLE_ZERO);\n//\t\t\tboolean showMainCategory = true;\n//\t\t\tint mainCategoryId = 0;\n\t\tboolean lastLinePrinted = false;\n//\t\tBigDecimal categoryAmount = BH.getBD(ParamConst.DOUBLE_ZERO);\n//\t\tString name = \"\";\n//\t\tint id = 0;\n\t\tMap<Integer, ReportPluDayItem> map = new HashMap<Integer, ReportPluDayItem>();\n\t\tfor (int j = 0; j < reportPluDayItems.size(); j++) {\n\n\t\t\tReportPluDayItem reportPluDayItem = reportPluDayItems.get(j);\n\t\t\t//ObjectFactory.getInstance().getReportPluDayItem(reportPluDayItem);\n\t\t\tif(map.containsKey(reportPluDayItem.getItemMainCategoryId().intValue())){\n\t\t\t\tReportPluDayItem amountReportPluDayItem = map.get(reportPluDayItem.getItemMainCategoryId().intValue());\n\t\t\t\tBigDecimal amount = BH.add(BH.getBD(amountReportPluDayItem.getItemAmount()), BH.getBD(reportPluDayItem.getItemAmount()), false);\n\t\t\t\tamountReportPluDayItem.setItemAmount(amount.toString());\n\t\t\t}else{\n\t\t\t\tReportPluDayItem rr = new ReportPluDayItem();\n\t\t\t\trr.setItemMainCategoryId(reportPluDayItem.getItemMainCategoryId());\n\t\t\t\trr.setItemMainCategoryName(reportPluDayItem.getItemMainCategoryName());\n\t\t\t\trr.setItemAmount(BH.formatMoney(reportPluDayItem.getItemAmount()));\n\t\t\t\tmap.put(reportPluDayItem.getItemMainCategoryId().intValue(), rr);\n\t\t\t}\n//\t\t\t\tif(mainCategoryId == 0 || mainCategoryId == reportPluDayItem.getItemMainCategoryId().intValue()){\n//\t\t\t\t\tcategoryAmount = BH.add(categoryAmount,\n//\t\t\t\t\t\t\tBH.getBD(reportPluDayItem.getItemAmount()), true);\n//\t\t\t\t\tname = reportPluDayItem.getItemMainCategoryName();\n//\t\t\t\t\tid = reportPluDayItem.getItemMainCategoryId().intValue();\n//\n//\t\t\t\t\tif(mainCategoryId == 0)\n//\t\t\t\t\t\tmainCategoryId = id;\n//\n//\t\t\t\t\tif( j == reportPluDayItems.size() - 1){\n//\t\t\t\t\t\tReportPluDayItem rr = new ReportPluDayItem();\n//\t\t\t\t\t\trr.setItemMainCategoryId(id);\n//\t\t\t\t\t\trr.setItemMainCategoryName(name);\n//\t\t\t\t\t\trr.setItemAmount(categoryAmount.toString());\n//\t\t\t\t\t\tcop.add(rr);\n//\t\t\t\t\t}\n//\t\t\t\t}else{\n//\t\t\t\t\tReportPluDayItem rr = new ReportPluDayItem();\n//\t\t\t\t\trr.setItemMainCategoryId(id);\n//\t\t\t\t\trr.setItemMainCategoryName(name);\n//\t\t\t\t\trr.setItemAmount(categoryAmount.toString());\n//\t\t\t\t\tcop.add(rr);\n//\t\t\t\t\tname = reportPluDayItem.getItemMainCategoryName();\n//\t\t\t\t\tid = reportPluDayItem.getItemMainCategoryId().intValue();\n//\t\t\t\t\tmainCategoryId = id;\n//\t\t\t\t\tcategoryAmount = BH.getBD(ParamConst.DOUBLE_ZERO);\n//\t\t\t\t\tcategoryAmount = BH.add(categoryAmount,\n//\t\t\t\t\t\t\tBH.getBD(reportPluDayItem.getItemAmount()), true);\n//\n//\t\t\t\t}\n\t\t}\n\n\t\tIterator<Map.Entry<Integer, ReportPluDayItem>> entries = map.entrySet().iterator();\n\t\tboolean isFirst = true;\n\t\twhile (entries.hasNext()){\n\t\t\tMap.Entry<Integer, ReportPluDayItem> entry = entries.next();\n\t\t\tif(!isFirst){\n\t\t\t\tthis.addHortionalLine(this.charSize);\n\t\t\t}\n\t\t\tisFirst = false;\n\t\t\tReportPluDayItem amontReportPluDayItem = entry.getValue();\n\t\t\tthis.AddItem(amontReportPluDayItem.getItemMainCategoryName(), \"\", \"\", BH.formatMoney(amontReportPluDayItem.getItemAmount()).toString(), 1);\n\t\t\tthis.addHortionalLine(this.charSize);\n\t\t\tfor (int j = 0; j < reportPluDayItems.size(); j++) {\n\n\t\t\t\tReportPluDayItem reportPluDayItem = reportPluDayItems.get(j);\n\t\t\t\tif (amontReportPluDayItem.getItemMainCategoryId().intValue() == reportPluDayItem.getItemMainCategoryId().intValue()) {\n\t\t\t\t\t// Print comb modifier\n\t\t\t\t\tint itmId = reportPluDayItem.getItemDetailId().intValue();\n\t\t\t\t\tArrayList<ReportPluDayComboModifier> comItems = combMap.get(itmId);\n\t\t\t\t\tif (comItems != null && comItems.size() > 0) {\n\n\t\t\t\t\t\tint mm = 0;\n\t\t\t\t\t\tthis.AddItem(\" \"+reportPluDayItem.getItemName(), BH.formatMoney(reportPluDayItem.getItemPrice()),\n\t\t\t\t\t\t\t\treportPluDayItem.getItemCount().toString(),\n\t\t\t\t\t\t\t\tBH.formatThree(reportPluDayItem.getItemAmount()), 1);\n\t\t\t\t\t\tlastLinePrinted = false;\n\t\t\t\t\t\tthis.addHortionalLine(this.charSize);\n\t\t\t\t\t\tfor (mm = 0; mm < comItems.size(); mm++) {\n\t\t\t\t\t\t\tReportPluDayComboModifier pluModifier = comItems.get(mm);\n\t\t\t\t\t\t\tint count = pluModifier.getModifierCount().intValue() - pluModifier.getVoidModifierCount().intValue() - pluModifier.getBillVoidCount().intValue();\n\t\t\t\t\t\t\tif (count > 0) {\n\t\t\t\t\t\t\t\tBigDecimal modifierAmount = BH.mul(BH.getBD(1.00), BH.getBD(pluModifier.getModifierPrice()), true);\n\t\t\t\t\t\t\t\tBigDecimal modifierPrice = BH.mul(BH.getBD(1.00), BH.getBD(pluModifier.getModifierItemPrice()), true);\n\t\t\t\t\t\t\t\tthis.AddItem(\" (\" + pluModifier.getModifierName() + \")\",\n\t\t\t\t\t\t\t\t\t\t\"(\" + BH.formatThree(modifierPrice.toString()) + \")\", \"(\" + String.valueOf(count) + \")\", \"(\" + BH.formatThree(modifierAmount.toString())+ \")\", 1);\n\t\t\t\t\t\t\t\tlastLinePrinted = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (mm == comItems.size() && mm > 0) {\n\t\t\t\t\t\t\tif (!lastLinePrinted)\n\t\t\t\t\t\t\t\tthis.addHortionalLine(this.charSize);\n\t\t\t\t\t\t\tlastLinePrinted = true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tthis.AddItem(\" \"+reportPluDayItem.getItemName(), BH.formatMoney(reportPluDayItem.getItemPrice()),\n\t\t\t\t\t\t\t\treportPluDayItem.getItemCount().toString(), \"\" + BH.formatMoney(reportPluDayItem.getItemAmount()), 1);\n\t\t\t\t\t\tlastLinePrinted = false;\n\t\t\t\t\t}\n\t\t\t\t\t//END Comb modifier print\n\t\t\t\t\tallQty += reportPluDayItem.getItemCount();\n\t\t\t\t\tallAmount = BH.add(allAmount,\n\t\t\t\t\t\t\tBH.getBD(reportPluDayItem.getItemAmount()), true);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n//\t\tfor(ReportPluDayItem category : cop) {\n//\t\t\t\tif(cop.indexOf(category) != 0){\n//\t\t\t\t\tthis.addHortionalLine(this.charSize);\n//\t\t\t\t}\n//\t\t\t\tthis.AddItem(category.getItemMainCategoryName(), \"\", \"\", category.getItemAmount(), 1);\n//\t\t\t\tthis.addHortionalLine(this.charSize);\n//\t\t\t\tfor (int j = 0; j < reportPluDayItems.size(); j++) {\n//\n//\t\t\t\t\tReportPluDayItem reportPluDayItem = reportPluDayItems.get(j);\n////\t\t\t\t\tif (mainCategoryId != reportPluDayItem.getItemMainCategoryId().intValue()) {\n////\t\t\t\t\t\tif (mainCategoryId != 0) {\n////\t\t\t\t\t\t\tif (!lastLinePrinted)\n////\t\t\t\t\t\t\t\tthis.addHortionalLine(this.charSize);\n////\t\t\t\t\t\t\tlastLinePrinted = true;\n////\t\t\t\t\t\t}\n////\t\t\t\t\t\tmainCategoryId = reportPluDayItem.getItemMainCategoryId().intValue();\n////\t\t\t\t\t\tshowMainCategory = true;\n////\t\t\t\t\t}\n////\t\t\t\t\tif (showMainCategory) {\n////\t\t\t\t\t\tthis.AddItem(reportPluDayItem.getItemMainCategoryName(), \"\", \"\", \"\", 1);\n////\t\t\t\t\t\tthis.addHortionalLine(this.charSize);\n////\t\t\t\t\t\tshowMainCategory = false;\n////\t\t\t\t\t\tlastLinePrinted = true;\n////\t\t\t\t\t}\n//\t\t\t\t\tif (category.getItemMainCategoryId().intValue() == reportPluDayItem.getItemMainCategoryId().intValue()) {\n//\t\t\t\t\t\t//Bob: Print comb modifier\n//\t\t\t\t\t\tint itmId = reportPluDayItem.getItemDetailId().intValue();\n//\t\t\t\t\t\tArrayList<ReportPluDayComboModifier> comItems = combMap.get(itmId);\n//\t\t\t\t\t\tif (comItems != null && comItems.size() > 0) {\n//\n//\t\t\t\t\t\t\tint mm = 0;\n//\t\t\t\t\t\t\tthis.AddItem(\" \"+reportPluDayItem.getItemName(), reportPluDayItem.getItemPrice(),\n//\t\t\t\t\t\t\t\t\treportPluDayItem.getItemCount().toString(),\n//\t\t\t\t\t\t\t\t\treportPluDayItem.getItemAmount(), 1);\n//\t\t\t\t\t\t\tlastLinePrinted = false;\n//\t\t\t\t\t\t\tthis.addHortionalLine(this.charSize);\n//\t\t\t\t\t\t\tfor (mm = 0; mm < comItems.size(); mm++) {\n//\t\t\t\t\t\t\t\tReportPluDayComboModifier pluModifier = comItems.get(mm);\n//\t\t\t\t\t\t\t\tint count = pluModifier.getModifierCount().intValue() - pluModifier.getVoidModifierCount().intValue() - pluModifier.getBillVoidCount().intValue();\n//\t\t\t\t\t\t\t\tif (count > 0) {\n//\t\t\t\t\t\t\t\t\tBigDecimal modifierAmount = BH.mul(BH.getBD(1.00), BH.getBD(pluModifier.getModifierPrice()), true);\n//\t\t\t\t\t\t\t\t\tBigDecimal modifierPrice = BH.mul(BH.getBD(1.00), BH.getBD(pluModifier.getModifierItemPrice()), true);\n//\t\t\t\t\t\t\t\t\tthis.AddItem(\" (\" + pluModifier.getModifierName() + \")\",\n//\t\t\t\t\t\t\t\t\t\t\t\"(\" + modifierPrice.toString() + \")\", \"(\" + String.valueOf(count) + \")\", \"(\" + modifierAmount.toString() + \")\", 1);\n//\t\t\t\t\t\t\t\t\tlastLinePrinted = false;\n//\t\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\tif (mm == comItems.size() && mm > 0) {\n//\t\t\t\t\t\t\t\tif (!lastLinePrinted)\n//\t\t\t\t\t\t\t\t\tthis.addHortionalLine(this.charSize);\n//\t\t\t\t\t\t\t\tlastLinePrinted = true;\n//\t\t\t\t\t\t\t}\n//\n//\t\t\t\t\t\t} else {\n//\n//\t\t\t\t\t\t\tthis.AddItem(\" \"+reportPluDayItem.getItemName(), reportPluDayItem.getItemPrice(),\n//\t\t\t\t\t\t\t\t\treportPluDayItem.getItemCount().toString(), \"\" + reportPluDayItem.getItemAmount(), 1);\n//\t\t\t\t\t\t\tlastLinePrinted = false;\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\t//END Comb modifier print\n//\t\t\t\t\t\tallQty += reportPluDayItem.getItemCount();\n//\t\t\t\t\t\tallAmount = BH.add(allAmount,\n//\t\t\t\t\t\t\t\tBH.getBD(reportPluDayItem.getItemAmount()), true);\n//\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t}\n\t\tif (allQty != 0) {\n\t\t\tthis.addHortionalLine(this.charSize);\n\t\t\tthis.AddItem(PrintService.instance.getResources().getString(R.string.total), \"\", allQty + \"\", BH.formatMoney(allAmount.toString()), 1);\n\t\t}\n\n\n\t}", "public ACommunity getCisInformation(String client, String cisId);" ]
[ "0.6309243", "0.60884887", "0.59478295", "0.5832883", "0.54200727", "0.5378915", "0.53770405", "0.53517973", "0.5292437", "0.52135605", "0.5191748", "0.5156747", "0.5107392", "0.51013786", "0.50772715", "0.5001133", "0.4969327", "0.49682936", "0.49580547", "0.49306533", "0.49306533", "0.49011427", "0.48979762", "0.48784718", "0.48784718", "0.48784718", "0.4859103", "0.48365632", "0.48281863", "0.48232824", "0.4805193", "0.48038056", "0.4803223", "0.48019102", "0.47876742", "0.47876742", "0.47723112", "0.46925554", "0.4687149", "0.4682172", "0.4670746", "0.46622396", "0.46609", "0.46354783", "0.46182325", "0.46123052", "0.46068424", "0.4595539", "0.45927072", "0.45906523", "0.45803875", "0.45674378", "0.45667145", "0.45583254", "0.45461762", "0.45390177", "0.45235792", "0.45187476", "0.45187476", "0.45141655", "0.44978827", "0.4496944", "0.44926414", "0.4490418", "0.44892374", "0.44813138", "0.44774246", "0.44703683", "0.44698492", "0.44588956", "0.44568297", "0.44483405", "0.44471145", "0.44458866", "0.44450185", "0.44448146", "0.443988", "0.44398347", "0.44379655", "0.44328076", "0.44327667", "0.441637", "0.44116467", "0.44115224", "0.44060892", "0.4406049", "0.44059905", "0.44042563", "0.44031018", "0.4399828", "0.43929994", "0.43870044", "0.43850565", "0.43823335", "0.4377462", "0.43765983", "0.43762684", "0.43762454", "0.43755892", "0.43750855" ]
0.6692373
0
Return all active catalog descriptions for certificates programs (can be null for all)
public List<CatalogDescription> getAllCatalogDescriptionsForCertificate();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<CatalogDescription> getAllCatalogDescriptionsForCertificatesWithNoDescription();", "public List<CatalogDescription> getAllCatalogDescriptionsForCertificate(boolean showInactives);", "@GET\n\t@Path(\"{programId}/course\")\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic List<Course> getCoursesforProgram(@PathParam(\"programId\") String progId){\n\t\treturn ProgramService.getInstance().getCourseForProgram(progId);\n\t}", "public CatalogDescription getCatalogDescription(String course_id);", "public List<CatalogDescription> getCatalogDescriptionsByDepartment(String department, boolean showInactives);", "private void showCourseCatalogue()\r\n {\r\n \tCourseCatalogue courseCat = this.getDBManager().getCourseCat();\r\n \tthis.getClientOut().printf(\"SUCCESS\\n%s\\n\", courseCat.toString());\r\n \tthis.getClientOut().flush();\r\n }", "public List<CatalogDescription> getCatalogDescriptionsByDepartment(String department);", "public List<CatalogDescription> getCatalogDescriptionsByDepartmentWithNoDescription(String department);", "public java.util.List<vn.com.ecopharma.hrm.rc.model.Certificate> findAll()\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;", "private void viewActiveCourseList() {\n boolean detailed = yesNoQuestion(\"Would you like to look at the detailed version? (just names if no)\");\n\n System.out.println(\"The current active courses are:\\n \");\n for (int i = 0; i < activeCourseList.size(); i++) {\n if (detailed) {\n System.out.println((i + 1) + \":\");\n detailedCoursePrint(activeCourseList.get(i));\n } else {\n System.out.println((i + 1) + \": \" + activeCourseList.get(i).getName());\n }\n }\n\n }", "public Set<CertificateInfo> getLoadedCertificates() throws GeneralSecurityException, IOException {\n Set<CertificateInfo> certificates = new HashSet<>();\n for (SSLConfiguration config : this.getLoadedSSLConfigurations()) {\n certificates.addAll(config.getDefinedCertificates(env));\n }\n return certificates;\n }", "public List<CatalogDescription> getCatalogDescriptions(Map<String, String> eqCriteria, Map<String, String> searchCriteria);", "public void showCatalogue() {\n for (Record r : cataloue) {\n System.out.println(r);\n }\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic List<Certificate> getAllCertificate() {\n\n\t\tTransaction transaction = null;\n\t\tList<Certificate> listOfCertificate = null;\n\t\ttry (Session session = HibernateUtil.getSessionFactory().openSession()) {\n\t\t\t// start a transaction\n\t\t\ttransaction = session.beginTransaction();\n\t\t\t// get an certificate object\n\t\t\t\n\t\t\tlistOfCertificate = session.createQuery(\"from Certificate\").getResultList();\n\t\t\t\n\t\t\t// commit transaction\n\t\t\ttransaction.commit();\n\t\t} catch (Exception e) {\n\t\t\tif (transaction != null) {\n\t\t\t\ttransaction.rollback();\n\t\t\t}\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn listOfCertificate;\n\t}", "public String[] getCourses();", "public void printActiveCourses() \n {\n for (String c: courses.keySet()) \n {\n if (courses.get(c).getActive()) \n {\n System.out.println(courses.get(c)); \n }\n }\n }", "public java.util.List<com.ms3.training.services.model.Course> findAll()\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;", "public String getCourses() throws CustomExceptions.InvalidInputException {\n Collections.sort(courses);\n StringBuilder builder = new StringBuilder();\n if (!courses.isEmpty()) {\n for (CurriculumItem course : courses) {\n builder.append(String.format(\"|--[%1s] %13s -----|\\n\",\n getCurriculumItemCompletionStatus(course),\n Manipulators.getCurriculumItemAsShortString(course)));\n }\n } else {\n return \"No courses found for Academic Term: \" + name;\n }\n return builder.toString();\n }", "public String getCertDescription() {\n return certDescription;\n }", "List<X509Cert> caCerts(String caName, ReqRespDebug debug) throws CmpClientException, PkiErrorException;", "@Override\n\tpublic List<Course> findAllCourses() {\n\t\tList<Course> list = cd.findAllCourses();\n\t\tif (null == list)\n\t\t\tlist = new ArrayList<Course>();\n\t\treturn list;\n\t}", "@GetMapping(\"/showAllCourses\")\n\tpublic List<Courses> allcourses() throws CoursesNotFoundException {\n\t\ttry {\n\t\t\treturn courseService.allCourse();\n\t\t} catch (CoursesNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tthrow new CoursesNotFoundException(\"No courses\");\n\t\t}\n\t}", "java.util.List<liubaninc.m0.pki.CertificatesOuterClass.Certificates> \n getCertificatesList();", "java.util.List<liubaninc.m0.pki.CertificatesOuterClass.Certificates> \n getCertificatesList();", "public List<CatalogDescription> getCatalogDescriptionsByCareer(String career, boolean showInactives);", "public List<Course> getAllCourses() {\n return allCourses;\n }", "@SuppressWarnings(\"unchecked\")\r\n\tpublic List<ServiceCat> listServiceCat() {\r\n\t\tList<ServiceCat> courses = null;\r\n\t\ttry {\r\n\t\t\tcourses = session.createQuery(\"from ServiceCat\").list();\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn courses;\r\n\t}", "private void viewCourses() {\n Iterable<Course> courses = ctrl.getCourseRepo().findAll();\n courses.forEach(System.out::println);\n }", "public IFuture<ItemInfo[]> getCatalog()\n\t{\n\t\tfinal Future<ItemInfo[]> ret = new Future<ItemInfo[]>();\n\t\tShopCapa shop = (ShopCapa)capa.getPojoCapability();\n\t\tret.setResult(shop.getCatalog().toArray(new ItemInfo[shop.getCatalog().size()]));\n\t\treturn ret;\n\t}", "public ArrayList<Concert> getConcerts(){\n\t\treturn concerts;\n\t}", "public static ArrayList selectCatalogCategory() {\n ConnectionPool pool = ConnectionPool.getInstance();\n Connection connection = pool.getConnection();\n PreparedStatement ps = null;\n PreparedStatement ps2 = null;\n ResultSet rs = null;\n ResultSet rs2 = null;\n ArrayList<String> p = new ArrayList();\n int count = 0;\n\n String query = \"SELECT DISTINCT catalogCategory FROM Product \"\n + \" ORDER BY catalogCategory\";\n \n String query2 = \"SELECT DISTINCT catalogCategory FROM Product \"\n + \" ORDER BY catalogCategory\";\n \n try {\n ps = connection.prepareStatement(query);\n ps2 = connection.prepareStatement(query2);\n rs = ps.executeQuery();\n rs2 = ps2.executeQuery();\n \n while( rs2.next() ) {\n ++count;\n } \n ////////////For test purposes only //System.out.println(\"DBSetup @ line 363 \" + count); \n for ( int i = 0; i < count; i++ ) {\n if ( rs.next() ) {\n \n p.add(rs.getString(\"catalogCategory\"));\n System.out.println(\"DBSetup @ line 370 \" + p.get(i));\n }\n }\n System.out.println(p.size());\n return p;\n } catch (SQLException e) {\n System.out.println(e);\n return null;\n } finally {\n DBUtil.closeResultSet(rs);\n DBUtil.closePreparedStatement(ps);\n pool.freeConnection(connection);\n }\n }", "@RequestMapping(value = \"/staff/corecourseslist/{id}\")\n\tpublic ModelAndView listCoreCourses(@PathVariable(\"id\") Long programID,\t@RequestParam(required = false) Integer page, \n\t\t\t@RequestParam(required = false) Integer pageSize, HttpSession session) {\n\t\t\n\t\tPagedListHolder<Course> resultList = (PagedListHolder<Course>) session.getAttribute(\"StaffController_coreCoursesList\");\n\t\t\n\t\tif ((page == null && pageSize == null) || resultList == null) {\t// first request (not page navigation) - get prerequisites from service\n\t\t\tpage = 0;\n\t\t\tresultList = new PagedListHolder<Course>(programService.getAvailableCoreCourses(programID));\n\t\t\tsession.setAttribute(\"StaffController_coreCoursesList\", resultList);\n\t\t\tif (pageSize == null) {\n\t\t\t\tpageSize = DEFAULT_PAGE_SIZE;\n\t\t\t}\n\t\t}\n\t\tif (page == null) {\n\t\t\tpage = 0;\n\t\t}\n\t\tresultList.setPage(page);\n\t\tif (pageSize != null) {\n\t\t\tresultList.setPageSize(pageSize);\n\t\t}\n\t\t\n\t\tModelAndView modelAndView = new ModelAndView(\"staff/courseselectlist\", \"resultList\", resultList);\n\t\tmodelAndView.addObject(\"programID\", programID);\n\t\tmodelAndView.addObject(\"actionType\", \"addCoreCourses\");\n\t\t\n\t\treturn modelAndView;\n\t}", "public List<CatalogDescription> getCatalogDescriptionsByCareer(String career);", "private void getCourseList(){\r\n\r\n CourseDAO courseDAO = new CourseDAO(Statistics.this);\r\n List<Course> courseList= courseDAO.readListofCourses();\r\n for(Course course: courseList) {\r\n courses.add(course.getName());\r\n }\r\n\r\n }", "java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> \n getCertificateList();", "public List<Catalog> getCatalogs() {\n \t\tList<Catalog> catalogs = new ArrayList<Catalog>();\n \t\tList<CatalogInfo> catalogInfos = getConfiguration().getCatalogInfos();\n \t\tfor (CatalogInfo catalogInfo : catalogInfos) {\n \t\t\tCatalogManager mgr = new CatalogManager(catalogInfo);\n \t\t\tCatalog catalog = mgr.loadCatalog();\n \t\t\t// as catalogInfo is marked as transient, we have to set it\n \t\t\tcatalog.setInfo(catalogInfo);\n \t\t\tif (catalog != null) {\n \t\t\t\tcatalogs.add(catalog);\n \t\t\t}\n \t\t}\n \t\treturn catalogs;\n \t}", "public CourseCatalog receiveAllCourses() {\n\t\tCourseCatalog receiveCourses = null;\n\t\ttry{\n\t\t\tsendMessage(\"getAllCourses\");\n\t\t\t\n\t\t\treceiveCourses = (CourseCatalog)socketObjectIn.readObject();\n\t\t}catch (ClassNotFoundException e){\n\t\t\tSystem.err.println(e.getStackTrace());\n\t\t}catch (IOException e) {\n\t\t\tSystem.err.println(e.getStackTrace());\n\t\t}\n\t\treturn receiveCourses;\n\t}", "public String getCourses() {\n return courses;\n }", "public java.lang.String getStrCatalog()\n\t{\n\t\treturn strCatalog;\n\t}", "@SuppressWarnings(\"unchecked\")\n\tpublic List<Course> getAllCourses() {\n\t\treturn this.getHibernateTemplate().find(\"from Course cs order by cs.cno\");\n\t \n\t}", "private List<String[]> getCourseEntries() {\n \n List<String[]> list = new LinkedList<String[]>();\n \n String courseCodes = courseEntries.getText();\n StringBuilder temp = new StringBuilder();\n if (courseCodes.length() > 0) {\n \n String[] container = new String[2];\n \n for (int i = 0; i < courseCodes.length() + 1; i++) {\n \n //add the subjectCode to the container array\n if (courseCodes.length() > i && courseCodes.charAt(i) == ' ') {\n\n container[0] = temp.toString();\n temp = new StringBuilder();\n }\n //add text to the string builder\n else if (courseCodes.length() > i && courseCodes.charAt(i) != ';') {\n \n temp.append(courseCodes.charAt(i));\n }\n //add the container object with subjectCode and courseNumber to the list.\n else {\n\n container[1] = temp.toString();\n list.add(container);\n temp = new StringBuilder();\n container = new String[2];\n }\n }\n }\n \n return list;\n }", "public CatalogDescription getCatalogDescription(Long id);", "public void printAllcourses() {\n\t\tfor (int i = 0; i < CourseManager.courses.size(); i++) {\n\t\t\tSystem.out.println(i + 1 + \". \" + CourseManager.courses.get(i).getName() + \", Section: \" + CourseManager.courses.get(i).getSection());\n\t\t}\n\t}", "public void getPrograms(HttpServletResponse resp, Map<String, String> programs) {\n try {\n if (programs == null) {\n programs = new HashMap<>();\n for (Program program : Program.values()) {\n programs.put(program.getProgramAbbreviation(), program.getProgram());\n }\n }\n String json = new Genson().serialize(programs);\n resp.setContentType(\"application/json\");\n resp.getOutputStream().write(json.getBytes());\n } catch (IOException err) {\n err.printStackTrace();\n }\n }", "public ObservableList<CatalogPres> getCatalogList() {\n\t\t\n\t\treturn readCatalogsFromDataSource();\n\t\t\n\t}", "@GetMapping(\"/courses\")\n\tpublic List<Courses> getAllCourses() {\n\t\treturn this.cservice.getAllCourses();\n\t\t//return course;\n\t}", "public java.util.List<liubaninc.m0.pki.CertificatesOuterClass.Certificates> getCertificatesList() {\n if (certificatesBuilder_ == null) {\n return java.util.Collections.unmodifiableList(certificates_);\n } else {\n return certificatesBuilder_.getMessageList();\n }\n }", "public java.util.List<liubaninc.m0.pki.CertificatesOuterClass.Certificates> getCertificatesList() {\n if (certificatesBuilder_ == null) {\n return java.util.Collections.unmodifiableList(certificates_);\n } else {\n return certificatesBuilder_.getMessageList();\n }\n }", "@RequestMapping(value = \"/staff/electivecourseslist/{id}\")\n\tpublic ModelAndView listElectiveCourses(@PathVariable(\"id\") Long programID,\t@RequestParam(required = false) Integer page, \n\t\t\t@RequestParam(required = false) Integer pageSize, HttpSession session) {\n\t\t\n\t\tPagedListHolder<Course> resultList = (PagedListHolder<Course>) session.getAttribute(\"StaffController_electiveCoursesList\");\n\t\t\n\t\tif ((page == null && pageSize == null) || resultList == null) {\t// first request (not page navigation) - get prerequisites from service\n\t\t\tpage = 0;\n\t\t\tresultList = new PagedListHolder<Course>(programService.getAvailableElectiveCourses(programID));\n\t\t\tsession.setAttribute(\"StaffController_electiveCoursesList\", resultList);\n\t\t\tif (pageSize == null) {\n\t\t\t\tpageSize = DEFAULT_PAGE_SIZE;\n\t\t\t}\n\t\t}\n\t\tif (page == null) {\n\t\t\tpage = 0;\n\t\t}\n\t\tresultList.setPage(page);\n\t\tif (pageSize != null) {\n\t\t\tresultList.setPageSize(pageSize);\n\t\t}\n\t\t\n\t\tModelAndView modelAndView = new ModelAndView(\"staff/courseselectlist\", \"resultList\", resultList);\n\t\tmodelAndView.addObject(\"programID\", programID);\n\t\tmodelAndView.addObject(\"actionType\", \"addElectiveCourses\");\n\t\t\n\t\treturn modelAndView;\n\t}", "@Override\n\tpublic List<String> getNameOfCourses() {\n\t\tconn = DBUtils.connectToDb();\n\t\tString query = \"select course_name from course;\";\n\t\tst = DBUtils.getStatement(conn);\n\t\tList<String> list = null;\n\t\ttry {\n\n\t\t\trs = st.executeQuery(query);\n\t\t\tif (rs != null) {\n\t\t\t\tlist = new ArrayList<String>();\n\t\t\t\twhile (rs.next())\n\t\t\t\t\tlist.add(rs.getString(1));\n\t\t\t}\n\t\t\tDBUtils.closeConnections();\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn list;\n\t}", "public SortedSet<Concert> getActiveConcerts()//\t\t--> Returnerer alle aktive konserter registrert på dette lokalet.\n\t{\n\t\tGregorianCalendar calender = (GregorianCalendar)Calendar.getInstance();\n\t\tcalender = Utilities.getCleanDate(calender);\n\n\t\tConcert c = new Concert(calender);\n\t\tSortedSet<Concert> active = concerts.tailSet(c);\n\n\t\tif(active.isEmpty())\n\t\t\treturn null;\n\n\t\treturn active;\n\t}", "private void viewSavedCourseList() {\n boolean detailed = yesNoQuestion(\"Would you like to look at the detailed version? (just names if no)\");\n\n System.out.println(\"The current active courses are:\\n \");\n for (int i = 0; i < courseList.getCourseList().size(); i++) {\n if (detailed) {\n System.out.println((i + 1) + \":\");\n detailedCoursePrint(courseList.getCourseList().get(i));\n } else {\n System.out.println((i + 1) + \": \" + courseList.getCourseList().get(i).getName());\n }\n }\n }", "public ArrayList getCourses();", "private static HashMap<Integer, Course> getCourses() {\r\n return IO.getCoursesFromInput(); // get courses from file\r\n }", "java.lang.String getLicensesCertificationsRaw();", "public abstract String[] getDescriptions();", "public Catalog getCatalog();", "public ArrayList<String> getRequestedCourses()\n\t{\n\t\treturn requestedCourses;\n\t}", "public List<Models.Course> showCourses() {\n List<Models.Course> results = em.createNativeQuery(\"select cr.* from course cr, courseparticipant cpa, participant p where cr.coursecode = cpa.coursecode and cpa.participantid = p.participantid and p.userid = ?\", Models.Course.class).setParameter(1, user.getUserid()).getResultList();\n\n // Display the output\n String output = \"\";\n\n output = addChat(results.size() + \" courses were found.\");\n\n for (Models.Course course : results) {\n output += \"<div class='result display' onclick=\\\"window.location.href='Course?id=\" + course.getCoursecode() + \"'\\\">\\n\"\n + \" <div class='top'>\\n\"\n + \" <img class='icon' src='https://www.flaticon.com/svg/static/icons/svg/717/717874.svg'>\\n\"\n + \" <div class='text'>\\n\"\n + \" <a class='type'>COURSE</a>\\n\"\n + \" <a class='name'>\" + course.getTitle() + \"</a>\\n\"\n + \" <a class='subname'>\" + course.getCoursecode() + \"</a>\\n\"\n + \" </div>\\n\"\n + \" </div>\\n\"\n + \" </div>\";\n }\n\n servlet.putInJsp(\"result\", output);\n return results;\n }", "public static List<Certificado> listaCertificadosWindows() throws NfeException {\r\n\r\n\t\t// Estou setando a variavel para 20 dispositivos no maximo\r\n\t\tList<Certificado> listaCert = new ArrayList<>(20);\r\n\r\n\t\ttry {\r\n\t\t\tKeyStore ks = KeyStore.getInstance(\"Windows-MY\", \"SunMSCAPI\");\r\n\r\n\t\t\tks.load(null, null);\r\n\r\n\t\t\tEnumeration<String> aliasEnum = ks.aliases();\r\n int idx = 0;\r\n\r\n\t\t\twhile (aliasEnum.hasMoreElements()) {\r\n\t\t\t\tString aliasKey = (String) aliasEnum.nextElement();\r\n\r\n\t\t\t\tif (ObjetoUtil.differentNull(aliasKey)) {\r\n\t\t\t\t\tCertificado cert = new Certificado();\r\n\t\t\t\t\tcert.setNome(aliasKey);\r\n\t\t\t\t\tcert.setTipo(Certificado.getWINDOWS());\r\n\t\t\t\t\tcert.setSenha(\"\");\r\n\t\t\t\t\tDate dataValidade = DataValidade(cert);\r\n\t\t\t\t\tif(dataValidade == null){\r\n\t\t\t\t\t\tcert.setNome(\"(INVALIDO)\"+aliasKey);\r\n\t\t\t\t\t\tcert.setVencimento(LocalDate.of(2000, 1, 1));\r\n\t\t\t\t\t\tcert.setDiasRestantes(0L);\r\n\t\t\t\t\t\tcert.setValido(false);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tcert.setVencimento(dataValidade.toInstant().atZone(ZoneId.systemDefault()).toLocalDate());\r\n\t\t\t\t\t\tcert.setDiasRestantes(diasRestantes(cert)); \r\n\t\t\t\t\t\tcert.setValido(valido(cert));\r\n cert.setNome(aliasKey);\r\n\t\t\t\t\t}\r\nSystem.out.println(\"Certificado \"+idx+\" - Nome: \"+cert.getNome()+\" - Vencimento: \"+cert.getVencimento());\t\t\t\t\t\r\n\t\t\t\t\tlistaCert.add(cert);\r\n\t\t\t\t}\r\n idx++;\r\n\t\t\t}\r\n\r\n\t\t} catch (KeyStoreException | NoSuchProviderException | NoSuchAlgorithmException | CertificateException\r\n\t\t\t\t| IOException ex) {\r\n\t\t\tthrow new NfeException(\"Erro ao Carregar Certificados:\" + ex.getMessage());\r\n\t\t}\r\n\r\n\t\treturn listaCert;\r\n\r\n\t}", "public Certificate[] getLocalCertificates() {\n/* 185 */ return this.delegate.getLocalCertificates();\n/* */ }", "public java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> getCertificateList() {\n if (certificateBuilder_ == null) {\n return java.util.Collections.unmodifiableList(certificate_);\n } else {\n return certificateBuilder_.getMessageList();\n }\n }", "public List<Course> getCourse() {\n\t\treturn null;\n\t}", "public HashMap<String, JSONObject> getListPrograms();", "private void performShowCertCommand(String[] args) throws Exception {\n int i = 1;\n X509Certificate c;\n boolean listAll = false;\n\n try {\n for (i = 1; i < args.length; i++) {\n\n if (args[i].equals(\"-encoding\")) {\n encoding = args[++i];\n } else if (args[i].equals(\"-certnum\")) {\n certnum = args[++i];\n } else if (args[i].equals(\"-chainnum\")) {\n chainNum = args[++i];\n } else if (args[i].equals(\"-all\")) {\n listAll = true;\n } else if (args[i].equals(\"-inputjad\")) {\n infile = args[++i];\n } else {\n usageError(\"Illegal option for \" + command +\n \": \" + args[i]);\n }\n }\n } catch (ArrayIndexOutOfBoundsException aiobe) {\n usageError(\"Missing value for \" + args[--i]);\n }\n\n if (listAll && (chainNum != null || certnum != null)) {\n usageError(\"-all cannot be used with -certnum or -chainnum\");\n }\n\n // these methods will check for the presence of the args they need\n checkCertAndChainNum();\n initJadUtil();\n\n if (listAll) {\n Vector certs = appdesc.getAllCerts();\n\n if (certs.size() == 0) {\n System.out.println(\"\\nNo certificates found in JAD.\\n\");\n return;\n }\n\n System.out.println();\n\n for (i = 0; i < certs.size(); i++) {\n Object[] temp = (Object[])certs.elementAt(i);\n\n System.out.println((String)temp[AppDescriptor.KEY] + \":\");\n\n displayCert((X509Certificate)temp[AppDescriptor.CERT]);\n }\n\n return;\n }\n\n try {\n c = appdesc.getCert(chainIndex, certIndex);\n } catch (Exception e) {\n throw new Exception(\"-showcert failed: \" + e.toString());\n }\n\n if (c == null) {\n throw new Exception(\"Certificate \" + chainIndex + \"-\" +\n certIndex + \" not in JAD\");\n }\n\n try {\n displayCert(c);\n return;\n } catch (Exception e) {\n throw new Exception(\"-showcert failed: \" + e.toString());\n }\n }", "private java.util.List<pkg.Courses> getData(java.lang.String arg0) {\n pkg.CalWebService port = service.getCalWebServicePort();\r\n return port.getData(arg0);\r\n }", "@Override\r\n\tpublic List<Courses> getCourses() {\n\t\treturn coursesdao.findAll();\r\n\t}", "@Override\n\tpublic List<Course> getAllCourses() {\n\t\tList<Course> list = null;\n\t\tconn = DBUtils.connectToDb();\n\t\tCourse course = null;\n\t\tString query = \"select * from course;\";\n\t\ttry {\n\t\t\tst = conn.createStatement();\n\t\t\trs = st.executeQuery(query);\n\t\t\tif(rs!=null)\n\t\t\t{\n\t\t\t\tlist = new ArrayList<Course>();\n\t\t\t\twhile(rs.next())\n\t\t\t\t{\n\t\t\t\t\tcourse = new Course();\n\t\t\t\t\tcourse.setCourse_id(Integer.parseInt(rs.getString(1)));\n\t\t\t\t\tcourse.setCourse_name(rs.getString(2));\n\t\t\t\t\tcourse.setStart_date(rs.getString(3));\n\t\t\t\t\tcourse.setEnd_date(rs.getString(4));\n\t\t\t\t\tcourse.setCapacity(Integer.parseInt(rs.getString(5)));\n\t\t\t\t\tlist.add(course);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn list;\n\t}", "private void printAllCourseInDB(){\n\n System.out.println(\"--------------------------------------------------------------------------------------\");\n System.out.println(\"COURSE SCHOOL AU INDEX SLOT TYPE DAY TIME\");\n System.out.println(\"--------------------------------------------------------------------------------------\");\n ArrayList<String> courseIDList = courseMgr.readAllCourseIDFromDB();\n for(String courseID: courseIDList){\n System.out.print(String.format(\"%6s \", courseID));\n Course course = courseMgr.readCourseByID(courseID);\n System.out.print(String.format(\"%5s \", course.getSchool()));\n int j = 0;\n for(CourseIndex courseIndex:course.getCourseIndices()){\n if (j==0)\n System.out.print(String.format(\" %d \", courseIndex.getAu()));\n else\n System.out.print(String.format(\" \", courseIndex.getAu()));\n System.out.print(String.format(\"%6s \", courseIndex.getIndex()));\n System.out.print(String.format(\"%3d \", courseIndex.getSlot()));\n int i = 0;\n for (CourseCompo courseCompo : courseIndex.getCourseCompos()){\n if(i==0){\n System.out.print(String.format(\"%3s \", courseCompo.getCompoType()));\n System.out.print(String.format(\"%3s \", courseCompo.getDay()));\n System.out.println(String.format(\"%3s \", courseCompo.getTimeSlot()));\n }\n else{\n System.out.print(String.format(\" %3s \", courseCompo.getCompoType()));\n System.out.print(String.format(\"%3s \", courseCompo.getDay()));\n System.out.println(String.format(\"%3s \", courseCompo.getTimeSlot()));\n }\n i++;\n }\n j++;\n System.out.println(\"\");\n }\n }\n\n System.out.println(\"--------------------------------------------------------------------------------------\\n\");\n }", "@RequestMapping(value = \"/staff/cacourselist\")\n\tpublic ModelAndView listCACourses(@RequestParam(required = true) Long campusID,\t\n\t\t\t@RequestParam(required = true) Long termID,\t\n\t\t\t@RequestParam(required = false) Integer page, \n\t\t\t@RequestParam(required = false) Integer pageSize, HttpSession session) {\n\t\t\n\t\tPagedListHolder<Course> resultList = (PagedListHolder<Course>) session.getAttribute(\"StaffController_CACoursesList\");\n\t\t\n\t\tif ((page == null && pageSize == null) || resultList == null) {\t// first request (not page navigation) - get prerequisites from service\n\t\t\tpage = 0;\n\t\t\tresultList = new PagedListHolder<Course>(caService.getAvailableCACourses(campusID, termID));\n\t\t\tsession.setAttribute(\"StaffController_CACoursesList\", resultList);\n\t\t\tif (pageSize == null) {\n\t\t\t\tpageSize = DEFAULT_PAGE_SIZE;\n\t\t\t}\n\t\t}\n\t\tif (page == null) {\n\t\t\tpage = 0;\n\t\t}\n\t\tresultList.setPage(page);\n\t\tif (pageSize != null) {\n\t\t\tresultList.setPageSize(pageSize);\n\t\t}\n\t\t\n\t\tModelAndView modelAndView = new ModelAndView(\"staff/courseselectlist\", \"resultList\", resultList);\n\t\tmodelAndView.addObject(\"campusID\", campusID);\n\t\tmodelAndView.addObject(\"termID\", termID);\n\t\tmodelAndView.addObject(\"actionType\", \"addCACourses\");\n\t\t\n\t\treturn modelAndView;\n\t}", "private java.security.cert.Certificate[] getJCACertificateChain() throws KeyStoreException, CertificateException {\n\tjava.security.cert.Certificate[] cert;\n\tcert = keyStore.getCertificateChain(alias);\n\tif (cert == null) {\n\t throw new CertificateException(\"Unknown alias.\");\n\t}\n\treturn cert;\n }", "public Collection<? extends Course> findAll() {\n\t\treturn crepo.findAll();\r\n\t}", "public static ArrayList<Course> getAll() {\n return courses;\n }", "@SuppressWarnings(\"unchecked\")\n\t@Override\n\tpublic List<Course> getAllCourse() {\n\t\treturn (List<Course>) sessionFactory.getCurrentSession().createCriteria(Course.class).list();\n\t}", "@Override\npublic ArrayList<String> courses() {\n\tArrayList<String> studentCourses = new ArrayList<String>();\n\tstudentCourses.add(\"CMPE - 273\");\n\tstudentCourses.add(\"CMPE - 206\");\n\tstudentCourses.add(\"CMPE - 277\");\n\tSystem.out.println(this.name+\" has take these courses\");\n\tfor(int i = 0 ; i < studentCourses.size() ; i++){\n\t\tSystem.out.println( studentCourses.get(i));\n\t}\n\treturn null;\n}", "public String catalog() {\n return catalogName;\n }", "public String catalog() {\n return catalogName;\n }", "public Object[] getCompInfo() {\n\t\tObject comp[] = new Object[2];\n\t\tcomp[0] = \"IBM\";\n\t\tcomp[1] = 1000;\n\t\t\n\t\treturn comp;\n\t}", "public String getCourseDesc() {\n return courseDesc;\n }", "@RequestMapping(value = \"/staff/compulsorycourseslist/{id}\")\n\tpublic ModelAndView listCompulsoryCourses(@PathVariable(\"id\") Long majorID,\t@RequestParam(required = false) Integer page, \n\t\t\t@RequestParam(required = false) Integer pageSize, HttpSession session) {\n\t\t\n\t\tPagedListHolder<Course> resultList = (PagedListHolder<Course>) session.getAttribute(\"StaffController_compulsoryCoursesList\");\n\t\t\n\t\tif ((page == null && pageSize == null) || resultList == null) {\t// first request (not page navigation) - get prerequisites from service\n\t\t\tpage = 0;\n\t\t\tresultList = new PagedListHolder<Course>(majorService.getAvailableCompulsoryCourses(majorID));\n\t\t\tsession.setAttribute(\"StaffController_compulsoryCoursesList\", resultList);\n\t\t\tif (pageSize == null) {\n\t\t\t\tpageSize = DEFAULT_PAGE_SIZE;\n\t\t\t}\n\t\t}\n\t\tif (page == null) {\n\t\t\tpage = 0;\n\t\t}\n\t\tresultList.setPage(page);\n\t\tif (pageSize != null) {\n\t\t\tresultList.setPageSize(pageSize);\n\t\t}\n\t\t\n\t\tModelAndView modelAndView = new ModelAndView(\"staff/courseselectlist\", \"resultList\", resultList);\n\t\tmodelAndView.addObject(\"majorID\", majorID);\n\t\tmodelAndView.addObject(\"actionType\", \"addCompulsoryCourses\");\n\t\t\n\t\treturn modelAndView;\n\t}", "List<AlgCollation> getCollationList();", "@GetMapping(\"/courses\")\r\n\tpublic List<Courses> getCourses() {\r\n\t\treturn this.cs.getCourses();\r\n\r\n\t}", "public Cursor fetchAll() {\n\t\tCursor cursor = db.query(CertificationConstants.DB_TABLE, CertificationConstants.fields(), null, null, null, null, null);\n\t\treturn cursor;\n\t}", "public void listOfCourses() {//admin cagirisa bulunna kurslarin hepsi\n if (Courses.size() != 0) {\n System.out.printf(\"%s kullanicisinin dersleri\\n\", this.getUsername());\n for (int i = 0; i < this.Courses.size(); ++i) {\n System.out.printf(\"%d-%s\\n\", i, Courses.get(i));\n }\n } else {\n System.out.printf(\"%s kullanicinin dersi yok\\n\", this.getUsername());\n }\n }", "@RequestMapping(value = \"/staff/calist\")\n\tpublic ModelAndView listCA(@RequestParam(required = false) Integer page, @RequestParam(required = false) Integer pageSize, HttpSession session) {\n\t\tif (page == null) {\n\t\t\tpage = 0;\n\t\t}\n\t\t\n\t\tPagedListHolder<CourseAvailability> resultList = (PagedListHolder<CourseAvailability>) session.getAttribute(\"StaffController_CAList\");\n\t\tif (resultList == null) {\n\t\t\tresultList = new PagedListHolder<CourseAvailability>(caService.getAllCAs());\n\t\t\tsession.setAttribute(\"StaffController_CAList\", resultList);\n\t\t\tif (pageSize == null) {\n\t\t\t\tpageSize = DEFAULT_PAGE_SIZE;\n\t\t\t}\n\t\t}\n\t\tif (pageSize != null) {\n\t\t\tresultList.setPageSize(pageSize);\n\t\t}\n\t\tresultList.setPage(page);\n\t\treturn new ModelAndView(\"staff/calist\", \"resultList\", resultList);\n\t}", "public ArrayList<Integer> getCertificates() {\r\n return certificates;\r\n }", "@GET\n \tpublic Response listCourses() throws JsonProcessingException {\n \t\tList<Course> courses = ofy().load().type(Course.class).list();\n \t\t\n \t\t// convert to json\n \t\tString json = new ObjectMapper().writeValueAsString(courses);\n \t\treturn Response.ok(Utils.JsonPad + json).build();\n \t}", "@ZAttr(id=-1)\n public String[] getDescription() {\n return getMultiAttr(Provisioning.A_description);\n }", "public Certificate[] getFileCertificates()\r\n {\r\n return acFileCertificates;\r\n }", "List<Course> selectAll();", "@RequestMapping(path = \"/v1/certificates\", method = RequestMethod.GET)\n public ResponseEntity<Object> getCertificates(@RequestParam(\"ag\") String assetGroup) {\n if (Strings.isNullOrEmpty(assetGroup)) {\n return ResponseUtils.buildFailureResponse(new Exception(ASSET_MANDATORY));\n }\n OutputDTO output = null;\n try {\n output = new OutputDTO(complianceService.getCertificates(assetGroup));\n } catch (ServiceException e) {\n return complianceService.formatException(e);\n }\n return ResponseUtils.buildSucessResponse(output);\n }", "@Override\n public List<Course> getCourses() {\n return courseDao.findAll();\n }", "public static ArrayList<Map<String,String>> getContentsFromCert()\n {\n ArrayList<String> contents = getFeedContents(AdressesClass.getUrls().get(3));\n ArrayList<Map<String,String>> allContents = new ArrayList<Map<String, String>>();\n Map<String,String> tempMap = new HashMap<String, String>();\n tempMap.put(\"URI\",AdressesClass.getUrls().get(3));\n allContents.add(tempMap);\n for (int i = 0; i < contents.size(); i++) {\n\n allContents.add(HtmlParseFromCert(contents.get(i)));\n }\n\n return allContents;\n }", "public java.util.List<com.alain.puntocoma.model.Catalogo> findAll()\n throws com.liferay.portal.kernel.exception.SystemException;", "@RequestMapping(\"/courses\")\n\tpublic List<Course> getAllCourses() {\n\t\treturn courseService.getAllCourses();\n\t}", "@Test\n public void testPrograms() throws Exception {\n List<ProgramRecord> programRecords = ImmutableList.of(\n new ProgramRecord(ProgramType.WORKER, \"dummyApp\", \"prog1\", \"\"),\n new ProgramRecord(ProgramType.MAPREDUCE, \"dummyApp\", \"prog2\", \"\"),\n new ProgramRecord(ProgramType.MAPREDUCE, \"dummyApp\", \"anotherProgram\", \"\"));\n ApplicationDetail applicationDetail = new ApplicationDetail(\"name\", ApplicationId.DEFAULT_VERSION, \"desc\", null,\n \"config\", null, programRecords, null,\n new ArtifactSummary(\"art\", \"1\"), null);\n when(applicationClient.get(new ApplicationId(\"dummyNs\", \"dummyApp\"))).thenReturn(applicationDetail);\n\n ResourceLookupContext resourceLookupContext = new ResourceLookupContext();\n resourceLookupContext.setResourceName(\"program\");\n resourceLookupContext.setUserInput(\"p\");\n resourceLookupContext.setResources(ImmutableMap.of(\"namespace\", ImmutableList.of(\"dummyNs\"),\n \"application\", ImmutableList.of(\"dummyApp\")));\n List<String> resources = client.getResources(resourceLookupContext);\n Assert.assertEquals(2, resources.size());\n Assert.assertEquals(ImmutableList.of(\n Joiner.on(RangerCommon.RESOURCE_SEPARATOR).join(ProgramType.WORKER.getPrettyName().toLowerCase(), \"prog1\"),\n Joiner.on(RangerCommon.RESOURCE_SEPARATOR).join(ProgramType.MAPREDUCE.getPrettyName().toLowerCase(), \"prog2\")),\n resources);\n }", "public void courseInfo() {\n\t\tList<Course> unfinishedCourses = super.getUnfinishedCourses();\n\t\tList<Course> finishedCourses = super.getFinishedCourses();\n\n\t\tString retStr = \"Unfinished Courses: \";\n\t\tfor (int i = 0; i < unfinishedCourses.size(); i++) {\n \tretStr += unfinishedCourses.get(i);\n \tif (i != unfinishedCourses.size()-1) {\n\t\t\t\tretStr += \", \";\n \t}\n\t\t}\n\t\tretStr += \"\\nFinished Courses: \";\n\t\tfor (int i = 0; i < finishedCourses.size(); i++) {\n \tretStr += finishedCourses.get(i);\n \tif (i != finishedCourses.size()-1) {\n\t\t\t\tretStr += \", \";\n \t}\n\t\t}\n\t\tretStr += \"\\nHP: \" + this.hp;\n\t\tSystem.out.println(retStr);\n\t}", "public ArrayList<Concert> getConcertList(){\n return concertList;\n }", "@Override\r\n\tpublic Set<Course> getAllCources() throws SQLException {\n\t\tSet<Course> courses = new HashSet<Course>();\r\n\t\tStatement statement = connection.createStatement();\r\n\t\tString sql = \"Select * from course\";\r\n\t\tResultSet resultSet = statement.executeQuery(sql);\r\n\t\twhile (resultSet.next()) {\r\n\t\t\tCourse course = new Course();\r\n\t\t\tcourse.setIdCourse(resultSet.getInt(\"idCourse\"));\r\n\t\t\tcourse.setDecription(resultSet.getString(\"decription\"));\r\n\t\t\tcourse.setDuration(resultSet.getString(\"duration\"));\r\n\t\t\tcourse.setName(\"name\");\r\n\t\t\tcourse.setPrerequisites(\"prerequisites\");\r\n\t\t\tcourses.add(course);\r\n\t\t}\r\n\t\treturn courses;\r\n\t}", "public static String courseDescription(long idCorso) {\n\t\tRequestContent rp = new RequestContent();\n\t\trp.type = RequestType.COURSE_DESCRIPTION;\n\t\trp.parameters = new Object[] { idCorso };\n\t\tReceiveContent rpc = sendReceive(rp);\n\t\tString descr = (String) rpc.parameters[0];\n\t\treturn descr;\n\t\t\n\t}" ]
[ "0.7328558", "0.7087683", "0.609905", "0.5795354", "0.5768967", "0.5747023", "0.57408935", "0.55799466", "0.548372", "0.5436602", "0.5420486", "0.53662443", "0.5338885", "0.5305916", "0.5293649", "0.5285838", "0.5285095", "0.5265682", "0.52372473", "0.5199609", "0.51364017", "0.51318693", "0.51106066", "0.51106066", "0.51089144", "0.510177", "0.50955105", "0.5088254", "0.5082354", "0.5082102", "0.50784576", "0.507365", "0.50643176", "0.5058961", "0.50401926", "0.50250244", "0.5024369", "0.5020565", "0.5003071", "0.50027263", "0.49970055", "0.49952602", "0.49580523", "0.49532247", "0.4946318", "0.49427813", "0.49408272", "0.49408272", "0.49390337", "0.49368113", "0.4926855", "0.4920476", "0.4918259", "0.4914082", "0.48973262", "0.4877191", "0.48706836", "0.48510635", "0.4848936", "0.48434874", "0.48432326", "0.4843101", "0.4839856", "0.4836302", "0.48291934", "0.48157388", "0.48091176", "0.48070362", "0.48037434", "0.48020193", "0.47998458", "0.4790979", "0.47800076", "0.47786918", "0.47674984", "0.47669855", "0.47669855", "0.47498202", "0.47479847", "0.47430685", "0.47360104", "0.47343305", "0.47342175", "0.47228464", "0.47222835", "0.47222233", "0.4719181", "0.4715418", "0.47154087", "0.47027487", "0.46961203", "0.46961123", "0.46948433", "0.46913886", "0.46894816", "0.46861014", "0.46819168", "0.46815187", "0.46770868", "0.4676498" ]
0.75352126
0
Return all active catalog descriptions for certificates programs with flag to indicate if we return or not inactive catalog descriptions
public List<CatalogDescription> getAllCatalogDescriptionsForCertificate(boolean showInactives);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<CatalogDescription> getAllCatalogDescriptionsForCertificatesWithNoDescription();", "public List<CatalogDescription> getAllCatalogDescriptionsForCertificate();", "public List<CatalogDescription> getCatalogDescriptionsByDepartment(String department, boolean showInactives);", "public void setCatalogDescriptionToInactive();", "private void viewActiveCourseList() {\n boolean detailed = yesNoQuestion(\"Would you like to look at the detailed version? (just names if no)\");\n\n System.out.println(\"The current active courses are:\\n \");\n for (int i = 0; i < activeCourseList.size(); i++) {\n if (detailed) {\n System.out.println((i + 1) + \":\");\n detailedCoursePrint(activeCourseList.get(i));\n } else {\n System.out.println((i + 1) + \": \" + activeCourseList.get(i).getName());\n }\n }\n\n }", "public List<CatalogDescription> getCatalogDescriptionsByDepartmentWithNoDescription(String department);", "public void printActiveCourses() \n {\n for (String c: courses.keySet()) \n {\n if (courses.get(c).getActive()) \n {\n System.out.println(courses.get(c)); \n }\n }\n }", "public List<CatalogDescription> getCatalogDescriptionsByCareer(String career, boolean showInactives);", "public List<CatalogDescription> getCatalogDescriptionsByDepartment(String department);", "private void showCourseCatalogue()\r\n {\r\n \tCourseCatalogue courseCat = this.getDBManager().getCourseCat();\r\n \tthis.getClientOut().printf(\"SUCCESS\\n%s\\n\", courseCat.toString());\r\n \tthis.getClientOut().flush();\r\n }", "public SortedSet<Concert> getActiveConcerts()//\t\t--> Returnerer alle aktive konserter registrert på dette lokalet.\n\t{\n\t\tGregorianCalendar calender = (GregorianCalendar)Calendar.getInstance();\n\t\tcalender = Utilities.getCleanDate(calender);\n\n\t\tConcert c = new Concert(calender);\n\t\tSortedSet<Concert> active = concerts.tailSet(c);\n\n\t\tif(active.isEmpty())\n\t\t\treturn null;\n\n\t\treturn active;\n\t}", "public String getIsCatalog() {\n return isCatalog;\n }", "public CatalogDescription getCatalogDescription(String course_id);", "public List<CatalogDescription> getCatalogDescriptions(Map<String, String> eqCriteria, Map<String, String> searchCriteria);", "public IFuture<ItemInfo[]> getCatalog()\n\t{\n\t\tfinal Future<ItemInfo[]> ret = new Future<ItemInfo[]>();\n\t\tShopCapa shop = (ShopCapa)capa.getPojoCapability();\n\t\tret.setResult(shop.getCatalog().toArray(new ItemInfo[shop.getCatalog().size()]));\n\t\treturn ret;\n\t}", "public abstract String[] getDescriptions();", "private void viewSavedCourseList() {\n boolean detailed = yesNoQuestion(\"Would you like to look at the detailed version? (just names if no)\");\n\n System.out.println(\"The current active courses are:\\n \");\n for (int i = 0; i < courseList.getCourseList().size(); i++) {\n if (detailed) {\n System.out.println((i + 1) + \":\");\n detailedCoursePrint(courseList.getCourseList().get(i));\n } else {\n System.out.println((i + 1) + \": \" + courseList.getCourseList().get(i).getName());\n }\n }\n }", "@GET\n\t@Path(\"{programId}/course\")\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic List<Course> getCoursesforProgram(@PathParam(\"programId\") String progId){\n\t\treturn ProgramService.getInstance().getCourseForProgram(progId);\n\t}", "public void showCatalogue() {\n for (Record r : cataloue) {\n System.out.println(r);\n }\n }", "@ZAttr(id=-1)\n public String[] getDescription() {\n return getMultiAttr(Provisioning.A_description);\n }", "public final boolean modstate_has_catalog () {\n\t\treturn modstate >= MODSTATE_CATALOG;\n\t}", "public boolean hasCatalog() {\n return ((bitField0_ & 0x00000002) != 0);\n }", "public static ArrayList selectCatalogCategory() {\n ConnectionPool pool = ConnectionPool.getInstance();\n Connection connection = pool.getConnection();\n PreparedStatement ps = null;\n PreparedStatement ps2 = null;\n ResultSet rs = null;\n ResultSet rs2 = null;\n ArrayList<String> p = new ArrayList();\n int count = 0;\n\n String query = \"SELECT DISTINCT catalogCategory FROM Product \"\n + \" ORDER BY catalogCategory\";\n \n String query2 = \"SELECT DISTINCT catalogCategory FROM Product \"\n + \" ORDER BY catalogCategory\";\n \n try {\n ps = connection.prepareStatement(query);\n ps2 = connection.prepareStatement(query2);\n rs = ps.executeQuery();\n rs2 = ps2.executeQuery();\n \n while( rs2.next() ) {\n ++count;\n } \n ////////////For test purposes only //System.out.println(\"DBSetup @ line 363 \" + count); \n for ( int i = 0; i < count; i++ ) {\n if ( rs.next() ) {\n \n p.add(rs.getString(\"catalogCategory\"));\n System.out.println(\"DBSetup @ line 370 \" + p.get(i));\n }\n }\n System.out.println(p.size());\n return p;\n } catch (SQLException e) {\n System.out.println(e);\n return null;\n } finally {\n DBUtil.closeResultSet(rs);\n DBUtil.closePreparedStatement(ps);\n pool.freeConnection(connection);\n }\n }", "public List<String> getDepartmentNameWithAtLeastOneCaWithNoDescription();", "@SuppressWarnings(\"unchecked\")\r\n\tpublic List<ServiceCat> listServiceCat() {\r\n\t\tList<ServiceCat> courses = null;\r\n\t\ttry {\r\n\t\t\tcourses = session.createQuery(\"from ServiceCat\").list();\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn courses;\r\n\t}", "public List<CatalogDescription> getCatalogDescriptionsByCareer(String career);", "boolean hasCertificates();", "boolean hasCertificates();", "public ArrayList<Concert> getConcerts(){\n\t\treturn concerts;\n\t}", "boolean getDesc();", "public String getCertDescription() {\n return certDescription;\n }", "List<ExamPackage> getListIsComing();", "public List<Catalog> getCatalogs() {\n \t\tList<Catalog> catalogs = new ArrayList<Catalog>();\n \t\tList<CatalogInfo> catalogInfos = getConfiguration().getCatalogInfos();\n \t\tfor (CatalogInfo catalogInfo : catalogInfos) {\n \t\t\tCatalogManager mgr = new CatalogManager(catalogInfo);\n \t\t\tCatalog catalog = mgr.loadCatalog();\n \t\t\t// as catalogInfo is marked as transient, we have to set it\n \t\t\tcatalog.setInfo(catalogInfo);\n \t\t\tif (catalog != null) {\n \t\t\t\tcatalogs.add(catalog);\n \t\t\t}\n \t\t}\n \t\treturn catalogs;\n \t}", "public static boolean getShowOnlyActiveAlgorithms() {\n\n return m_bShowOnlyActiveAlgorithms;\n\n }", "public String[] getCourses();", "public CatalogDescription getCatalogDescription(Long id);", "public Catalog getCatalog();", "public MapList getActiveCRs(Context context, String[] args) throws Exception {\n\n Pattern relationship_pattern = new Pattern(TigerConstants.RELATIONSHIP_PSS_SUBPROGRAMPROJECT);\n relationship_pattern.addPattern(TigerConstants.RELATIONSHIP_PSS_CONNECTEDPCMDATA);\n\n Pattern type_pattern = new Pattern(TigerConstants.TYPE_PSS_CHANGEREQUEST);\n type_pattern.addPattern(TigerConstants.TYPE_PSS_PROGRAMPROJECT);\n\n Pattern finalType = new Pattern(TigerConstants.TYPE_PSS_CHANGEREQUEST);\n try {\n\n StringList slselectObjStmts = getSLCTableSelectables(context);\n\n Map programMap = (Map) JPO.unpackArgs(args);\n String strProgProjId = (String) programMap.get(\"objectId\");\n // TIGTK-16801 : 30-08-2018 : START\n boolean bAdminOrPMCMEditAllow = isAdminOrPMCMofRelatedPP(context, strProgProjId);\n StringBuffer sbWhereBuffer = new StringBuffer();\n sbWhereBuffer.append(\"(type==\\\"\");\n sbWhereBuffer.append(TigerConstants.TYPE_PSS_CHANGEREQUEST);\n sbWhereBuffer.append(\"\\\"&&current!=\\\"\");\n sbWhereBuffer.append(TigerConstants.STATE_REJECTED_CR);\n sbWhereBuffer.append(\"\\\")\");\n // TIGTK-16801 : 30-08-2018 : END\n\n DomainObject domainObj = DomainObject.newInstance(context, strProgProjId);\n\n MapList mapList = domainObj.getRelatedObjects(context, relationship_pattern.getPattern(), // relationship pattern\n type_pattern.getPattern(), // object pattern\n slselectObjStmts, // object selects\n null, // relationship selects\n false, // to direction\n true, // from direction\n (short) 0, // recursion level\n sbWhereBuffer.toString(), // object where clause\n null, (short) 0, false, // checkHidden\n true, // preventDuplicates\n (short) 1000, // pageSize\n finalType, // Postpattern\n null, null, null);\n\n // TIGTK_3961:Sort CR data according to CR state :23/1/2017:Rutuja Ekatpure:Start\n if (mapList.size() > 0) {\n // return sortCRListByState(context, mapList);\n MapList mlReturn = sortCRListByState(context, mapList);\n\n // PCM2.0 Spr4:TIGTK-6894:19/9/2017:START\n\n Iterator<Map<String, String>> itrCR = mlReturn.iterator();\n while (itrCR.hasNext()) {\n Map tempMap = itrCR.next();\n String strCRId = (String) tempMap.get(DomainConstants.SELECT_ID);\n MapList mlIA = getImpactAnalysis(context, strCRId);\n\n String strIAId = \"\";\n if (!mlIA.isEmpty()) {\n Map mpIA = (Map) mlIA.get(0);\n strIAId = (String) mpIA.get(DomainConstants.SELECT_ID);\n }\n tempMap.put(\"LatestRevIAObjectId\", strIAId);\n // TIGTK-16801 : 30-08-2018 : START\n tempMap.put(\"bAdminOrPMCMEditAllow\", bAdminOrPMCMEditAllow);\n // TIGTK-16801 : 30-08-2018 : END\n }\n return mlReturn;\n // PCM2.0 Spr4:TIGTK-6894:19/9/2017:END\n\n } else {\n return mapList;\n }\n // TIGTK_3961:Sort CR data according to CR state :23/1/2017:Rutuja Ekatpure:End\n\n } catch (Exception ex) {\n logger.error(\"Error in getActiveCRs: \", ex);\n throw ex;\n }\n }", "public Set<CertificateInfo> getLoadedCertificates() throws GeneralSecurityException, IOException {\n Set<CertificateInfo> certificates = new HashSet<>();\n for (SSLConfiguration config : this.getLoadedSSLConfigurations()) {\n certificates.addAll(config.getDefinedCertificates(env));\n }\n return certificates;\n }", "@java.lang.Override\n public boolean hasCatalog() {\n return catalog_ != null;\n }", "public List<CMCourse> getCMCourses(String startsWith) {\r\n\tlong start = System.currentTimeMillis();\r\n\tlog.debug(\"getCMCourses that starts with \" + startsWith);\r\n\tList<CMCourse> cmCourses = new ArrayList<CMCourse>();\r\n\tSet<CourseSet> courseSets = courseManagementService.getCourseSets();\r\n\tSet<CourseOffering> courseOffs = null;\r\n\tSet<Section> sections = null;\r\n\tCourseSet courseSet = null;\r\n\tCourseOffering courseOff = null;\r\n\tString courseOffEid = null;\r\n\tSection courseS = null;\r\n\tif (courseSets == null)\r\n\t return null;\r\n\tList<AcademicSession> acadSessions =\r\n\t\tcourseManagementService.getCurrentAcademicSessions();\r\n\tDate endDate = null;\r\n\tDate startDate = null;\r\n\r\n\tfor (AcademicSession acadSession : acadSessions) {\r\n\r\n\t for (Iterator<CourseSet> cSets = courseSets.iterator(); cSets\r\n\t\t .hasNext();) {\r\n\t\tcourseSet = cSets.next();\r\n\t\tcourseOffs =\r\n\t\t\tcourseManagementService.findCourseOfferings(\r\n\t\t\t\tcourseSet.getEid(), acadSession.getEid());\r\n\t\tfor (Iterator<CourseOffering> cOffs = courseOffs.iterator(); cOffs\r\n\t\t\t.hasNext();) {\r\n\t\t courseOff = cOffs.next();\r\n\t\t courseOffEid = courseOff.getEid();\r\n\t\t sections =\r\n\t\t\t courseManagementService.getSections(courseOffEid);\r\n\t\t if (courseOffEid.startsWith(startsWith)) {\r\n\t\t\tfor (Iterator<Section> cSs = sections.iterator(); cSs\r\n\t\t\t\t.hasNext();) {\r\n\t\t\t courseS = cSs.next();\r\n\t\t\t String courseTitle =\r\n\t\t\t\t courseManagementService.getCanonicalCourse(\r\n\t\t\t\t\t courseOff.getCanonicalCourseEid())\r\n\t\t\t\t\t .getTitle();\r\n\t\t\t String courseSId = courseS.getEid();\r\n\t\t\t String session =\r\n\t\t\t\t courseOff.getAcademicSession().getTitle();\r\n\t\t\t String sigle = courseOff.getCanonicalCourseEid();\r\n\t\t\t String section =\r\n\t\t\t\t (SHARABLE_SECTION.equals(courseSId\r\n\t\t\t\t\t .substring(courseSId.length() - 2,\r\n\t\t\t\t\t\t courseSId.length()))) ? SHARABLE_SECTION\r\n\t\t\t\t\t : courseSId.substring(\r\n\t\t\t\t\t\t courseSId.length() - 3,\r\n\t\t\t\t\t\t courseSId.length());\r\n\r\n\t\t\t String instructorsString = \"\";\r\n\t\t\t int studentNumber = -1;\r\n\t\t\t EnrollmentSet enrollmentSet =\r\n\t\t\t\t courseS.getEnrollmentSet();\r\n\t\t\t if (enrollmentSet != null) {\r\n\t\t\t\t// Retrieve official instructors\r\n\t\t\t\tSet<String> instructors =\r\n\t\t\t\t\tenrollmentSet.getOfficialInstructors();\r\n\t\t\t\tUser user = null;\r\n\t\t\t\tString name = null;\r\n\t\t\t\tfor (String instructor : instructors) {\r\n\t\t\t\t try {\r\n\t\t\t\t\tuser =\r\n\t\t\t\t\t\tuserDirectoryService\r\n\t\t\t\t\t\t\t.getUserByEid(instructor);\r\n\t\t\t\t\tname = user.getDisplayName();\r\n\t\t\t\t\tinstructorsString += name + \" & \";\r\n\t\t\t\t } catch (UserNotDefinedException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t }\r\n\t\t\t\t}\r\n\t\t\t\t// retrieve student number\r\n\t\t\t\tSet<Enrollment> enrollments =\r\n\t\t\t\t\tcourseManagementService\r\n\t\t\t\t\t\t.getEnrollments(enrollmentSet\r\n\t\t\t\t\t\t\t.getEid());\r\n\t\t\t\tif (enrollments != null)\r\n\t\t\t\t studentNumber = enrollments.size();\r\n\t\t\t }\r\n\t\t\t if (!instructorsString.equals(\"\"))\r\n\t\t\t\tinstructorsString =\r\n\t\t\t\t\tinstructorsString.substring(0,\r\n\t\t\t\t\t\tinstructorsString.length() - 3);\r\n\r\n\t\t\t CMCourse cmCourse = new CMCourse();\r\n\t\t\t cmCourse.setId(courseS.getEid());\r\n\t\t\t cmCourse.setSession(session);\r\n\t\t\t cmCourse.setName(courseTitle);\r\n\t\t\t cmCourse.setSigle(sigle);\r\n\t\t\t cmCourse.setSection(section);\r\n\t\t\t cmCourse.setInstructor(instructorsString);\r\n\t\t\t cmCourse.setStudentNumber(studentNumber);\r\n\t\t\t cmCourses.add(cmCourse);\r\n\t\t\t}\r\n\t\t }\r\n\t\t}\r\n\t }\r\n\t}\r\n\tlog.debug(\"getCMCourses \" + elapsed(start) + \" for \" + cmCourses.size()\r\n\t\t+ \" courses\");\r\n\treturn cmCourses;\r\n }", "public String getCourses() throws CustomExceptions.InvalidInputException {\n Collections.sort(courses);\n StringBuilder builder = new StringBuilder();\n if (!courses.isEmpty()) {\n for (CurriculumItem course : courses) {\n builder.append(String.format(\"|--[%1s] %13s -----|\\n\",\n getCurriculumItemCompletionStatus(course),\n Manipulators.getCurriculumItemAsShortString(course)));\n }\n } else {\n return \"No courses found for Academic Term: \" + name;\n }\n return builder.toString();\n }", "private void performShowCertCommand(String[] args) throws Exception {\n int i = 1;\n X509Certificate c;\n boolean listAll = false;\n\n try {\n for (i = 1; i < args.length; i++) {\n\n if (args[i].equals(\"-encoding\")) {\n encoding = args[++i];\n } else if (args[i].equals(\"-certnum\")) {\n certnum = args[++i];\n } else if (args[i].equals(\"-chainnum\")) {\n chainNum = args[++i];\n } else if (args[i].equals(\"-all\")) {\n listAll = true;\n } else if (args[i].equals(\"-inputjad\")) {\n infile = args[++i];\n } else {\n usageError(\"Illegal option for \" + command +\n \": \" + args[i]);\n }\n }\n } catch (ArrayIndexOutOfBoundsException aiobe) {\n usageError(\"Missing value for \" + args[--i]);\n }\n\n if (listAll && (chainNum != null || certnum != null)) {\n usageError(\"-all cannot be used with -certnum or -chainnum\");\n }\n\n // these methods will check for the presence of the args they need\n checkCertAndChainNum();\n initJadUtil();\n\n if (listAll) {\n Vector certs = appdesc.getAllCerts();\n\n if (certs.size() == 0) {\n System.out.println(\"\\nNo certificates found in JAD.\\n\");\n return;\n }\n\n System.out.println();\n\n for (i = 0; i < certs.size(); i++) {\n Object[] temp = (Object[])certs.elementAt(i);\n\n System.out.println((String)temp[AppDescriptor.KEY] + \":\");\n\n displayCert((X509Certificate)temp[AppDescriptor.CERT]);\n }\n\n return;\n }\n\n try {\n c = appdesc.getCert(chainIndex, certIndex);\n } catch (Exception e) {\n throw new Exception(\"-showcert failed: \" + e.toString());\n }\n\n if (c == null) {\n throw new Exception(\"Certificate \" + chainIndex + \"-\" +\n certIndex + \" not in JAD\");\n }\n\n try {\n displayCert(c);\n return;\n } catch (Exception e) {\n throw new Exception(\"-showcert failed: \" + e.toString());\n }\n }", "List<CatalogItem> getAllCatalogItems();", "public Object[] getCompInfo() {\n\t\tObject comp[] = new Object[2];\n\t\tcomp[0] = \"IBM\";\n\t\tcomp[1] = 1000;\n\t\t\n\t\treturn comp;\n\t}", "public ObservableList<CatalogPres> getCatalogList() {\n\t\t\n\t\treturn readCatalogsFromDataSource();\n\t\t\n\t}", "public java.lang.String getStrCatalog()\n\t{\n\t\treturn strCatalog;\n\t}", "private void getCourseList(){\r\n\r\n CourseDAO courseDAO = new CourseDAO(Statistics.this);\r\n List<Course> courseList= courseDAO.readListofCourses();\r\n for(Course course: courseList) {\r\n courses.add(course.getName());\r\n }\r\n\r\n }", "public List getDescriptions() {\n return descriptions;\n }", "List<X509Cert> caCerts(String caName, ReqRespDebug debug) throws CmpClientException, PkiErrorException;", "List<CodeCategory> getCodeCategories(boolean retrieveCodes)\n throws DAOException;", "private static List<String> checkInstallCertificates(){\n\t\tList<String> output = new ArrayList<>();\n\t\ttry {\n\t\t\t\n\t\t\tString cmd = currentDir + scriptDir + \"checkInstallCertificate.sh\";\n\t\t\tProcess p = Runtime.getRuntime().exec(cmd);\n\t\t\tList<String> lines = readOutput(p);\n\t\t\toutput = checkOutputLong(lines);\n\t\t\t\n\t\t\treturn output;\n\n\t\t}catch (Exception ex){\n\t\t\tex.printStackTrace();\n\t\t}\t\n\t\treturn output;\n\t}", "public List<String> getAllEnabledCourierCode();", "public List<Application> getVisibleApplications() {\n return null;\r\n }", "java.util.List<liubaninc.m0.pki.CertificatesOuterClass.Certificates> \n getCertificatesList();", "java.util.List<liubaninc.m0.pki.CertificatesOuterClass.Certificates> \n getCertificatesList();", "public CourseCatalog receiveAllCourses() {\n\t\tCourseCatalog receiveCourses = null;\n\t\ttry{\n\t\t\tsendMessage(\"getAllCourses\");\n\t\t\t\n\t\t\treceiveCourses = (CourseCatalog)socketObjectIn.readObject();\n\t\t}catch (ClassNotFoundException e){\n\t\t\tSystem.err.println(e.getStackTrace());\n\t\t}catch (IOException e) {\n\t\t\tSystem.err.println(e.getStackTrace());\n\t\t}\n\t\treturn receiveCourses;\n\t}", "public void printNotfullcourses() {\n\t\tfor (int i = 0; i < CourseManager.courses.size(); i++) {\n\t\t\tif (CourseManager.courses.get(i).checkFull() == false) {\n\t\t\t\tSystem.out.println(i + 1 + \". \" + CourseManager.courses.get(i).getName());\n\t\t\t}\n\t\t}\n\t}", "public CatalogDescription getLastVersionCatalogDescription(String courseId);", "@RequestMapping(path = \"/v1/certificates\", method = RequestMethod.GET)\n public ResponseEntity<Object> getCertificates(@RequestParam(\"ag\") String assetGroup) {\n if (Strings.isNullOrEmpty(assetGroup)) {\n return ResponseUtils.buildFailureResponse(new Exception(ASSET_MANDATORY));\n }\n OutputDTO output = null;\n try {\n output = new OutputDTO(complianceService.getCertificates(assetGroup));\n } catch (ServiceException e) {\n return complianceService.formatException(e);\n }\n return ResponseUtils.buildSucessResponse(output);\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic List<Certificate> getAllCertificate() {\n\n\t\tTransaction transaction = null;\n\t\tList<Certificate> listOfCertificate = null;\n\t\ttry (Session session = HibernateUtil.getSessionFactory().openSession()) {\n\t\t\t// start a transaction\n\t\t\ttransaction = session.beginTransaction();\n\t\t\t// get an certificate object\n\t\t\t\n\t\t\tlistOfCertificate = session.createQuery(\"from Certificate\").getResultList();\n\t\t\t\n\t\t\t// commit transaction\n\t\t\ttransaction.commit();\n\t\t} catch (Exception e) {\n\t\t\tif (transaction != null) {\n\t\t\t\ttransaction.rollback();\n\t\t\t}\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn listOfCertificate;\n\t}", "public ArrayList<String> getRequestedCourses()\n\t{\n\t\treturn requestedCourses;\n\t}", "private void printAllCourseInDB(){\n\n System.out.println(\"--------------------------------------------------------------------------------------\");\n System.out.println(\"COURSE SCHOOL AU INDEX SLOT TYPE DAY TIME\");\n System.out.println(\"--------------------------------------------------------------------------------------\");\n ArrayList<String> courseIDList = courseMgr.readAllCourseIDFromDB();\n for(String courseID: courseIDList){\n System.out.print(String.format(\"%6s \", courseID));\n Course course = courseMgr.readCourseByID(courseID);\n System.out.print(String.format(\"%5s \", course.getSchool()));\n int j = 0;\n for(CourseIndex courseIndex:course.getCourseIndices()){\n if (j==0)\n System.out.print(String.format(\" %d \", courseIndex.getAu()));\n else\n System.out.print(String.format(\" \", courseIndex.getAu()));\n System.out.print(String.format(\"%6s \", courseIndex.getIndex()));\n System.out.print(String.format(\"%3d \", courseIndex.getSlot()));\n int i = 0;\n for (CourseCompo courseCompo : courseIndex.getCourseCompos()){\n if(i==0){\n System.out.print(String.format(\"%3s \", courseCompo.getCompoType()));\n System.out.print(String.format(\"%3s \", courseCompo.getDay()));\n System.out.println(String.format(\"%3s \", courseCompo.getTimeSlot()));\n }\n else{\n System.out.print(String.format(\" %3s \", courseCompo.getCompoType()));\n System.out.print(String.format(\"%3s \", courseCompo.getDay()));\n System.out.println(String.format(\"%3s \", courseCompo.getTimeSlot()));\n }\n i++;\n }\n j++;\n System.out.println(\"\");\n }\n }\n\n System.out.println(\"--------------------------------------------------------------------------------------\\n\");\n }", "public boolean isProgramActive(String programId);", "WinningCombination getDescription();", "private void testAccessibleDescription(Component comp, AccessibleContext comp_AC) {\n String desc = comp_AC.getAccessibleDescription();\n \n // LOG ONLY -/\n if(debugLog) System.err.println(LOG_CAPTION+\" - <testAccessibleDescription()> - accessibleDescription=\"+desc);\n \n if (testSettings.AP_accessibleDescription && (desc == null)){\n noDesc.add(comp);\n }\n }", "boolean hasDescription();", "boolean hasDescription();", "boolean hasDescription();", "public Vector<CourseSubject> getCourses() throws IOException{\n\n\t\tVector<CourseSubject> coursesVector = new Vector<CourseSubject>();\t\n\t\tString sourceLine = \"\";\n\t\tString content = \"\";\t\n\t\t\n\t\tInputStreamReader pageInput = new InputStreamReader(address.openStream());\n\t\tBufferedReader source = new BufferedReader(pageInput);\n\t\twhile( (sourceLine = source.readLine()) != null){\n\t\t\tcontent += sourceLine + \"\\n\";\n\t\t}\n\t\tPattern style = null;\n\t\tPattern p = null;\n\t\tString regex0 = \"\";\t\t// required for the split\n\t\tString regex1 = \"\";\t\t// required for the split\n\t\t\n\t\tswitch (flag) {\t// dependent on different schools\n \tcase 0:\n \t\tregex0 = \"<div class=\\\"ws-course-title\\\"><a href.*?>\";\n \t\tstyle = Pattern.compile(\"<div class=\\\"ws-course-title\\\"><a href.*?>.*?</a></div>\");\n \t\tp = Pattern.compile(\"<a href=\\\".*?skinId=2169\\\">\");\n \t\tregex1 = \"</a></div>\";\n \tbreak;\n }\n\t\t\n\n Matcher mstyle = style.matcher(content);\n String address = null;\n Matcher pstyle = null;\n if( p != null)\n \tpstyle = p.matcher(content);\n \n String tag = \"\";\n String[] str = null;\n // need to change counter for Stanford mstyle has more values then pstyle\n int counter = 0;\n boolean done = false;\n while (mstyle.find() ){\n \tdone = pstyle.find();\n \ttag = mstyle.group();\n \tstr = tag.split(regex0, 3);\n \tif(str.length != 1)\n \t\tstr = str[str.length-1].split(regex1, 3);\t\t// str[0] holds the name of the course\n \tCourseSubject courseSub = new CourseSubject(str[0], null);\t\t// no subclasses yet.\n \t\n \tif(flag == 3){\t\t// for berkeley\n \t\taddress = str[0].trim().replace(' ', '+');\n \t\taddress = cleanURL(address, flag);\n \t}\n \telse{\n \t\tif(flag == 2 && (counter < 9 || !done) )\t// done for stanford\n \t\t\taddress = \"http://www.fail.com\";\t// fail this will be removed in linkedcoursesApp\n \t\telse\n \t\t\taddress = pstyle.group();\n \t\taddress = cleanURL(address, flag);\n \t}\n \tcourseSub.setURL(new URL(address));\n \t\n \tcoursesVector.add(courseSub);\n \tcounter++;\n }\n \n\t\tpageInput.close();\n\t\tsource.close();\n\t\treturn coursesVector;\n\t}", "public void courseInfo() {\n\t\tList<Course> unfinishedCourses = super.getUnfinishedCourses();\n\t\tList<Course> finishedCourses = super.getFinishedCourses();\n\n\t\tString retStr = \"Unfinished Courses: \";\n\t\tfor (int i = 0; i < unfinishedCourses.size(); i++) {\n \tretStr += unfinishedCourses.get(i);\n \tif (i != unfinishedCourses.size()-1) {\n\t\t\t\tretStr += \", \";\n \t}\n\t\t}\n\t\tretStr += \"\\nFinished Courses: \";\n\t\tfor (int i = 0; i < finishedCourses.size(); i++) {\n \tretStr += finishedCourses.get(i);\n \tif (i != finishedCourses.size()-1) {\n\t\t\t\tretStr += \", \";\n \t}\n\t\t}\n\t\tretStr += \"\\nHP: \" + this.hp;\n\t\tSystem.out.println(retStr);\n\t}", "public java.util.List<com.ms3.training.services.model.Course> findAll()\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;", "@RequestMapping(value = \"/staff/calist\")\n\tpublic ModelAndView listCA(@RequestParam(required = false) Integer page, @RequestParam(required = false) Integer pageSize, HttpSession session) {\n\t\tif (page == null) {\n\t\t\tpage = 0;\n\t\t}\n\t\t\n\t\tPagedListHolder<CourseAvailability> resultList = (PagedListHolder<CourseAvailability>) session.getAttribute(\"StaffController_CAList\");\n\t\tif (resultList == null) {\n\t\t\tresultList = new PagedListHolder<CourseAvailability>(caService.getAllCAs());\n\t\t\tsession.setAttribute(\"StaffController_CAList\", resultList);\n\t\t\tif (pageSize == null) {\n\t\t\t\tpageSize = DEFAULT_PAGE_SIZE;\n\t\t\t}\n\t\t}\n\t\tif (pageSize != null) {\n\t\t\tresultList.setPageSize(pageSize);\n\t\t}\n\t\tresultList.setPage(page);\n\t\treturn new ModelAndView(\"staff/calist\", \"resultList\", resultList);\n\t}", "@Override public String toString() {\n Lookup.Template template = new Lookup.Template<CatalogReader>(CatalogReader.class);\n Lookup.Result result = getUserCatalogsLookup().lookup(template); \n return \"CatalogSettings[ global-scope: \" + result.allInstances() + \n \", project-scope: \" + mountedCatalogs + \" ]\";\n }", "public ArrayList getCourses();", "public interface CatalogDescriptionDao {\r\n\r\n public void init();\r\n\r\n /**\r\n * Return a catalog description based on the database id\r\n * \r\n * @param id - the database id of the catalog description\r\n * @return - the CatalogDescription\r\n */\r\n public CatalogDescription getCatalogDescription(Long id);\r\n \r\n /**\r\n * Return the active catalog description based on the course id\r\n * \r\n * @param id - the course id of the catalog description\r\n * @return - the last version of the CatalogDescription\r\n */\r\n public CatalogDescription getCatalogDescription(String course_id);\r\n\r\n /**\r\n * Return the last version of a catalog description based on the course id\r\n * \r\n * @param id - the course id of the catalog description\r\n * @return - the last version of the CatalogDescription (null if nothing is found)\r\n */\r\n public CatalogDescription getLastVersionCatalogDescription(String courseId);\r\n\r\n \r\n /**\r\n * Return active catalog descriptions that correspond to the given department\r\n * (can be null for all)\r\n * \r\n * @return - the list of CatalogDescription\r\n */\r\n public List<CatalogDescription> getCatalogDescriptionsByDepartment(String department);\r\n \r\n /**\r\n * Return active catalog descriptions that correspond to the given department with flag to indicate if we return or not inactive catalog descriptions \r\n */\r\n public List<CatalogDescription> getCatalogDescriptionsByDepartment(String department, boolean showInactives);\r\n \r\n \r\n /**\r\n * Return active catalog descriptions that correspond to the given academic career\r\n * (can be null for all)\r\n * \r\n * @return - the list of CatalogDescription\r\n */\r\n public List<CatalogDescription> getCatalogDescriptionsByCareer(String career);\r\n \r\n /**\r\n * Return active catalog descriptions that correspond to the given academic career with flag to indicate if we return or not inactive catalog descriptions\r\n */\r\n public List<CatalogDescription> getCatalogDescriptionsByCareer(String career, boolean showInactives);\r\n \r\n \r\n /**\r\n * Return all active catalog descriptions for certificates programs\r\n * (can be null for all)\r\n * \r\n * @return - the list of CatalogDescription\r\n */\r\n \r\n public List<CatalogDescription> getAllCatalogDescriptionsForCertificate();\r\n \r\n /**\r\n * Return all active catalog descriptions for certificates programs with flag to indicate if we return or not inactive catalog descriptions\r\n */\r\n \r\n public List<CatalogDescription> getAllCatalogDescriptionsForCertificate(boolean showInactives);\r\n \r\n \r\n /**\r\n * Return active catalog descriptions that correspond to the given criteria map\r\n * (can be null for all)\r\n * \r\n * @return - the list of CatalogDescription\r\n */\r\n public List<CatalogDescription> getCatalogDescriptions(Map<String, String> eqCriteria, Map<String, String> searchCriteria);\r\n\r\n /**\r\n * save the catalog description to the database\r\n * \r\n * @param cd - the catalog description to save\r\n * @throws StaleDataException\r\n * @throws DatabaseException\r\n */\r\n public void saveCatalogDescription(CatalogDescription cd)\r\n\t throws StaleDataException, DatabaseException;\r\n\r\n /**\r\n * Return a list of Course id (used by quartz job to determine if the catalog description is already created)\r\n * \r\n * @return - the list of Course id\r\n */\r\n public List<String> getListCourseId();\r\n \r\n \r\n /** \r\n * @return all active catlog descriptions\r\n */\r\n public List<CatalogDescription> getAllCatalogDescriptions();\r\n \r\n \r\n /**\r\n * Set all catalog description to \"inactive\" status\r\n * \r\n */\r\n public void setCatalogDescriptionToInactive();\r\n \r\n /**\r\n * Get catalog description from department that have no description and which are not certificate courses\r\n * \r\n */\r\n public List<CatalogDescription> getCatalogDescriptionsByDepartmentWithNoDescription(String department);\r\n \r\n \r\n /**\r\n * Get catalog description for certificates courses that have no description\r\n * \r\n */\r\n public List<CatalogDescription> getAllCatalogDescriptionsForCertificatesWithNoDescription();\r\n \r\n /**\r\n * Get all departments that have at least one catalog description with an empty description\r\n * \r\n */\r\n public List<String> getDepartmentNameWithAtLeastOneCaWithNoDescription();\r\n \r\n \r\n /**\r\n * return whether or not the specified Catalog Description exists.\r\n * \r\n * @param course_id - the course_id of the catalog description\r\n * @return true if the catalog description exists, false otherwise\r\n */\r\n public boolean descriptionExists(String course_id);\r\n}", "public ArrayList <Course> getCourseList ()\n\n {\n\n // Returns courseList when called.\n return courseList;\n\n }", "boolean hasPageCategoryDescription();", "boolean isSetDesc();", "public Certificate[] getLocalCertificates() {\n/* 185 */ return this.delegate.getLocalCertificates();\n/* */ }", "public HashMap<String, JSONObject> getListPrograms();", "@Override\n\t\tpublic List<Customer> ViewPendingApplications() {\n\t\t\treturn null;\n\t\t}", "public ArrayList getDescription() {\n return descriptionArray;\n }", "public ArrayList<Concert> getConcertList(){\n return concertList;\n }", "public List<Course> getAllCourses() {\n return allCourses;\n }", "public boolean hasCertificates() {\n return certificates_ != null;\n }", "public boolean hasCertificates() {\n return certificates_ != null;\n }", "java.util.List<liubaninc.m0.pki.CertificateOuterClass.Certificate> \n getCertificateList();", "Catalog getCatalog();", "Catalog getCatalog();", "public ArrayList<String> getExemptionCoursesList() {\r\n\t\treturn exemptionCoursesList;\r\n\t}", "public static String getCatalogTitleList(Connection con, loginProfile prof, WizbiniLoader wizbini)\n throws SQLException, cwSysMessage{\n boolean checkStatus = false;\n aeCatalog cat = new aeCatalog();\n String xml = null;\n try{\n xml = cat.getTitleListAsXML(con, prof, checkStatus, null, wizbini);\n }catch(qdbException e){\n throw new SQLException(e.getMessage());\n }\n return xml;\n }", "@Override\n\tpublic List<Course> findAllCourses() {\n\t\tList<Course> list = cd.findAllCourses();\n\t\tif (null == list)\n\t\t\tlist = new ArrayList<Course>();\n\t\treturn list;\n\t}", "public java.util.List<vn.com.ecopharma.hrm.rc.model.Certificate> findAll()\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;", "public String getCourseDesc() {\n return courseDesc;\n }", "public String getDescs() {\n return descs;\n }", "public default Collection<String> getDescription()\r\n\t{\r\n\t\treturn new ArrayList<String>();\r\n\t}", "public List<String> iterateProgramPageList();", "List<AlgCollation> getCollationList();", "public List<Models.Course> showCourses() {\n List<Models.Course> results = em.createNativeQuery(\"select cr.* from course cr, courseparticipant cpa, participant p where cr.coursecode = cpa.coursecode and cpa.participantid = p.participantid and p.userid = ?\", Models.Course.class).setParameter(1, user.getUserid()).getResultList();\n\n // Display the output\n String output = \"\";\n\n output = addChat(results.size() + \" courses were found.\");\n\n for (Models.Course course : results) {\n output += \"<div class='result display' onclick=\\\"window.location.href='Course?id=\" + course.getCoursecode() + \"'\\\">\\n\"\n + \" <div class='top'>\\n\"\n + \" <img class='icon' src='https://www.flaticon.com/svg/static/icons/svg/717/717874.svg'>\\n\"\n + \" <div class='text'>\\n\"\n + \" <a class='type'>COURSE</a>\\n\"\n + \" <a class='name'>\" + course.getTitle() + \"</a>\\n\"\n + \" <a class='subname'>\" + course.getCoursecode() + \"</a>\\n\"\n + \" </div>\\n\"\n + \" </div>\\n\"\n + \" </div>\";\n }\n\n servlet.putInJsp(\"result\", output);\n return results;\n }" ]
[ "0.7177681", "0.7007505", "0.6565598", "0.57967454", "0.57276917", "0.5721776", "0.5663379", "0.56564885", "0.5599294", "0.55755883", "0.53477126", "0.52779096", "0.525847", "0.51445055", "0.5119448", "0.5114841", "0.51005375", "0.50693256", "0.50398475", "0.49494192", "0.4949303", "0.49469483", "0.48643184", "0.4814241", "0.47852218", "0.478095", "0.4778448", "0.4778448", "0.47641316", "0.47537106", "0.47294247", "0.4722834", "0.47031325", "0.47030547", "0.46978518", "0.46963856", "0.46906662", "0.468707", "0.46833193", "0.46830422", "0.46725523", "0.46596035", "0.46473712", "0.4646065", "0.46451527", "0.4640888", "0.46402943", "0.46375886", "0.46348867", "0.46240556", "0.46133867", "0.45981812", "0.45897642", "0.45793995", "0.45732802", "0.45732802", "0.45723036", "0.4566764", "0.45617604", "0.4560473", "0.4555999", "0.4555107", "0.4551509", "0.4548857", "0.45395643", "0.45366028", "0.45331925", "0.45331925", "0.45331925", "0.45311487", "0.45168602", "0.45126864", "0.45012087", "0.44998416", "0.44965744", "0.4492298", "0.44911924", "0.4486545", "0.44843954", "0.44774607", "0.44709", "0.4467343", "0.44518462", "0.44505754", "0.4438921", "0.4438422", "0.4438422", "0.44346657", "0.44187525", "0.44187525", "0.44127023", "0.44083273", "0.4404281", "0.4401597", "0.4400463", "0.44003513", "0.43977275", "0.43955836", "0.43842843", "0.4382135" ]
0.74293756
0
Return active catalog descriptions that correspond to the given criteria map (can be null for all)
public List<CatalogDescription> getCatalogDescriptions(Map<String, String> eqCriteria, Map<String, String> searchCriteria);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List getCalendarios(Map criteria);", "public List<Contact> searchContacts(Map<SearchTerm,String> criteria);", "public List getBeneficioDeudaList(Map criteria);", "public void executeProcesarClasificacion(Map criteria);", "public List<CatalogDescription> getCatalogDescriptionsByDepartment(String department, boolean showInactives);", "public abstract List<Course> getByFilter(HashMap<String, String> filter);", "public List getValidarCuvExistencia(Map criteria);", "public String getIndicadorEliminacionCodigoSAC(Map criteria);", "public List getFeriadoZona(Map criteria);", "public List getValidarSapExistencia(Map criteria);", "private Criteria buildActiveCriteria(){\r\n Criteria criteria = new Criteria();\r\n criteria.addEqualTo(KRADPropertyConstants.ACTIVE, true);\r\n\r\n return criteria;\r\n }", "public List<CatalogDescription> getAllCatalogDescriptionsForCertificate(boolean showInactives);", "private SearchRegistryCriteria createCriteria(Map criteriaMap)\n {\n SearchRegistryCriteria criteria = new SearchRegistryCriteria();\n\n Object[] keys = criteriaMap.keySet().toArray();\n for (int i=0; i<keys.length; i++)\n {\n Logger.debug(\n \"[SubmitRegistrySearchAction.createCriteria] Setting field \"+keys[i] +\n \" to \"+criteriaMap.get(keys[i]));\n criteria.setFieldValue((Number)keys[i], criteriaMap.get(keys[i]));\n }\n\n return criteria;\n }", "public List<LocalCentroComercial> consultarLocalesCentroComercialPorParametro(Map<String, String> filtros);", "private Criteria buildCriteria(Map<String, ?> fieldValues) {\r\n Criteria criteria = new Criteria();\r\n for (Iterator i = fieldValues.entrySet().iterator(); i.hasNext();) {\r\n Map.Entry<String, Object> e = (Map.Entry<String, Object>) i.next();\r\n\r\n String key = e.getKey();\r\n Object value = e.getValue();\r\n if (value instanceof Collection) {\r\n criteria.addIn(key, (Collection) value);\r\n } else {\r\n criteria.addEqualTo(key, value);\r\n }\r\n }\r\n\r\n return criteria;\r\n }", "private Criteria buildInactiveCriteria(){\r\n Criteria criteria = new Criteria();\r\n criteria.addEqualTo(KRADPropertyConstants.ACTIVE, false);\r\n\r\n return criteria;\r\n }", "public List getGestionStockList(Map criteria);", "public List<CatalogDescription> getCatalogDescriptionsByDepartment(String department);", "protected Criteria buildActiveCriteria() {\r\n Criteria criteria = new Criteria();\r\n criteria.addEqualTo(KRADPropertyConstants.ACTIVE, true);\r\n\r\n return criteria;\r\n }", "@Override\n\tpublic List<DisplayCriterion> displayDoc(List<Paragraph> ps) {\n\t\tList<DisplayCriterion> displaycriteria = new ArrayList<DisplayCriterion>();\n\t\tint i = 1;\n\t\tfor (Paragraph p : ps) {\n\t\t\tboolean ehrstatus = false;\n\t\t\tDisplayCriterion d = new DisplayCriterion();\n\t\t\tStringBuffer sb = new StringBuffer();\n\t\t\tfor (Sentence s : p.getSents()) {\n\t\t\t\tsb.append(s.getDisplay());\n\t\t\t\tfor (Term t : s.getTerms()) {\n\t\t\t\t\tif (Arrays.asList(GlobalSetting.primaryEntities).contains(t.getCategorey())) {\n\t\t\t\t\t\tehrstatus = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\td.setCriterion(sb.toString());\n\t\t\td.setId(i++);\n\t\t\td.setEhrstatus(ehrstatus);\n\t\t\tdisplaycriteria.add(d);\n\t\t}\n\t\treturn displaycriteria;\n\t}", "public int contarPorCriterio(Map<String, String> filters)\r\n/* 44: */ {\r\n/* 45:95 */ return this.categoriaArticuloServicioDao.contarPorCriterio(filters);\r\n/* 46: */ }", "public List<CatalogDescription> getCatalogDescriptionsByCareer(String career, boolean showInactives);", "public CatalogDescription getCatalogDescription(Long id);", "public List<CatalogDescription> getAllCatalogDescriptionsForCertificate();", "public List getOredCriteria() {\r\n return oredCriteria;\r\n }", "public MdCategoryVCriteria() {\n oredCriteria = new ArrayList<Criteria>();\n }", "private void getCriteriaSaved() {\n try {\n Map<Integer, Criteria> mapCriteria = search.getDataBaseInHashMap();\n for (Integer key : mapCriteria.keySet()) {\n Criteria cri = mapCriteria.get(key);\n frameSearch.getTpDataBase().addRowTableDb(\n (key), mapCriteria.get(key).getNameOwnwe());\n }\n cm = new HashMap<Integer, Criteria>(mapCriteria);\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "List<Accessprofile> listWithCritera(SearchCriteria searchCriteria);", "public List<CatalogDescription> getAllCatalogDescriptionsForCertificatesWithNoDescription();", "public String searchCategoriesByCriteria()\n {\n logger.info(\"**** In searchCategoriesByCriteria in Controller ****\");\n if (category != null && (StringUtils.isNotEmpty(category.getCategoryName()) || StringUtils.isNotEmpty(category.getCategoryDescription())))\n {\n categoryList = categoryService.searchCategoriesByCriteria(category);\n }\n else\n {\n FacesMessage facesMsg = new FacesMessage(FacesMessage.SEVERITY_INFO, Constants.NO_SEARCH_CRITERIA, Constants.NO_SEARCH_CRITERIA);\n FacesContext.getCurrentInstance().getExternalContext().getFlash().setKeepMessages(true);\n FacesContext.getCurrentInstance().addMessage(null, facesMsg);\n }\n return Constants.SEARCH_CATEGORY_VIEW;\n }", "ApplyInfo queryByApplyId(Map<String, Object> map);", "public String getIndicadorHabilitacionRuv(Map criteria);", "public void executeProcesarClasificacionLove(Map criteria);", "public String getCriteria() {\r\n\t\treturn criteria;\r\n\t}", "public List getOredCriteria() {\n return oredCriteria;\n }", "private String getEvidence(String criteriaMet, Map<String, List<Info>> criteria) {\n\t\tString ret = criteriaMet+\" \";\n\t\tString[] crit = criteriaMet.split(\":\");\n\t\t\n\t\tfor(int i=0; i<crit.length; i++) {\n\t\t\tList<Info> info = criteria.get(crit[i]);\n\t\t\tif(info==null) {\n\t\t\t\tSystem.out.println(crit[i] + \" has NO Info\");\n\t\t\t\tSystem.exit(1);\n\t\t\t}\n\t\t\tret += \"<\"+crit[i]+\">\";\n\t\t\t\n\t\t\tint cnt=0;\n\t\t\tfor(Info in : info) {\n\t\t\t\tif(cnt>0) ret += \"~~\";\n\t\t\t\tret += in.docName+\"::\"+in.section+\"::\"+in.concept+\"::\"+in.sentence;\n\t\t\t\tcnt++;\n\t\t\t}\t\n\t\t}\n\t\t\n\t\treturn ret;\n\t}", "@Override\r\n\tpublic final Search searchProducts(\r\n\t\t\tfinal Map<String, List<String>> searchCriteria,\r\n\t\t\tfinal String correlationId) throws BaseException, ServiceException,\r\n\t\t\tAdapterException {\r\n\t\tfinal long startTime = LOGGER.logMethodEntry(correlationId);\r\n\t\tLOGGER.info(\"Request uri map is \" + searchCriteria, correlationId);\r\n\t\tSearch searchList = null;\r\n\t\tif (searchCriteria.containsKey(RequestAttributeConstant.ATTR)) {\r\n\t\t\tfinal String inputParameter = StringUtils\r\n\t\t\t\t\t.collectionToCommaDelimitedString(searchCriteria\r\n\t\t\t\t\t\t\t.get(RequestAttributeConstant.ATTR));\r\n\r\n\t\t\tfinal String[] pipeSeparated = inputParameter.split(\"\\\\|\");\r\n\t\t\tfor (final String pipeSeparatedString : pipeSeparated) {\r\n\t\t\t\tif (pipeSeparatedString\r\n\t\t\t\t\t\t.contains(RequestAttributeConstant.PRICE)) {\r\n\t\t\t\t\tthis.buildPriceRange(searchCriteria, pipeSeparatedString,\r\n\t\t\t\t\t\t\tcorrelationId);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Added this condition to remove dim attribute if its value is false\r\n\t\tif (searchCriteria.containsKey(RequestAttributeConstant.DIM)) {\r\n\t\t\tfinal List<String> dimvalue = searchCriteria\r\n\t\t\t\t\t.get(RequestAttributeConstant.DIM);\r\n\t\t\tif (dimvalue.get(0).equalsIgnoreCase(CommonConstants.FALSE_VALUE)) {\r\n\t\t\t\tsearchCriteria.remove(RequestAttributeConstant.DIM);\r\n\t\t\t}\r\n\t\t}\r\n\t\tfinal Map<String, String> requestMapURI = this.requestParser\r\n\t\t\t\t.processRequestAttribute(searchCriteria, correlationId);\r\n\t\tList<Map<String, String>> resultMap = null;\r\n\t\tfinal EndecaAdapter endecaAdapter = (EndecaAdapter) this.adapterManager\r\n\t\t\t\t.getAdapter();\r\n\t\trequestMapURI.put(EndecaConstants.REFINEMENTS_REQUIRED,\r\n\t\t\t\tCommonConstants.TRUE_VALUE);\r\n\t\t//OPTIONS Parameter to be added in future\r\n\t\tfinal Map<String, List<String>> optionNodes = null;\r\n\t\tresultMap = endecaAdapter.service(requestMapURI, optionNodes, correlationId);\r\n\t\tthis.generateSearchReport(requestMapURI, resultMap);\r\n\t\tLOGGER.debug(\"ResultMap \" + resultMap, correlationId);\r\n\t\tif ((resultMap != null) && (!resultMap.isEmpty())) {\r\n\t\t\tsearchList = this.searchMapper.convertToSearchPojo(resultMap,\r\n\t\t\t\t\tcorrelationId);\r\n\t\t\tLOGGER.info(\"The search list : \"\r\n\t\t\t\t\t+ searchList.getSearchReport().getTotalProducts(),\r\n\t\t\t\t\tcorrelationId);\r\n\t\t}\r\n\r\n\t\tLOGGER.logMethodExit(startTime, correlationId);\r\n\t\treturn searchList;\r\n\t}", "public List getOredCriteria() {\r\n return oredCriteria;\r\n }", "public List getOredCriteria() {\r\n return oredCriteria;\r\n }", "public List getOredCriteria() {\r\n return oredCriteria;\r\n }", "private void generalizeCSACriteria(){\n\t\tArrayList<ServiceTemplate> comps = new ArrayList<ServiceTemplate>() ;\n\t\tArrayList<Criterion> crit = new ArrayList<Criterion>() ;\n\t\t\n\t\tcomps = this.data.getServiceTemplates();\n\t\tcrit = this.data.getCriteria();\n\t\t\n\t\tfor(ServiceTemplate c : comps){\n\t\t\tfor(Criterion cr : crit){\n\t\t\t\ttry {\n\t\t\t\t\tCriterion temp = (Criterion) BeanUtils.cloneBean(cr);\n\t\t\t\t\tc.addCrit(temp);\n\t\t\t\t} catch (IllegalAccessException | InstantiationException | InvocationTargetException | NoSuchMethodException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n\tpublic List<NoticeVO> listCriteria(Criteria cri) {\n\t\treturn sqlSession.selectList(namespace + \".listCriteria\", cri);\r\n\t}", "HashMap<String, String> getAdditionalDescriptions();", "public PayActinfoExample() {\r\n oredCriteria = new ArrayList<Criteria>();\r\n }", "List<Accessprofile> listWithCriteras(List<SearchCriteria> searchCriterias);", "public List getOredCriteria() {\n return oredCriteria;\n }", "public List getOredCriteria() {\n return oredCriteria;\n }", "public List getOredCriteria() {\n return oredCriteria;\n }", "public List getOredCriteria() {\n return oredCriteria;\n }", "public List<CatalogDescription> getCatalogDescriptionsByDepartmentWithNoDescription(String department);", "public List<String> getCategory(SqlSession session, HashMap<String, Object> map) {\r\n\t\treturn session.selectList(\"getCategory\", map);\r\n\t}", "public CardInformationExample() {\n oredCriteria = new ArrayList<Criteria>();\n }", "public GoodsSkuCriteria() {\n oredCriteria = new ArrayList<Criteria>();\n }", "@Override\n public List<OrgInfo> listByAll(HashMap<String, Object> map) {\n return infoMapper.listByAll(map);\n }", "public void setCriterias(Map<String,Boolean> criterias){\n\t\t\tthis.criterias = criterias;\n\t\t}", "public String getLabels() {\n return queryMap.get(Types.FILTER_CRITERIA_LABELS);\n }", "public CatalogDescription getCatalogDescription(String course_id);", "@Test\n public void testCreateListCriteria() throws Exception {\n System.out.println(\"createListCriteria\");\n \n Map<String, String> map = new TreeMap<String,String>();\n map.put(\"1\", \"{\\\"key\\\":{\\\"FunctionalEnvironment\\\":\\\"Production\\\",\\\"Delivery\\\":\\\"***REMOVED***\\\"},\"\n + \"\\\"values\\\":[\\\"Company\\\",\\\"VirtualDC\\\",\\\"Manufacturer\\\"]}\");\n \n map.put(\"2\", \"{\\\"key\\\":{\\\"FunctionalEnvironment\\\":\\\"Production\\\",\\\"Delivery\\\":\\\"***REMOVED***\\\"},\"\n + \"\\\"values\\\":[\\\"Company\\\",\\\"VirtualDC\\\"]}\");\n \n \n \n String expResult1 = \"{\\\"key\\\":{\\\"Delivery\\\":\\\"***REMOVED***\\\",\\\"FunctionalEnvironment\\\":\\\"Production\\\"},\"\n + \"\\\"values\\\":[\\\"Company\\\",\\\"VirtualDC\\\",\\\"Manufacturer\\\"]}\";\n String expResult2 = \"{\\\"key\\\":{\\\"Delivery\\\":\\\"***REMOVED***\\\",\\\"FunctionalEnvironment\\\":\\\"Production\\\"},\"\n + \"\\\"values\\\":[\\\"Company\\\",\\\"VirtualDC\\\"]}\";\n \n \n TreeMap<String,String> key = new TreeMap<>();\n List<String> values =new ArrayList<String>();\n CriteriaFilter instance = new CriteriaFilter(key, values);\n \n List<CriteriaFilter> resultList = instance.createListCriteria(map);\n \n String result1 = \"\";\n String result2 = \"\";\n for (int i = 0 ; i < resultList.size() ; i++){\n result1 = resultList.get(0).toString();\n result2 = resultList.get(1).toString();\n break;\n }\n System.out.println(result1);\n System.out.println(expResult1);\n System.out.println(result2);\n System.out.println(expResult2);\n \n \n \n assertEquals(expResult1, result1);\n assertEquals(expResult2, result2);\n \n }", "public List<CustomerServiceDto> selectInfoListByName(Criteria criteria){\n \treturn tbCustomerServiceMapper.selectInfoListByName(criteria);\n }", "protected Map<String, String> getAssociationFilters(Map<String, String>fieldValues) {\n Map<String, String> associationDetails = new HashMap<String, String>();\n\n for (Iterator<Map.Entry<String, String>> fieldIter = fieldValues.entrySet().iterator(); fieldIter.hasNext(); ) {\n Map.Entry<String, String> field = fieldIter.next();\n if (StringUtils.startsWith(field.getKey(), ASSOC_PREFIX)) {\n fieldIter.remove();\n //add the associated filter to the result ONLY if it contains some value\n if (!StringUtils.isEmpty(field.getValue())) {\n associationDetails.put(field.getKey().replaceFirst(ASSOC_PREFIX + \".\", \"\"), field.getValue());\n }\n }\n }\n\n return associationDetails;\n }", "@Override\n public List<? extends BusinessObject> getSearchResults(Map<String, String> parameters) {\n if (parameters.containsKey(KFSPropertyConstants.CLOSED)) {\n final String closedValue = parameters.get(KFSPropertyConstants.CLOSED);\n\n if (closedValue != null && closedValue.length() != 0) {\n if (\"Y1T\".indexOf(closedValue) > -1) {\n parameters.put(KFSPropertyConstants.ACTIVE, \"N\");\n }\n else if (\"N0F\".indexOf(closedValue) > -1) {\n parameters.put(KFSPropertyConstants.ACTIVE, \"Y\");\n }\n }\n\n parameters.remove(KFSPropertyConstants.CLOSED);\n }\n return super.getSearchResults(parameters);\n }", "List<Basicinfo> selectByExample(BasicinfoCriteria example);", "@TransactionAttribute(TransactionAttributeType.REQUIRED)\r\n public java.util.Collection findCuentasPorCobrarByQuery(Map aMap) {\r\n\t\treturn queryManagerLocal.singleClassQueryList(CuentasPorCobrarEJB.class, aMap); \r\n }", "@Override\n\tpublic List<VideoInfo> categoryVideos(Map<String,Object> map) {\n\t\treturn dao.getAboutVideos(map);\n\t}", "private void loadCriteriaList() {\n DataBaseManager DBM = new DataBaseManager();\n criteriaList = DBM.loadCriteriaList(pantallaIdentificacion.this);\n }", "@Override\n\tpublic LinkedHashMap<String,Object> output()\n\t{\n\t\t\n\t\treturn this._criteria;\n\t\t\n\t}", "public void setCriteria(String criteria) {\r\n\t\tthis.criteria = criteria;\r\n\t}", "public interface CatalogDescriptionDao {\r\n\r\n public void init();\r\n\r\n /**\r\n * Return a catalog description based on the database id\r\n * \r\n * @param id - the database id of the catalog description\r\n * @return - the CatalogDescription\r\n */\r\n public CatalogDescription getCatalogDescription(Long id);\r\n \r\n /**\r\n * Return the active catalog description based on the course id\r\n * \r\n * @param id - the course id of the catalog description\r\n * @return - the last version of the CatalogDescription\r\n */\r\n public CatalogDescription getCatalogDescription(String course_id);\r\n\r\n /**\r\n * Return the last version of a catalog description based on the course id\r\n * \r\n * @param id - the course id of the catalog description\r\n * @return - the last version of the CatalogDescription (null if nothing is found)\r\n */\r\n public CatalogDescription getLastVersionCatalogDescription(String courseId);\r\n\r\n \r\n /**\r\n * Return active catalog descriptions that correspond to the given department\r\n * (can be null for all)\r\n * \r\n * @return - the list of CatalogDescription\r\n */\r\n public List<CatalogDescription> getCatalogDescriptionsByDepartment(String department);\r\n \r\n /**\r\n * Return active catalog descriptions that correspond to the given department with flag to indicate if we return or not inactive catalog descriptions \r\n */\r\n public List<CatalogDescription> getCatalogDescriptionsByDepartment(String department, boolean showInactives);\r\n \r\n \r\n /**\r\n * Return active catalog descriptions that correspond to the given academic career\r\n * (can be null for all)\r\n * \r\n * @return - the list of CatalogDescription\r\n */\r\n public List<CatalogDescription> getCatalogDescriptionsByCareer(String career);\r\n \r\n /**\r\n * Return active catalog descriptions that correspond to the given academic career with flag to indicate if we return or not inactive catalog descriptions\r\n */\r\n public List<CatalogDescription> getCatalogDescriptionsByCareer(String career, boolean showInactives);\r\n \r\n \r\n /**\r\n * Return all active catalog descriptions for certificates programs\r\n * (can be null for all)\r\n * \r\n * @return - the list of CatalogDescription\r\n */\r\n \r\n public List<CatalogDescription> getAllCatalogDescriptionsForCertificate();\r\n \r\n /**\r\n * Return all active catalog descriptions for certificates programs with flag to indicate if we return or not inactive catalog descriptions\r\n */\r\n \r\n public List<CatalogDescription> getAllCatalogDescriptionsForCertificate(boolean showInactives);\r\n \r\n \r\n /**\r\n * Return active catalog descriptions that correspond to the given criteria map\r\n * (can be null for all)\r\n * \r\n * @return - the list of CatalogDescription\r\n */\r\n public List<CatalogDescription> getCatalogDescriptions(Map<String, String> eqCriteria, Map<String, String> searchCriteria);\r\n\r\n /**\r\n * save the catalog description to the database\r\n * \r\n * @param cd - the catalog description to save\r\n * @throws StaleDataException\r\n * @throws DatabaseException\r\n */\r\n public void saveCatalogDescription(CatalogDescription cd)\r\n\t throws StaleDataException, DatabaseException;\r\n\r\n /**\r\n * Return a list of Course id (used by quartz job to determine if the catalog description is already created)\r\n * \r\n * @return - the list of Course id\r\n */\r\n public List<String> getListCourseId();\r\n \r\n \r\n /** \r\n * @return all active catlog descriptions\r\n */\r\n public List<CatalogDescription> getAllCatalogDescriptions();\r\n \r\n \r\n /**\r\n * Set all catalog description to \"inactive\" status\r\n * \r\n */\r\n public void setCatalogDescriptionToInactive();\r\n \r\n /**\r\n * Get catalog description from department that have no description and which are not certificate courses\r\n * \r\n */\r\n public List<CatalogDescription> getCatalogDescriptionsByDepartmentWithNoDescription(String department);\r\n \r\n \r\n /**\r\n * Get catalog description for certificates courses that have no description\r\n * \r\n */\r\n public List<CatalogDescription> getAllCatalogDescriptionsForCertificatesWithNoDescription();\r\n \r\n /**\r\n * Get all departments that have at least one catalog description with an empty description\r\n * \r\n */\r\n public List<String> getDepartmentNameWithAtLeastOneCaWithNoDescription();\r\n \r\n \r\n /**\r\n * return whether or not the specified Catalog Description exists.\r\n * \r\n * @param course_id - the course_id of the catalog description\r\n * @return true if the catalog description exists, false otherwise\r\n */\r\n public boolean descriptionExists(String course_id);\r\n}", "public List<Criterion> getCriteria() {\n\t return criteria;\n\t }", "@Override\n\tpublic Map<String, Object> getSectInfo(Map<String, Object> requestMap) {\n\t\tMap<String,Object> responseMap = new HashMap<>();\n\t\tVoteSectInfoExample voteSectInfoExample = new VoteSectInfoExample();\n\t\tCriteria criteria = voteSectInfoExample.createCriteria();\n\t\tif (!StringUtils.isEmpty((String)requestMap.get(\"sectName\"))){\n\t\t\tcriteria.andSectNameLike((String)requestMap.get(\"sectName\"));\n\t\t}\n\t\tvoteSectInfoExample.setOrderByClause(\"sect_name asc\");\n\t\tList<VoteSectInfo> list = voteSectInfoMapper.selectByExample(voteSectInfoExample);\n\t\tresponseMap.put(\"listInfo\", list);\n\t\tresponseMap.put(\"status\", true);\n\t\treturn responseMap;\n\t}", "public void filterBy(Map<String, List<String>> queryMap) {\n }", "@Override\r\n\tpublic List<CompanyBoardVO> scrolllistSearchCriteria(Map<String, String> map) throws Exception{\n\t\treturn dao.scrolllistSearchCriteria(map);\r\n\t}", "public List getOredCriteria() {\r\n\t\treturn oredCriteria;\r\n\t}", "public List getOredCriteria() {\r\n\t\treturn oredCriteria;\r\n\t}", "public List getOredCriteria() {\r\n\t\treturn oredCriteria;\r\n\t}", "public List<Criteria> getOredCriteria() {\n return oredCriteria;\n }", "public java.lang.String getCriteria () {\n\t\treturn criteria;\n\t}", "Map<Long, List<String>> retrieveCategoriesForTargetTable(TargetTable ttable);", "public List<Criteria> getOredCriteria() {\r\n return oredCriteria;\r\n }", "public List<Criteria> getOredCriteria() {\r\n return oredCriteria;\r\n }", "public List<Criteria> getOredCriteria() {\r\n return oredCriteria;\r\n }", "public List<Criteria> getOredCriteria() {\r\n return oredCriteria;\r\n }", "public List<Criteria> getOredCriteria() {\r\n return oredCriteria;\r\n }", "public List<Criteria> getOredCriteria() {\r\n return oredCriteria;\r\n }", "public List<Criteria> getOredCriteria() {\r\n return oredCriteria;\r\n }", "public List<Criteria> getOredCriteria() {\r\n return oredCriteria;\r\n }", "public List<Criteria> getOredCriteria() {\r\n return oredCriteria;\r\n }", "public List<Criteria> getOredCriteria() {\r\n return oredCriteria;\r\n }", "public List<Criteria> getOredCriteria() {\r\n return oredCriteria;\r\n }", "public List<Criteria> getOredCriteria() {\r\n return oredCriteria;\r\n }", "public List<Criteria> getOredCriteria() {\r\n return oredCriteria;\r\n }", "public List<Criteria> getOredCriteria() {\r\n return oredCriteria;\r\n }", "public List<Criteria> getOredCriteria() {\r\n return oredCriteria;\r\n }", "public List<Criteria> getOredCriteria() {\r\n return oredCriteria;\r\n }", "public List<Criteria> getOredCriteria() {\r\n return oredCriteria;\r\n }", "public List<Criteria> getOredCriteria() {\r\n return oredCriteria;\r\n }", "public List<Criteria> getOredCriteria() {\r\n return oredCriteria;\r\n }", "public List<DIS001> findByCriteria(DistrictCriteria criteria);", "public CrkProductExample() {\r\n oredCriteria = new ArrayList<Criteria>();\r\n }", "public List<AnnexDetail> getByMap(Object[] params) {\n\t\treturn null;\n\t}" ]
[ "0.60413903", "0.56438136", "0.5596506", "0.550884", "0.54876786", "0.54698193", "0.5426009", "0.5407888", "0.539813", "0.5274965", "0.52464545", "0.52460146", "0.5152527", "0.5140051", "0.5116439", "0.5080727", "0.50767434", "0.50713813", "0.50523204", "0.5000965", "0.49798086", "0.49708432", "0.49568355", "0.4944958", "0.49256086", "0.49193627", "0.49124587", "0.49076352", "0.4906288", "0.4906281", "0.49053392", "0.49026373", "0.48999256", "0.48868436", "0.4884859", "0.48815152", "0.48812938", "0.4878512", "0.4878512", "0.4878512", "0.48729968", "0.48661843", "0.48534325", "0.4849015", "0.48423597", "0.4837557", "0.4837557", "0.4837557", "0.4837557", "0.48355836", "0.48157376", "0.48024973", "0.48013642", "0.4793988", "0.47912306", "0.4786731", "0.47846317", "0.4783046", "0.47821176", "0.47760457", "0.47728965", "0.4769844", "0.47697443", "0.47663605", "0.47610945", "0.47558305", "0.47512755", "0.47472966", "0.47429556", "0.47393253", "0.4736954", "0.4727217", "0.47197697", "0.47197697", "0.47197697", "0.4718341", "0.47135356", "0.4709775", "0.46947572", "0.46947572", "0.46947572", "0.46947572", "0.46947572", "0.46947572", "0.46947572", "0.46947572", "0.46947572", "0.46947572", "0.46947572", "0.46947572", "0.46947572", "0.46947572", "0.46947572", "0.46947572", "0.46947572", "0.46947572", "0.46947572", "0.46925187", "0.46882185", "0.4686077" ]
0.7853883
0
save the catalog description to the database
public void saveCatalogDescription(CatalogDescription cd) throws StaleDataException, DatabaseException;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void saveNewCatalog() {\n\n\t}", "public void Save() throws Exception{\n\t\tDB.InsertUpdate(\"Descriptions\", \n\t\t\t\tnew_description, \n\t\t\t\tnew Field<Long>(\"id\",this.id,true),\n\t\t\t\tnew Field<String>(\"text\",this.text),\n\t\t\t\tnew Field<Long>(\"user_nusp\",this.user_nusp),\n\t\t\t\tnew Field<Long>(\"image_id\",this.image_id),\n\t\t\t\tnew Field<Boolean>(\"approved\",this.approved),\n\t\t\t\tnew Field<Boolean>(\"discarded\",this.discarded)\n\t\t);\n\t}", "public int saveNewCatalog(String catName) throws BackendException;", "public void persist() {\n\t\ttry {\n\t\t\tFileOutputStream fos = this._context.openFileOutput(\n\t\t\t\t\tConstants.CATALOG_XML_FILE_NAME, Context.MODE_PRIVATE);\n\t\t\tfos.write(\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" ?>\\n\".getBytes());\n\t\t\tfos.write(\"<orders>\\n\".getBytes());\n\t\t\tfor (int i = 0; i < getOrderEntryCount(); i++) {\n\t\t\t\tOrderEntry oe = getOrderEntry(i);\n\t\t\t\tfos.write(oe.toXMLString().getBytes());\n\t\t\t}\n\t\t\tfos.write(\"</orders>\\n\".getBytes());\n\t\t\tfos.flush();\n\t\t\tfos.close();\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tLog.d(Constants.LOGTAG, \" \" + OrderList.CLASSTAG\n\t\t\t\t\t+ \"Failed to write out file?\" + e.getMessage());\n\t\t}\n\t}", "public void Save() {\r\n //solo se salvara el container\r\n vc.getContainer();\r\n }", "private void writeDescription(IFileStore store, ProjectDescription description) throws IOException, CoreException {\n \t\tOutputStream output = null;\n \t\ttry {\n \t\t\toutput = store.openOutputStream(EFS.NONE, getMonitor());\n \t\t\tnew ModelObjectWriter().write(description, output);\n \t\t} finally {\n \t\t\tassertClose(output);\n \t\t}\n \n \t}", "public void save() {\t\n\t\n\t\n\t}", "public void save() {\n ProductData.saveData(tree);\n }", "public void saveDescription(CharSequence s) {\n Log.i(\"text event\", \"description event\");\n description = s.toString();\n Log.i(\"text event\", \"description: \" + description);\n }", "public void store() throws IOException, SQLException {\r\n \r\n /* Project section */\r\n final HashMap<Object, Object> projectdata = new HashMap<Object, Object>(8);\r\n \r\n if(project == null){\r\n \t// The title \r\n projectdata.put(ProjectAccessor.TITLE, title);\r\n // Create the project database object.\r\n final ProjectAccessor newProject = new ProjectAccessor(projectdata);\r\n newProject.persist(conn);\r\n projectid = (Long) newProject.getGeneratedKeys()[0];\r\n } else {\r\n \tprojectid = project.getProjectid();\r\n }\r\n }", "private void saveProduct() {\n //Delegating to the Presenter to trigger focus loss on listener registered Views,\n //in order to persist their data\n mPresenter.triggerFocusLost();\n\n //Retrieving the data from the views and the adapter\n String productName = mEditTextProductName.getText().toString().trim();\n String productSku = mEditTextProductSku.getText().toString().trim();\n String productDescription = mEditTextProductDescription.getText().toString().trim();\n ArrayList<ProductAttribute> productAttributes = mProductAttributesAdapter.getProductAttributes();\n mCategoryOtherText = mEditTextProductCategoryOther.getText().toString().trim();\n\n //Delegating to the Presenter to initiate the Save process\n mPresenter.onSave(productName,\n productSku,\n productDescription,\n mCategoryLastSelected,\n mCategoryOtherText,\n productAttributes\n );\n }", "public void saveInformation(){\n market.saveInformationOfMarket();\n deckProductionCardOneBlu.saveInformationOfProductionDeck();\n deckProductionCardOneGreen.saveInformationOfProductionDeck();\n deckProductionCardOneViolet.saveInformationOfProductionDeck();\n deckProductionCardOneYellow.saveInformationOfProductionDeck();\n deckProductionCardThreeBlu.saveInformationOfProductionDeck();\n deckProductionCardThreeGreen.saveInformationOfProductionDeck();\n deckProductionCardThreeYellow.saveInformationOfProductionDeck();\n deckProductionCardThreeViolet.saveInformationOfProductionDeck();\n deckProductionCardTwoBlu.saveInformationOfProductionDeck();\n deckProductionCardTwoGreen.saveInformationOfProductionDeck();\n deckProductionCardTwoViolet.saveInformationOfProductionDeck();\n deckProductionCardTwoYellow.saveInformationOfProductionDeck();\n\n\n }", "public void save() {\n if (category != null) {\n category.save();\n }\n }", "public void save(boolean close)\n {\n try {\n Editor rootEditor = Utils.getRootEditor(petal_model);\n Model rootModel = rootEditor.getModel();\n CatalogManager.save(rootModel, close);\n Utils.addMessagesText(\"Network \\\"\" + rootModel.getSuperBox().getLabel() +\n \"\\\" successfully saved to the catalog.\\n\");\n } catch(Throwable e) {\n ((Exception)e).printStackTrace();\n JOptionPane.showConfirmDialog(null,\n e,\n \"Exception\" ,\n JOptionPane.DEFAULT_OPTION,\n JOptionPane.ERROR_MESSAGE);\n }\n\n }", "public void save()\n\t{\n\t\ttry\n\t\t{\n\t\t\tgetConnection().commit();\n\t\t\tgetPreparedStatement(\"SET FILES SCRIPT FORMAT COMPRESSED\").execute();\n\t\t\t// causes a checkpoint automatically.\n\t\t} catch (SQLException e)\n\t\t{\n\t\t\tm_logger.error(\"Couldn't cleanly save.\", e);\n\t\t}\n\t}", "public String saveCata(){\n\t\tFacesContext facesContext = FacesContext.getCurrentInstance();\n\t\tFacesMessage facesMessage = new FacesMessage(\"Catalogo guardado\");\n\t\tfacesContext.addMessage(null, facesMessage);\n\t\treturn \"catalogo\";\n\t}", "public void save() {\n //write lift information to datastore\n LiftDataAccess lda = new LiftDataAccess();\n ArrayList<Long>newKeys = new ArrayList<Long>();\n for (Lift l : lift) {\n newKeys.add(lda.insert(l));\n }\n\n //write resort information to datastore\n liftKeys = newKeys;\n dao.update(this);\n }", "void save();", "void save();", "void save();", "public void save();", "public void save();", "public void save();", "public void save();", "@Override\n\t\t\tpublic void ajouter(Catalogue catalogue) {\n\t\t\t\t\n\t\t\t}", "public void catalogToTextArea(Catalog theCatalog, JTextArea textArea) {\n textArea.setText(\"CONTENTS OF CATALOG:\\n\\n\");\n for (int CDNum = 0; CDNum < theCatalog.getNumItems(); CDNum++) {\n CD cd = (CD) theCatalog.getItem(CDNum);\n // display the title, composer and performer for the CD\n textArea.append(cd.displayStringWithTag() + \"\\n\");\n // display all the tracks, indented using a tab character\n for (int trackNum = 0; trackNum < cd.getNumTracks(); trackNum++) {\n textArea.append(\"\\t\" + cd.getTrack(trackNum) + \"\\n\");\n } // end for trackNum\n } // end for CDNum\n }", "@Override\n\tpublic void insert(String descrizione) throws SQLException {\n\t\tPreparedStatement ps=conn.prepareStatement(\"INSERT INTO categoria(descrizione) VALUES (?)\");\n\t\tps.setString(1, descrizione);\n\t\tps.executeUpdate();\n\t\t\n\t}", "void saveProduct(Product product);", "public void save(){\r\n\t\t//System.out.println(\"call save\");\r\n\t\tmodel.printDoc();\r\n\t}", "public void save()\n\t{\t\n\t\tfor (Preis p : items) {\n\t\t\titmDAO.create(p.getItem());\n\t\t\tprcDAO.create(p);\n\t\t}\n\t\tstrDAO.create(this);\n\t}", "public static void addCategoryType(String description) {\n\t\tConnection conn = null;\n PreparedStatement ps = null;\n try {\n \t// Get a connection to the specified JDBC URL.\n \t\tconn = JDBCConnection.getConnection();\n // Create a Statement object for sending SQL statements to the database.\n \t\t// Statement: The object used for executing a static SQL statement and returning the results it produces.\n \t\tps = conn.prepareStatement(\"INSERT INTO observation_categories ( description ) VALUES ( ? )\");\n \t\tps.setString( 1, description );\n \t\tps.execute();\n \t} catch(SQLException e) {\n \te.printStackTrace();\n } finally {\n\t\t\tJDBCConnection.closeConnection(conn, ps, null);\n\t\t}\n }", "@Override\r\n\tpublic void insertCatalog(Catalog catalog) throws Exception {\n\t\tcatalogDAO.insertCatalog(catalog);\r\n\t}", "@Override\r\n\tpublic void save() {\n\r\n\t\ts.save();\r\n\r\n\t}", "private void persist() {\n \t\ttry {\n \t\t\tproblemFile = File.createTempFile(\"p2Encoding\", \".opb\"); //$NON-NLS-1$//$NON-NLS-2$\n \t\t\tBufferedWriter w = new BufferedWriter(new FileWriter(problemFile));\n \t\t\tint clauseCount = tautologies.size() + dependencies.size() + constraints.size();\n \n \t\t\tint variableCount = variables.size();\n \t\t\tw.write(\"* #variable= \" + variableCount + \" #constraint= \" + clauseCount + \" \"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$\n \t\t\tw.newLine();\n \t\t\tw.write(\"*\"); //$NON-NLS-1$\n \t\t\tw.newLine();\n \n \t\t\tif (variableCount == 0 && clauseCount == 0) {\n \t\t\t\tw.close();\n \t\t\t\treturn;\n \t\t\t}\n \t\t\tw.write(objective);\n \t\t\tw.newLine();\n \t\t\tw.newLine();\n \n \t\t\tw.write(explanation + \" ;\"); //$NON-NLS-1$\n \t\t\tw.newLine();\n \t\t\tw.newLine();\n \n \t\t\tfor (Iterator iterator = dependencies.iterator(); iterator.hasNext();) {\n \t\t\t\tw.write((String) iterator.next());\n \t\t\t\tw.newLine();\n \t\t\t}\n \t\t\tfor (Iterator iterator = constraints.iterator(); iterator.hasNext();) {\n \t\t\t\tw.write((String) iterator.next());\n \t\t\t\tw.newLine();\n \t\t\t}\n \t\t\tfor (Iterator iterator = tautologies.iterator(); iterator.hasNext();) {\n \t\t\t\tw.write((String) iterator.next());\n \t\t\t\tw.newLine();\n \t\t\t}\n \t\t\tw.close();\n \t\t} catch (IOException e) {\n \t\t\te.printStackTrace();\n \t\t}\n \t}", "private void saveCourse() {\n String nameString = mNameEditText.getText().toString().trim();\n\n // Check if this is supposed to be a new pet\n // and check if all the fields in the editor are blank\n if (mCurrentCourseUri == null && TextUtils.isEmpty(nameString)) {\n // Since no fields were modified, we can return early without creating a new pet.\n // No need to create ContentValues and no need to do any ContentProvider operations.\n return;\n }\n\n // Create a ContentValues object where column names are the keys,\n // and pet attributes from the editor are the values.\n ContentValues values = new ContentValues();\n values.put(CourseEntry.COLUMN_COURSE_NAME, nameString);\n\n // Determine if this is a new or existing pet by checking if mCurrentPetUri is null or not\n if (mCurrentCourseUri == null) {\n // This is a NEW pet, so insert a new pet into the provider,\n // returning the content URI for the new pet.\n Uri newUri = getContentResolver().insert(CourseEntry.CONTENT_URI_COURSE, values);\n\n // Show a toast message depending on whether or not the insertion was successful.\n if (newUri == null) {\n // If the new content URI is null, then there was an error with insertion.\n Toast.makeText(this, getString(R.string.editor_insert_course_failed),\n Toast.LENGTH_SHORT).show();\n } else {\n // Otherwise, the insertion was successful and we can display a toast.\n Toast.makeText(this, getString(R.string.editor_insert_course_successful),\n Toast.LENGTH_SHORT).show();\n }\n } else {\n\n int rowsAffected = getContentResolver().update(mCurrentCourseUri, values, null, null);\n\n // Show a toast message depending on whether or not the update was successful.\n if (rowsAffected == 0) {\n // If no rows were affected, then there was an error with the update.\n Toast.makeText(this, getString(R.string.editor_update_course_failed),\n Toast.LENGTH_SHORT).show();\n } else {\n // Otherwise, the update was successful and we can display a toast.\n Toast.makeText(this, getString(R.string.editor_update_course_successful),\n Toast.LENGTH_SHORT).show();\n }\n }\n }", "public void save(SystenLogInfo osInfo, String string) {\n\t\t\n\t}", "private void addCatalogEntry(CatalogDefinition catalogDefinition) throws TranslationException\n {\n\tif(log.isDebugEnabled())\n\t log.debug(\"Adding catalog entry to catalogs table\");\n\n\tString sql = null;\n\n\ttry\n\t{\n\t String name = \"'\" + catalogDefinition.getName() + \"'\";\n\t String version = \"'\" + catalogDefinition.getVersion() + \"'\";\n\t String description = \"'\" + catalogDefinition.getDescription() + \"'\";\n\t String releaseDate = \"'\" + catalogDefinition.getReleaseDate().getValueAsString() + \"'\";\n\n\t sql = \"INSERT INTO \" + PropertyLookup.getCatalogsTableName()\n\t\t + \" (name, version, release_date, description) VALUES (\" + name + \",\" + version + \",\" + releaseDate\n\t\t + \",\" + description + \")\";\n\n\t sqlConnector.closeConnection();\n\t int insertedRows = sqlConnector.executeUpdate(sql);\n\n\t if(insertedRows != 1)\n\t\tthrow new TranslationException(\"Error trying inserting the catalog, returning code: \" + insertedRows);\n\t}\n\tcatch(SQLException e)\n\t{\n\t throw new TranslationException(\"Error inserting the catalog row: \" + sql, e);\n\t}\n\tcatch(IncompatibleTypeException e)\n\t{\n\t throw new TranslationException(\"Error accesing the catalog release date\", e);\n\t}\n\tfinally\n\t{\n\t sqlConnector.closeConnection();\n\t}\n }", "private void saveDatabaseSettings() {\r\n\r\n\t\t// --- Get new database ID --------------------------------------------\r\n\t\tint newID = 0;\r\n\t\tString newIDString = this.getJTextFieldDatabaseID().getText();\r\n\t\tif (newIDString!=null && newIDString.isEmpty()==false) {\r\n\t\t\ttry {\r\n\t\t\t\tnewID = Integer.parseInt(newIDString); \r\n\t\t\t} catch (Exception e) {\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// --- Save in the preferences ----------------------------------------\r\n\t\tBundleHelper.setIdScenarioResultForSetup(newID);\r\n\t}", "public void save() throws Throwable\n {\n String typeFilename = \n CatalogManager.getCurrentDirectory()+\n File.separator+\n CompositeTypeRecord.databaseFileName;\n\n String fieldFilename =\n CatalogManager.getCurrentDirectory()+\n File.separator+\n TypeFieldRecord.databaseFileName;\n\n new File(typeFilename).delete();\n new File(fieldFilename).delete();\n\n Db typeRecordTable = new Db(null, 0);\n typeRecordTable.set_error_stream(System.err);\n typeRecordTable.set_errpfx(\"Catalog Save Error\");\n typeRecordTable.open(typeFilename, null, Db.DB_BTREE, Db.DB_CREATE, 0644);\n\n Db typeFieldRecordTable = new Db(null, 0);\n typeFieldRecordTable.set_error_stream(System.err);\n typeFieldRecordTable.set_errpfx(\"Catalog Save Error\");\n typeFieldRecordTable.open(fieldFilename, null, Db.DB_BTREE, Db.DB_CREATE, 0644);\n\n CompositeType[] compositeTypes = getAllCompositeTypes();\n\n if (compositeTypes != null) {\n for (int i = 0; i < compositeTypes.length; i++) {\n CompositeType type = compositeTypes[i];\n IntegerDbt key = new IntegerDbt(type.getId());\n CompositeTypeRecord typeRecord = new CompositeTypeRecord(type.getId(), \n type.getName(), \n type.getNumberOfAttributes(),\n\t\t\t\t\t\t\t\t\t type.getIsInferred());\n if (typeRecordTable.put(null, key, typeRecord, 0) == Db.DB_KEYEXIST) \n System.out.println(\"The key already exists.\");\n int offset = 0;\n \n for (int j = 0; j < type.getNumberOfAttributes(); j++) {\n Type t = type.getAttributeType(j);\n if (t.isPrimitive()) {\n int size = type.getAttributeLength(j);\n IntegerArrayDbt innerKey = new IntegerArrayDbt(new int[] {type.getId(), j});\n \n int fieldType = 0;\n\n PrimitiveType primitiveType = (PrimitiveType) t;\n fieldType = primitiveType.getTypeId();\n\n TypeFieldRecord typeFieldRecord = new TypeFieldRecord(type.getId(), \n j, \n type.getAttributeName(j), \n fieldType,\n offset,\n size);\n offset += size;\n if (typeFieldRecordTable.put(null, innerKey, typeFieldRecord, 0) == Db.DB_KEYEXIST) \n System.out.println(\"The key already exists.\");\n }\n }\n }\n if (Constants.VERBOSE) System.out.println(\"\" + compositeTypes.length + \n\t\t\t\t\t\t \" types are recorded.\");\n } \n typeRecordTable.close(0);\n typeFieldRecordTable.close(0);\n }", "@Override\n\tpublic void save() {\n\t\t\n\t}", "@Override\n\tpublic void save() {\n\t\t\n\t}", "public static void save()\n {\n try {\n \n \n PrintWriter fich = null;\n \n fich = new PrintWriter(new BufferedWriter(new FileWriter(\"bd.pl\", true)));\n\t\t\t//true c'est elle qui permet d'écrire à la suite des donnée enregistrer et non de les remplacé \n \n for(String auto : GestionController.listApp)\n {\n \n fich.println(auto);\n }\n fich.println();\n for(String auto : GestionController.listDetFact)\n {\n \n fich.println(auto);\n }\n fich.println();\n for(String auto : GestionController.listFact)\n {\n \n fich.println(auto);\n }\n fich.println();\n for(String auto : GestionController.listType)\n {\n \n fich.println(auto);\n }\n fich.println();\n fich.close();\n } catch (Exception e1) {\n printStrace(e1);\n\t\t}\n }", "public boolean querySave(DominoDocument doc) throws NotesException {\n\t\tString category = doc.getItemValueString(\"Category\");\n\t\tString name = doc.getItemValueString(\"Name\");\n\t\tdoc.replaceItemValue(\"Id\",AbstractNode.encodeSnippet(category,name));\n\t\t\n\t\treturn true;\n\t}", "public void saveData() {\n\t\t//place to save notes e.g to file\n\t}", "public void save() {\n }", "public String Save()\n\t{\n\t\tif (this.actionString == \"Create\")\n\t\t{\n\t\t\tSystem.out.println(\"CREATE NEW CAR: \" + this.modifyCar.toString());\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"UPDATE CAR: \" + this.modifyCar.toString());\n\t\t}\n\n\t\treturn \"home\";\n\t}", "public void saveCatalogDetail(long warehouseId, long itemId, int qty) throws ModelException{\n\t\tCatalogDetail catalogDetail = null;\n\t\tcatalogDetail = getCatalogDetail(warehouseId, itemId);\n\t\tif (catalogDetail == null) {\n\t\t\tcatalogDetail = createCatalogDetail(warehouseId, itemId, qty);\n\t\t\tthis.getCatalogDetailDAO().createCatalogDetail(catalogDetail);\n\t\t} else {\n\t\t\tcatalogDetail.setQty(qty);\n\t\t\tthis.getCatalogDetailDAO().updateCatalogDetail(catalogDetail);\n\t\t}\n\t}", "void save() {\n gameModelPoDao.saveToFile(file.getAbsolutePath(), gameModelPo);\n }", "public void setNewValues_description(java.lang.String param){\n localNewValues_descriptionTracker = true;\n \n this.localNewValues_description=param;\n \n\n }", "private void saveData() {\n readViews();\n final BookEntry bookEntry = new BookEntry(mNameString, mQuantityString, mPriceString, mSupplier, mPhoneString);\n AppExecutors.getInstance().diskIO().execute(new Runnable() {\n @Override\n public void run() {\n // Insert the book only if mBookId matches DEFAULT_BOOK_ID\n // Otherwise update it\n // call finish in any case\n if (mBookId == DEFAULT_BOOK_ID) {\n mDb.bookDao().insertBook(bookEntry);\n } else {\n //update book\n bookEntry.setId(mBookId);\n mDb.bookDao().updateBook(bookEntry);\n }\n finish();\n }\n });\n }", "@Override\n\tpublic void save() {\n\t\tSystem.out.println(\"save method\");\n\t}", "public void save() {\n DataBuffer.saveDataLocally();\n\n //TODO save to db must be done properly\n DataBuffer.save(session);\n\n //TODO recording saved confirmation\n }", "public void storeToFile() throws IOException {\n\t\t\n\t\tDLProgramStorer storer = new DLProgramStorerImpl();\n\t\t\n\t\t//String datalogFile = inputCKR.getGlobalOntologyFilename() + \".dlv\";\n\t\t//String datalogFile = \"./testcase/output.dlv\";\n\t\t//System.out.println(datalogGlobal.getStatements().size());\n\t\t\n\t\tFileWriter writer = new FileWriter(outputFilePath);\n\t\tstorer.store(datalogCKR, writer);\n\t\t//writer.flush();\n\t\twriter.close();\n\t\t\n\t\t//System.out.println(\"CKR program saved in: \" + outputFilePath);\n\t}", "public void writeDatabase();", "private void saveAT() \n {\n // get DatabaseConnector to interact with the SQLite database\n\t AnimalDatabase db = new AnimalDatabase(this);\n\t AnimalList al = new AnimalList (db);\n\t \n // insert the contact information into the database\n al.Update(id, amount, comments);\n\n }", "@Override\r\n\tpublic void save() {\n\r\n\t}", "@Override\r\n\tpublic void save() {\n\r\n\t}", "public void setDescription(final String description) throws CouldntSaveDataException {\n try {\n m_module.getConfiguration().setDescription(description);\n } catch (final com.google.security.zynamics.binnavi.Database.Exceptions.CouldntSaveDataException e) {\n throw new CouldntSaveDataException(e);\n }\n }", "@Override\n public void Save() {\n\t \n }", "public void saveText() {\n\t\t\tapp.saveStrings(\"./data/exports/ID_Order.txt\", saveIDOrder);\n\t\t\t//Saving the new name text\n\t\t\tapp.saveStrings(\"./data/exports/Name_Order.txt\", saveNameOrder);\n\t\t\t//Saving the new breed text\n\t\t\tapp.saveStrings(\"./data/exports/Breed_Order.txt\", saveBreedOrder);\n\t\t\t//Saving the new date text\n\t\t\tapp.saveStrings(\"./data/exports/Date_Order.txt\", saveDateOrder);\n\t\t\n\t}", "void setdescription(String description) {\n\t\tthis.description = description;\n\t}", "private void save() {\r\n\t\tif (Store.save()) {\r\n\t\t\tSystem.out.println(\" > The store has been successfully saved in the file StoreData.\\n\");\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\" > An error occurred during saving.\\n\");\r\n\t\t}\r\n\t}", "protected void save() {\n close();\n if(saveAction != null) {\n saveAction.accept(getObject());\n }\n }", "public void updateCatalog(Catalog catalog) throws BackendException;", "public void saveToFile()\n\t{\t\n\t\tsetCourseToFileString(courseToFileString);\n\t\t\ttry \n\t {\n\t FileWriter fw = new FileWriter(fileName);\n\t fw.write (this.getCourseToFileString ( ));\n\t for(Student b : this.getStudents ( ))\t \t\n\t \tfw.write(b.toFileString ( ));\n\t \tfw.close ( );\n\t } \n\t catch (Exception ex) \n\t {\n\t ex.printStackTrace();\n\t }\n\t\t\tthis.saveNeed = false;\n\n\t}", "public void saveNewProject(){\n String pn = tGUI.ProjectTextField2.getText();\n String pd = tGUI.ProjectTextArea1.getText();\n String statusID = tGUI.StatusComboBox.getSelectedItem().toString();\n String customerID = tGUI.CustomerComboBox.getSelectedItem().toString();\n\n int sstatusID = getStatusID(statusID);\n int ccustomerID = getCustomerID(customerID);\n\n try {\n pstat = cn.prepareStatement (\"insert into projects (project_name, project_description, project_status_id, customer_id) VALUES (?,?,?,?)\");\n pstat.setString(1, pn);\n pstat.setString(2,pd);\n pstat.setInt(3, sstatusID);\n pstat.setInt(4, ccustomerID);\n pstat.executeUpdate();\n\n }catch (SQLException ex) {\n Logger.getLogger(ProjectMethods.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "void save(JournalPage page);", "public void saveExtraData() {}", "@Override\n public void save() {\n \n }", "public interface DescriptionDAO {\r\n public void save(Description toSave) throws IOException;\r\n\r\n public void close();\r\n\r\n public void check();\r\n}", "private void saveData() {\n }", "public String save() {\n\t\t\t try {\n\t\t\t\t File file = new File(CollectionFileScanner.getFileName());\n\t\t\t\t String fileName = CollectionFileScanner.getFileName();\n\t\t\t\t DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\n\t\t\t\t DocumentBuilder builder = factory.newDocumentBuilder();\n\t\t\t\t Document document = builder.newDocument();\n\t\t\t\t Element tagCollections = document.createElement(\"Collections\");\n\t\t\t\t document.appendChild(tagCollections);\n\t\t\t\t for (Olders e : collectionsOlders) {\n\t\t\t\t\t if (e.getId() != 0) {\n\t\t\t\t\t\t Element tagOlders = document.createElement(\"Older\");\n\t\t\t\t\t\t Element nameOlder = document.createElement(\"Name\");\n\t\t\t\t\t\t Element tagID = document.createElement(\"ID\");\n\t\t\t\t\t\t Element tagDimension = document.createElement(\"Dimension\");\n\t\t\t\t\t\t Text iDText = document.createTextNode(new Long(e.getId()).toString());\n\t\t\t\t\t\t tagCollections.appendChild(tagOlders);\n\t\t\t\t\t\t tagOlders.appendChild(nameOlder);\n\t\t\t\t\t\t Text nameText = document.createTextNode(e.getName());\n\t\t\t\t\t\t nameOlder.appendChild(nameText);\n\t\t\t\t\t\t tagOlders.appendChild(tagID);\n\t\t\t\t\t\t tagID.appendChild(iDText);\n\t\t\t\t\t\t tagOlders.appendChild(tagDimension);\n\n\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t DOMImplementation impl = document.getImplementation();\n\t\t\t\t DOMImplementationLS implLS = (DOMImplementationLS) impl.getFeature(\"LS\", \"3.0\");\n\t\t\t\t LSSerializer ser = implLS.createLSSerializer();\n\t\t\t\t ser.getDomConfig().setParameter(\"format-pretty-print\", true);\n\t\t\t\t String wellDone = ser.writeToString(document);\n\t\t\t\t LSOutput out = implLS.createLSOutput();\n\t\t\t\t out.setEncoding(\"UTF-8\");\n\t\t\t\t try {\n\t\t\t\t\t out.setByteStream(Files.newOutputStream(Paths.get(fileName)));\n\t\t\t\t } catch (IOException e1) {\n\t\t\t\t\t return \"Файл не найден или не доступен\";\n\t\t\t\t }\n\t\t\t\t try {\n\t\t\t\t\t ser.write(document, out);\n\t\t\t\t } catch (LSException l) {\n\n\t\t\t\t }\n\t\t\t\t return \"Коллекция успешно была сохранена!\";\n\t\t\t } catch (ParserConfigurationException e) {\n\t\t\t\t return \"Ошибка парсинга файла!\";\n\t\t\t }\n\t\t }", "public void doSave(VideogameBean prod) throws SQLException {\n\n\t\tDatabaseConnector connector = new DatabaseConnector();\n\t\tconnector.startConnection();\n\t\tPreparedStatement state = null;\n\t\tstate = connector.getJdbcConnection()\n\t\t\t\t.prepareStatement(\"insert into Videogioco values (?, ?, ?, ?, ?, ?, ?, ?)\");\n\n\t\tstate.setInt(1, prod.getVideogameCode());\n\t\tstate.setString(2, prod.getTitle());\n\t\tstate.setString(3, prod.getDescription());\n\t\tstate.setString(4, prod.getConsole());\n\t\tstate.setDouble(5, prod.getPrice());\n\t\tstate.setInt(6, prod.getAvailability());\n\t\tstate.setInt(7, prod.getShipment());\n\t\tstate.setString(8, prod.getImgPath());\n\t\tstate.executeUpdate();\n\t\tconnector.closeConnection();\n\n\t}", "public void saveData(){\n reporter.info(\"Save edited form\");\n clickOnElement(LOCATORS.getBy(COMPONENT_NAME,\"SAVE_BUTTON\"));\n }", "public void saveProduct(Product product);", "private void setData() {\n\t\t\n\t\tString str = readInternalStorage();\n\t\tString[] arr = str.split(\"--\");\n\t\tLog.v(\"CONSOLE\", arr.length+\" \"+arr);\n\t\t\n\t\tLog.v(\"CONSOLE\", \"path\"+arr[0]+\n\t\t\t\t\" name \"+arr[1]+\n\t\t\t\t\" date \"+arr[2]+\n\t\t\t\t\" desc \"+arr[3]); \n\t\t\n\t\tString desc =str;\n\t\t\n\t\ttxtName.setText(entity.getName());\n\t\ttxtDate.setText(entity.getDate());\n\t\ttxtDesc.setText(desc);\n\t}", "private void updateDatFile() {\n\t\tIOService<?> ioManager = new IOService<Entity>();\n\t\ttry {\n\t\t\tioManager.writeToFile(FileDataWrapper.productMap.values(), new Product());\n\t\t\tioManager = null;\n\t\t} catch (Exception ex) {\n\t\t\tDisplayUtil.displayValidationError(buttonPanel, StoreConstants.ERROR + \" saving new product\");\n\t\t\tioManager = null;\n\t\t}\n\t}", "public void save(){\n\t\tlowresModelManager.save();\n\t}", "public void saveCard(card cardToBeSaved)\n {\n dbObj=new dbFlashCards(uid);\n dbObj.saveCard(packId, cardToBeSaved.getCardId(), cardToBeSaved.getFront(),cardToBeSaved.getBack());\n \n \n }", "@Override\n public void save()\n {\n \n }", "private void populateCatalogEntitiesTable(CatalogDefinition catalogDefinition) throws TranslationException\n {\n\tCollection<String> entityNames = catalogDefinition.getEntityNames();\n\tString tableName = getEntitiesTableName();\n\n\ttry\n\t{\n\t for(String entityName : entityNames)\n\t {\n\t\tEntityDefinition entityDefinition = catalogDefinition.getEntityDefinition(entityName);\n\t\tString sql = \"INSERT INTO \" + tableName + \" (name, description) VALUES ('\" + entityDefinition.getName()\n\t\t\t + \"','\" + entityDefinition.getDescription() + \"')\";\n\n\t\tsqlConnector.closeConnection();\n\t\tsqlConnector.executeUpdate(sql);\n\t }\n\t}\n\tcatch(SQLException e)\n\t{\n\t throw new TranslationException(\"Error populating \" + tableName, e);\n\t}\n\tfinally\n\t{\n\t sqlConnector.closeConnection();\n\t}\n }", "@Override\r\n\tpublic void save(org.holtz.eve.jpa.entity.TCsCourse course) {\n\r\n\t}", "public void setDescription(String description) {\n this.description = description;\n UnitOfWork.getCurrent().registerDirty(this);\n }", "private void showCourseCatalogue()\r\n {\r\n \tCourseCatalogue courseCat = this.getDBManager().getCourseCat();\r\n \tthis.getClientOut().printf(\"SUCCESS\\n%s\\n\", courseCat.toString());\r\n \tthis.getClientOut().flush();\r\n }", "void saveContext();", "@Override\n public void save() {\n\n }", "private static void writeCatalog(XMLStreamWriter w, RepositoryConnection con)\n\t\tthrows XMLStreamException {\n\t\tString cat = \"http://data.gov.be/catalog\";\n\n\t\tw.writeStartElement(\"rdf:RDF\");\n\t\twritePrefixes(w);\n\n\t\tw.writeStartElement(\"dcat:Catalog\");\n\t\tw.writeAttribute(\"dct:identifier\", cat);\n\t\tw.writeAttribute(\"rdf:about\", cat);\n\n\t\tIRI uri = con.getValueFactory().createIRI(cat);\n\t\twriteGeneric(w, con, uri);\n\t\twriteReferences(w, con, uri, FOAF.HOMEPAGE, \"foaf:homepage\");\n\t\twriteReferences(w, con, uri, DCTERMS.LICENSE, \"dct:license\");\n\t\twriteDatasets(w, con);\n\t\twriteDataservices(w, con);\n\t\tw.writeEndElement();\n\n\t\twriteAgents(w, con);\n\n\t\twriteLocations(w, con);\n\t\n\t\twriteDocuments(w, con, DCTERMS.PROVENANCE, \"dct:ProvenanceStatement\");\n\t\twriteDocuments(w, con, DCTERMS.LICENSE, \"dct:LicenseDocument\");\n\t\twriteDocuments(w, con, DCTERMS.RIGHTS, \"dct:RightsStatement\");\n\t\twriteDocuments(w, con, DCTERMS.CONFORMS_TO, \"dct:Standard\");\n\n\t\twriteConcepts(w, con, DCTERMS.ACCESS_RIGHTS, \"dct:RightsStatement\");\n\t\twriteConcepts(w, con, DCTERMS.ACCRUAL_PERIODICITY, \"dct:Frequency\");\n\t\twriteConcepts(w, con, DCTERMS.LANGUAGE, \"dct:LinguisticSystem\");\n\t\twriteConcepts(w, con, DCTERMS.FORMAT, \"dct:MediaTypeOrExtent\");\n\t\twriteConcepts(w, con, DCTERMS.TYPE, \"skos:Concept\");\n\t\twriteConcepts(w, con, DCAT.MEDIA_TYPE, \"dct:MediaType\");\n\t\twriteConcepts(w, con, DCAT.COMPRESS_FORMAT, \"dct:MediaType\");\n\t\twriteConcepts(w, con, DCAT.THEME, \"skos:Concept\");\n\n\t\tw.writeEndElement();\n\t}", "public void save(){\r\n if (inputValidation()) {\r\n if (modifyingPart) {\r\n saveExisting();\r\n } else {\r\n saveNew();\r\n }\r\n closeWindow();\r\n }\r\n\r\n }", "public void store() throws PersistenceException {\n }", "public void consulterCatalog() {\n\t\t\n\t}", "@Override\n\tpublic void addContent(String title, Genre genre, String description, String trailer, int yearReleased,Double rating\n\t\t\t,Category category) {\n\t\tContent content = new Content(title, genre, description, trailer, yearReleased,rating, category);\n\t\tentityManager.persist(content);\n\t}", "public void putInformation(DatabaseOperations dop, String description, String time) {\n SQLiteDatabase SQ = dop.getWritableDatabase();\n ContentValues cv = new ContentValues();\n cv.put(TableData.TableInfo.description, description);\n cv.put(TableData.TableInfo.time, time);\n long k = SQ.insert(TableData.TableInfo.Table_Name, null, cv);\n Log.d(\"Database operations\", \"One raw inserted\");\n }", "@Override\n\tpublic void saveProduct(MultipartFile file, String title, String price, String description) throws IOException {\n\t\tProductEntity productEntity = new ProductEntity();\n\t\tproductEntity.setPrice(new BigDecimal(price));\n//\t\tproductEntity.setImage(fileMetaData.getLocation());\n\t\tproductEntity.setTitle(title);\n\t\tproductEntity.setDescription(description);\n\t\tproductEntity.setImg(file.getBytes());\n\t\tproductRepository.save(productEntity);\n\t}", "@Override\n public String storeItem() {\n return \"N/\" + description;\n }", "public void setDescription(String description){this.description=description;}", "private void updateDatabase() {\n\t\tAbstractSerializer serializer = new CineplexSerializer();\n\t\tArrayList<String> updatedRecords = serializer.serialize(records);\n\t\tDatabaseHandler.writeToDatabase(DATABASE_NAME, updatedRecords);\n\t}", "private void save() {\n Toast.makeText(ContactActivity.this, getString(R.string.save_contact_toast), Toast.LENGTH_SHORT).show();\n\n String nameString = name.getText().toString();\n String titleString = title.getText().toString();\n String emailString = email.getText().toString();\n String phoneString = phone.getText().toString();\n String twitterString = twitter.getText().toString();\n \n if (c != null) {\n datasource.editContact(c, nameString, titleString, emailString, phoneString, twitterString);\n }\n else {\n \tc = datasource.createContact(nameString, titleString, emailString, phoneString, twitterString);\n }\n }", "void save() throws IOException, ParserConfigurationException, TransformerConfigurationException;", "@Override\n\tprotected void cmdSaveWidgetSelected() {\n\n\t\tif (fieldsOk()) {\n\t\t\tif(fieldsChanged) {\n\t\t\t\tTransaction tx = null;\n\t\t\t\ttry {\n\n\t\t\t\t\tMessageBox mSave = new MessageBox(getShell(), SWT.ICON_QUESTION\n\t\t\t\t\t\t\t| SWT.YES | SWT.NO);\n\n\t\t\t\t\tif(currentScreenMode.equalsIgnoreCase(screenModes[0])) {\n\t\t\t\t\t\tmSave.setText(\"iDART: Add New Pharmacy?\");\n\t\t\t\t\t\tmSave.setMessage(\"Are you sure you want to add Pharmacy '\"\n\t\t\t\t\t\t\t\t+ txtStockCenterName.getText() + \"'?\");\n\t\t\t\t\t}\n\t\t\t\t\telse if(currentScreenMode.equalsIgnoreCase(screenModes[1])) {\n\t\t\t\t\t\tmSave.setText(\"iDART: Update Pharmacy?\");\n\t\t\t\t\t\tmSave.setMessage(\"Are you sure you want to update the Pharmacy '\"\n\t\t\t\t\t\t\t\t+ txtStockCenterName.getText() + \"'?\");\n\t\t\t\t\t}\n\t\t\t\t\telse if(currentScreenMode.equalsIgnoreCase(screenModes[2])) {\n\t\t\t\t\t\tmSave.setText(\"iDART: Update Facility Details?\");\n\t\t\t\t\t\tmSave.setMessage(\"Are you sure you want to update the Facility Details?\");\n\t\t\t\t\t}\n\t\t\t\t\tswitch (mSave.open()) {\n\n\t\t\t\t\tcase SWT.YES:\n\t\t\t\t\t\ttx = getHSession().beginTransaction();\n\n\t\t\t\t\t\tsaveModeInformation();\n\t\t\t\t\t\tgetHSession().flush();\n\t\t\t\t\t\ttx.commit();\n\t\t\t\t\t\tMessageBox confirmUpdate = new MessageBox(getShell(),\n\t\t\t\t\t\t\t\tSWT.OK | SWT.ICON_INFORMATION);\n\t\t\t\t\t\tconfirmUpdate.setText(\"iDART: Database Updated\");\n\t\t\t\t\t\tconfirmUpdate.setMessage(\"The changes have been updated.\");\n\t\t\t\t\t\tconfirmUpdate.open();\n\t\t\t\t\t\tclearMode();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase SWT.NO:\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// else, there was a problem saving the PharmacyDetails details to the\n\t\t\t\t// database\n\t\t\t\tcatch (HibernateException he) {\n\t\t\t\t\tMessageBox confirmUpdate = new MessageBox(getShell(), SWT.OK\n\t\t\t\t\t\t\t| SWT.ICON_INFORMATION);\n\t\t\t\t\tconfirmUpdate.setText(\"iDART: Database Error\");\n\t\t\t\t\tconfirmUpdate\n\t\t\t\t\t.setMessage(\"There was a problem saving the PharmacyDetails \"\n\t\t\t\t\t\t\t+ \"information to the database - sorry! \\n\\nPlease \"\n\t\t\t\t\t\t\t+ \"try again later.\");\n\t\t\t\t\tconfirmUpdate.open();\n\t\t\t\t\tif (tx != null) {\n\t\t\t\t\t\ttx.rollback();\n\t\t\t\t\t}\n\t\t\t\t\tgetLog().error(\n\t\t\t\t\t\t\t\"Hibernate Exception while adding/updating PharmacyDetails\",\n\t\t\t\t\t\t\the);\n\t\t\t\t\tcmdCancelWidgetSelected();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tMessageBox mSave = new MessageBox(getShell(), SWT.OK\n\t\t\t\t\t\t| SWT.ICON_INFORMATION);\n\t\t\t\tmSave.setText(\"iDART: Changes Not Made\");\n\t\t\t\tmSave.setMessage(\"No changes were made\");\n\t\t\t\tmSave.open();\n\n\t\t\t}\n\n\t\t}\n\n\t}", "public void saveToFile(View view) {\n //Insert the word into the Database\n try {\n //Insert the word and definition into the database\n DefinitionsViewModel dvm = ViewModelProviders.of(this).get(DefinitionsViewModel.class);\n dvm.insert(new Definitions(queryString, shortDef));\n\n //Let the user know the operation was successful\n Toast.makeText(this, getString(R.string.saveSuccessMessage), Toast.LENGTH_SHORT).show();\n } catch (Exception e) {\n e.printStackTrace();\n //Let the user know that the operation failed.\n Toast.makeText(this, getString(R.string.saveFailedMessage), Toast.LENGTH_SHORT);\n\n\n }\n\n }" ]
[ "0.75558364", "0.72734773", "0.6599249", "0.6418478", "0.61544025", "0.60511124", "0.60335034", "0.6030326", "0.5910186", "0.5837687", "0.58071417", "0.57916313", "0.57810575", "0.5773456", "0.5737657", "0.5734887", "0.5728908", "0.5715399", "0.5715399", "0.5715399", "0.56959134", "0.56959134", "0.56959134", "0.56959134", "0.56591535", "0.5652609", "0.5629464", "0.56186783", "0.55970716", "0.55679053", "0.55649555", "0.55534565", "0.5544405", "0.5539366", "0.5524193", "0.551458", "0.551153", "0.55096316", "0.549851", "0.54796016", "0.54796016", "0.5479133", "0.5469588", "0.54679495", "0.54579157", "0.5438441", "0.54361403", "0.5433994", "0.54335386", "0.5428884", "0.54200226", "0.5419885", "0.5417237", "0.5415053", "0.54098517", "0.5386849", "0.5386849", "0.5384786", "0.5382745", "0.53782135", "0.536891", "0.53661877", "0.5358493", "0.53546447", "0.5348292", "0.5334733", "0.5332873", "0.5331446", "0.5330372", "0.53285706", "0.53254294", "0.5324565", "0.53236973", "0.53180957", "0.5315628", "0.5307971", "0.53077286", "0.5305703", "0.53049", "0.5301533", "0.5295987", "0.5285928", "0.5282338", "0.5281816", "0.5280796", "0.5271283", "0.5270321", "0.5265626", "0.5254014", "0.52524066", "0.52488256", "0.5245632", "0.5244271", "0.52402455", "0.52396965", "0.5237305", "0.52362406", "0.5234993", "0.52307785", "0.5225378" ]
0.81546754
0
Return a list of Course id (used by quartz job to determine if the catalog description is already created)
public List<String> getListCourseId();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ArrayList<String> getCourseIds() {\n ArrayList<String> courseIds = new ArrayList<>();\r\n for (int i=0; i < courses.size(); i++) \r\n courseIds.add(courses.get(i).getId());\r\n\r\n return courseIds; \r\n }", "public ArrayList<Integer> courseIDs() {\r\n ArrayList<Integer> ids = new ArrayList<Integer>();\r\n for (Course course : getCourse()) {\r\n ids.add(course.getSubject().getID());\r\n }\r\n return ids;\r\n }", "public String getIdCourse() {\n\t\t\treturn idCourse;\n\t\t}", "private void getCourseList(){\r\n\r\n CourseDAO courseDAO = new CourseDAO(Statistics.this);\r\n List<Course> courseList= courseDAO.readListofCourses();\r\n for(Course course: courseList) {\r\n courses.add(course.getName());\r\n }\r\n\r\n }", "public Long getIdCourse() {\n return idCourse;\n }", "public String getCourseID() {\r\n return COURSE_ID;\r\n }", "public String getCourseId() {\n\t\treturn courseId;\n\t}", "public String getCourseId() {\n return courseId;\n }", "public ArrayList<String> selectAllIdsStudentCourse() {\n Connection connection = null;\n Statement statement = null;\n ResultSet resultSet = null;\n ArrayList<String> pkList = new ArrayList<>();\n\n try {\n Class.forName(Tools.MYSQL_JDBC_DRIVER);\n\n connection = DriverManager.getConnection(Tools.DB_URL, Tools.USERNAME, Tools.PASSWORD);\n\n statement = connection.createStatement();\n\n String query = \"SELECT CONCAT(STUDENT_ID, ',', COURSE_ID) AS PK FROM STUDENTS_COURSES;\";\n\n resultSet = statement.executeQuery(query);\n\n while (resultSet.next()) {\n String pk = resultSet.getString(\"PK\");\n pkList.add(pk);\n }\n } catch (ClassNotFoundException | SQLException e) {\n e.printStackTrace();\n } finally {\n if (resultSet != null) {\n try {\n resultSet.close();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }\n\n if (statement != null) {\n try {\n statement.close();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }\n if (connection != null) {\n try {\n connection.close();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }\n }\n return pkList;\n }", "protected String getCourseID(){\n sharedPref = getSharedPreferences(AppCSTR.PREF_NAME, Context.MODE_PRIVATE);\n //Log.d(\"ID\", sharedPref.getString(\"id\", null));\n return sharedPref.getString(AppCSTR.ACCOUNT_COURSE, null);\n }", "public static List<Course> createCourseList() {\n List<Course> courses = new ArrayList<Course>();\n courses.add(createCourse(\"12345\"));\n courses.add(createCourse(\"67890\"));\n return courses;\n }", "@Override\n\tpublic String getCourseId() \n\t{\n\t\treturn null;\n\t}", "public ArrayList getCourseIds(String studentId)\r\n throws RemoteException;", "public int getCourseId()\n {\n return this.courseId;\n }", "public List<String>ViewCourseDAO(int id) {\n\t\tList<String> courses = new ArrayList<String>();\n\t\ttry {\n stmt = connection.prepareStatement(SqlQueries.ViewAssignCourse);\n stmt.setInt(1, id);\n stmt.execute();\t \n ResultSet rs =stmt.executeQuery();\n while(rs.next())\n {\n \tcourses.add(rs.getString(1));\n }\n } catch(Exception ex){\n \tlogger.error(ex.getMessage());\n \n }finally{\n \t//close resources\n \tDBUtil.closeStmt(stmt);\n }\n\treturn courses ;\n\t}", "@Override\n\tpublic List<String> getNameOfCourses() {\n\t\tconn = DBUtils.connectToDb();\n\t\tString query = \"select course_name from course;\";\n\t\tst = DBUtils.getStatement(conn);\n\t\tList<String> list = null;\n\t\ttry {\n\n\t\t\trs = st.executeQuery(query);\n\t\t\tif (rs != null) {\n\t\t\t\tlist = new ArrayList<String>();\n\t\t\t\twhile (rs.next())\n\t\t\t\t\tlist.add(rs.getString(1));\n\t\t\t}\n\t\t\tDBUtils.closeConnections();\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn list;\n\t}", "public ArrayList<String> getCourseList() {\r\n\t\treturn courseList;\r\n\t}", "public String getCourses() {\n return courses;\n }", "public String[] getCourses();", "public String toString() {\r\n return COURSE_ID + \"-\" + COURSE_NAME;\r\n }", "public List<Course> getCourseByCid(int id) {\n\t\treturn null;\n\t}", "public Course getCourseById(String id);", "public int getCourseID() {\n return courseID;\n }", "public List<Courses> courseInfo(String courseid) {\n\t\t\n\t\tList<Courses> courselist = new ArrayList<Courses>();\n\t\t\n\t\tMongoConnection mongocon = new MongoConnection();\n\t\tDBCursor resultcursor = mongocon.getDBObject(\"courseid\", courseid, \"Course\");\n\t\tif(resultcursor.hasNext()){\n\t\t\tDBObject theObj = resultcursor.next();\n\t\t\t\n\t\t\tCourses courses = new Courses();\n\t\t\tcourses.setCourseCategory((String)theObj.get(\"courseCategory\"));\n\t\t\tcourses.setCourseDescription((String)theObj.get(\"courseDescription\"));\n\t\t\tcourses.setCourseFee((String)theObj.get(\"courseFee\"));\n\t\t\tcourses.setCourseid((String)theObj.get(\"courseid\"));\n\t\t\tcourses.setCourseimageid((String)theObj.get(\"courseimageid\"));\n\t\t\tcourses.setCourseName((String)theObj.get(\"courseName\"));\n\t\t\tcourses.setCourseownerid((String)theObj.get(\"courseownerid\"));\n\t\t\tString[] partners = ((String)theObj.get(\"coursePartners\")).split(\",\");\n\t\t\tcourses.setCoursePartners(partners);\n\t\t\t//String[] reviews = ((String)theObj.get(\"courseReview\")).split(\",\");\n\t\t\tcourses.setCourseReview((String)theObj.get(\"courseReview\"));\n\t\t\tString[] sponsors = ((String)theObj.get(\"courseSponsors\")).split(\",\");\n\t\t\tcourses.setCourseSponsors(sponsors);\n\t\t\tString[] faqids = ((String)theObj.get(\"FAQid\")).split(\",\");\n\t\t\tcourses.setFAQid(faqids) ;\n\t\t\t\n\t\t\tcourselist.add(courses);\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\n\t\t/*\n\t\t * for(int i=0;i<courseinfo.size();i++){ Courses corselst =\n\t\t * courseinfo.get(i); courselist.add(corselst.getCoursename());\n\t\t * courselist.add(corselst.getCourseid());\n\t\t * courselist.add(corselst.getCourseCategory());\n\t\t * courselist.add(corselst.getCourseDescription());\n\t\t * courselist.add(corselst.getCourseFee());\n\t\t * courselist.add(corselst.getCourseimageid());\n\t\t * courselist.add(corselst.getTimeduration());\n\t\t * courselist.add(corselst.getFAQ());\n\t\t * \n\t\t * \n\t\t * ApplicationContext ctx1 = new\n\t\t * AnnotationConfigApplicationContext(SpringMongoConfig.class);\n\t\t * MongoOperations mongoOperation1 = (MongoOperations)\n\t\t * ctx1.getBean(\"mongoTemplate\");\n\t\t * \n\t\t * //User Details Query query1 = new Query(); //\n\t\t * query2.addCriteria(Criteria.where(\"courseOwner\").is(\"dog\").and(\"age\")\n\t\t * .is(40)); query1.addCriteria(Criteria.where(\"userid\").is(\n\t\t * \"572f7777bc22c22add92894e\")); List<Profile> profileinfo =\n\t\t * (List<Profile>) mongoOperation1.find(query1, Profile.class); for(int\n\t\t * j=0;j<profileinfo.size();j++){\n\t\t * \n\t\t * Profile prof = profileinfo.get(j);\n\t\t * \n\t\t * courselist.add(prof.getAboutme());\n\t\t * courselist.add(prof.getProfileThumbnailid());\n\t\t * courselist.add(prof.getCoursesids());\n\t\t * courselist.add(prof.getEmailid());\n\t\t * courselist.add(prof.getExperience());\n\t\t * courselist.add(prof.getFollowers());\n\t\t * \n\t\t * }\n\t\t * \n\t\t * \n\t\t * //Partners details String[] coursePartners =\n\t\t * corselst.getCoursePartners(); for(int\n\t\t * m=0;m<coursePartners.length;m++){\n\t\t * \n\t\t * List partners;\n\t\t * \n\t\t * Query query2 = new Query(); //\n\t\t * query2.addCriteria(Criteria.where(\"courseOwner\").is(\"dog\").and(\"age\")\n\t\t * .is(40));\n\t\t * query2.addCriteria(Criteria.where(\"companyid\").is(coursePartners[m]))\n\t\t * ; partners = (List<Company>) mongoOperation.find(query2,\n\t\t * Company.class);\n\t\t * \n\t\t * if(partners.isEmpty()){ Query query3 = new Query(); //\n\t\t * query2.addCriteria(Criteria.where(\"courseOwner\").is(\"dog\").and(\"age\")\n\t\t * .is(40));\n\t\t * query3.addCriteria(Criteria.where(\"organizationID\").is(coursePartners\n\t\t * [m])); partners = (List<Organization>) mongoOperation.find(query1,\n\t\t * Organization.class);\n\t\t * \n\t\t * for(int n=0;n<partners.size();n++){ Organization org = (Organization)\n\t\t * partners.get(n); courselist.add(org.getOrganizationID());\n\t\t * courselist.add(org.getOrglogoid()); }\n\t\t * \n\t\t * \n\t\t * }else{ for(int n=0;n<partners.size();n++){ Company company =\n\t\t * (Company) partners.get(n); courselist.add(company.getCompanyid());\n\t\t * courselist.add(company.getCompanylogoid()); } }\n\t\t * \n\t\t * }\n\t\t * \n\t\t * \n\t\t * \n\t\t * //Sponsor details String[] courseSponsors =\n\t\t * corselst.getCourseSponsors(); for(int\n\t\t * o=0;o<courseSponsors.length;o++){\n\t\t * \n\t\t * List sponsors;\n\t\t * \n\t\t * Query query2 = new Query(); //\n\t\t * query2.addCriteria(Criteria.where(\"courseOwner\").is(\"dog\").and(\"age\")\n\t\t * .is(40));\n\t\t * query2.addCriteria(Criteria.where(\"companyid\").is(courseSponsors[o]))\n\t\t * ; sponsors = (List<Company>) mongoOperation.find(query1,\n\t\t * Company.class);\n\t\t * \n\t\t * if(sponsors.isEmpty()){ Query query3 = new Query(); //\n\t\t * query2.addCriteria(Criteria.where(\"courseOwner\").is(\"dog\").and(\"age\")\n\t\t * .is(40));\n\t\t * query3.addCriteria(Criteria.where(\"organizationID\").is(courseSponsors\n\t\t * [o])); sponsors = (List<Organization>) mongoOperation.find(query1,\n\t\t * Organization.class);\n\t\t * \n\t\t * for(int n=0;n<sponsors.size();n++){ Organization org = (Organization)\n\t\t * sponsors.get(n); courselist.add(org.getOrganizationID());\n\t\t * courselist.add(org.getOrglogoid()); }\n\t\t * \n\t\t * \n\t\t * }else{ for(int n=0;n<sponsors.size();n++){ Company company =\n\t\t * (Company) sponsors.get(n); courselist.add(company.getCompanyid());\n\t\t * courselist.add(company.getCompanylogoid()); } }\n\t\t * \n\t\t * }\n\t\t * \n\t\t * //Review details\n\t\t * \n\t\t * }\n\t\t */\n\n\t\tSystem.out.println(\"courseinfo >>.\" + courselist);\n\n\t\treturn courselist;\n\n\t}", "public List<Course> getCourse() {\n\t\treturn null;\n\t}", "public ArrayList<Course> findCoursesById(String id) {\n ArrayList<Course> coursesById = new ArrayList<>(); \r\n for(int i=0; i < courses.size(); i++) {\r\n if (courses.get(i).getId().contains(id)) \r\n coursesById.add(courses.get(i));\r\n } \r\n return coursesById;\r\n }", "public long getCourseId() {\n return _courseImage.getCourseId();\n }", "@Override\r\n\t//得到任一课程对应的教室ID\r\n\tpublic List<Integer> getAllClassroomIdOfCourse(int courseId) {\n\t\tsession = sessionFactory.openSession();\r\n\t\tTransaction tran = session.beginTransaction();\r\n\t\tString hql = \"select id from Classroom where state=:classroomState and yogaCludId=( select yogaClubID from CourseEntry where id=(:courseId) and state=:courseState )\";\t\t\r\n\t\t@SuppressWarnings(\"unchecked\")\r\n\t\tList<Integer> lists = session.createQuery(hql).setInteger(\"classroomState\", 0).setInteger(\"courseId\", courseId).setInteger(\"courseState\", 0).list();\r\n\t\ttran.commit();\r\n\t\tsession.close();\r\n\t\tlogger.debug(\"use the method named :getAllClassroomIdOfCourse(int courseId)\");\r\n\t\tif (lists.size() > 0) {\r\n\t\t\treturn lists;\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public int getID() {\n return courseID;\n }", "public String toString() {\n return \"\"+courseID;\n }", "public ArrayList<String> getCourseIdsByCat(String category) {\n ArrayList<String> courseIdsByCat = new ArrayList<>(); \r\n for(int i=0; i < courses.size(); i++) {\r\n if (courses.get(i).getCategory().equals(category)) \r\n courseIdsByCat.add(courses.get(i).getId());\r\n }\r\n \r\n return courseIdsByCat; \r\n }", "@GET\n\t@Path(\"{programId}/course\")\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic List<Course> getCoursesforProgram(@PathParam(\"programId\") String progId){\n\t\treturn ProgramService.getInstance().getCourseForProgram(progId);\n\t}", "public ArrayList <Course> getCourseList ()\n\n {\n\n // Returns courseList when called.\n return courseList;\n\n }", "public ArrayList getStudentIds(String courseId)\r\n throws RemoteException;", "public CatalogDescription getCatalogDescription(String course_id);", "public LinkedList<Course> getCourseList() {\n return courseList;\n }", "private static HashMap<Integer, Course> getCourses() {\r\n return IO.getCoursesFromInput(); // get courses from file\r\n }", "public ArrayList<Course> getCoursesInField(){\r\n\t\treturn CourseFieldController.getFieldCourses(this);\r\n\t}", "public String getCourse() {\n\t\treturn Course;\n\t}", "@Override\npublic ArrayList<String> courses() {\n\tArrayList<String> studentCourses = new ArrayList<String>();\n\tstudentCourses.add(\"CMPE - 273\");\n\tstudentCourses.add(\"CMPE - 206\");\n\tstudentCourses.add(\"CMPE - 277\");\n\tSystem.out.println(this.name+\" has take these courses\");\n\tfor(int i = 0 ; i < studentCourses.size() ; i++){\n\t\tSystem.out.println( studentCourses.get(i));\n\t}\n\treturn null;\n}", "public String toString() {\r\n \treturn \"Course: \"+courseName+\"|\"+cid+\"|\"+start+\"|\"+end+\"|\"+modules.size()+\" modules\";\r\n }", "public ArrayList<String> getRequestedCourses()\n\t{\n\t\treturn requestedCourses;\n\t}", "public ArrayList getCourses();", "@Override\n\tpublic List<Course> getAllCourses() {\n\t\tList<Course> list = null;\n\t\tconn = DBUtils.connectToDb();\n\t\tCourse course = null;\n\t\tString query = \"select * from course;\";\n\t\ttry {\n\t\t\tst = conn.createStatement();\n\t\t\trs = st.executeQuery(query);\n\t\t\tif(rs!=null)\n\t\t\t{\n\t\t\t\tlist = new ArrayList<Course>();\n\t\t\t\twhile(rs.next())\n\t\t\t\t{\n\t\t\t\t\tcourse = new Course();\n\t\t\t\t\tcourse.setCourse_id(Integer.parseInt(rs.getString(1)));\n\t\t\t\t\tcourse.setCourse_name(rs.getString(2));\n\t\t\t\t\tcourse.setStart_date(rs.getString(3));\n\t\t\t\t\tcourse.setEnd_date(rs.getString(4));\n\t\t\t\t\tcourse.setCapacity(Integer.parseInt(rs.getString(5)));\n\t\t\t\t\tlist.add(course);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn list;\n\t}", "public String getCourses() throws CustomExceptions.InvalidInputException {\n Collections.sort(courses);\n StringBuilder builder = new StringBuilder();\n if (!courses.isEmpty()) {\n for (CurriculumItem course : courses) {\n builder.append(String.format(\"|--[%1s] %13s -----|\\n\",\n getCurriculumItemCompletionStatus(course),\n Manipulators.getCurriculumItemAsShortString(course)));\n }\n } else {\n return \"No courses found for Academic Term: \" + name;\n }\n return builder.toString();\n }", "@Override\n\tpublic String setCourseId() {\n\t\treturn null;\n\t}", "public ArrayList<String> courseList() throws Exception {\n\t\tArrayList<String> courses = new ArrayList<String>();\n\t\tConnection con = null;\n\t\tcon = DBConnector.dbConnection();\n\t\ttry {\n\t\t\tPreparedStatement st = con.prepareStatement(\"select course_name from course\");\n\t\t\tResultSet rs = st.executeQuery();\n\t\t\twhile (rs.next()) {\n\t\t\t\tcourses.add(rs.getString(1));\n\t\t\t}\n\t\t\tcon.close();\n\t\t} catch (SQLSyntaxErrorException e) {\n\t\t\tthrow new SQLSyntaxErrorException(\"Error in SQL syntax\");\n\t\t} catch (SQLException e) {\n\t\t\tthrow new SQLException(\"Connection with database failed\");\n\t\t} catch (Exception e) {\n\t\t\tthrow new Exception(\"Some error occured\");\n\t\t}\n\t\treturn courses;\n\t}", "public List<Assignment> getCourseAssignments(long c_id) {\n\n SQLiteDatabase db = this.getReadableDatabase();\n List<Assignment> assignmentList = new ArrayList<>();\n Cursor cursor = null;\n try {\n cursor = db.query(Config.TABLE_NAME_ASSIGNMENT, null, null,\n null, null, null, null);\n\n if (cursor != null) {\n if (cursor.moveToFirst()) {\n\n do {\n if (cursor.getInt(cursor.getColumnIndex(Config.COLUMN_COURSE_ID)) == c_id) {\n long a_id = cursor.getInt(cursor.getColumnIndex(\n Config.COLUMN_ASSIGNMENT_ID));\n long course_id = cursor.getInt(cursor.getColumnIndex(\n Config.COLUMN_COURSE_ID));\n String title = cursor.getString(cursor.getColumnIndex(\n Config.COLUMN_ASSIGNMENT_TITLE));\n double grade = cursor.getDouble(cursor.getColumnIndex(\n Config.COLUMN_ASSIGNMENT_GRADE));\n assignmentList.add(new Assignment(a_id, course_id, title, grade));\n }\n\n } while (cursor.moveToNext());\n\n return assignmentList;\n }\n }\n\n } catch (Exception e) {\n Log.d(TAG, \"Exception: \" + e.getMessage());\n } finally {\n if (cursor != null)\n cursor.close();\n db.close();\n }\n\n\n return Collections.emptyList();\n }", "public List<Events> getCourseEventListByCourseId(int courseId);", "public Course[] getCourses() {\n\t\tCourse[] temp = new Course[this.noc];\n\t\t\n\t\tfor(int i = 0; i < this.noc; i++) {\n\t\t\ttemp[i] = this.courseList[i];\n\t\t}\n\t\t\n\t\t\n\t\treturn temp;\n\t}", "public String getcourse() {\n\t\treturn course;\n\t}", "public Course[] getCourse() {\r\n return course.toArray(new Course[course.size()]);\r\n }", "public String getCourseName(){//getCourseName body start\n\t\treturn CourseName;\n\t}", "public List<CurriculumVO> getCourseCurriculum(int courseID);", "public List<Course> getCourses() {\n\t\tList<Course> courses = new ArrayList<Course>();\n\t\tfor (Registration reg : registrations) {\n\t\t\tcourses.add(reg.getIndex().getCourse());\n\t\t}\n\t\treturn courses;\n\t}", "public List getCoursesToSelect() {\n return coursesToSelect;\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic List<Course> getAllCourses() {\n\t\treturn this.getHibernateTemplate().find(\"from Course cs order by cs.cno\");\n\t \n\t}", "@AutoEscape\n\tpublic String getCourse();", "public String getCourse() {\n return courseName;\n }", "java.lang.String getCourseName();", "public List<Course> getAllCourses() {\n return allCourses;\n }", "private Course getCourse(String courseId) {\n MongoCollection<Course> courseMongoCollection = mongoDatabase.getCollection(\"course\", Course.class);\n return courseMongoCollection.find(eq(\"_id\", new ObjectId(courseId))).first();\n }", "MesCourses getMesCoursesById(Long id);", "@Override\n public List<Course> getCourses() {\n return courseDao.findAll();\n }", "@Override\r\n\tpublic Set<Course> getAllCources() throws SQLException {\n\t\tSet<Course> courses = new HashSet<Course>();\r\n\t\tStatement statement = connection.createStatement();\r\n\t\tString sql = \"Select * from course\";\r\n\t\tResultSet resultSet = statement.executeQuery(sql);\r\n\t\twhile (resultSet.next()) {\r\n\t\t\tCourse course = new Course();\r\n\t\t\tcourse.setIdCourse(resultSet.getInt(\"idCourse\"));\r\n\t\t\tcourse.setDecription(resultSet.getString(\"decription\"));\r\n\t\t\tcourse.setDuration(resultSet.getString(\"duration\"));\r\n\t\t\tcourse.setName(\"name\");\r\n\t\t\tcourse.setPrerequisites(\"prerequisites\");\r\n\t\t\tcourses.add(course);\r\n\t\t}\r\n\t\treturn courses;\r\n\t}", "public String getCourseCode() {\n\t\treturn CourseCode;\n\t}", "public java.util.List<com.ms3.training.services.model.Course> findAll()\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;", "@Override\r\n\tpublic List<Courses> getCourses() {\n\t\treturn coursesdao.findAll();\r\n\t}", "public List<Models.Course> showCourses() {\n List<Models.Course> results = em.createNativeQuery(\"select cr.* from course cr, courseparticipant cpa, participant p where cr.coursecode = cpa.coursecode and cpa.participantid = p.participantid and p.userid = ?\", Models.Course.class).setParameter(1, user.getUserid()).getResultList();\n\n // Display the output\n String output = \"\";\n\n output = addChat(results.size() + \" courses were found.\");\n\n for (Models.Course course : results) {\n output += \"<div class='result display' onclick=\\\"window.location.href='Course?id=\" + course.getCoursecode() + \"'\\\">\\n\"\n + \" <div class='top'>\\n\"\n + \" <img class='icon' src='https://www.flaticon.com/svg/static/icons/svg/717/717874.svg'>\\n\"\n + \" <div class='text'>\\n\"\n + \" <a class='type'>COURSE</a>\\n\"\n + \" <a class='name'>\" + course.getTitle() + \"</a>\\n\"\n + \" <a class='subname'>\" + course.getCoursecode() + \"</a>\\n\"\n + \" </div>\\n\"\n + \" </div>\\n\"\n + \" </div>\";\n }\n\n servlet.putInJsp(\"result\", output);\n return results;\n }", "public String getCourseNum() {\n return this.courseNum;\n }", "public Long getGradeCourseId() {\n\t\treturn gradeCourseId;\n\t}", "private List<String[]> getCourseEntries() {\n \n List<String[]> list = new LinkedList<String[]>();\n \n String courseCodes = courseEntries.getText();\n StringBuilder temp = new StringBuilder();\n if (courseCodes.length() > 0) {\n \n String[] container = new String[2];\n \n for (int i = 0; i < courseCodes.length() + 1; i++) {\n \n //add the subjectCode to the container array\n if (courseCodes.length() > i && courseCodes.charAt(i) == ' ') {\n\n container[0] = temp.toString();\n temp = new StringBuilder();\n }\n //add text to the string builder\n else if (courseCodes.length() > i && courseCodes.charAt(i) != ';') {\n \n temp.append(courseCodes.charAt(i));\n }\n //add the container object with subjectCode and courseNumber to the list.\n else {\n\n container[1] = temp.toString();\n list.add(container);\n temp = new StringBuilder();\n container = new String[2];\n }\n }\n }\n \n return list;\n }", "public String getCourseName() {\r\n\t\treturn CourseName;\r\n\t}", "public String getCourseName() {\r\n return COURSE_NAME;\r\n }", "@Override\n\tpublic List<Course> findAllCourses() {\n\t\tList<Course> list = cd.findAllCourses();\n\t\tif (null == list)\n\t\t\tlist = new ArrayList<Course>();\n\t\treturn list;\n\t}", "public String getCourseCode() {\r\n\t\treturn this.courseCode;\r\n\t}", "public ArrayList<String> getExemptionCoursesList() {\r\n\t\treturn exemptionCoursesList;\r\n\t}", "public Cursor fetchAllCourses() {\r\nreturn database.query(DATABASE_TABLE, new String[] { KEY_ROWID, KEY_CATEGORY, KEY_COURSENAME, KEY_ASSIGNMENTNAME, KEY_DESCRIPTION, KEY_DUEDATE, KEY_COMPLETED }, null, null, null,\r\nnull, null);\r\n}", "@Override\r\n\tpublic List<Courseschedule> getCourseschedulesByCourseId(int courseId) {\n\t\tsession = sessionFactory.openSession();\r\n\t\tTransaction tran = session.beginTransaction();\r\n\t\tString hql = \"from Courseschedule where courseId=:courseId and state=:state\";\t\t\r\n\t\tList<Courseschedule> lists = session.createQuery(hql).setInteger(\"courseId\", courseId).setInteger(\"state\", 0).list();\r\n\t\ttran.commit();\r\n\t\tsession.close();\r\n\t\tlogger.debug(\"use the method named :getCourseschedulesByCourseId(int courseId)\");\r\n\t\tif (lists.size() > 0) {\r\n\t\t\treturn lists;\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public String getCourseNumber ( )\n\t{\n\t\treturn courseNumber;\n\t}", "public ArrayList<Assignment> getAssignmentsForCourse(Course course){\n ArrayList<Assignment> result = new ArrayList();\n \n String statement = GET_ASSIGNMENTS_FOR_COURSE;\n\n // execute the preparedstatement\n ResultSet rs = data.makePreparedStatement(statement,new Object[]{(Object)course.getId()});\n try {\n while(rs.next()){\n Assignment assignment = new Assignment(rs.getInt(\"id\"),rs.getString(\"title\"),rs.getString(\"description\"),\n rs.getDate(\"sub_dateTime\").toLocalDate(),rs.getInt(\"oral_mark\"),rs.getInt(\"total_mark\"));\n result.add(assignment);\n \n }\n } catch (SQLException ex) {\n System.out.println(\"Problem with CourseDao.getAssignmentsForCourse()\");\n }finally{\n data.closeConnections(rs,data.ps, data.conn);\n }\n \n return result;\n }", "public TreeSet<String> getCourseList_() {\n return courseList_;\n }", "public Course(int id, String name, String description) {\n this.id = id;\n this.name = name;\n this.description = description;\n this.teachers = new ArrayList<>();\n }", "public String getCourseName() {\n\t\treturn CourseName;\n\t}", "Map<String, String> fetchCourseDetails(String courseId);", "@GetMapping(\"/courses\")\n\tpublic List<Courses> getAllCourses() {\n\t\treturn this.cservice.getAllCourses();\n\t\t//return course;\n\t}", "@Override\n\tpublic List<Chapter> findByCourse(Integer idCourse) {\n\t\treturn rDao.findByCourse(idCourse);\n\t}", "public List getCourseTypes() throws ULMSSysException\r\n {\r\n return codeMaintainDAO.getCourseTypes();\r\n }", "public Course getCourseById(int id) {\n\t\treturn null;\n\t}", "public String getCourseName() {\n return this.courseName;\n }", "public Long getTeacCourseId() {\n return teacCourseId;\n }", "public List<Subject> getsixthsubj(String course) {\n\t\treturn sub_dao.getsixthsubj(course);\r\n\t}", "public ArrayList<String> getCompletedCoursesList() {\r\n\t\treturn completedCoursesList;\r\n\t}", "@GetMapping(\"/courses\")\r\n\tpublic List<Courses> getCourses() {\r\n\t\treturn this.cs.getCourses();\r\n\r\n\t}", "courses selectByPrimaryKey(String courseId);", "public String getCourseName() {\n return courseName;\n }", "public List<CourseType> searchAllCourses(){\n ArrayList<CourseType> courses = new ArrayList<>();\n Connection connection = getConnection();\n if(connection != null){\n try{\n PreparedStatement preparedStatement = connection.prepareStatement(\"SELECT * from Courses\");\n ResultSet resultSet = preparedStatement.executeQuery();\n while (resultSet.next()){\n courses.add(new CourseType(\n \t\tresultSet.getInt(1),\n resultSet.getString(2),\n resultSet.getString(3),\n resultSet.getInt(4),\n resultSet.getInt(5),\n resultSet.getInt(6)));\n }\n }catch (SQLException e){e.printStackTrace();}\n finally {\n closeConnection(connection);\n }\n }\n return courses;\n }", "public void setIdCourse(Long idCourse) {\n this.idCourse = idCourse;\n }", "public static ArrayList<Course> getAll() {\n return courses;\n }", "@ResponseBody\n @RequestMapping(value=\"/usercourses\", method=RequestMethod.GET)\n public LinkedList<Completed> usersCourses(@RequestParam(\"ID\") String id){\n dbManager.initializeDatabase();\n int ID=Integer.parseInt(id);\n LinkedList<Completed> usersCurrent=dbManager.getUsersCourseList(ID);\n dbManager.closeDatabase();\n return usersCurrent;\n }" ]
[ "0.79026586", "0.72843665", "0.7077969", "0.69632465", "0.69348484", "0.69164526", "0.69053483", "0.6882769", "0.6837188", "0.6741571", "0.66894835", "0.6678368", "0.66542625", "0.6652792", "0.66208947", "0.65541756", "0.6504425", "0.65043974", "0.64785653", "0.6468129", "0.6465358", "0.64273584", "0.6420905", "0.64061254", "0.6405798", "0.63598263", "0.6333513", "0.6275627", "0.6273646", "0.6272015", "0.62666696", "0.6251909", "0.62378174", "0.620919", "0.6198908", "0.6185714", "0.61654764", "0.61608475", "0.61438656", "0.6123816", "0.6114103", "0.61096877", "0.60959303", "0.60867304", "0.6084212", "0.607557", "0.6071853", "0.60580206", "0.604794", "0.60348624", "0.6033056", "0.6029149", "0.60180646", "0.6011545", "0.59968245", "0.59845334", "0.59777755", "0.5960663", "0.595999", "0.59539723", "0.59473", "0.59431654", "0.59283996", "0.5894786", "0.5877347", "0.58770525", "0.5869177", "0.5862004", "0.5853285", "0.58468753", "0.58391154", "0.5830071", "0.58291703", "0.58063954", "0.5803236", "0.5802287", "0.5797073", "0.5789394", "0.5788835", "0.57814395", "0.5779504", "0.57751995", "0.5772919", "0.5772141", "0.5768555", "0.5759925", "0.5729888", "0.5724109", "0.5721368", "0.57187", "0.5713185", "0.5709432", "0.5700603", "0.5695529", "0.5693899", "0.5682527", "0.56787676", "0.5676796", "0.56649154", "0.5657741" ]
0.8243097
0
Set all catalog description to "inactive" status
public void setCatalogDescriptionToInactive();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void setInactive() {\r\n\t\tactive = false;\r\n\t}", "public void setInactive() {\n\t\tactive = false;\n\t}", "void markInactive();", "public final void setInactive(java.lang.Boolean inactive)\r\n\t{\r\n\t\tsetInactive(getContext(), inactive);\r\n\t}", "void setInactive(boolean aInactive) {\n/* 4829 */ this.inactive = aInactive;\n/* */ }", "public final void setInactive(com.mendix.systemwideinterfaces.core.IContext context, java.lang.Boolean inactive)\r\n\t{\r\n\t\tgetMendixObject().setValue(context, MemberNames.Inactive.toString(), inactive);\r\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn \"inactive\";\n\t}", "public void deactivate(){\n state = State.invisible;\n active = false;\n }", "public void deactivate() {\n\t\tactive_status = false;\n\t}", "public void setStatus( boolean avtive ){\r\n\t\tthis.activ = avtive;\r\n\t}", "public void setInactiveCount(int tmp) {\n this.inactiveCount = tmp;\n }", "public void setSuspended() {\n \tfor (int i = 0; i < listAnimals.size(); i++) \n\t\t{\n\t\t\tlistAnimals.get(i).setSuspended();\n\t\t\trepaint();\n\t\t}\n }", "@Override\n\tpublic boolean isInactive();", "public boolean isInactive();", "public void deactivate() {\n this.active = false;\n }", "void deactivate(){\n \tthis.config.clear();\n\t\tlog.debug(bundleMarker,\"deactivating...\");\n\t}", "public void setOffline() {\r\n \t for (Utente u: utenti) { \r\n \t\t u.setStatus(\"OFFLINE\");\r\n \t }\r\n }", "public void setActiveStatus(Boolean active){ this.status = active; }", "private void activationOFF() {\n switch (afficheChoix) {\n case AFFICHE_SPOOL :\n ecranSpool.desactivatedContents();\n break;\n case AFFICHE_USER :\n ecranUser.desactivatedContents();\n break;\n case AFFICHE_CONFIG :\n ecranConfig.desactivatedContents();\n break;\n default: break;\n }\n }", "public void deactivate() {\n\t\t// TODO Auto-generated method stub\n\t}", "boolean isInactive() {\n String value = configData.get(IS_ACTIVE_KEY, \"true\");\n return !Boolean.parseBoolean(value);\n }", "void deactivate();", "public void deactivate();", "public StateChangeMdiIcon inactive() {\n defaultIcon.inactive();\n statesMap.values().forEach(MdiIcon::inactive);\n return this;\n }", "public void setUnstable() {\n this.unstable = true;\n this.unstableTimeline.play();\n if (this.online == true) {\n this.statusLed.setStatus(\"alert\");\n this.statusLed.setFastBlink(true);\n }\n }", "public void deactivate() {\n log.info(\"Stopped\");\n }", "public void setIsActive(boolean value) {\r\n this.isActive = value;\r\n }", "public void disable(){\r\n\t\tthis.activ = false;\r\n\t}", "public int setInactiveForNoRebill();", "void unsetDescription();", "void unsetDescription();", "@Override\r\n\tpublic void deactivate() {\n\t\t\r\n\t}", "public void changeAvailability() {\n\t\tavailability = !availability;\n\t}", "boolean isInactive() {\n/* 4818 */ return this.inactive;\n/* */ }", "public abstract void setBusy (String description);", "@Override\n\tpublic void deactivate() {\n\t}", "public void setInactiveCount(String tmp) {\n this.inactiveCount = Integer.parseInt(tmp);\n }", "public void setActive(boolean active);", "public void setActive(boolean active);", "public void setActive(boolean active);", "@Override\n public void deactivate() {\n \n }", "@Override\n\tpublic void deactivate() {\n\t\t\n\t}", "public void setStatus(boolean newstatus){activestatus = newstatus;}", "public abstract void deactivate();", "public void setIsActive(Boolean isActive) {\r\n this.isActive = isActive;\r\n }", "public void setIsActive( Boolean isActive ) {\n this.isActive = isActive;\n }", "@Override\n\tpublic boolean isInactive() {\n\t\treturn model.isInactive();\n\t}", "org.hl7.fhir.Boolean getInactive();", "public void deactivateAllActiveSubscriptions() throws AndesException {\n\n Map<String, String> subscriptions = andesContextStore.getAllDurableSubscriptionsByID();\n Map<String, String> modifiedSubscriptions = new HashMap<>();\n for (Map.Entry<String, String> entry : subscriptions.entrySet()) {\n\n if (log.isDebugEnabled()) {\n log.debug(\"Deactivating subscription with id: \" + entry.getKey());\n }\n BasicSubscription subscription = new BasicSubscription(entry.getValue());\n\n //The HasExternalSubscriptions attribute of a subscription indicates whether the the subscription is active\n //Therefore, setting it to false makes the subscriptions inactive\n subscription.setHasExternalSubscriptions(false);\n\n modifiedSubscriptions.put(entry.getKey(), subscription.encodeAsStr());\n\n }\n\n //update all the stored durable subscriptions to be inactive\n andesContextStore.updateDurableSubscriptions(modifiedSubscriptions);\n }", "public void setIsActive(Boolean isActive) {\n this.isActive = isActive;\n }", "public void setIsActive(Boolean isActive) {\n this.isActive = isActive;\n }", "public void setIsActive(boolean isActive) {\n this.isActive = isActive;\n }", "public void disable(){\n if(criticalStop) return;\n getModel().setStatus(false);\n }", "public void botoiaDesaktibatu() {\r\n\t\tordaindu_Botoia.setEnabled(false);\r\n\t}", "void setNilDescription();", "@Override\n\tpublic void setDescription(java.lang.String description) {\n\t\t_dmGtStatus.setDescription(description);\n\t}", "void deactivate() {\n\t\tanimalTemplate = null;\n\t\tscope=null;\n\t\ttriggerOnID=false;\n\t\tstate = null;\n\t\tlog.debug(bundleMarker, \"deactivating...\");\n\t}", "public void setIsActive(Byte isActive) {\n this.isActive = isActive;\n }", "public void setDenied() {\r\n\t\tstatus = \"Denied\";\r\n\t}", "protected void ACTION_B_DISABLE(ActionEvent arg0) {\n\r\n\t\tL_FilterStatusBox.setText(\"Disabled (All Ports)\");\r\n\t}", "public void setIsActive(Integer isActive) {\n this.isActive = isActive;\n }", "public void setIsActive (boolean IsActive);", "public void setIsActive (boolean IsActive);", "public void setIsActive (boolean IsActive);", "public void setIsActive (boolean IsActive);", "public void setIsActive (boolean IsActive);", "public void setIsActive (boolean IsActive);", "public void setIsActive (boolean IsActive);", "public void setIsActive (boolean IsActive);", "public void setIsActive (boolean IsActive);", "public void setIsActive (boolean IsActive);", "public void setIsActive (boolean IsActive);", "public void setIsActive (boolean IsActive);", "public void setIsActive( boolean isActive )\n\t{\n\t\tthis.isActive\t= isActive;\n\t}", "public void setInvisible(boolean b)\n\t{\n\t\t_invisible = b;\n\t}", "public void setActive(Boolean active)\r\n/* */ {\r\n/* 207 */ this.active = active;\r\n/* */ }", "public void deactivateAll() {\n for (int i = 0; i < numFrequencies; i++)\n isActive[i] = false;\n\n numActive = 0;\n }", "void setActiveDescription(MultiViewDescription description) {\n \n if (currentEditor == description) return;\n MultiViewDescription old = currentEditor;\n currentEditor = description;\n // fireSelectionChanged(old, description);\n }", "protected synchronized void setActive(final boolean b) {\n active = b;\n }", "public void setStatusDecription(String statusDecription) {this.statusDecription = statusDecription;}", "protected void onDiscard() {\r\n this.setActive(false);\r\n }", "public void unsetDescription()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_attribute(DESCRIPTION$8);\r\n }\r\n }", "public void setNotiDescription(String value) {\r\n setAttributeInternal(NOTIDESCRIPTION, value);\r\n }", "public void unsetDescription()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_attribute(DESCRIPTION$14);\n }\n }", "public void setActive(boolean active) { \n this.active = active;\n }", "private void barDisableAll() {\n imgNinja.setImageDrawable(resources.getDrawable(R.drawable.ic_banana_dis));\n imgFruiter.setImageDrawable(resources.getDrawable(R.drawable.ic_like_dis));\n imgHack.setImageDrawable(resources.getDrawable(R.drawable.ic_lock_dis));\n imgNews.setImageDrawable(resources.getDrawable(R.drawable.ic_news_dis));\n tvNinja.setTextColor(resources.getColor(R.color.barTextDisabled));\n tvFruiter.setTextColor(resources.getColor(R.color.barTextDisabled));\n tvHack.setTextColor(resources.getColor(R.color.barTextDisabled));\n tvNews.setTextColor(resources.getColor(R.color.barTextDisabled));\n }", "void channelInactive() throws Exception;", "void channelInactive() throws Exception;", "void setClosedCaptionState(int status);", "public void unsetBankDescription()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(BANKDESCRIPTION$2, 0);\n }\n }", "public void setXinactive (boolean xinactive) {\n\t\tthis.xinactive = xinactive;\n\t}", "private Criteria buildInactiveCriteria(){\r\n Criteria criteria = new Criteria();\r\n criteria.addEqualTo(KRADPropertyConstants.ACTIVE, false);\r\n\r\n return criteria;\r\n }", "public void setActive(boolean value) {\n this.active = value;\n }", "private void setBidded(){\n this.status = \"Bidded\";\n }", "void unsetDesc();", "public void setIsActive(boolean isActive) {\n\t\tthis.isActive = isActive;\n\t}", "void statusUpdate(boolean invalid);", "public void setActive(boolean isActive) {\r\n\t\tthis.isActive = isActive;\r\n\t}", "void setDescription(State state);", "public boolean isActive(){\n\t\treturn false;\n\t}" ]
[ "0.6904907", "0.68650997", "0.6311886", "0.62786853", "0.6249804", "0.62290585", "0.60083896", "0.591576", "0.58484477", "0.5659383", "0.5623321", "0.5622211", "0.5589425", "0.5547557", "0.55409724", "0.55236554", "0.54654765", "0.5447315", "0.5444631", "0.542959", "0.5390892", "0.53713834", "0.53685683", "0.536439", "0.5359216", "0.5352615", "0.5318186", "0.529608", "0.5266469", "0.5265462", "0.5265462", "0.5265459", "0.52507323", "0.52505434", "0.52499276", "0.52354705", "0.5225394", "0.5219648", "0.5219648", "0.5219648", "0.5206625", "0.5203007", "0.5199427", "0.5173899", "0.5173034", "0.5173003", "0.51559824", "0.5154012", "0.5121126", "0.5109248", "0.5109248", "0.51011354", "0.50976384", "0.5097505", "0.5095985", "0.5093296", "0.5084095", "0.50806546", "0.50803256", "0.50770634", "0.5075469", "0.50754535", "0.50754535", "0.50754535", "0.50754535", "0.50754535", "0.50754535", "0.50754535", "0.50754535", "0.50754535", "0.50754535", "0.50754535", "0.50754535", "0.50754005", "0.5072683", "0.5069564", "0.5069328", "0.505713", "0.50502527", "0.50481015", "0.50412136", "0.5039088", "0.5036806", "0.50309074", "0.50155187", "0.49867633", "0.49806818", "0.49806818", "0.4965273", "0.49648494", "0.49623823", "0.49592", "0.4953374", "0.49520764", "0.49507096", "0.49403796", "0.49309385", "0.49261892", "0.49209222", "0.49181968" ]
0.86473227
0
Get catalog description from department that have no description and which are not certificate courses
public List<CatalogDescription> getCatalogDescriptionsByDepartmentWithNoDescription(String department);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<String> getDepartmentNameWithAtLeastOneCaWithNoDescription();", "public List<CatalogDescription> getAllCatalogDescriptionsForCertificatesWithNoDescription();", "public List<CatalogDescription> getCatalogDescriptionsByDepartment(String department);", "public CatalogDescription getCatalogDescription(String course_id);", "public List<CatalogDescription> getAllCatalogDescriptionsForCertificate();", "public List<CatalogDescription> getCatalogDescriptionsByDepartment(String department, boolean showInactives);", "public String getCourseDesc() {\n return courseDesc;\n }", "public static String courseDescription(long idCorso) {\n\t\tRequestContent rp = new RequestContent();\n\t\trp.type = RequestType.COURSE_DESCRIPTION;\n\t\trp.parameters = new Object[] { idCorso };\n\t\tReceiveContent rpc = sendReceive(rp);\n\t\tString descr = (String) rpc.parameters[0];\n\t\treturn descr;\n\t\t\n\t}", "public CatalogDescription getCatalogDescription(Long id);", "public CatalogDescription getLastVersionCatalogDescription(String courseId);", "java.lang.String getDesc();", "public String getCourses() throws CustomExceptions.InvalidInputException {\n Collections.sort(courses);\n StringBuilder builder = new StringBuilder();\n if (!courses.isEmpty()) {\n for (CurriculumItem course : courses) {\n builder.append(String.format(\"|--[%1s] %13s -----|\\n\",\n getCurriculumItemCompletionStatus(course),\n Manipulators.getCurriculumItemAsShortString(course)));\n }\n } else {\n return \"No courses found for Academic Term: \" + name;\n }\n return builder.toString();\n }", "public TreeMap<String, Course> getDepartmentCourses(String dept) {\n TreeMap<String, Course> map = new TreeMap<>();\n\n for (Course c : courses.values()) {\n if (c.getCourseId().contains(dept)) {\n map.put(c.getCourseId(), c);\n }\n }\n\n return map;\n }", "public boolean descriptionExists(String course_id);", "public M csseDescNull(){if(this.get(\"csseDescNot\")==null)this.put(\"csseDescNot\", \"\");this.put(\"csseDesc\", null);return this;}", "java.lang.String getProductDescription();", "java.lang.String getDescription();", "java.lang.String getDescription();", "java.lang.String getDescription();", "java.lang.String getDescription();", "java.lang.String getDescription();", "java.lang.String getDescription();", "java.lang.String getDescription();", "java.lang.String getDescription();", "java.lang.String getDescription();", "public List<CatalogDescription> getAllCatalogDescriptionsForCertificate(boolean showInactives);", "String getDescriptionIfNotMet();", "io.dstore.values.StringValueOrBuilder getPageCategoryDescriptionOrBuilder();", "@Override\n public String getDescription() {\n return \"Digital goods delisting\";\n }", "public void setCatalogDescriptionToInactive();", "io.dstore.values.StringValue getPageCategoryDescription();", "boolean getCampaignDescriptionNull();", "public String getCertDescription() {\n return certDescription;\n }", "String getDesc();", "public String getDescription() {\n if ((desc == null) && (forVar != null)) {\n Attribute att = forVar.findAttributeIgnoreCase(CDM.LONG_NAME);\n if ((att != null) && att.isString())\n desc = att.getStringValue();\n\n if (desc == null) {\n att = forVar.findAttributeIgnoreCase(\"description\");\n if ((att != null) && att.isString())\n desc = att.getStringValue();\n }\n\n if (desc == null) {\n att = forVar.findAttributeIgnoreCase(CDM.TITLE);\n if ((att != null) && att.isString())\n desc = att.getStringValue();\n }\n\n if (desc == null) {\n att = forVar.findAttributeIgnoreCase(CF.STANDARD_NAME);\n if ((att != null) && att.isString())\n desc = att.getStringValue();\n }\n }\n return (desc == null) ? null : desc.trim();\n }", "public String getDescription(String lang) {\n/* 188 */ return getLangAlt(lang, \"description\");\n/* */ }", "@ZAttr(id=-1)\n public String[] getDescription() {\n return getMultiAttr(Provisioning.A_description);\n }", "public List<CatalogDescription> getCatalogDescriptionsByCareer(String career);", "private void testAccessibleDescription(Component comp, AccessibleContext comp_AC) {\n String desc = comp_AC.getAccessibleDescription();\n \n // LOG ONLY -/\n if(debugLog) System.err.println(LOG_CAPTION+\" - <testAccessibleDescription()> - accessibleDescription=\"+desc);\n \n if (testSettings.AP_accessibleDescription && (desc == null)){\n noDesc.add(comp);\n }\n }", "public String getCourseDept() {\n return this.courseDept;\n }", "String getDescription() {\n if (description == null) {\n return null;\n }\n if (basicControl) {\n return String.format(\"%s %s\", context.getString(description), context.getString(R.string.basicControl));\n }\n return context.getString(description);\n }", "public Department(){\n\t\tdepartName = null;\n\t\tcourses = null;\n\t}", "protected HashSet getNoDesc(){\n return tester.noDesc;\n }", "public String getCategoriaDescripcion();", "public void setCourseDesc(String courseDesc) {\n this.courseDesc = courseDesc == null ? null : courseDesc.trim();\n }", "public String obtenirDesription() {\n String description = new String(\"\");\n switch (typePlancher) {\n case CERAMIQUE:\n description = CERAMIQUE_DESC;\n break;\n case TUILESDEVINYLE:\n description = TUILESDEVINYLE_DESC;\n break;\n case LINOLEUM:\n description = LINOLEUM_DESC;\n break;\n case BOISFRANC:\n description = BOISFRANC_DESC;\n break;\n case FLOTTANT:\n description = FLOTTANT_DESC;\n }\n return description;\n }", "public default Collection<String> getDescription()\r\n\t{\r\n\t\treturn new ArrayList<String>();\r\n\t}", "private String getDepartmentString() {\n String[] departments = contact.getDepartment().split(\"\\\\$\");\n String result = \"\";\n for (String dept : departments)\n result += dept.replace('~', ',') + \"\\n\";\n return result;\n }", "boolean hasPageCategoryDescription();", "public String getExtendDPDiscountDescription() {\n\t\tString desc = \"NONE\";\n\t\t//Show any redeemed extend DP promo if any.\n\t\tSet<String> usedCodes = this.sale.getUsedPromotionCodes();\n\t\tif ( usedCodes != null) {\n\t\t\tfor(Iterator<String> it = usedCodes.iterator(); it.hasNext();) {\n\t\t\t\tPromotionI promo = PromotionFactory.getInstance().getPromotion(it.next());\n\t\t\t\tif (promo != null && promo.isExtendDeliveryPass())\n\t\t\t\t\tdesc = promo.getDescription();\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn desc;\n\t}", "@Override\n\tpublic List<Culture> ViewCourse() {\n\t\treturn null;\n\t}", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "public String getDescription()\r\n {\r\n return descriptionFilter;\r\n }", "private void showCourseCatalogue()\r\n {\r\n \tCourseCatalogue courseCat = this.getDBManager().getCourseCat();\r\n \tthis.getClientOut().printf(\"SUCCESS\\n%s\\n\", courseCat.toString());\r\n \tthis.getClientOut().flush();\r\n }", "com.microsoft.schemas.xrm._2011.contracts.Label getDescription();", "io.dstore.values.StringValue getCampaignDescription();", "@Override\n\tpublic MoodleContentResponseList getCourseContents(String course) {\n\t\treturn null;\n\t}", "@Override\r\n\tpublic Catalogue getCatalogue() {\n\t\treturn null;\r\n\t}", "public boolean hasDESCRIPTION() {\n return fieldSetFlags()[1];\n }", "public List<Course> getCourse() {\n\t\treturn null;\n\t}", "public void unsetDescription()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(DESCRIPTION$2, 0);\n }\n }", "public String getcDescription() {\n return cDescription;\n }", "public Iterable<String> certificateOfElimination(String team) {\n return null;\n }" ]
[ "0.7328087", "0.6990408", "0.69639295", "0.6781157", "0.61464715", "0.6051417", "0.57690984", "0.56742495", "0.56469834", "0.55901", "0.5588017", "0.55838245", "0.5501034", "0.5489007", "0.54713285", "0.5407968", "0.53315353", "0.53315353", "0.53315353", "0.53315353", "0.53315353", "0.53315353", "0.53315353", "0.53315353", "0.53315353", "0.5323208", "0.52397686", "0.5238596", "0.5237525", "0.5229588", "0.5208556", "0.5202867", "0.5200809", "0.5196376", "0.51688945", "0.5143477", "0.5121479", "0.51029015", "0.50907624", "0.5086106", "0.5084658", "0.50619227", "0.5047187", "0.5031763", "0.5025044", "0.50098735", "0.50040317", "0.4998372", "0.49939665", "0.4986891", "0.4985528", "0.49836227", "0.49836227", "0.49836227", "0.49836227", "0.49836227", "0.49836227", "0.49836227", "0.49836227", "0.49836227", "0.49836227", "0.49836227", "0.49836227", "0.49836227", "0.49836227", "0.49836227", "0.49836227", "0.49836227", "0.49836227", "0.49836227", "0.49836227", "0.49836227", "0.49836227", "0.49836227", "0.49836227", "0.49836227", "0.49836227", "0.49836227", "0.49836227", "0.49836227", "0.49836227", "0.49836227", "0.49836227", "0.49836227", "0.49836227", "0.49836227", "0.49836227", "0.49836227", "0.49836227", "0.4982054", "0.49811554", "0.49744943", "0.49629754", "0.49606135", "0.4959641", "0.49591795", "0.49415857", "0.49295667", "0.4927794", "0.49213192" ]
0.7960594
0
Get catalog description for certificates courses that have no description
public List<CatalogDescription> getAllCatalogDescriptionsForCertificatesWithNoDescription();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public CatalogDescription getCatalogDescription(String course_id);", "public List<CatalogDescription> getAllCatalogDescriptionsForCertificate();", "public String getCourseDesc() {\n return courseDesc;\n }", "public List<CatalogDescription> getCatalogDescriptionsByDepartmentWithNoDescription(String department);", "public CatalogDescription getLastVersionCatalogDescription(String courseId);", "public static String courseDescription(long idCorso) {\n\t\tRequestContent rp = new RequestContent();\n\t\trp.type = RequestType.COURSE_DESCRIPTION;\n\t\trp.parameters = new Object[] { idCorso };\n\t\tReceiveContent rpc = sendReceive(rp);\n\t\tString descr = (String) rpc.parameters[0];\n\t\treturn descr;\n\t\t\n\t}", "public List<CatalogDescription> getAllCatalogDescriptionsForCertificate(boolean showInactives);", "public String getCourses() throws CustomExceptions.InvalidInputException {\n Collections.sort(courses);\n StringBuilder builder = new StringBuilder();\n if (!courses.isEmpty()) {\n for (CurriculumItem course : courses) {\n builder.append(String.format(\"|--[%1s] %13s -----|\\n\",\n getCurriculumItemCompletionStatus(course),\n Manipulators.getCurriculumItemAsShortString(course)));\n }\n } else {\n return \"No courses found for Academic Term: \" + name;\n }\n return builder.toString();\n }", "public CatalogDescription getCatalogDescription(Long id);", "@Override\n\tpublic MoodleContentResponseList getCourseContents(String course) {\n\t\treturn null;\n\t}", "private void showCourseCatalogue()\r\n {\r\n \tCourseCatalogue courseCat = this.getDBManager().getCourseCat();\r\n \tthis.getClientOut().printf(\"SUCCESS\\n%s\\n\", courseCat.toString());\r\n \tthis.getClientOut().flush();\r\n }", "public String getCertDescription() {\n return certDescription;\n }", "public boolean descriptionExists(String course_id);", "@Override\n\tpublic MoodleContentResponseList getCourseContent(String course) {\n\t\treturn null;\n\t}", "java.lang.String getDesc();", "java.lang.String getDescription();", "java.lang.String getDescription();", "java.lang.String getDescription();", "java.lang.String getDescription();", "java.lang.String getDescription();", "java.lang.String getDescription();", "java.lang.String getDescription();", "java.lang.String getDescription();", "java.lang.String getDescription();", "public String getCourses() {\n return courses;\n }", "public List<Course> getCourse() {\n\t\treturn null;\n\t}", "@ZAttr(id=-1)\n public String[] getDescription() {\n return getMultiAttr(Provisioning.A_description);\n }", "public List<String> getDepartmentNameWithAtLeastOneCaWithNoDescription();", "String getDescription() {\n if (description == null) {\n return null;\n }\n if (basicControl) {\n return String.format(\"%s %s\", context.getString(description), context.getString(R.string.basicControl));\n }\n return context.getString(description);\n }", "@Override\n\tpublic MoodleContentResponse[] getCourseContentXML(String course) {\n\t\treturn null;\n\t}", "public List<CatalogDescription> getCatalogDescriptionsByDepartment(String department);", "public String getDescription() {\n String description = null;\n if ( !descriptions.isEmpty() ) {\n description = (String)descriptions.get(0);\n }\n return description;\n }", "@Override\n\tpublic String getCourseName() {\n\t\treturn null;\n\t}", "@Override\n\tpublic List<Culture> ViewCourse() {\n\t\treturn null;\n\t}", "public void setCourseDesc(String courseDesc) {\n this.courseDesc = courseDesc == null ? null : courseDesc.trim();\n }", "public String getcDescription() {\n return cDescription;\n }", "public Course getCourse() {\n\t\treturn null;\n\t}", "public default Collection<String> getDescription()\r\n\t{\r\n\t\treturn new ArrayList<String>();\r\n\t}", "public String[] getCourses();", "public Object getDescription() {\n\t\treturn null;\n\t}", "public ArrayList getDescription() {\n return descriptionArray;\n }", "public String getDescription(){\n \n return\"\";\n }", "com.microsoft.schemas.xrm._2011.contracts.Label getDescription();", "java.lang.String getProductDescription();", "public String describe() { return new String(\"No description.\"); }", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "String getDescription();", "public void courseInfo() {\n\t\tList<Course> unfinishedCourses = super.getUnfinishedCourses();\n\t\tList<Course> finishedCourses = super.getFinishedCourses();\n\n\t\tString retStr = \"Unfinished Courses: \";\n\t\tfor (int i = 0; i < unfinishedCourses.size(); i++) {\n \tretStr += unfinishedCourses.get(i);\n \tif (i != unfinishedCourses.size()-1) {\n\t\t\t\tretStr += \", \";\n \t}\n\t\t}\n\t\tretStr += \"\\nFinished Courses: \";\n\t\tfor (int i = 0; i < finishedCourses.size(); i++) {\n \tretStr += finishedCourses.get(i);\n \tif (i != finishedCourses.size()-1) {\n\t\t\t\tretStr += \", \";\n \t}\n\t\t}\n\t\tretStr += \"\\nHP: \" + this.hp;\n\t\tSystem.out.println(retStr);\n\t}", "public void printNotfullcourses() {\n\t\tfor (int i = 0; i < CourseManager.courses.size(); i++) {\n\t\t\tif (CourseManager.courses.get(i).checkFull() == false) {\n\t\t\t\tSystem.out.println(i + 1 + \". \" + CourseManager.courses.get(i).getName());\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n\tpublic Catalogue getCatalogue() {\n\t\treturn null;\r\n\t}", "public M csseDescNull(){if(this.get(\"csseDescNot\")==null)this.put(\"csseDescNot\", \"\");this.put(\"csseDesc\", null);return this;}", "String getDesc();", "public String getDescription(){\n return getString(KEY_DESCRIPTION);\n }", "public String getDescription(String lang) {\n/* 188 */ return getLangAlt(lang, \"description\");\n/* */ }", "String getDescriptionIfNotMet();", "public java.lang.String[] getDescription() {\n return description;\n }", "java.lang.String getCourseName();", "public void setCatalogDescriptionToInactive();", "private void getCourseList(){\r\n\r\n CourseDAO courseDAO = new CourseDAO(Statistics.this);\r\n List<Course> courseList= courseDAO.readListofCourses();\r\n for(Course course: courseList) {\r\n courses.add(course.getName());\r\n }\r\n\r\n }", "public String getDescription() {\n/* 179 */ return getDescription((String)null);\n/* */ }", "@Override\r\n\tpublic String getDescription() {\n\t\treturn null;\r\n\t}", "@Override\r\n\tpublic String getDescription() {\n\t\treturn null;\r\n\t}", "@Override\n\tpublic String getDescription() {\n\t\treturn null;\n\t}", "@Override\n\tpublic String getDescription() {\n\t\treturn null;\n\t}" ]
[ "0.7738771", "0.7401594", "0.6624837", "0.6559037", "0.6553148", "0.6397556", "0.6241362", "0.6185084", "0.61353076", "0.6056381", "0.60105306", "0.60027605", "0.59042054", "0.58993685", "0.58024496", "0.57750773", "0.57750773", "0.57750773", "0.57750773", "0.57750773", "0.57750773", "0.57750773", "0.57750773", "0.57750773", "0.5763595", "0.5750804", "0.572995", "0.57204926", "0.5686863", "0.5671982", "0.5636705", "0.56042033", "0.5590779", "0.55827314", "0.5566462", "0.55580944", "0.5548042", "0.55292076", "0.5525012", "0.55044043", "0.54973644", "0.54884225", "0.5477823", "0.54763603", "0.5469431", "0.54640293", "0.54640293", "0.54640293", "0.54640293", "0.54640293", "0.54640293", "0.54640293", "0.54640293", "0.54640293", "0.54640293", "0.54640293", "0.54640293", "0.54640293", "0.54640293", "0.54640293", "0.54640293", "0.54640293", "0.54640293", "0.54640293", "0.54640293", "0.54640293", "0.54640293", "0.54640293", "0.54640293", "0.54640293", "0.54640293", "0.54640293", "0.54640293", "0.54640293", "0.54640293", "0.54640293", "0.54640293", "0.54640293", "0.54640293", "0.54640293", "0.54640293", "0.54640293", "0.54640293", "0.54626423", "0.5458454", "0.54572517", "0.5454941", "0.54459274", "0.54417336", "0.54211646", "0.541518", "0.54074836", "0.539688", "0.5395847", "0.5378399", "0.5377222", "0.5372631", "0.5372631", "0.53692114", "0.53692114" ]
0.8099123
0
Get all departments that have at least one catalog description with an empty description
public List<String> getDepartmentNameWithAtLeastOneCaWithNoDescription();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<CatalogDescription> getCatalogDescriptionsByDepartmentWithNoDescription(String department);", "public List<CatalogDescription> getCatalogDescriptionsByDepartment(String department);", "public List<CatalogDescription> getAllCatalogDescriptionsForCertificatesWithNoDescription();", "public boolean isSetDescription()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(DESCRIPTION$2) != 0;\n }\n }", "public boolean isSetDescription() {\n return this.description != null;\n }", "public boolean isSetDescription() {\n return this.description != null;\n }", "public boolean isSetDescription() {\n return this.description != null;\n }", "boolean hasDescription();", "boolean hasDescription();", "boolean hasDescription();", "public List<CatalogDescription> getCatalogDescriptionsByDepartment(String department, boolean showInactives);", "@Override\n public List<Department> getAllDepartments() {\n return null;\n }", "public boolean isSetDescription() {\n return this.Description != null;\n }", "boolean getCampaignDescriptionNull();", "public boolean descriptionExists(String course_id);", "public boolean isSetBankDescription()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(BANKDESCRIPTION$2) != 0;\n }\n }", "boolean isSetDescription();", "boolean isSetDescription();", "@Override\n\t\t\tpublic List<Dept> queryAll() {\n\t\t\t\treturn null;\n\t\t\t}", "public boolean isSetDescription()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().find_attribute_user(DESCRIPTION$14) != null;\n }\n }", "boolean isSetDesc();", "public M csseDescNull(){if(this.get(\"csseDescNot\")==null)this.put(\"csseDescNot\", \"\");this.put(\"csseDesc\", null);return this;}", "public boolean isSetDescription()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return get_store().find_attribute_user(DESCRIPTION$8) != null;\r\n }\r\n }", "@Test\n\tpublic void basic_courses_without_students(){\n\t\t\n\t\tCriteriaBuilder criteriaBuilder = em.getCriteriaBuilder();\n\t\tCriteriaQuery<Course> criteriaQuery = criteriaBuilder.createQuery(Course.class);\n\t\t\n\t\t//2. Define root tables which are involved into query\n\t\tRoot<Course> courseRoot = criteriaQuery.from(Course.class);\t\t\n\n\t\t//3. Define predicate using criteria builder\n\t\tPredicate isEmptyStudentPredicate = criteriaBuilder.isEmpty(courseRoot.get(\"students\"));\n\t\t\n\t\t//4. Add predictes to the criteria query\n\t\tcriteriaQuery.where(isEmptyStudentPredicate);\n\t\t\n\t\t//5. Defined Typed Query\n\t\tTypedQuery<Course> query = em.createQuery(criteriaQuery.select(courseRoot));\n\t\t\n\t\tList<Course> resultList = query.getResultList();\n\t\t\n\t\tlogger.info(\"isEMPTY STUDENT COURSES ==> {}\", resultList);\n\t\t\t\n\t\t\n\t}", "@Override\n\t\t\tpublic List<Dept> findAll() {\n\t\t\t\treturn null;\n\t\t\t}", "public boolean isSetDesc()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return get_store().find_attribute_user(DESC$10) != null;\r\n }\r\n }", "public boolean isEmpty() { return this.filterExpression.length()==0; }", "boolean hasCampaignDescription();", "boolean hasPageCategoryDescription();", "private void defaultDepartmentShouldNotBeFound(String filter) throws Exception {\n restDepartmentMockMvc.perform(get(\"/api/departments?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))\n .andExpect(jsonPath(\"$\").isArray())\n .andExpect(jsonPath(\"$\").isEmpty());\n\n // Check, that the count call also returns 0\n restDepartmentMockMvc.perform(get(\"/api/departments/count?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))\n .andExpect(content().string(\"0\"));\n }", "@java.lang.Override\n public boolean hasCatalog() {\n return catalog_ != null;\n }", "public boolean isSetDepartment() {\n return this.department != null;\n }", "@Override\n public boolean isEmpty() {\n return filtered.isEmpty();\n }", "public boolean isEmptyNestedClauses ();", "public boolean dealtIsEmpty() {\r\n\t\treturn dealt.isEmpty();\r\n\t}", "public boolean hasCampaignDescription() {\n return campaignDescription_ != null;\n }", "boolean isNilDescription();", "@Override\n public boolean shouldRun(Description description) {\n for(Description child : description.getChildren()){\n if(shouldRun(child)){\n return true;\n }\n }\n\n Collection<Class<?>> categories = getCategories(description);\n\n if (allCategoriesAreIncluded()) {\n return categoriesAreNotExcluded(categories);\n }\n\n return categoriesAreNotExcluded(categories)\n && categoriesAreIncluded(categories);\n\n }", "public void testAddPaymentTerm_EmptyDescription() throws Exception {\r\n try {\r\n PaymentTerm paymentTerm = this.getPaymentTermWithOutId();\r\n paymentTerm.setDescription(\" \");\r\n this.getManager().addPaymentTerm(paymentTerm);\r\n fail(\"IllegalArgumentException is expected\");\r\n } catch (IllegalArgumentException e) {\r\n assertTrue(e.getMessage()\r\n .indexOf(\"The description of PaymentTerm to be added should not be empty\") >= 0);\r\n }\r\n }", "private void defaultDepartmentShouldNotBeFound(String filter) throws Exception {\n restDepartmentMockMvc\n .perform(get(ENTITY_API_URL + \"?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))\n .andExpect(jsonPath(\"$\").isArray())\n .andExpect(jsonPath(\"$\").isEmpty());\n\n // Check, that the count call also returns 0\n restDepartmentMockMvc\n .perform(get(ENTITY_API_URL + \"/count?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))\n .andExpect(content().string(\"0\"));\n }", "private void defaultDepartmentShouldNotBeFound(String filter) throws Exception {\n restDepartmentMockMvc\n .perform(get(ENTITY_API_URL + \"?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))\n .andExpect(jsonPath(\"$\").isArray())\n .andExpect(jsonPath(\"$\").isEmpty());\n\n // Check, that the count call also returns 0\n restDepartmentMockMvc\n .perform(get(ENTITY_API_URL + \"/count?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))\n .andExpect(content().string(\"0\"));\n }", "public Builder clearCampaignDescriptionNull() {\n \n campaignDescriptionNull_ = false;\n onChanged();\n return this;\n }", "public List<Artist> getArtistsWhichHaveNoReleases();", "private List<String> returnEmptyRequiredFields(List<String> requiredFields, Object givenObject){\n return requiredFields.stream()\n .filter(x -> {\n try {\n return StringUtils.isEmpty((String) givenObject.getClass().getDeclaredField(x).get(givenObject));\n } catch (Exception e) {\n //Not going to try and scmOrganization for exceptions; if there is an exception we probably have greater issues than an empty/null field\n getLog().debug(String.format(\"Unable to ascertain if %s is null/empty\",x));\n return true;\n }\n })\n .collect(Collectors.toList());\n }", "public boolean hasCampaignDescription() {\n return campaignDescriptionBuilder_ != null || campaignDescription_ != null;\n }", "@Override\n\tpublic List<DeptInf> findAllDept() {\n\t\tDeptInfExample example = new DeptInfExample();\n\t\tList<DeptInf> list = deptMapper.selectByExample(example);\n\t\treturn list;\n\t}", "public boolean isEmpty() {\n this.ensureAtLeastPartResolved();\n return isNull;\n }", "public void validateDescription (String description){\n boolean isValid = description != null && !description.isEmpty();\n setDescriptionValid(isValid);\n }", "public boolean hasPageCategoryDescription() {\n return pageCategoryDescriptionBuilder_ != null || pageCategoryDescription_ != null;\n }", "public boolean hasCatalog() {\n return ((bitField0_ & 0x00000002) != 0);\n }", "public Builder setCampaignDescriptionNull(boolean value) {\n \n campaignDescriptionNull_ = value;\n onChanged();\n return this;\n }", "private boolean thisAnswerExist(String description){\n \tboolean exist = false;\n \tif(answers.isEmpty() == false){\n\t \tfor(Answer a : answers){\n\t \t\tif(a.getMeeting().getDescription().equals(description)){\n\t \t\t\texist = true;\n\t \t\t}\n\t \t}\t\n \t}\n \treturn exist;\n }", "public boolean isSetDescricao() {\n return this.descricao != null;\n }", "public boolean isSetDescricao() {\n return this.descricao != null;\n }", "public boolean isSetDescricao() {\n return this.descricao != null;\n }", "public boolean isSetDescricao() {\n return this.descricao != null;\n }", "@Transactional(readOnly = true) \n public List<DepositoryInfoDTO> findAllWhereApplicationProspectIsNull() {\n log.debug(\"Request to get all depositoryInfos where ApplicationProspect is null\");\n return StreamSupport\n .stream(depositoryInfoRepository.findAll().spliterator(), false)\n .filter(depositoryInfo -> depositoryInfo.getApplicationProspect() == null)\n .map(depositoryInfoMapper::toDto)\n .collect(Collectors.toCollection(LinkedList::new));\n }", "public boolean isSetDescription() {\n return (this.description != null ? this.description.isSetValue() : false);\n }", "public boolean hasDESCRIPTION() {\n return fieldSetFlags()[1];\n }", "@Transactional(readOnly = true) \n public List<HistouriqueStatutDemandeDTO> findAllWhereDemandeIsNull() {\n log.debug(\"Request to get all histouriqueStatutDemandes where Demande is null\");\n return StreamSupport\n .stream(histouriqueStatutDemandeRepository.findAll().spliterator(), false)\n .filter(histouriqueStatutDemande -> histouriqueStatutDemande.getDemande() == null)\n .map(histouriqueStatutDemandeMapper::toDto)\n .collect(Collectors.toCollection(LinkedList::new));\n }", "@Override\n public boolean isEmpty() {\n return super.isEmpty() && ElementUtil.isEmpty(subsidyCode, programCode, prescriberTypes, notes, cautionaryNotes,\n restriction, commonwealthExManufacturerPrice, manufacturerExManufacturerPrice);\n }", "List<Post> findAllDescAndDeletedIsFalse();", "protected boolean islSubsWithTranslationsNull() {\n List<List<NetSubtitle>> swt = lSubsWithTranslations;\n return (swt == null || swt.size() < 2 ||\n swt.get(0) == null || swt.get(0).isEmpty() ||\n swt.get(1) == null || swt.get(1).isEmpty());\n }", "boolean getCharacteristicDescriptionNull();", "public boolean isEmpty() {\r\n return treasures.isEmpty();\r\n }", "public List<Department> getAllDepartments();", "public boolean isSetStationDescription()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return get_store().find_attribute_user(STATIONDESCRIPTION$20) != null;\r\n }\r\n }", "@Override\n\tpublic boolean isEmpty() {\n\t\treturn frontier.isEmpty();\n\t}", "void isArrayEmpty(ArrayList<UserContactInfo> contactDeatailsList);", "public boolean isEmpty() { return count == 0; }", "private List<Factor> getEmpty(List<Factor> factors) {\n ArrayList<Factor> filt = new ArrayList<Factor>();\n for (Factor f : factors) {\n if (f.getVars().size() == 0) {\n filt.add(f);\n }\n }\n return filt;\n }", "public boolean hasPageCategoryDescription() {\n return pageCategoryDescription_ != null;\n }", "public Builder clearCatalog() {\n bitField0_ = (bitField0_ & ~0x00000002);\n catalog_ = null;\n if (catalogBuilder_ != null) {\n catalogBuilder_.dispose();\n catalogBuilder_ = null;\n }\n onChanged();\n return this;\n }", "public void unsetDescription()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(DESCRIPTION$2, 0);\n }\n }", "public boolean isAListEmpty(){\r\n\t\tif((programChairs.size() > 0) && (committeeMembers.size() > 0)){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public boolean getCampaignDescriptionNull() {\n return campaignDescriptionNull_;\n }", "boolean getGroupByCategoryNull();", "public boolean isEmptyNestedClauses () {\r\n\t\t\t// clauses are asserted not to be null (because we do not have a setter for clauses)\r\n\t\t\treturn (this.clauses.size() == 0);\r\n\t\t}", "QueryElement addOrEmpty(String collectionProperty);", "public boolean getCampaignDescriptionNull() {\n return campaignDescriptionNull_;\n }", "public boolean hasDescription() {\n return fieldSetFlags()[1];\n }", "public boolean isEmptyComplexValue() {\r\n if(complexValue==null){\r\n return true;\r\n }\r\n return complexValue.isEmpty();\r\n }", "public static boolean isNullOrEmpty( final Collection< ? > c ) {\n return c == null || c.isEmpty();\n }", "public Builder clearDescription() {\n \n description_ = getDefaultInstance().getDescription();\n onChanged();\n return this;\n }", "public boolean isEmpty() {\n return attestationsByValidatorCount.isEmpty();\n }", "private boolean CheckEmptyServices(List<Services> services){\n for(Services service : services){\n if(service.getServiceQuantity() > 0){\n return false;\n }\n }\n return true;\n }", "private boolean isDescriptionInDocGeneratorResponse(DocumentGeneratorResponse response) {\n\n if (StringUtils.isBlank(response.getDescription())) {\n Map<String, Object> logMap = new HashMap<>();\n logMap.put(LOG_MESSAGE_KEY,\n \"The description has not been in the Document Generator Response\");\n LOGGER.error(LOG_DOC_GENERATOR_RESPONSE_INVALID_MESSAGE_KEY, logMap);\n\n return false;\n }\n return true;\n }", "@UsesAdsUtilities({AdsUtility.SELECTOR_BUILDER})\n SelectorBuilderInterface<SelectorT> containsNone(String field, String... values);", "public org.LNDCDC_NCS_NCSAR.NCSAR_BUSINESS_UNITS.apache.nifi.LNDCDC_NCS_NCSAR_NCSAR_BUSINESS_UNITS.Builder clearDESCRIPTION() {\n DESCRIPTION = null;\n fieldSetFlags()[1] = false;\n return this;\n }", "public boolean isEmpty() {\n return elements.isEmpty();\n }", "@Override\r\n\tpublic boolean isEmpty() {\n\t\treturn set.isEmpty();\r\n\t}", "public Boolean getHideEmptyFacetValues() {\r\n return getAttributeAsBoolean(\"hideEmptyFacetValues\");\r\n }", "public boolean factsEmtpy(TransportClient client){\n // Request for knowing if hits get returned or not\n SearchResponse response = client.prepareSearch(\"cityflow\")\n .setTypes(\"facts\")\n .setSearchType(SearchType.DFS_QUERY_THEN_FETCH)\n .setQuery(QueryBuilders.matchAllQuery()) // Query\n .setFrom(0).setSize(1).setExplain(true)\n .get();\n \n return response.getHits().getHits().length == 0;\n }", "private boolean isEmpty()\n {\n return dimensions.isEmpty();\n }", "public Builder setCharacteristicDescriptionNull(boolean value) {\n \n characteristicDescriptionNull_ = value;\n onChanged();\n return this;\n }", "@Test\n @IfProfileValue(name=\"dept-test-group\", values={\"all\",\"department\"})\n public void _2_2_1_getAllDept() throws Exception {\n this.mockMvc.perform(get(\"/api/v1.0/companies/\"+\n c_1.getId().toString()+\n \"/departments\")\n .header(AUTHORIZATION,ACCESS_TOKEN))\n .andDo(print())\n .andExpect(status().isOk())\n .andExpect(jsonPath(\"$._embedded.departments\",hasSize(4)));\n }", "public static void handleEmptyDescriptionException() {\n System.out.println(\"\\tSorry sir, you need to include a description of the task as well.\");\n Duke.jarvis.printDivider();\n }", "public boolean isSetAmountDescription() {\r\n return amountDescription != null;\r\n }", "public Builder clearDescription() {\n bitField0_ = (bitField0_ & ~0x00000004);\n description_ = getDefaultInstance().getDescription();\n onChanged();\n return this;\n }", "@Override\r\n\tpublic List<Dept> pagedQuery(Dept t) {\n\t\treturn null;\r\n\t}" ]
[ "0.739805", "0.5903739", "0.58746403", "0.55280405", "0.5153635", "0.5153635", "0.5153635", "0.51399934", "0.51399934", "0.51399934", "0.51158744", "0.5115171", "0.5051577", "0.50381297", "0.501458", "0.4992688", "0.49894384", "0.49894384", "0.4977305", "0.49744585", "0.4954652", "0.49410275", "0.4922063", "0.49202463", "0.49161482", "0.48751757", "0.48700204", "0.48327404", "0.47903535", "0.47901225", "0.47829247", "0.477457", "0.47546548", "0.47161642", "0.47050226", "0.46964327", "0.4693933", "0.46925104", "0.4685786", "0.46761647", "0.46761647", "0.46521926", "0.46441194", "0.46402192", "0.46384874", "0.46195552", "0.461754", "0.45843318", "0.45795", "0.4573977", "0.4571893", "0.45650193", "0.45593438", "0.45593438", "0.45593438", "0.45593438", "0.45587504", "0.45447195", "0.45428857", "0.45395902", "0.45206887", "0.4516464", "0.45074877", "0.45060804", "0.4492828", "0.44835395", "0.44816312", "0.4471759", "0.4471289", "0.44619682", "0.44613013", "0.44564557", "0.44466695", "0.44452786", "0.4444113", "0.44380635", "0.44367906", "0.44295534", "0.44288346", "0.4427909", "0.44254082", "0.4424615", "0.44190192", "0.44185886", "0.44100097", "0.44097808", "0.44093913", "0.44048765", "0.43969956", "0.4394257", "0.43880945", "0.43839186", "0.4376014", "0.43690783", "0.43671808", "0.43630356", "0.43611592", "0.4351889", "0.43443483", "0.43434367" ]
0.6722669
1
return whether or not the specified Catalog Description exists.
public boolean descriptionExists(String course_id);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean hasDescription();", "boolean hasDescription();", "boolean hasDescription();", "public boolean isSetDescription()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(DESCRIPTION$2) != 0;\n }\n }", "private boolean isCatalogPresent(CatalogDefinition catalogDefinition) throws TranslationException\n {\n\ttry\n\t{\n\t String name = \"'\" + catalogDefinition.getName() + \"'\";\n\t String version = \"'\" + catalogDefinition.getVersion() + \"'\";\n\t String releaseDate = \"'\" + catalogDefinition.getReleaseDate().getValueAsString() + \"'\";\n\n\t String sql = \"SELECT * FROM \" + PropertyLookup.getCatalogsTableName() + \" WHERE name = \" + name\n\t\t\t + \" AND version = \" + version + \" AND release_date = \" + releaseDate;\n\n\t sqlConnector.closeConnection();\n\t ResultSet result = sqlConnector.executeQuery(sql);\n\n\t // If we do NOT retrieve any row is because the catalog is not in the DB yet.\n\t return result.first();\n\t}\n\tcatch(SQLException e)\n\t{\n\t throw new TranslationException(\"Error accesing the catalogs table\", e);\n\t}\n\tcatch(IncompatibleTypeException e)\n\t{\n\t throw new TranslationException(\"Error accesing the catalog release date\", e);\n\t}\n\tfinally\n\t{\n\t sqlConnector.closeConnection();\n\t}\n }", "public boolean isSetDescription()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return get_store().find_attribute_user(DESCRIPTION$8) != null;\r\n }\r\n }", "public boolean isSetDescription()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().find_attribute_user(DESCRIPTION$14) != null;\n }\n }", "public boolean isSetDescription() {\n return this.Description != null;\n }", "boolean hasCampaignDescription();", "public boolean isSetDescription() {\n return this.description != null;\n }", "public boolean isSetDescription() {\n return this.description != null;\n }", "public boolean isSetDescription() {\n return this.description != null;\n }", "@java.lang.Override\n public boolean hasCatalog() {\n return catalog_ != null;\n }", "boolean isSetDescription();", "boolean isSetDescription();", "boolean isNilDescription();", "public boolean isSetBankDescription()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(BANKDESCRIPTION$2) != 0;\n }\n }", "boolean hasPageCategoryDescription();", "public boolean hasCampaignDescription() {\n return campaignDescription_ != null;\n }", "public boolean hasCatalog() {\n return ((bitField0_ & 0x00000002) != 0);\n }", "public boolean isSetDesc()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return get_store().find_attribute_user(DESC$10) != null;\r\n }\r\n }", "public boolean isSetStationDescription()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return get_store().find_attribute_user(STATIONDESCRIPTION$20) != null;\r\n }\r\n }", "public boolean descriptionContains(String value){\n return(((MvwDefinitionDMO) core).descriptionContains(value));\n }", "private boolean thisAnswerExist(String description){\n \tboolean exist = false;\n \tif(answers.isEmpty() == false){\n\t \tfor(Answer a : answers){\n\t \t\tif(a.getMeeting().getDescription().equals(description)){\n\t \t\t\texist = true;\n\t \t\t}\n\t \t}\t\n \t}\n \treturn exist;\n }", "public boolean hasDESCRIPTION() {\n return fieldSetFlags()[1];\n }", "public boolean hasCampaignDescription() {\n return campaignDescriptionBuilder_ != null || campaignDescription_ != null;\n }", "public boolean hasDescription() {\n return fieldSetFlags()[1];\n }", "private boolean isDescriptionInDocGeneratorResponse(DocumentGeneratorResponse response) {\n\n if (StringUtils.isBlank(response.getDescription())) {\n Map<String, Object> logMap = new HashMap<>();\n logMap.put(LOG_MESSAGE_KEY,\n \"The description has not been in the Document Generator Response\");\n LOGGER.error(LOG_DOC_GENERATOR_RESPONSE_INVALID_MESSAGE_KEY, logMap);\n\n return false;\n }\n return true;\n }", "boolean isSetDesc();", "public static boolean hiveCatalog(Configuration conf, Properties props) {\n String catalogName = props.getProperty(InputFormatConfig.CATALOG_NAME);\n String catalogType = getCatalogType(conf, catalogName);\n if (catalogType != null) {\n return CatalogUtil.ICEBERG_CATALOG_TYPE_HIVE.equalsIgnoreCase(catalogType);\n }\n catalogType = getCatalogType(conf, ICEBERG_DEFAULT_CATALOG_NAME);\n if (catalogType != null) {\n return CatalogUtil.ICEBERG_CATALOG_TYPE_HIVE.equalsIgnoreCase(catalogType);\n }\n return getCatalogProperties(conf, catalogName, catalogType).get(CatalogProperties.CATALOG_IMPL) == null;\n }", "public boolean checkDescription() {\n int size = description.length();\n return size >= 1 && size <= 256;\n }", "public boolean hasPageCategoryDescription() {\n return pageCategoryDescription_ != null;\n }", "public boolean isSetDescription() {\n return (this.description != null ? this.description.isSetValue() : false);\n }", "public boolean hasDescription() {\n return fieldSetFlags()[4];\n }", "public boolean isCatalogEntity() {\n return getCatalogId() != null;\n }", "boolean hasCharacteristicDescription();", "public boolean exists()\n\t{\n\n\t\treturn true;\n\t}", "boolean hasDescribe();", "public boolean hasCharacteristicDescription() {\n return characteristicDescription_ != null;\n }", "public boolean exists(final String title) {\n\t\treturn exists(title, null);\n\t}", "public String getIsCatalog() {\n return isCatalog;\n }", "public boolean isVehicleDescriptionLabel() {\r\n\t\treturn isElementPresent(vehicleName.replace(\"Vehicle Name\", \"Vehicle Description\"), SHORTWAIT);\r\n\t}", "public final boolean modstate_has_catalog () {\n\t\treturn modstate >= MODSTATE_CATALOG;\n\t}", "public boolean hasPageCategoryDescription() {\n return pageCategoryDescriptionBuilder_ != null || pageCategoryDescription_ != null;\n }", "public void isDescriptionCorrect(String description) {\n\t\tSystem.out.println(description);\n\t\tString text = WebUtility.getText(Locators.getLocators(\"loc.text.description\"));\n\t\tSystem.out.println(text);\n\t\tAssert.assertTrue(text.contains(data.getValidatingData(description)), \"Description is not present\");\n\n\t}", "public boolean isIncludingDescription() {\n return includingDescription;\n }", "public boolean isSetCatalogTable() {\n return this.catalogTable != null;\n }", "public boolean descriptionIsValid() {\n return bikeDescription.length() > 0 && bikeDescription.length() < MAX_DESCRIPTION_LENGTH;\n }", "public boolean isExists() {\n\t\treturn exists();\n\t}", "boolean getDesc();", "public boolean isDescriptionInitialized() {\n return description_is_initialized; \n }", "public void testexisteDescripcion()\n\t{\n\t\tString descripcion = new String(\"admin\");\n\t\tLong id = new Long(\"-1\");\n\t\t\n\t\tBoolean bol = servicio.existeDescripcion(descripcion, id);\n\t\t\tassertEquals(bol.booleanValue(), true);\n\t}", "public final boolean isValidDescriptor(String desc) {\n return getValidDescriptors().contains(desc);\n }", "public boolean hasCharacteristicDescription() {\n return characteristicDescriptionBuilder_ != null || characteristicDescription_ != null;\n }", "boolean exists();", "boolean exists();", "public boolean exist() {\n\t\treturn false;\n\t}", "@Override\r\n\tpublic boolean exists() {\n\t\treturn false;\r\n\t}", "public boolean hasDescription() {\n return ((bitField0_ & 0x00000004) == 0x00000004);\n }", "@Override\n\tpublic boolean exists() {\n\t\treturn false;\n\t}", "boolean databaseExists(String databaseName) throws CatalogException;", "public abstract boolean exists() throws VlException;", "boolean hasCategory();", "public boolean hasDescription() {\n return ((bitField0_ & 0x00000004) == 0x00000004);\n }", "public CatalogDescription getCatalogDescription(Long id);", "abstract public boolean exists() throws VlException;", "public boolean exist(Long cid) {\n\t\treturn categoryDao.exist(cid);\n\t}", "@Override\n\tpublic boolean exists(String arg0) {\n\t\treturn false;\n\t}", "public boolean isSetCaption()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(CAPTION$0) != 0;\n }\n }", "public boolean containsCategory(String categoryName);", "public abstract boolean exists();", "public boolean getExists() {\n return (review != null);\n }", "public boolean isSetCatalogSchema() {\n return this.catalogSchema != null;\n }", "boolean codeCategoryExists(UUID id)\n throws DAOException;", "public boolean hasORDERDESCRIPTION() {\n return fieldSetFlags()[1];\n }", "public static boolean doesTitleExists ( Context context, String title ){\n\n boolean exists = false;\n MovieSqlHelper movieDB = new MovieSqlHelper(context);\n Log.d(\"-fetchTitle\", title);\n Cursor MC = movieDB.getReadableDatabase().query(DBConstants.MOVIES_T,null,DBConstants.SUBJECT_C+\"=?\",new String[]{title},null,null,null);\n if ( MC.getCount() > 0 ) {\n exists=true;\n }\n else\n {\n exists=false;\n }\n\n MC.close();\n movieDB.close();\n return exists;\n }", "public boolean isSetCatalogFunction() {\n return this.catalogFunction != null;\n }", "public boolean exists() {\n \t\treturn (type != UNKNOWN && isValid() && ((type == STRING) ? !sVal.equals(\"\") : true));\n \t}", "public boolean exists( Conge conge ) ;", "public boolean isSetAmountDescription() {\r\n return amountDescription != null;\r\n }", "@Override\r\n\tpublic boolean itemExists(String absPath) throws RepositoryException {\n\t\treturn false;\r\n\t}", "public CatalogDescription getCatalogDescription(String course_id);", "public boolean exists() throws LRException\n\t{\n\t\tDataHRecordData myData=(DataHRecordData)getData();\n\t\tgetBackground();\n\t\ttry { return myData.record.exists(background.getClient()); }\n\t\tcatch (LDBException e) { setStatus(e); }\n\t\treturn false;\n\t}", "public static boolean exists(){\n \t\treturn everbie != null;\n \t}", "public boolean isExists() {\n return getIndexOperations().exists();\n }", "public boolean getExists();", "public boolean containsKeyword(String keyword) {\n String lcKeyword = keyword.toLowerCase();\n String lcDescription = description.toLowerCase();\n return lcDescription.contains(lcKeyword);\n }", "public boolean doLiteratureExist(String literatureTitle) {\n Iterator<Literature> it = literatureRegister.iterator();\n boolean doItExist = false;\n\n while(it.hasNext()) {\n Literature literature = it.next();\n\n if(literature.getTitle().equals(literatureTitle)) {\n doItExist = true;\n }\n }\n return doItExist;\n }", "boolean hasBuyDescribe();", "public boolean categoryExists (\n\t\tfinal int correlationCategory)\n\t{\n\t\treturn _correlationCategoryBetaMap.containsKey (\n\t\t\tcorrelationCategory\n\t\t);\n\t}", "public boolean courseExists(int courseCode){}", "public boolean isSetDescricao() {\n return this.descricao != null;\n }", "public boolean isSetDescricao() {\n return this.descricao != null;\n }", "public boolean isSetDescricao() {\n return this.descricao != null;\n }", "public boolean isSetDescricao() {\n return this.descricao != null;\n }", "protected boolean datasetExists(URI dataset) {\n return Db.getStatements(dataset, RDF.TYPE, Sparql.namespaced(\"dcat\",\"Dataset\"),true,dataset).size() == 1;\n }", "private static boolean isDescriptionCommand(String string){\n return stringStartsWith(string, GeneralInfo.PREFIX_COMMAND_DESCRIPTION);\n }", "private void testAccessibleDescription(Component comp, AccessibleContext comp_AC) {\n String desc = comp_AC.getAccessibleDescription();\n \n // LOG ONLY -/\n if(debugLog) System.err.println(LOG_CAPTION+\" - <testAccessibleDescription()> - accessibleDescription=\"+desc);\n \n if (testSettings.AP_accessibleDescription && (desc == null)){\n noDesc.add(comp);\n }\n }", "public boolean exists() {\n \t\treturn (type != UNASKED && isValid() && ((type == STRING) ? !sVal.equals(\"\") : true));\n \t}", "public abstract boolean doesExist();" ]
[ "0.7235087", "0.7235087", "0.7235087", "0.7123035", "0.7000215", "0.6969089", "0.69680417", "0.6645373", "0.6596884", "0.6578688", "0.6578688", "0.6578688", "0.65441966", "0.64697796", "0.64697796", "0.6429771", "0.6425911", "0.6298251", "0.6291606", "0.62552243", "0.62252253", "0.6174848", "0.61612266", "0.6132012", "0.6121864", "0.60233265", "0.60231763", "0.6016303", "0.60157436", "0.5975021", "0.5959478", "0.5945399", "0.5933134", "0.59272045", "0.5914041", "0.59062105", "0.58284605", "0.57884395", "0.57745105", "0.57602906", "0.575449", "0.57526964", "0.57386893", "0.5701283", "0.56965464", "0.56584704", "0.56374985", "0.56185454", "0.56167954", "0.5608223", "0.55937016", "0.5558826", "0.555127", "0.5536961", "0.55290294", "0.55290294", "0.5517036", "0.55066144", "0.5497647", "0.5461824", "0.5423845", "0.54222053", "0.54211515", "0.5419301", "0.5410971", "0.5404306", "0.5391667", "0.53527886", "0.5342665", "0.5335074", "0.5332794", "0.53264153", "0.5319583", "0.5311874", "0.5311239", "0.5282734", "0.52812374", "0.5277328", "0.5268999", "0.52656317", "0.5264141", "0.52610534", "0.5246176", "0.5245454", "0.52317345", "0.52041364", "0.5202506", "0.5193447", "0.5192476", "0.516789", "0.51607084", "0.5152068", "0.5152068", "0.5152068", "0.5152068", "0.5139718", "0.5127898", "0.51180714", "0.5114079", "0.5111784" ]
0.75856006
0
/ Given n points in the plane that are all pairwise distinct, a "boomerang" is a tuple of points (i, j, k) such that the distance between i and j equals the distance between i and k (the order of the tuple matters). Find the number of boomerangs. You may assume that n will be at most 500 and coordinates of points are all in the range [10000, 10000] (inclusive). Example: Input: [[0,0],[1,0],[2,0]] Output: 2 Explanation: The two boomerangs are [[1,0],[0,0],[2,0]] and [[1,0],[2,0],[0,0]] In essence, what is being done here is that for each point we are computing its distance to the other points and there are multiple distances that are the same for a single point, then that point serves as the "focal" point for a valid tuple (if the tuple if (i,j,k), then the current point is the j point the intersection of the edges essentially) then for the number of times that the distance repeats, we permute that number since the order does matter for example if there were 3 distances (edges) that were the same, that means that there are three other points for the current point we are looking at that have a distance 5 away from our current point which means that we just need to choose 2 of those points (the i and the k for the (i,j,k) tuple where j is our current point), so we have 3 P 2 which is 3 (3 1) or 3!/(32)!. So we have 6 "boomerangs" or unique tuples of points (i,j,k) with the current point being j. The map clearing is an optimization so that we don't need to create a new map each time.
public int numberOfBoomerangs(int[][] points) { Map<Integer, Integer> map = new HashMap<>(); int result = 0; for (int i = 0; i < points.length; i++){ for(int j = 0; j < points.length; j++){ if(j != i){ int distance = calcSquareDistance(points[i],points[j]); map.put(distance, map.getOrDefault(distance,0) + 1); } } for(Integer val : map.values()){ result += (val * (val-1)); } map.clear(); } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\n\t\tint t = in.nextInt();\n\t\twhile( t-- > 0 )\n\t\t{\n\t\t\tint n = in.nextInt();\n\t\t\tint m = in.nextInt();\n\t\t\tString s[] = new String[n];\n\t\t\tfor( int i = 0 ; i < n ; i++ )\n\t\t\t{\n\t\t\t\ts[i] = in.next();\n\t\t\t}\n\t\t\tArrayList<Point> p = new ArrayList<>();\n\t\t\tfor(int i = 0 ; i < n ; i++ )\n\t\t\t{\n\t\t\t\tfor(int j = 0 ; j < m ; j++)\n\t\t\t\t{\n\t\t\t\t\tif(s[i].charAt(j) == '1')\n\t\t\t\t\t{\n\t\t\t\t\t\tp.add(new Point(i,j));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n//\t\t\tfor(int i = 0 ; i < p.size() ;i++ )\n//\t\t\t{\n//\t\t\t\tSystem.out.println(p.get(i).x +\" \" + p.get(i).y );\n//\t\t\t}\n\t\t\t\n\t\t\tHashMap<Integer,Integer> map = new HashMap<>();\n\t\t\tfor(int i = 1 ; i < p.size() ; i++ )\n\t\t\t{\n\t\t\t\t\n\t\t\t}\n\t\t\tfor(int i = 0 ; i < p.size() ;i++ )\n\t\t\t{\n\t\t\t\tfor(int j = i + 1 ; j < p.size() ; j++ )\n\t\t\t\t{\n\t\t\t\t\t{\n\t\t\t\t\t\tPoint p1 = p.get(i);\n\t\t\t\t\t\tPoint p2 = p.get(j);\n\t\t\t\t\t\tint d = Math.abs(p1.x - p2.x) + Math.abs(p1.y - p2.y);\n\t\t\t\t\t\tif(!map.containsKey(d))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmap.put(d, 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmap.put(d, map.get(d) + 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 1 ; i <= n + m - 2 ; i++)\n\t\t\t{\n\t\t\t\tif (map.containsKey(i))\n\t\t\t\t{\n\t\t\t\t\tSystem.out.print(map.get(i)+ \" \");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tSystem.out.print(0 + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\t\n\t}", "public int numberOfBoomerangs(int[][] points) {\n int re=0;\n \tfor(int i=0; i<points.length; i++){\n \t\tMap<Integer, Integer> map=new HashMap<Integer, Integer>();\n \t\tfor(int j=0; j<points.length; j++){\n \t\t\tint x=points[i][0]-points[j][0];\n \t\t\tint y=points[i][1]-points[j][1];\n \t\t\tint dis=x*x+y*y; \t\t\t\n \t\t\tmap.put(dis, map.getOrDefault(dis, 0)+1);\n \t\t}\n \t\t\n \t\tfor(Integer cnt: map.values()){\n \t\t\tif(cnt>=2){\n \t\t\t\tre+=cnt*(cnt-1);\n \t\t\t}\n \t\t}\n \t}\n \treturn re;\n }", "public static long journeyToMoon(int n, List<List<Integer>> astronaut) {\n // Write your code here\n Map<Integer, Node<Integer>> countryMap = new HashMap<>();\n for(List<Integer> pairs: astronaut) {\n Node<Integer> node1 = countryMap.computeIfAbsent(pairs.get(0), Node::new);\n Node<Integer> node2 = countryMap.computeIfAbsent(pairs.get(1), Node::new);\n node1.connected.add(node2);\n node2.connected.add(node1);\n }\n\n List<Integer> countryCluster = new ArrayList<>();\n for(Node<Integer> node: countryMap.values()) {\n if(node.connected.size() == 0) {\n countryCluster.add(1);\n } else if(!node.visited){\n countryCluster.add(getNodeCount3(node));\n }\n }\n List<Integer> countryNodes = countryMap.values().stream().map(nn -> nn.value).collect(Collectors.toList());\n List<Integer> missingNodes = new ArrayList<>();\n for(int i=0; i < n; i++) {\n if(!countryNodes.contains(i))\n missingNodes.add(i);\n }\n\n for(int i=0; i < missingNodes.size(); i++) {\n countryCluster.add(1);\n }\n\n long ans = 0;\n //For one country we cannot pair with any other astronauts\n if(countryCluster.size() >= 2) {\n ans = (long) countryCluster.get(0) * countryCluster.get(1);\n if(countryCluster.size() > 2) {\n int sum = countryCluster.get(0) + countryCluster.get(1);\n for(int i=2; i < countryCluster.size(); i++) {\n ans += (long) sum * countryCluster.get(i);\n sum += countryCluster.get(i);\n }\n }\n }\n\n /*\n permutation of two set with size A and B = AxB\n permutation of three set with size A,B,C = AxB + AxC + BxC = AxB + (A+B)xC\n permutation of four set with size A,B,C,D = AxB + AxC + AxD + BxC + BxD + CxD = AxB + (A+B)xC + (A+B+C)xD\n */\n /*\n if(keys.length == 1) {\n ans = keys[0].size();\n } else {\n ans = keys[0].size() * keys[1].size();\n if(keys.length > 2) {\n int sum = keys[0].size() + keys[1].size();\n for (int i = 2; i < keys.length; i++) {\n ans += sum * keys[i].size();\n sum += keys[i].size();\n }\n }\n }\n */\n return ans;\n }", "@Override\n public long[ ][ ] count() {\n // precompute common nodes\n for (int x = 0; x < n; x++) {\n for (int n1 = 0; n1 < deg[x]; n1++) {\n int a = adj[x][n1];\n for (int n2 = n1 + 1; n2 < deg[x]; n2++) {\n int b = adj[x][n2];\n Tuple ab = createTuple(a, b);\n common2.put(ab, common2.getOrDefault(ab, 0) + 1);\n for (int n3 = n2 + 1; n3 < deg[x]; n3++) {\n int c = adj[x][n3];\n boolean st = adjacent(adj[a], b) ? (adjacent(adj[a], c) || adjacent(adj[b], c)) :\n (adjacent(adj[a], c) && adjacent(adj[b], c));\n if (!st) continue;\n Tuple abc = createTuple(a, b, c);\n common3.put(abc, common3.getOrDefault(abc, 0) + 1);\n }\n }\n }\n }\n\n // precompute triangles that span over edges\n int[ ] tri = countTriangles();\n\n // count full graphlets\n long[ ] C5 = new long[n];\n int[ ] neigh = new int[n];\n int[ ] neigh2 = new int[n];\n int nn, nn2;\n for (int x = 0; x < n; x++) {\n for (int nx = 0; nx < deg[x]; nx++) {\n int y = adj[x][nx];\n if (y >= x) break;\n nn = 0;\n for (int ny = 0; ny < deg[y]; ny++) {\n int z = adj[y][ny];\n if (z >= y) break;\n if (adjacent(adj[x], z)) {\n neigh[nn++] = z;\n }\n }\n for (int i = 0; i < nn; i++) {\n int z = neigh[i];\n nn2 = 0;\n for (int j = i + 1; j < nn; j++) {\n int zz = neigh[j];\n if (adjacent(adj[z], zz)) {\n neigh2[nn2++] = zz;\n }\n }\n for (int i2 = 0; i2 < nn2; i2++) {\n int zz = neigh2[i2];\n for (int j2 = i2 + 1; j2 < nn2; j2++) {\n int zzz = neigh2[j2];\n if (adjacent(adj[zz], zzz)) {\n C5[x]++;\n C5[y]++;\n C5[z]++;\n C5[zz]++;\n C5[zzz]++;\n }\n }\n }\n }\n }\n }\n\n int[ ] common_x = new int[n];\n int[ ] common_x_list = new int[n];\n int ncx = 0;\n int[ ] common_a = new int[n];\n int[ ] common_a_list = new int[n];\n int nca = 0;\n\n // set up a system of equations relating orbit counts\n for (int x = 0; x < n; x++) {\n for (int i = 0; i < ncx; i++) common_x[common_x_list[i]] = 0;\n ncx = 0;\n\n // smaller graphlets\n orbit[x][0] = deg[x];\n for (int nx1 = 0; nx1 < deg[x]; nx1++) {\n int a = adj[x][nx1];\n for (int nx2 = nx1 + 1; nx2 < deg[x]; nx2++) {\n int b = adj[x][nx2];\n if (adjacent(adj[a], b)) orbit[x][3]++;\n else orbit[x][2]++;\n }\n for (int na = 0; na < deg[a]; na++) {\n int b = adj[a][na];\n if (b != x && !adjacent(adj[x], b)) {\n orbit[x][1]++;\n if (common_x[b] == 0) common_x_list[ncx++] = b;\n common_x[b]++;\n }\n }\n }\n\n long f_71 = 0, f_70 = 0, f_67 = 0, f_66 = 0, f_58 = 0, f_57 = 0; // 14\n long f_69 = 0, f_68 = 0, f_64 = 0, f_61 = 0, f_60 = 0, f_55 = 0, f_48 = 0, f_42 = 0, f_41 = 0; // 13\n long f_65 = 0, f_63 = 0, f_59 = 0, f_54 = 0, f_47 = 0, f_46 = 0, f_40 = 0; // 12\n long f_62 = 0, f_53 = 0, f_51 = 0, f_50 = 0, f_49 = 0, f_38 = 0, f_37 = 0, f_36 = 0; // 8\n long f_44 = 0, f_33 = 0, f_30 = 0, f_26 = 0; // 11\n long f_52 = 0, f_43 = 0, f_32 = 0, f_29 = 0, f_25 = 0; // 10\n long f_56 = 0, f_45 = 0, f_39 = 0, f_31 = 0, f_28 = 0, f_24 = 0; // 9\n long f_35 = 0, f_34 = 0, f_27 = 0, f_18 = 0, f_16 = 0, f_15 = 0; // 4\n long f_17 = 0; // 5\n long f_22 = 0, f_20 = 0, f_19 = 0; // 6\n long f_23 = 0, f_21 = 0; // 7\n\n for (int nx1 = 0; nx1 < deg[x]; nx1++) {\n int a = inc[x][nx1]._1, xa = inc[x][nx1]._2;\n\n for (int i = 0; i < nca; i++) common_a[common_a_list[i]] = 0;\n nca = 0;\n for (int na = 0; na < deg[a]; na++) {\n int b = adj[a][na];\n for (int nb = 0; nb < deg[b]; nb++) {\n int c = adj[b][nb];\n if (c == a || adjacent(adj[a], c)) continue;\n if (common_a[c] == 0) common_a_list[nca++] = c;\n common_a[c]++;\n }\n }\n\n // x = orbit-14 (tetrahedron)\n for (int nx2 = nx1 + 1; nx2 < deg[x]; nx2++) {\n int b = inc[x][nx2]._1, xb = inc[x][nx2]._2;\n if (!adjacent(adj[a], b)) continue;\n for (int nx3 = nx2 + 1; nx3 < deg[x]; nx3++) {\n int c = inc[x][nx3]._1, xc = inc[x][nx3]._2;\n if (!adjacent(adj[a], c) || !adjacent(adj[b], c)) continue;\n orbit[x][14]++;\n f_70 += common3.getOrDefault(createTuple(a, b, c), 0) - 1;\n f_71 += (tri[xa] > 2 && tri[xb] > 2) ? (common3.getOrDefault(createTuple(x, a, b), 0) - 1) : 0;\n f_71 += (tri[xa] > 2 && tri[xc] > 2) ? (common3.getOrDefault(createTuple(x, a, c), 0) - 1) : 0;\n f_71 += (tri[xb] > 2 && tri[xc] > 2) ? (common3.getOrDefault(createTuple(x, b, c), 0) - 1) : 0;\n f_67 += tri[xa] - 2 + tri[xb] - 2 + tri[xc] - 2;\n f_66 += common2.getOrDefault(createTuple(a, b), 0) - 2;\n f_66 += common2.getOrDefault(createTuple(a, c), 0) - 2;\n f_66 += common2.getOrDefault(createTuple(b, c), 0) - 2;\n f_58 += deg[x] - 3;\n f_57 += deg[a] - 3 + deg[b] - 3 + deg[c] - 3;\n }\n }\n\n // x = orbit-13 (diamond)\n for (int nx2 = 0; nx2 < deg[x]; nx2++) {\n int b = inc[x][nx2]._1, xb = inc[x][nx2]._2;\n if (!adjacent(adj[a], b)) continue;\n for (int nx3 = nx2 + 1; nx3 < deg[x]; nx3++) {\n int c = inc[x][nx3]._1, xc = inc[x][nx3]._2;\n if (!adjacent(adj[a], c) || adjacent(adj[b], c)) continue;\n orbit[x][13]++;\n f_69 += (tri[xb] > 1 && tri[xc] > 1) ? (common3.getOrDefault(createTuple(x, b, c), 0) - 1) : 0;\n f_68 += common3.getOrDefault(createTuple(a, b, c), 0) - 1;\n f_64 += common2.getOrDefault(createTuple(b, c), 0) - 2;\n f_61 += tri[xb] - 1 + tri[xc] - 1;\n f_60 += common2.getOrDefault(createTuple(a, b), 0) - 1;\n f_60 += common2.getOrDefault(createTuple(a, c), 0) - 1;\n f_55 += tri[xa] - 2;\n f_48 += deg[b] - 2 + deg[c] - 2;\n f_42 += deg[x] - 3;\n f_41 += deg[a] - 3;\n }\n }\n\n // x = orbit-12 (diamond)\n for (int nx2 = nx1 + 1; nx2 < deg[x]; nx2++) {\n int b = inc[x][nx2]._1, xb = inc[x][nx2]._2;\n if (!adjacent(adj[a], b)) continue;\n for (int na = 0; na < deg[a]; na++) {\n int c = inc[a][na]._1, ac = inc[a][na]._2;\n if (c == x || adjacent(adj[x], c) || !adjacent(adj[b], c)) continue;\n orbit[x][12]++;\n f_65 += (tri[ac] > 1) ? common3.getOrDefault(createTuple(a, b, c), 0) : 0;\n f_63 += common_x[c] - 2;\n f_59 += tri[ac] - 1 + common2.getOrDefault(createTuple(b, c), 0) - 1;\n f_54 += common2.getOrDefault(createTuple(a, b), 0) - 2;\n f_47 += deg[x] - 2;\n f_46 += deg[c] - 2;\n f_40 += deg[a] - 3 + deg[b] - 3;\n }\n }\n\n // x = orbit-8 (cycle)\n for (int nx2 = nx1 + 1; nx2 < deg[x]; nx2++) {\n int b = inc[x][nx2]._1, xb = inc[x][nx2]._2;\n if (adjacent(adj[a], b)) continue;\n for (int na = 0; na < deg[a]; na++) {\n int c = inc[a][na]._1, ac = inc[a][na]._2;\n if (c == x || adjacent(adj[x], c) || !adjacent(adj[b], c)) continue;\n orbit[x][8]++;\n f_62 += (tri[ac] > 0) ? common3.getOrDefault(createTuple(a, b, c), 0) : 0;\n f_53 += tri[xa] + tri[xb];\n f_51 += tri[ac] + common2.getOrDefault(createTuple(c, b), 0);\n f_50 += common_x[c] - 2;\n f_49 += common_a[b] - 2;\n f_38 += deg[x] - 2;\n f_37 += deg[a] - 2 + deg[b] - 2;\n f_36 += deg[c] - 2;\n }\n }\n\n // x = orbit-11 (paw)\n for (int nx2 = nx1 + 1; nx2 < deg[x]; nx2++) {\n int b = inc[x][nx2]._1, xb = inc[x][nx2]._2;\n if (!adjacent(adj[a], b)) continue;\n for (int nx3 = 0; nx3 < deg[x]; nx3++) {\n int c = inc[x][nx3]._1, xc = inc[x][nx3]._2;\n if (c == a || c == b || adjacent(adj[a], c) || adjacent(adj[b], c)) continue;\n orbit[x][11]++;\n f_44 += tri[xc];\n f_33 += deg[x] - 3;\n f_30 += deg[c] - 1;\n f_26 += deg[a] - 2 + deg[b] - 2;\n }\n }\n\n // x = orbit-10 (paw)\n for (int nx2 = 0; nx2 < deg[x]; nx2++) {\n int b = inc[x][nx2]._1, xb = inc[x][nx2]._2;\n if (!adjacent(adj[a], b)) continue;\n for (int nb = 0; nb < deg[b]; nb++) {\n int c = inc[b][nb]._1, bc = inc[b][nb]._2;\n if (c == x || c == a || adjacent(adj[a], c) || adjacent(adj[x], c)) continue;\n orbit[x][10]++;\n f_52 += common_a[c] - 1;\n f_43 += tri[bc];\n f_32 += deg[b] - 3;\n f_29 += deg[c] - 1;\n f_25 += deg[a] - 2;\n }\n }\n\n // x = orbit-9 (paw)\n for (int na1 = 0; na1 < deg[a]; na1++) {\n int b = inc[a][na1]._1, ab = inc[a][na1]._2;\n if (b == x || adjacent(adj[x], b)) continue;\n for (int na2 = na1 + 1; na2 < deg[a]; na2++) {\n int c = inc[a][na2]._1, ac = inc[a][na2]._2;\n if (c == x || !adjacent(adj[b], c) || adjacent(adj[x], c)) continue;\n orbit[x][9]++;\n f_56 += (tri[ab] > 1 && tri[ac] > 1) ? common3.getOrDefault(createTuple(a, b, c), 0) : 0;\n f_45 += common2.getOrDefault(createTuple(b, c), 0) - 1;\n f_39 += tri[ab] - 1 + tri[ac] - 1;\n f_31 += deg[a] - 3;\n f_28 += deg[x] - 1;\n f_24 += deg[b] - 2 + deg[c] - 2;\n }\n }\n\n // x = orbit-4 (path)\n for (int na = 0; na < deg[a]; na++) {\n int b = inc[a][na]._1, ab = inc[a][na]._2;\n if (b == x || adjacent(adj[x], b)) continue;\n for (int nb = 0; nb < deg[b]; nb++) {\n int c = inc[b][nb]._1, bc = inc[b][nb]._2;\n if (c == a || adjacent(adj[a], c) || adjacent(adj[x], c)) continue;\n orbit[x][4]++;\n f_35 += common_a[c] - 1;\n f_34 += common_x[c];\n f_27 += tri[bc];\n f_18 += deg[b] - 2;\n f_16 += deg[x] - 1;\n f_15 += deg[c] - 1;\n }\n }\n\n // x = orbit-5 (path)\n for (int nx2 = 0; nx2 < deg[x]; nx2++) {\n int b = inc[x][nx2]._1, xb = inc[x][nx2]._2;\n if (b == a || adjacent(adj[a], b)) continue;\n for (int nb = 0; nb < deg[b]; nb++) {\n int c = inc[b][nb]._1, bc = inc[b][nb]._2;\n if (c == x || adjacent(adj[a], c) || adjacent(adj[x], c)) continue;\n orbit[x][5]++;\n f_17 += deg[a] - 1;\n }\n }\n\n // x = orbit-6 (claw)\n for (int na1 = 0; na1 < deg[a]; na1++) {\n int b = inc[a][na1]._1, ab = inc[a][na1]._2;\n if (b == x || adjacent(adj[x], b)) continue;\n for (int na2 = na1 + 1; na2 < deg[a]; na2++) {\n int c = inc[a][na2]._1, ac = inc[a][na2]._2;\n if (c == x || adjacent(adj[x], c) || adjacent(adj[b], c)) continue;\n orbit[x][6]++;\n f_22 += deg[a] - 3;\n f_20 += deg[x] - 1;\n f_19 += deg[b] - 1 + deg[c] - 1;\n }\n }\n\n // x = orbit-7 (claw)\n for (int nx2 = nx1 + 1; nx2 < deg[x]; nx2++) {\n int b = inc[x][nx2]._1, xb = inc[x][nx2]._2;\n if (adjacent(adj[a], b)) continue;\n for (int nx3 = nx2 + 1; nx3 < deg[x]; nx3++) {\n int c = inc[x][nx3]._1, xc = inc[x][nx3]._2;\n if (adjacent(adj[a], c) || adjacent(adj[b], c)) continue;\n orbit[x][7]++;\n f_23 += deg[x] - 3;\n f_21 += deg[a] - 1 + deg[b] - 1 + deg[c] - 1;\n }\n }\n }\n\n // solve equations\n orbit[x][72] = C5[x];\n orbit[x][71] = (f_71 - 12 * orbit[x][72]) / 2;\n orbit[x][70] = (f_70 - 4 * orbit[x][72]);\n orbit[x][69] = (f_69 - 2 * orbit[x][71]) / 4;\n orbit[x][68] = (f_68 - 2 * orbit[x][71]);\n orbit[x][67] = (f_67 - 12 * orbit[x][72] - 4 * orbit[x][71]);\n orbit[x][66] = (f_66 - 12 * orbit[x][72] - 2 * orbit[x][71] - 3 * orbit[x][70]);\n orbit[x][65] = (f_65 - 3 * orbit[x][70]) / 2;\n orbit[x][64] = (f_64 - 2 * orbit[x][71] - 4 * orbit[x][69] - 1 * orbit[x][68]);\n orbit[x][63] = (f_63 - 3 * orbit[x][70] - 2 * orbit[x][68]);\n orbit[x][62] = (f_62 - 1 * orbit[x][68]) / 2;\n orbit[x][61] = (f_61 - 4 * orbit[x][71] - 8 * orbit[x][69] - 2 * orbit[x][67]) / 2;\n orbit[x][60] = (f_60 - 4 * orbit[x][71] - 2 * orbit[x][68] - 2 * orbit[x][67]);\n orbit[x][59] = (f_59 - 6 * orbit[x][70] - 2 * orbit[x][68] - 4 * orbit[x][65]);\n orbit[x][58] = (f_58 - 4 * orbit[x][72] - 2 * orbit[x][71] - 1 * orbit[x][67]);\n orbit[x][57] = (f_57 - 12 * orbit[x][72] - 4 * orbit[x][71] - 3 * orbit[x][70] - 1 * orbit[x][67] - 2 * orbit[x][66]);\n orbit[x][56] = (f_56 - 2 * orbit[x][65]) / 3;\n orbit[x][55] = (f_55 - 2 * orbit[x][71] - 2 * orbit[x][67]) / 3;\n orbit[x][54] = (f_54 - 3 * orbit[x][70] - 1 * orbit[x][66] - 2 * orbit[x][65]) / 2;\n orbit[x][53] = (f_53 - 2 * orbit[x][68] - 2 * orbit[x][64] - 2 * orbit[x][63]);\n orbit[x][52] = (f_52 - 2 * orbit[x][66] - 2 * orbit[x][64] - 1 * orbit[x][59]) / 2;\n orbit[x][51] = (f_51 - 2 * orbit[x][68] - 2 * orbit[x][63] - 4 * orbit[x][62]);\n orbit[x][50] = (f_50 - 1 * orbit[x][68] - 2 * orbit[x][63]) / 3;\n orbit[x][49] = (f_49 - 1 * orbit[x][68] - 1 * orbit[x][64] - 2 * orbit[x][62]) / 2;\n orbit[x][48] = (f_48 - 4 * orbit[x][71] - 8 * orbit[x][69] - 2 * orbit[x][68] - 2 * orbit[x][67] - 2 * orbit[x][64] - 2 * orbit[x][61] - 1 * orbit[x][60]);\n orbit[x][47] = (f_47 - 3 * orbit[x][70] - 2 * orbit[x][68] - 1 * orbit[x][66] - 1 * orbit[x][63] - 1 * orbit[x][60]);\n orbit[x][46] = (f_46 - 3 * orbit[x][70] - 2 * orbit[x][68] - 2 * orbit[x][65] - 1 * orbit[x][63] - 1 * orbit[x][59]);\n orbit[x][45] = (f_45 - 2 * orbit[x][65] - 2 * orbit[x][62] - 3 * orbit[x][56]);\n orbit[x][44] = (f_44 - 1 * orbit[x][67] - 2 * orbit[x][61]) / 4;\n orbit[x][43] = (f_43 - 2 * orbit[x][66] - 1 * orbit[x][60] - 1 * orbit[x][59]) / 2;\n orbit[x][42] = (f_42 - 2 * orbit[x][71] - 4 * orbit[x][69] - 2 * orbit[x][67] - 2 * orbit[x][61] - 3 * orbit[x][55]);\n orbit[x][41] = (f_41 - 2 * orbit[x][71] - 1 * orbit[x][68] - 2 * orbit[x][67] - 1 * orbit[x][60] - 3 * orbit[x][55]);\n orbit[x][40] = (f_40 - 6 * orbit[x][70] - 2 * orbit[x][68] - 2 * orbit[x][66] - 4 * orbit[x][65] - 1 * orbit[x][60] - 1 * orbit[x][59] - 4 * orbit[x][54]);\n orbit[x][39] = (f_39 - 4 * orbit[x][65] - 1 * orbit[x][59] - 6 * orbit[x][56]) / 2;\n orbit[x][38] = (f_38 - 1 * orbit[x][68] - 1 * orbit[x][64] - 2 * orbit[x][63] - 1 * orbit[x][53] - 3 * orbit[x][50]);\n orbit[x][37] = (f_37 - 2 * orbit[x][68] - 2 * orbit[x][64] - 2 * orbit[x][63] - 4 * orbit[x][62] - 1 * orbit[x][53] - 1 * orbit[x][51] - 4 * orbit[x][49]);\n orbit[x][36] = (f_36 - 1 * orbit[x][68] - 2 * orbit[x][63] - 2 * orbit[x][62] - 1 * orbit[x][51] - 3 * orbit[x][50]);\n orbit[x][35] = (f_35 - 1 * orbit[x][59] - 2 * orbit[x][52] - 2 * orbit[x][45]) / 2;\n orbit[x][34] = (f_34 - 1 * orbit[x][59] - 2 * orbit[x][52] - 1 * orbit[x][51]) / 2;\n orbit[x][33] = (f_33 - 1 * orbit[x][67] - 2 * orbit[x][61] - 3 * orbit[x][58] - 4 * orbit[x][44] - 2 * orbit[x][42]) / 2;\n orbit[x][32] = (f_32 - 2 * orbit[x][66] - 1 * orbit[x][60] - 1 * orbit[x][59] - 2 * orbit[x][57] - 2 * orbit[x][43] - 2 * orbit[x][41] - 1 * orbit[x][40]) / 2;\n orbit[x][31] = (f_31 - 2 * orbit[x][65] - 1 * orbit[x][59] - 3 * orbit[x][56] - 1 * orbit[x][43] - 2 * orbit[x][39]);\n orbit[x][30] = (f_30 - 1 * orbit[x][67] - 1 * orbit[x][63] - 2 * orbit[x][61] - 1 * orbit[x][53] - 4 * orbit[x][44]);\n orbit[x][29] = (f_29 - 2 * orbit[x][66] - 2 * orbit[x][64] - 1 * orbit[x][60] - 1 * orbit[x][59] - 1 * orbit[x][53] - 2 * orbit[x][52] - 2 * orbit[x][43]);\n orbit[x][28] = (f_28 - 2 * orbit[x][65] - 2 * orbit[x][62] - 1 * orbit[x][59] - 1 * orbit[x][51] - 1 * orbit[x][43]);\n orbit[x][27] = (f_27 - 1 * orbit[x][59] - 1 * orbit[x][51] - 2 * orbit[x][45]) / 2;\n orbit[x][26] = (f_26 - 2 * orbit[x][67] - 2 * orbit[x][63] - 2 * orbit[x][61] - 6 * orbit[x][58] - 1 * orbit[x][53] - 2 * orbit[x][47] - 2 * orbit[x][42]);\n orbit[x][25] = (f_25 - 2 * orbit[x][66] - 2 * orbit[x][64] - 1 * orbit[x][59] - 2 * orbit[x][57] - 2 * orbit[x][52] - 1 * orbit[x][48] - 1 * orbit[x][40]) / 2;\n orbit[x][24] = (f_24 - 4 * orbit[x][65] - 4 * orbit[x][62] - 1 * orbit[x][59] - 6 * orbit[x][56] - 1 * orbit[x][51] - 2 * orbit[x][45] - 2 * orbit[x][39]);\n orbit[x][23] = (f_23 - 1 * orbit[x][55] - 1 * orbit[x][42] - 2 * orbit[x][33]) / 4;\n orbit[x][22] = (f_22 - 2 * orbit[x][54] - 1 * orbit[x][40] - 1 * orbit[x][39] - 1 * orbit[x][32] - 2 * orbit[x][31]) / 3;\n orbit[x][21] = (f_21 - 3 * orbit[x][55] - 3 * orbit[x][50] - 2 * orbit[x][42] - 2 * orbit[x][38] - 2 * orbit[x][33]);\n orbit[x][20] = (f_20 - 2 * orbit[x][54] - 2 * orbit[x][49] - 1 * orbit[x][40] - 1 * orbit[x][37] - 1 * orbit[x][32]);\n orbit[x][19] = (f_19 - 4 * orbit[x][54] - 4 * orbit[x][49] - 1 * orbit[x][40] - 2 * orbit[x][39] - 1 * orbit[x][37] - 2 * orbit[x][35] - 2 * orbit[x][31]);\n orbit[x][18] = (f_18 - 1 * orbit[x][59] - 1 * orbit[x][51] - 2 * orbit[x][46] - 2 * orbit[x][45] - 2 * orbit[x][36] - 2 * orbit[x][27] - 1 * orbit[x][24]) / 2;\n orbit[x][17] = (f_17 - 1 * orbit[x][60] - 1 * orbit[x][53] - 1 * orbit[x][51] - 1 * orbit[x][48] - 1 * orbit[x][37] - 2 * orbit[x][34] - 2 * orbit[x][30]) / 2;\n orbit[x][16] = (f_16 - 1 * orbit[x][59] - 2 * orbit[x][52] - 1 * orbit[x][51] - 2 * orbit[x][46] - 2 * orbit[x][36] - 2 * orbit[x][34] - 1 * orbit[x][29]);\n orbit[x][15] = (f_15 - 1 * orbit[x][59] - 2 * orbit[x][52] - 1 * orbit[x][51] - 2 * orbit[x][45] - 2 * orbit[x][35] - 2 * orbit[x][34] - 2 * orbit[x][27]);\n }\n\n return orbit;\n }", "private void generateMap () {\n for (int i = 0 ; i < n ; i++) {\n mapCoordinate[i] = new CoordinateInfo(100 * random.nextFloat(), 100 * random.nextFloat());\n\n for (int j = 0 ; j <= i ; j++) {\n mapDistance[i][j] = mapDistance[j][i] = getDistance(mapCoordinate[i], mapCoordinate[j]);\n }\n }\n }", "private static void solution() {\n for (int i = 0; i < n; i++) {\n Coord here = coords[i]; // start, end, dir, gen\n for (int j = 0; j < here.gen; j++) {\n // Rotate degree of 90.\n List<Pair> changed = rotate(here.coord, here.endPoint);\n boolean first = true;\n for(Pair p: changed){\n if(first) {\n here.endPoint = new Pair(p.x, p.y);\n first = false;\n }\n here.coord.add(new Pair(p.x, p.y));\n }\n }\n }\n // count the number of squares enclosing all angles with dragon curve\n for (int i = 0; i < n; i++) {\n for(Pair p: coords[i].coord)\n board[p.y][p.x] = true;\n }\n int cnt = 0;\n for (int i = 0; i < 100; i++)\n for (int j = 0; j < 100; j++)\n if(board[i][j] && board[i + 1][j] && board[i][j + 1] && board[i + 1][j + 1])\n cnt += 1;\n System.out.println(cnt);\n }", "int[][] Naive(int m, Pointd[] points){\n int[][] tours = new int[m][];\n for(int i=0; i<m; i++){\n if(i<points.length%m) tours[i] = new int[points.length/m+1];\n else tours[i] = new int[points.length/m];\n }\n\n //Select the first point, find the next closest point, find the next closest point to that etc\n boolean[] alreadyInTour = new boolean[points.length];\n double minDistance;\n double distance;\n Pointd pointA;\n Pointd pointB;\n int index = 0;\n int n;\n\n for(int k=0; k<m; k++){\n //Each row of tours, first find a node that isn't in a tour\n n = 0;\n while(alreadyInTour[n]) n++;\n pointA = points[n];\n tours[k][0] = n;\n alreadyInTour[n] = true;\n\n int iterate = 0;\n int j=1;\n while(j<tours[k].length){\n if(!alreadyInTour[iterate]){\n minDistance = Double.MAX_VALUE;\n //Find next closest point to pointA\n for(int i=0; i<points.length; i++){\n pointB = points[i];\n if(!alreadyInTour[i]){\n distance = Math.sqrt( Math.pow(pointA.x - pointB.x, 2) + Math.pow(pointA.y - pointB.y, 2) );\n if(distance < minDistance){\n minDistance = distance;\n index = i;\n }\n }\n }\n //System.out.println(index);\n tours[k][j] = index;\n alreadyInTour[index] = true;\n j++;\n }\n iterate++;\n if(iterate >= points.length) iterate = 0;\n }\n }\n for(int i=0; i<tours.length; i++){\n //System.out.println(Arrays.toString(tours[i]));\n }\n return tours;\n }", "private void generatePointPairs() {\n\t\tfinal int mod = SIZE_OF_ORIGINAL_LIST * 8; \n\t\t\n\t\tif(DEBUG) System.out.println(\"----- Generating Point Pairs...\");\n\n\t\tint counter = 0;\n\t\tint j = 0;\n\t\t\n\t\tfor(int i = 0; i < myPoints.length; i++) {\n\t\t\t//while(j++ < myPoints.length) {\n\t\t\tfor( ; j < myPoints.length; j++) {\n\t\t\t\t// i and j are the same point, so ignore that pair.\n\t\t\t\tif(i != j) {\n\t\t\t\t\tmyPairs.add(new PointPair(myPoints[i], myPoints[j]));\n\t\t\t\t\tif(DEBUG && ++counter % mod == 0) System.out.print(\"pair \");\n\t\t\t\t}\n\t\t\t\t// Not yet colinear, just a unique pair to use later.\n\t\t\t}\n\n\t\t}\n\t\tif(DEBUG) System.out.println(\"\\n----- ----- \" + counter + \" pairs found.\\n\");\n\t}", "public void convexHull(int n) {\n // There must be at least 3 points\n if (n < 3) return;\n\n // Initialize Result\n Vector<Marker> hull = new Vector<>();\n\n // Find the leftmost point\n int l = 0;\n for (int i = 1; i < n; i++)\n if (markers.get(i).getPosition().longitude < markers.get(l).getPosition().longitude)\n l = i;\n\n // Start from leftmost point, keep moving\n // counterclockwise until reach the start point\n // again. This loop runs O(h) times where h is\n // number of points in result or output.\n int p = l, q;\n do {\n // Add current point to result\n hull.add(markers.get(p));\n\n // Search for a point 'q' such that\n // orientation(p, x, q) is counterclockwise\n // for all points 'x'. The idea is to keep\n // track of last visited most counterclock-\n // wise point in q. If any point 'i' is more\n // counterclock-wise than q, then update q.\n q = (p + 1) % n;\n\n for (int i = 0; i < n; i++) {\n // If i is more counterclockwise than\n // current q, then update q\n if (orientation(p, i, q)\n == 2)\n q = i;\n }\n\n // Now q is the most counterclockwise with\n // respect to p. Set p as q for next iteration,\n // so that q is added to result 'hull'\n p = q;\n\n } while (p != l); // While we don't come to first\n\n drawer = new ArrayList<>(hull);\n }", "public void triplet(int[] b,int n){\r\n\t\tint count=0;\r\n\t\tfor(int i=0;i<n;i++){\r\n\t\t\tfor(int j=i+1;j<n-1;j++){\r\n\t\t\t\tfor(int k=j+1;k<n-2;k++){\r\n\t\t\t\t\tif(b[i]+b[j]+b[k]==0){\r\n\t\t\t\t\t\tSystem.out.println(b[i]+\" \"+b[j]+\" \"+b[k]);\r\n\t\t\t\t\t\tcount++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"no of distinct triplet is:\"+count);\t\r\n\r\n\t}", "static long gridlandMetro(long n, int m, int k, int[][] track) {\n Map<Integer, Stack<int[]>> map = new HashMap<>();\n for (int i = 0; i < k; i++) {\n int r = track[i][0];\n int c1 = track[i][1];\n int c2 = track[i][2];\n Stack<int[]> stack = map.get(r);\n if (stack == null) {\n stack = new Stack<>();\n stack.push(new int[] { c1, c2 });\n map.put(r, stack);\n } else {\n int[] c = stack.peek();\n if (c[1] >= c1)\n c[1] = Math.max(c[1], c2);\n else\n stack.push(new int[] { c1, c2 });\n }\n }\n return (long) n * m - map.values().stream().flatMap(Collection::stream).mapToLong(c -> c[1] - c[0] + 1).sum();\n}", "public static void main(String[] args) \n {\n int[] numOfPoints = { 1000, 10000, 7000, 10000, 13000 };\n for(int count = 0; count < numOfPoints.length; count++)\n {\n List<Point> pointsTobeUsed = new ArrayList<Point>();\n int current = numOfPoints[count];\n int inc = 0;\n \n //creating list of points to be used\n for(int x = 0; x <= current; x++)\n {\n \n if(x <= current/2)\n {\n pointsTobeUsed.add(new Point(x,x));\n \n }\n else\n {\n pointsTobeUsed.add(new Point(x, x - (1 + 2*(inc)) ) );\n inc++;\n }\n }\n \n //n logn implementation of Pareto optimal\n long timeStart = System.currentTimeMillis();\n \n // n logn quicksort\n pointsTobeUsed = quickSort(pointsTobeUsed, 0, pointsTobeUsed.size() -1 );\n \n \n \n ParetoOptimal(pointsTobeUsed);\n \n \n long timeEnd = System.currentTimeMillis();\n System.out.println(\"final:\" + \" exper: \" + (timeEnd - timeStart) + \" N: \" + current ); \n }\n }", "@Override\n public ArrayList<ArrayList<String>> getNeighborhood(ArrayList<String> point, double argument1, double argument2) {\n ArrayList<ArrayList<String>> neighborhood = new ArrayList<>();\n String[] moves = {\"U\", \"D\", \"L\", \"R\"};\n if(point.size() == 0){\n point.add(moves[(int)(Math.random()*4)]);\n }\n\n //kazde rozwiązanie powstaje przez wstawienie każdego ruchu w środku ścieżki\n for(int i = 0; i<point.size(); i++){\n for(String move : moves){\n ArrayList<String> newPath = arrayListDeepCopy(point);\n newPath.add(i, move);\n newPath = cleanUpPath(newPath);\n if(testFunction.check(newPath)) neighborhood.add(newPath);\n }\n for(String move : moves){\n ArrayList<String> newPath = arrayListDeepCopy(point);\n newPath.add(i, move);\n newPath.add(i, move);\n newPath = cleanUpPath(newPath);\n if(testFunction.check(newPath)) neighborhood.add(newPath);\n }\n }\n\n //kazde rozwiązanie powstaje przez usunięcie jednego elementu\n for(int i=0; i<point.size(); i++){\n ArrayList<String> newPath = arrayListDeepCopy(point);\n newPath.remove(i);\n newPath = cleanUpPath(newPath);\n if(testFunction.check(newPath)) neighborhood.add(newPath);\n }\n\n //kazde rozwiązanie powstaje przez swapowanie wszystkich z losowym\n int random = (int)(Math.random()*point.size());\n for(int i=0; i<point.size(); i++){\n ArrayList<String> newPath = arrayListDeepCopy(point);\n newPath.set(i, point.get(random));\n newPath.set(random, point.get(i));\n newPath = cleanUpPath(newPath);\n if(testFunction.check(newPath)) neighborhood.add(newPath);\n }\n\n //System.out.println(neighborhood.size());\n\n ArrayList<ArrayList<String>> newNeighborhood = new ArrayList<>();\n for (int i = 0; i < neighborhood.size(); i++) {\n newNeighborhood.add(shortenPath(neighborhood.get(i)));\n }\n\n return newNeighborhood;\n }", "public static Set<Set<Polyomino>> tilings(ArrayList<Polyomino> polyominos_list,Polyomino P, boolean use_all_once, boolean rotations, boolean reflections) {\r\n\t\t\r\n\t\tHashMap<Integer, Square> hmap_P = new HashMap<Integer, Square>();\r\n\t\tSet<Integer> X= new HashSet<Integer>();\r\n\t\tSet<Set<Integer>> C= new HashSet<Set<Integer>>();\t\r\n\t\tSet<Set<Polyomino>> tilings = new HashSet<Set<Polyomino>>();\r\n\t\t\r\n\t\tif (use_all_once) {//quick check to see if there is a tiling of P using each tile exactly once: ( sum of area(tile) ) == area(P)\r\n\t\t\tint total_area=0;\r\n\t\t\tfor (Polyomino q: polyominos_list) total_area+=q.area;\r\n\t\t\tif (!(total_area==P.area)) return tilings;\r\n\t\t}\r\n\t\t\t\t\t\r\n\t\t//index squares of P\r\n\t\tfor (int i=0; i<P.vertices.size();i++) {\r\n\t\t\thmap_P.put(i+1,P.vertices.get(i));\r\n\t\t\tX.add(i+1);\r\n\t\t}\r\n\t\tif (use_all_once) {//we add extra elements to the ground set to ensure each polyomino is used exactly once\r\n\t\t\tfor (int j=0;j<polyominos_list.size();j++) {\r\n\t\t\t\tX.add(P.vertices.size()+j+1);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\t\r\n\t\t//we now define C\r\n\t\t//if A= set of (fixed/one-sided/free) polyominos of area n\r\n\t\t//C= union over Q in A of union of S subset of X corresponding to indices of squares of P covered by some translate of Q\r\n\t\t//to generate C, we iterate over the polyominos Q in A and we see, for each possible translation of Q,\r\n\t\t//if Q fits in P, in which case we record the indices of the squares of P it covers\r\n\t\t\r\n\t\tfor (int k=0; k<polyominos_list.size();k++) {\r\n\t\t\tPolyomino tile=polyominos_list.get(k);\r\n\t\t\t\r\n\t\t\tArrayList<Polyomino> orientations_of_tile=new ArrayList<Polyomino>();\r\n\t\t\tif (rotations && reflections) orientations_of_tile=tile.distinct_symmetries();\r\n\t\t\telse if (rotations) orientations_of_tile=tile.rotations();\r\n\t\t\telse if (reflections) orientations_of_tile=tile.reflections();\r\n\t\t\telse orientations_of_tile.add(tile);//if no rotations, the only possible orientation is the tile as it was given\r\n\t\t\r\n\t\t\tfor (Polyomino Q: orientations_of_tile) {\r\n\t\t\t\t//for each VALID translation of Q, we calculate the indices of squares of P which Q occupies, and add this to C\r\n\t\t\t\t//we choose some square of Q, which we will \"nail\" to the squares of P and see if Q fits in in P in that position\r\n\t\t\t\tSquare nail = Q.vertices.get(0);\r\n\t\t\t\tfor (Square s: P.vertices) {\r\n\t\t\t\t Set<Integer> indices_Q_translated= new HashSet<Integer>();\r\n\t\t\t\t boolean Q_fits_inP=true;\r\n\t\t\t\t\tfor (Square q: Q.vertices) {//lets check if this translation of Q fits in P\r\n\t\t\t\t\t\tSquare translated_q=new Square (q.x+s\r\n\t\t\t\t\t\t\t\t.x-nail.x,q.y+s.y-nail.y);\r\n\t\t\t\t\t\tif (!P.contains(translated_q)) {//check if square translated_q fits is in P\r\n\t\t\t\t\t\t\tQ_fits_inP=false;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\thmap_P.forEach((key, value) -> {//get index of square translated_q\r\n\t\t\t\t\t\t if (value.equals(translated_q)) {\r\n\t\t\t\t\t\t \tindices_Q_translated.add(key);\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (Q_fits_inP) {\r\n\t\t\t\t\t\t//we add an element which corresponds to putting a one in a dummy column in the exact cover matrix\r\n\t\t\t\t\t\tif (use_all_once) indices_Q_translated.add(k+P.vertices.size()+1); \r\n\t\t\t\t\t\tC.add(indices_Q_translated);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Initialization step complete, with complexity at least |polyominos_list|*4*area(P)*area(Q)*area(P)\r\n\t\t\r\n\t\tif(!(C.size()==0)) {\r\n\t\t\t\r\n\t\t\tint[][] M=Exact_cover.sets_to_matrix(X,C);\r\n\t\t\r\n\t\t\t//we add n columns (initialized to all zeros) to M where n=polyominos_list.size().\r\n\t\t\t//Each row of M corresponds to some translation of a polyomino Pk in polyominos_list-{P1,...,Pn}\r\n\t\t\t//in a such a row we place a 1 in the column k\r\n\t\t\t//any exact cover of M must then use each Pk exactly once \r\n\r\n\t\t\tDancingLinks dl = new DancingLinks(M);\r\n\t\t\tSet<Set<data_object>> exact_covers_data_objects=dl.exactCover(dl.master_header);\r\n\t\t\t\r\n\t\t\tfor (Set<data_object> cover_data_objects: exact_covers_data_objects) {\r\n\t\t\t\t\r\n\t\t\t\tSet<Set<Integer>> cover_sets=new HashSet<Set<Integer>>();\r\n\t\t\t\tfor (data_object t: cover_data_objects) cover_sets.add(dl.set_of_row.get(t.row_id));\r\n\t\t\t\t\r\n\t\t\t\tSet<Polyomino> T = new HashSet<Polyomino>();//a tiling, i.e a set of polyominos\r\n\t\t\t\t\r\n\t\t\t\tfor (Set<Integer> indices: cover_sets) {\r\n\t\t\t\t\tArrayList<Square> vertices= new ArrayList<Square>();\r\n\t\t\t\t\t//convert indices to corresponding squares of P, \r\n\t\t\t\t\t//and add the corresponding Polyomino R to T\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor (int index: indices) {\r\n\t\t\t\t\t\tif (index<P.vertices.size()+1) {//if not a dummy index (in the case of use_all_once polyominos)\r\n\t\t\t\t\t\t\tvertices.add(hmap_P.get(index));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tT.add(new Polyomino(vertices,\"R\"));\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\ttilings.add(T);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn tilings;\r\n\t}", "public static boolean isBoomerang(int[][] points){\n if (points[0] == points[1] || points[0] == points[2] || points[1] == points[2]) return false;\n if ((points[0][0] - points[1][0])*(points[0][1] - points[2][1]) != (points[0][0] - points[2][0])*(points[0][1] - points[1][1])) return true;\n return false;\n }", "private void processPoints() {\n\t\t// We don't want multiple of the same normals, so we calculate them on the fly\n\t\tArrayList<Vector2f> normals = new ArrayList<Vector2f>();\n\t\tVector2f edge = new Vector2f();\n\n\t\tif (points.length < 3) {\n\t\t\tthrow new IllegalStateException(\"There must be more than two points in a polygon... Shame on you!\");\n\t\t}\n\t\t\n\t\t// Calculate the center\n\t\tcenter = new Vector2f();\n\t\tfor (Vector2f p : points) {\n\t\t\tcenter.add(p);\t\t\n\t\t}\n\t\tcenter.scale(1.0f / (float) points.length);\n\t\t\n\t\t// Subtract the center from each point so it's centerd\n\t\tfor (Vector2f p : points) {\n\t\t\tp.sub(center);\n\t\t}\n\t\t\n\t\t// Calculate the direction to loop through them\n\t\tVector2f edgeA = points[points.length - 1].clone().sub(points[0]);\n\t\tVector2f edgeB = points[1].clone().sub(points[0]);\n\t\t\n\t\tboolean rightHand = edgeA.x * edgeB.y - edgeB.x * edgeA.y < 0;\n\t\t\n\t\tfor (int i = 0; i < points.length; i++) {\n\t\t\tVector2f.sub(points[(i + 1) % points.length], points[i], edge);\n\t\t\t\n\t\t\t// Check if the current point is further away then the current\n\t\t\tfloat length = points[i].length();\n\t\t\tbroadPhaseLength = Math.max(length, broadPhaseLength);\n\t\t\t\n\t\t\t// Calculated of 90 degree rotation matrix\n\t\t\t\n\t\t\tVector2f normal;\n\t\t\tif (rightHand) {\n\t\t\t\tnormal = new Vector2f( edge.y,-edge.x);\n\t\t\t} else {\n\t\t\t\tnormal = new Vector2f(-edge.y, edge.x);\n\t\t\t}\n\t\t\tnormal.normalise();\n\t\t\tint j = 0;\n\t\t\tfor (; j < normals.size(); j++) {\n\t\t\t\tif (Math.abs(normals.get(j).dot(normal)) == 1.0f) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (j == normals.size()) {\n\t\t\t\tnormals.add(normal);\n\t\t\t}\n\t\t}\n\t\t\n\t\tthis.normals = new Vector2f[normals.size()];\n\t\tnormals.toArray(this.normals);\n\t}", "public static Set<Set<Set<Polyomino>>> tile_dilate(int n,int k, boolean use_all_once) {\r\n\t\r\n\t\tSet<Set<Set<Polyomino>>> tilings_of_dilate = new HashSet<Set<Set<Polyomino>>>();\t\r\n\t\tArrayList<Polyomino> polyominos_list=Generate.polyominos(n,\"free\");\r\n\t\t\t\r\n\t\tfor (int p=0; p<polyominos_list.size();p++) {\r\n\t\t\t\t\r\n\t\t\tPolyomino P=polyominos_list.get(p);\r\n\t\t\tPolyomino dilate_P=polyominos_list.get(p).copy();\r\n\t\t\tdilate_P.dilate(k);\r\n\t\t\t\r\n\t\t\t//*****it's not obvious if calculating distinct_symmetries will save time\r\n\t\t\t//it will reduce the number of tile combinations but increase time to calculate symmetries\r\n\t\t\t//however calculation of symmetries is done in constant time (we check for duplicates in a list of 8 elements)\t\t\t\r\n\t\t\t\r\n\t\t\tSet<Set<Polyomino>> T=tilings(P.distinct_symmetries(),dilate_P,use_all_once,false,false);\r\n\r\n\t\t\t\r\n\t\t\tif (!T.isEmpty()){\r\n\t\t\t\ttilings_of_dilate.add(T);\r\n\t\t\t}\t\r\n\t\t}\r\n\t\t\r\n\t\treturn tilings_of_dilate;\r\n\t}", "static long countTriplets(List<Long> arr, long r) {\n Map<Long, Integer> map=new HashMap<Long, Integer>();\n int l = arr.size();\n long triplets = 0;\n //Create a map with unique numbers in arr as key and its frequency as value\n for(int i = 0; i < l; i++) {\n if (map.containsKey(arr.get(i))) {\n map.put(arr.get(i), map.get(arr.get(i)) + 1);\n } else {\n map.put(arr.get(i), 1);\n }\n }\n \n /*\n If ratio is 1, arr is {2,2,2,2,2,2,2,2,2,2}.. 2 is 10 times than map will be \n {(2, 10)}, where 2 is key and 10 is value than answer will be Nc3 (10c3), using permutations and combinations.. select '2' three times from 10 items which can be done in 10c3 ways\n */\n if (r == 1) {\n for (Map.Entry<Long, Integer> entry : map.entrySet()) {\n long key = entry.getKey();\n long val = entry.getValue();\n System.out.println(\"Key is: \" + key);\n System.out.println(\"Value is: \" + val);\n if (val > 2) {\n //here applying formula for Nc3\n triplets = triplets + (val * (val - 1) * (val - 2))/6;\n }\n } \n } else {\n /*\n eg. 2,4,4,8,8,16,24,24,24 and r is 2\n map will be {(2,1), (4,2), (8,2), (16,1), (24,3)}\n iterate for every key,value pair in the map\n first time (2,1), key is 2.. now check for 2*r(4) and 2*r*r(8) in map\n if present means triplet found.. now we need to calculate how many triplets can be formed with these 3 values.. that will be multiplication of values of these 3 keys in map... 2 is 1 time, 4 is 2 times, 8 is 2 times... no. of triplets = 1*2*2=4\n */\n for (Map.Entry<Long, Integer> entry : map.entrySet()) {\n long key1 = entry.getKey();\n long val = entry.getValue();\n long key2 = key1 * r;\n long key3 = key2 * r;\n\n if(map.containsKey(key2) && map.containsKey(key3)) {\n triplets = triplets + (val * map.get(key2) * map.get(key3));\n }\n } \n }\n return triplets;\n }", "public int infectNeighbours(Map map);", "static int countFriendsPairings(int n) \n { \n int a = 1, b = 2, c = 0; \n if (n <= 2) { \n return n; \n } \n for (int i = 3; i <= n; i++) { \n c = b + (i - 1) * a; \n a = b; \n b = c; \n } \n return c; \n }", "public void generate()\n {\n System.out.println(\"Initial allocated space for Set: Not supported\");\n// System.out.println(\"Initial allocated space for Set: \" + theMap.capacity());\n final long startTime = TimeUtils.nanoTime();\n Mnemonic m = new Mnemonic(123456789L);\n// GridPoint2 gp = new GridPoint2(0, 0);\n for (int x = -width; x < width; x++) {\n for (int y = -height; y < height; y++) {\n// for (int z = -height; z < height; z++) {\n\n// long z = (x & 0xFFFFFFFFL) << 32 | (y & 0xFFFFFFFFL);\n// z = ((z & 0x00000000ffff0000L) << 16) | ((z >>> 16) & 0x00000000ffff0000L) | (z & 0xffff00000000ffffL);\n// z = ((z & 0x0000ff000000ff00L) << 8 ) | ((z >>> 8 ) & 0x0000ff000000ff00L) | (z & 0xff0000ffff0000ffL);\n// z = ((z & 0x00f000f000f000f0L) << 4 ) | ((z >>> 4 ) & 0x00f000f000f000f0L) | (z & 0xf00ff00ff00ff00fL);\n// z = ((z & 0x0c0c0c0c0c0c0c0cL) << 2 ) | ((z >>> 2 ) & 0x0c0c0c0c0c0c0c0cL) | (z & 0xc3c3c3c3c3c3c3c3L);\n// z = ((z & 0x2222222222222222L) << 1 ) | ((z >>> 1 ) & 0x2222222222222222L) | (z & 0x9999999999999999L);\n// theMap.put(z, null); // uses 23312536 bytes of heap\n// long z = szudzik(x, y);\n// theMap.put(z, null); // uses 18331216 bytes of heap?\n// unSzudzik(pair, z);\n// theMap.put(0xC13FA9A902A6328FL * x ^ 0x91E10DA5C79E7B1DL * y, null); // uses 23312576 bytes of heap\n// theMap.put((x & 0xFFFFFFFFL) << 32 | (y & 0xFFFFFFFFL), null); // uses 28555456 bytes of heap\n theMap.add(new Vector2(x - width * 0.5f, y - height * 0.5f)); // crashes out of heap with 720 Vector2\n// gp.set(x, y);\n// theMap.add(gp.hashCode());\n// long r, s;\n// r = (x ^ 0xa0761d65L) * (y ^ 0x8ebc6af1L);\n// s = 0xa0761d65L * (z ^ 0x589965cdL);\n// r -= r >> 32;\n// s -= s >> 32;\n// r = ((r ^ s) + 0xeb44accbL) * 0xeb44acc8L;\n// theMap.add((int)(r - (r >> 32)));\n\n// theMap.add(m.toMnemonic(szudzik(x, y)));\n }\n }\n// }\n// final GridPoint2 gp = new GridPoint2(x, y);\n// final int gpHash = gp.hashCode(); // uses the updated GridPoint2 hashCode(), not the current GDX code\n// theMap.put(gp, gpHash | 0xFF000000); //value doesn't matter; this was supposed to test ObjectMap\n //theMap.put(gp, (53 * 53 + x + 53 * y) | 0xFF000000); //this is what the hashCodes would look like for the current code\n \n //final int gpHash = x * 0xC13F + y * 0x91E1; // updated hashCode()\n //// In the updated hashCode(), numbers are based on the plastic constant, which is\n //// like the golden ratio but with better properties for 2D spaces. These don't need to be prime.\n \n //final int gpHash = 53 * 53 + x + 53 * y; // equivalent to current hashCode()\n long taken = TimeUtils.timeSinceNanos(startTime);\n System.out.println(taken + \"ns taken, about 10 to the \" + Math.log10(taken) + \" power.\");\n// System.out.println(\"Post-assign allocated space for Set: \" + theMap.capacity());\n System.out.println(\"Post-assign allocated space for Set: Not supported\");\n }", "public static void main(String[] args) {\n int[][] map = new int[N][N];\r\n // 1D to 2D index map\r\n CustomPair[] indToVal = new CustomPair[(N * N) + 1];\r\n // 2D to value map\r\n Map<CustomPair, Integer> gridToValue = new HashMap<>();\r\n // Direction to start\r\n Direction dir = Direction.RIGHT;\r\n int j = 1;\r\n int y = N / 2;\r\n // shift left for even n's\r\n int x = (N % 2 == 0) ? y - 1 : y;\r\n /**\r\n * We use y, x here because the grid is sort of turned around.\r\n * */\r\n while(j <= ((N * N))) {\r\n CustomPair currentIndex = new CustomPair(y, x);\r\n // if the number is not prime it is traversable\r\n if (!isPrime(j)) {\r\n map[y][x] = 1;\r\n gridToValue.put(currentIndex, j);\r\n } else {\r\n map[y][x] = -1;\r\n }\r\n // add the value to 1d to 2d index values\r\n indToVal[j] = currentIndex;\r\n switch(dir){\r\n case RIGHT:\r\n if(x <= (N - 1) && map[y - 1][x] == 0 && j > 1)\r\n dir = Direction.UP;\r\n break;\r\n case UP:\r\n if(map[y][x - 1] == 0)\r\n dir = Direction.LEFT;\r\n break;\r\n case LEFT:\r\n if(x == 0 || map[y + 1][x] == 0)\r\n dir = Direction.DOWN;\r\n break;\r\n case DOWN:\r\n if(map[y][x + 1] == 0)\r\n dir = Direction.RIGHT;\r\n break;\r\n }\r\n // update the grid index\r\n switch(dir){\r\n case RIGHT:\r\n x++;\r\n break;\r\n case UP:\r\n y--;\r\n break;\r\n case LEFT:\r\n x--;\r\n break;\r\n case DOWN:\r\n y++;\r\n break;\r\n }\r\n // update 1D index\r\n j++;\r\n }\r\n\r\n Scanner sc = new Scanner(System.in);\r\n int caseNum = 1;\r\n while (sc.hasNextInt()) {\r\n int start = sc.nextInt();\r\n int goal = sc.nextInt();\r\n // find the shortest path\r\n Queue<CustomPair> q = new LinkedList<>();\r\n // 2D grid to distance values\r\n Map<CustomPair, Integer> distMap = new HashMap<>();\r\n // start is 0\r\n distMap.put(indToVal[start], 0);\r\n q.add(indToVal[start]);\r\n while (!q.isEmpty()) {\r\n CustomPair cur = q.remove();\r\n // for each neighbour (4 potential moves)\r\n for (int i = 0; i < 4; i++) {\r\n int nx = cur.a + X_NEIG_INDEX[i];\r\n int ny = cur.b + Y_NEIG_INDEX[i];\r\n CustomPair neighP = new CustomPair(nx, ny);\r\n // if the value is not in the grid\r\n if (!gridToValue.containsKey(neighP))\r\n continue;\r\n // if the value is already visited\r\n if (distMap.containsKey(neighP))\r\n continue;\r\n distMap.put(neighP, distMap.get(cur) + 1);\r\n q.add(neighP);\r\n }\r\n }\r\n // print for Kattis reasons\r\n String msg = \"Case \" + caseNum + \": \";\r\n if (!distMap.containsKey(indToVal[goal]) ||\r\n distMap.getOrDefault(indToVal[goal], -1) == -1 && start != goal)\r\n System.out.println(msg + \" impossible\");\r\n else\r\n System.out.println(msg + \"\" + distMap.get(indToVal[goal]));\r\n caseNum++;\r\n }\r\n }", "int help(int n, int k, int[][] map) {\n if (n <= 0 || k < 0) return 0;\n if (0 == k) return 1;\n if (1 == k) return n - 1;\n if (map[n][k] > 0) return map[n][k];\n long sum = 0;\n for (int i = 1; i <= k; i ++) {\n for (int j = 0; j < n; j ++) {\n// System.out.println(\"i = \" + i + \", j = \" + j + \", j - i = \" + (j - i) + \", j + i = \" + (j + i) + \", f0 = \" + (n - j + i - 1) + \", f1 = \" + (n - j - i - 1) + \", k - i = \" + (k - i));\n int g = 0, g0 = 0, g1 = 0;\n if (j - i >= 0) {\n g += help(n - j + i - 1, k - i, map);\n sum += g;\n// System.out.println(\"g0 = \" + g0 + \", g1 = \" + g1 + \", g = \" + g + \", sum = \" + sum);\n// System.out.println(\"-\");\n }\n }\n\n }\n// System.out.println(\"sum = \" + sum + \" ----\");\n map[n][k] = (int)sum;\n return (int)sum;\n }", "public static ArrayList<ArrayList<Integer>> getMelodicBinomialFromChord(TreeMap<Integer,ArrayList<String>> inputMap)\r\n {\r\n ArrayList<String> previousValueList = new ArrayList<>();\r\n ArrayList<String> nextValueList = new ArrayList<>();\r\n \r\n ArrayList<String> permutationList = new ArrayList<>();\r\n ArrayList<Integer> singleBinomialPrev = new ArrayList<>();\r\n ArrayList<Integer> singleBinomialNext = new ArrayList<>();\r\n \r\n TreeMap<String,ArrayList<Integer>> binomialMap = new TreeMap<>();\r\n \r\n for(int k=inputMap.size()-1; k>0; k--)\r\n { \r\n previousValueList = inputMap.get(k);\r\n nextValueList = inputMap.get(k-1);\r\n \r\n if(previousValueList.size() > 0 && nextValueList.size() > 0)\r\n {\r\n int w=0;\r\n int j=0;\r\n \r\n for(w=0; w<previousValueList.size(); w++)\r\n {\r\n for(j=0; j<nextValueList.size(); j++)\r\n {\r\n int PC_prev = 0;\r\n int NC_prev = 0;\r\n int PC_next = 0;\r\n int NC_next = 0;\r\n \r\n singleBinomialPrev = new ArrayList<>();\r\n singleBinomialNext = new ArrayList<>();\r\n \r\n String singlePermutation = previousValueList.get(w) + \":\" + nextValueList.get(j);\r\n String notePrev = previousValueList.get(w);\r\n String noteNext = nextValueList.get(j);\r\n //System.out.println(\"Permutazioni \" + previousValueList.get(w) + \"*\" + nextValueList.get(j));\r\n \r\n PC_prev = getPitchClass(previousValueList.get(w).substring(0, previousValueList.get(w).length()-1));\r\n NC_prev = getNameClass(previousValueList.get(w).substring(0, 1));\r\n singleBinomialPrev.add(PC_prev);\r\n singleBinomialPrev.add(NC_prev);\r\n \r\n PC_next = getPitchClass(nextValueList.get(j).substring(0, nextValueList.get(j).length()-1));\r\n NC_next = getNameClass(nextValueList.get(j).substring(0, 1));\r\n singleBinomialNext.add(PC_next);\r\n singleBinomialNext.add(NC_next);\r\n \r\n if((notePrev != null && !\"\".equals(notePrev)) && singleBinomialPrev.size() > 0)\r\n binomialMap.put(notePrev, singleBinomialPrev);\r\n \r\n if((noteNext != null && !\"\".equals(noteNext)) && singleBinomialPrev.size() > 0)\r\n binomialMap.put(noteNext, singleBinomialNext);\r\n \r\n if(singlePermutation != null && !\"\".equals(singlePermutation))\r\n permutationList.add(singlePermutation);\r\n }\r\n }\r\n }\r\n }\r\n //System.out.println(\"permutationList \" + permutationList);\r\n //System.out.println(\"permutationList Size \" + permutationList.size());\r\n //System.out.println(\"binomialMap \" + binomialMap);\r\n //System.out.println(\"binomialMap Size \" + binomialMap.size());\r\n return calculateInterval(permutationList, binomialMap); \r\n }", "public static boolean checkPath(int[][] bs, int i) {\n ArrayList<Integer> temp_cP = new ArrayList<Integer>();\r\n Set<Integer> temp_setcP = new HashSet<Integer>();\r\n boolean denoter = true;\r\n while (i == 3) {\r\n for (int k = 0; k < i; k++) {\r\n for (int e = 0; e < 3; e++) {\r\n temp_cP.add(e, bs[k][e]);\r\n }\r\n }\r\n temp_setcP = new HashSet<Integer>(temp_cP);\r\n if (temp_cP.size() > temp_setcP.size()) {\r\n denoter = false;\r\n break;\r\n\r\n } else {\r\n temp_cP.clear();\r\n temp_setcP.clear();\r\n\r\n for (int k = 0; k < i; k++) {\r\n for (int e = 3; e < 6; e++) {\r\n temp_cP.add(bs[k][e]);\r\n }\r\n }\r\n temp_setcP = new HashSet<Integer>(temp_cP);\r\n if (temp_cP.size() > temp_setcP.size()) {\r\n denoter = false;\r\n break;\r\n\r\n } else {\r\n break;\r\n }\r\n }\r\n }\r\n while (i == 6) {\r\n\r\n for (int k = 3; k < i; k++) {\r\n for (int e = 0; e < 3; e++) {\r\n temp_cP.add(e, bs[k][e]);\r\n }\r\n }\r\n temp_setcP = new HashSet<Integer>(temp_cP);\r\n if (temp_cP.size() > temp_setcP.size()) {\r\n denoter = false;\r\n break;\r\n\r\n } else {\r\n temp_cP.clear();\r\n temp_setcP.clear();\r\n\r\n for (int k = 3; k < i; k++) {\r\n for (int e = 3; e < 6; e++) {\r\n temp_cP.add(bs[k][e]);\r\n }\r\n }\r\n temp_setcP = new HashSet<Integer>(temp_cP);\r\n if (temp_cP.size() > temp_setcP.size()) {\r\n denoter = false;\r\n break;\r\n\r\n } else {\r\n break;\r\n }\r\n }\r\n\r\n }\r\n return denoter;\r\n }", "public static void flow(Point[][] points, int row, int col, int m, int n) {\n if (points[row][col].found) {\n return;\n }\n points[row][col].found = true;\n \n System.out.println(row + \" \" + col);\n int currentVal = points[row][col].value;\n\n if (row <= 0 || col <= 0) {\n points[row][col].reachesPac = true;\n }\n if (row >= m - 1 || col >= n - 1) {\n points[row][col].reachesAtl = true;\n }\n\n if (row+1 < m) {\n if (points[row + 1][col].value <= currentVal) {\n flow(points, row + 1, col, m, n);\n }\n }\n if (row-1 >= 0) {\n if (points[row - 1][col].value <= currentVal) {\n flow(points, row - 1, col, m, n);\n }\n }\n if (col+1 < n) {\n if (points[row][col+1].value <= currentVal) {\n flow(points, row, col + 1, m, n);\n }\n }\n if (col-1 >= 0) {\n if (points[row][col-1].value <= currentVal) {\n flow(points, row, col - 1, m, n);\n }\n }\n\n return;\n }", "public int numSolutions(int N, int M) {\n HashMap<Integer, Integer> dp = new HashMap<Integer, Integer>();\n dp.put(0, 1);\n for (int i = 0; i < N; ++i) {\n for (int j = 0; j < M; ++j) {\n HashMap<Integer, Integer> nDp = new HashMap<Integer, Integer>();\n for (Integer key : dp.keySet()) {\n int leftCell = getCell(key, j - 1);\n int upCell = getCell(key, j);\n int count = dp.get(key);\n if (upCell != 0) {\n // This is the last chance to fulfill upCell.\n if (upCell == 1 || upCell == 3) {\n // Don't paint this cell.\n int newKey = setCell(key, j, 0);\n addValue(nDp, newKey, count);\n } else {\n // Paint this cell.\n int current = 2 + (leftCell == 0 ? 0 : 1);\n int newKey = setCell(key, j, current);\n if (leftCell != 0) {\n newKey = setCell(newKey, j - 1, leftCell + 1);\n }\n addValue(nDp, newKey, count);\n }\n } else {\n // Don't paint this cell.\n int newKey = setCell(key, j, 0);\n addValue(nDp, newKey, count);\n // Paint this cell.\n if (leftCell == 0) {\n newKey = setCell(key, j, 1);\n } else {\n newKey = setCell(key, j - 1, leftCell + 1);\n newKey = setCell(newKey, j, 2);\n }\n addValue(nDp, newKey, count);\n }\n }\n dp = nDp;\n }\n }\n int result = 0;\n for (Integer key : dp.keySet()) {\n boolean valid = true;\n for (int i = 0; i < M; ++i) {\n int current = getCell(key, i);\n if (current == 2 || current == 4) {\n valid = false;\n break;\n }\n }\n if (valid) {\n result = (result + dp.get(key)) % MOD;\n }\n }\n return result;\n }", "public static void main(String[] args) {\n setStandardInput();\n\n Scanner in = new Scanner(System.in);\n\n int N = in.nextInt(); // Denoting the number of balls.\n in.skip(\"\\n\");\n\n int maxN = 100005; // The maximum number of balls.\n int maxV = 10005; // The maximum value written on a ball.\n\n int[] nums = new int[maxN];\n ArrayList<Integer> sortedBalls = new ArrayList<>();\n\n for (int i = 1; i <= N; i++) {\n nums[i] = in.nextInt();\n sortedBalls.add(nums[i]);\n }\n\n Arrays.sort(sortedBalls.toArray());\n\n int[] balls = IntStream.of(nums).distinct().toArray(); // V\n\n HashMap<Integer, Integer> H = new HashMap<>();\n for (int i = 0; i < balls.length; i++) {\n H.put(balls[i], i);\n }\n\n int[] counter = new int[maxN];\n for (int i = 1; i <= N; i++) {\n counter[H.get(nums[i])]++;\n }\n\n long[] powerOfTwo = new long[maxN]; // Maybe I can change to LONG as solution\n powerOfTwo[0] = 1L;\n for (int i = 1; i <= N; i++) {\n powerOfTwo[i] = (powerOfTwo[i - 1] << 1L) % mod;\n }\n\n // Let ways[v] denotes the number of ways modulus 10^9+7 that balls can\n // be drawn from the set, so that their GCD equals the number v.\n int[] ways = new int[maxV];\n\n for (int i = 0; i < balls.length; i++) {\n// balls\n }\n\n for (int i = 0; i < balls.length; i++) {\n\n for (int v = 1; v <= 10000; v++) {\n\n int gcd = gcd(balls[i], v);\n ways[gcd] = add(ways[gcd], (int)((powerOfTwo[counter[i]] - 1) * ways[v]));\n }\n\n ways[balls[i]] = add(ways[balls[i]], (int)powerOfTwo[counter[i]] - 1);\n }\n\n int Q = in.nextInt(); // Representing the number of GCD queries that will have to be performed.\n in.nextLine();\n\n// in.skip(\"\\n\");\n\n for (int queryNum = 1; queryNum <= Q; queryNum++) {\n\n int X = in.nextInt(); // Denoting the GCD.\n\n System.out.println(ways[X]);\n }\n }", "public String solve(long n, long a, long b, long c, long d, long x0, long y0, long m)\n {\n long[] count = new long[9];\n long x = x0;\n long y = y0;\n for (long t = 0; t < n; t++)\n {\n// System.out.println(x + \", \" + y);\n int i = (int) (x % 3) * 3 + (int) (y % 3);\n count[i]++;\n x = (a * x + b) % m;\n y = (c * y + d) % m;\n }\n\n long totalCount = 0;\n for (int i1 = 0; i1 < 9; i1++)\n {\n long count1 = count[i1];\n if (count1 == 0)\n {\n continue;\n }\n count[i1]--;\n for (int i2 = i1; i2 < 9; i2++)\n {\n long count2 = count[i2];\n if (count2 == 0)\n {\n continue;\n }\n count[i2]--;\n int x1 = i1 / 3;\n int y1 = i1 % 3;\n int x2 = i2 / 3;\n int y2 = i2 % 3;\n int x3 = (3 - (x1 + x2) % 3) % 3;\n int y3 = (3 - (y1 + y2) % 3) % 3;\n int i3 = (x3 % 3) * 3 + (y3 % 3);\n long count3 = count[i3];\n if (i3 >= i2 && count3 > 0)\n {\n // either i1==i2==i3 OR i1!=i2!=i3; you can never have only two i's the same.\n if (i1 == i2 && i2 == i3)\n {\n totalCount += calcCombinations(count1);//the first count value is the genuine count for that x,y coordinate.\n }\n else\n {\n totalCount += count1 * count2 * count3;\n }\n }\n count[i2]++;\n }\n count[i1]++;\n }\n\n return String.valueOf(totalCount);\n }", "public long countFriendsPairings(int n) \n {\n if(n<3){\n return n;\n }\n else{\n long mod=(long)Math.pow(10,9)+7;\n long b=1;\n long a=2;\n long curr=0;\n for(int i=3;i<n+1;i++){\n curr=(a+(i-1)*b)%mod;\n b=a;\n a=curr;\n \n } \n \n \n \n return curr; } \n }", "public void seekWalls() {\n\t\t for (int j=0; j<visited[0].length; j++){\n\t\t\tfor (int i=visited.length-1; i>=0; i--) {\t\t\t\n\t\t\t\tif (i!=0 && j!= visited[0].length-1) {//general position\n\t\t\t\t\tif (map.get(visited[i][j]) + map.get(visited[i-1][j]) == maxComb && !isFree(i,j,2)) {\n\t\t\t\t\t\twallRow = i+1;\n\t\t\t\t\t\twallCol = j+1;\n\t\t\t\t\t\twallSide = 'N';\n\t\t\t\t\t\treturn;//not break!!!!! return to exit !\n\t\t\t\t\t}\n\n\t\t\t\t\tif (map.get(visited[i][j]) + map.get(visited[i][j+1]) == maxComb && !isFree(i,j,4)) {\n\t\t\t\t\t\twallRow = i+1;\n\t\t\t\t\t\twallCol = j+1;\n\t\t\t\t\t\twallSide = 'E';\t\n\t\t\t\t\t\treturn;\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse if (i==0 && j!= visited[0].length-1) {\n\t\t\t\t\tif (map.get(visited[i][j]) + map.get(visited[i][j+1]) == maxComb && !isFree(i,j,4)) {\n\t\t\t\t\t\twallRow = i+1;\n\t\t\t\t\t\twallCol = j+1;\n\t\t\t\t\t\twallSide = 'E';\t\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\telse if (i!=0 && j== visited[0].length-1) {\n\t\t\t\t\tif (map.get(visited[i][j]) + map.get(visited[i-1][j]) == maxComb && !isFree(i,j,2)) {\n\t\t\t\t\t\twallRow = i+1;\n\t\t\t\t\t\twallCol = j+1;\n\t\t\t\t\t\twallSide = 'N';\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\telse {//if (i==0 && j== visited[0].length-1) {\n\t\t\t\t\t//no solution\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void calculateDistances(int point) {\n int start = getDistanceIndex(point);\n\n for (int i = 0; i < point; i++) {\n distances[start + i] = getDistance(ntree.get(point), ntree.get(i));\n }\n\n int numPoints = getNumPoints();\n\n for (int i = point + 1; i < numPoints; i++) {\n start = getDistanceIndex(i);\n distances[start + point] = getDistance(ntree.get(point),\n ntree.get(i));\n }\n }", "private static List<Point> genererPointsAlea(int nbPoints) {\n /*List<Point> points = new ArrayList<>();\n Random rand = new Random(0);\n for(int i=0; i<nbPoints; i++) {\n Point p = new Point(rand.nextDouble(), rand.nextDouble());\n points.add(p);\n }\n return points;*/\n return null;\n }", "public static void main(String[] args)throws Exception{\n BufferedReader bf = new BufferedReader(new FileReader(new File(\"data.txt\")));\n\n int t = Integer.parseInt(bf.readLine());\n map = new int[t][t];\n group = new int[t][t];\n for( int i = 0 ; i < t; i ++){\n String[] strArr = bf.readLine().split(\" \");\n for(int j = 0 ; j < t; j ++){\n map[i][j] = Integer.parseInt(strArr[j]);\n }\n }\n int g = 2;\n LinkedList<Point> gQueue = new LinkedList<>();\n for(int i = 0 ; i < t ; i ++){\n for(int j = 0 ; j < t ; j ++){\n if(map[i][j] == 1 && group[i][j] == 0){\n gQueue.add(new Point(i,j));\n while(!gQueue.isEmpty()){\n Point p = gQueue.remove();\n int startI = p.i;\n int startJ = p.j;\n group[startI][startJ] = g;\n for(int k = 0 ; k < 4; k ++){\n int tmpI = startI+mI[k];\n int tmpJ = startJ+mJ[k];\n if(tmpI >=0 && tmpJ >=0 && tmpI < t && tmpJ < t){\n if(group[tmpI][tmpJ] == 0 && map[tmpI][tmpJ] == 1){\n gQueue.add(new Point(tmpI,tmpJ));\n group[tmpI][tmpJ] = g;\n }\n }\n }\n }\n g++;\n }\n }\n }\n LinkedList<Point> queue = new LinkedList<>();\n int cnt = 0;\n while(true) {\n boolean flag = false;\n boolean match = false;\n cnt++;\n for (int i = 0; i < t; i++) {\n for (int j = 0; j < t; j++) {\n if (map[i][j] == cnt) {\n flag = true;\n int sI = i;\n int sJ = j;\n for (int k = 0; k < 4; k++) {\n int tmpI = sI + mI[k];\n int tmpJ = sJ + mJ[k];\n if (tmpI >= 0 && tmpJ >= 0 && tmpI < t && tmpJ < t) {\n if (map[tmpI][tmpJ] == 0) {\n map[tmpI][tmpJ] = map[sI][sJ] + 1;\n group[tmpI][tmpJ] = group[sI][sJ];\n }\n }\n }\n }\n }\n }\n if(!flag){\n break;\n }\n }\n for(int i = 0 ; i < t ; i ++){\n for(int j = 0 ; j < t ; j ++){\n for(int k = 0 ; k < 4 ; k ++){\n int tmpI = i + mI[k];\n int tmpJ = j + mJ[k];\n if (tmpI >= 0 && tmpJ >= 0 && tmpI < t && tmpJ < t) {\n if(group[i][j] != group[tmpI][tmpJ]){\n answer = Math.min(answer,map[i][j]+map[tmpI][tmpJ]);\n }\n }\n }\n }\n }\n System.out.println(answer-2);\n }", "public static boolean checkPath(int[][] bs, int i) {\n\t\tArrayList<Integer> temp_cP = new ArrayList<Integer>();\n\t\tSet<Integer> temp_setcP = new HashSet<Integer>();\n\t\tboolean denoter = true;\n\t\twhile (i == 3) {\n\t\t\tfor (int k = 0; k < i; k++) {\n\t\t\t\tfor (int e = 0; e < 3; e++) {\n\t\t\t\t\ttemp_cP.add(e, bs[k][e]);\n\t\t\t\t}\n\t\t\t}\n\t\t\ttemp_setcP = new HashSet<Integer>(temp_cP);\n\t\t\tif (temp_cP.size() > temp_setcP.size()) {\n\t\t\t\tdenoter = false;\n\t\t\t\tbreak;\n\n\t\t\t} else {\n\t\t\t\ttemp_cP.clear();\n\t\t\t\ttemp_setcP.clear();\n\n\t\t\t\tfor (int k = 0; k < i; k++) {\n\t\t\t\t\tfor (int e = 3; e < 6; e++) {\n\t\t\t\t\t\ttemp_cP.add(bs[k][e]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttemp_setcP = new HashSet<Integer>(temp_cP);\n\t\t\t\tif (temp_cP.size() > temp_setcP.size()) {\n\t\t\t\t\tdenoter = false;\n\t\t\t\t\tbreak;\n\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\twhile (i == 6) {\n\n\t\t\tfor (int k = 3; k < i; k++) {\n\t\t\t\tfor (int e = 0; e < 3; e++) {\n\t\t\t\t\ttemp_cP.add(e, bs[k][e]);\n\t\t\t\t}\n\t\t\t}\n\t\t\ttemp_setcP = new HashSet<Integer>(temp_cP);\n\t\t\tif (temp_cP.size() > temp_setcP.size()) {\n\t\t\t\tdenoter = false;\n\t\t\t\tbreak;\n\n\t\t\t} else {\n\t\t\t\ttemp_cP.clear();\n\t\t\t\ttemp_setcP.clear();\n\n\t\t\t\tfor (int k = 3; k < i; k++) {\n\t\t\t\t\tfor (int e = 3; e < 6; e++) {\n\t\t\t\t\t\ttemp_cP.add(bs[k][e]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttemp_setcP = new HashSet<Integer>(temp_cP);\n\t\t\t\tif (temp_cP.size() > temp_setcP.size()) {\n\t\t\t\t\tdenoter = false;\n\t\t\t\t\tbreak;\n\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\treturn denoter;\n\t}", "IntPair findPacmansCrossRoad(IntPair pacPosition, Direction.directionType pacDirection)\n {\n IntPair delta = Direction.directionToIntPair(pacDirection);\n if (isCorner(pacPosition.item1, pacPosition.item2)) {\n Direction.directionType newDirection = turnDirection(pacPosition.item1, pacPosition.item2, delta.item1, delta.item2);\n IntPair nd = Direction.directionToIntPair(newDirection);\n return findPacmansCrossRoad(\n new IntPair(pacPosition.item1 + nd.item1, pacPosition.item2 + nd.item2), newDirection);\n }\n\n if (delta.item1 == 0) {\n for (int y = pacPosition.item2; y >= 0 && y < LoadMap.MAPHEIGHTINTILES; y += delta.item2) {\n if (isCrossroad(pacPosition.item1, y)) {\n return new IntPair(pacPosition.item1, y);\n } else if (isCorner(pacPosition.item1, y)) {\n Direction.directionType newDirection = turnDirection(pacPosition.item1, y, delta.item1, delta.item2);\n IntPair nd = Direction.directionToIntPair(newDirection);\n return findPacmansCrossRoad(new IntPair(pacPosition.item1 + nd.item1, y + nd.item2), newDirection);\n }\n }\n } else {\n for (int x = pacPosition.item1; x >= 0 && x < LoadMap.MAPWIDTHINTILES; x += delta.item1) {\n if (isCrossroad(x, pacPosition.item2)) {\n return new IntPair(x, pacPosition.item2);\n } else if (isCorner(x, pacPosition.item2)) {\n Direction.directionType newDirection = turnDirection(x, pacPosition.item2, delta.item1, delta.item2);\n IntPair nd = Direction.directionToIntPair(newDirection);\n return findPacmansCrossRoad(new IntPair(x + nd.item1, pacPosition.item2 + nd.item2), newDirection);\n }\n }\n }\n\n return pacPosition;\n }", "public void generateNeighborhood(TSPSolution s){\r\n\t\tint [] rounte = new int[problem.city_num+1];\r\n\t\tfor(int i=0;i<problem.city_num;i++) rounte[i] = s.route[i];\r\n\t\trounte[problem.city_num] = rounte[0];\r\n\t\tint [] pos = new int[problem.city_num];\r\n\t\tproblem.calculatePosition(rounte, pos);\r\n\t\tint pos1 = 0;\r\n\t\tint pos2 = 0;\r\n\t\tfor(int k=0;k<problem.city_num;k++){\r\n\t\t\tint i = k;\r\n\t\t\tpos1 = i;\r\n\t\t\tint curIndex = rounte[i];\r\n\t\t\tint nextIndex = rounte[i+1];\r\n\t\t\tArrayList<Integer> candidate = problem.candidateList.get(curIndex);\r\n\t\t\tIterator<Integer> iter = candidate.iterator();\r\n\t\t\twhile(iter.hasNext()){\r\n\t\t\t\tint next = iter.next();\r\n\t\t\t\tpos2 = pos[next];\r\n\t\t\t\tint curIndex1 = rounte[pos2];\r\n\t\t\t\tint nextIndex1 = rounte[pos2+1];\r\n\t\t\t\tif(curIndex == nextIndex1) continue;\r\n\t\t\t\tif(curIndex == curIndex1) continue;\r\n\t\t\t\tif(nextIndex == nextIndex1) continue;\r\n\t\t\t\tif(curIndex1 == nextIndex) continue;\r\n\t\t\t\tint betterTimes = 0;\r\n\t\t\t\tTSPSolution solution = new TSPSolution(problem.city_num, problem.obj_num, -1);\r\n\t\t\t\tfor(int j=0;j<problem.obj_num;j++){\r\n\t\t\t\t\tint gain = problem.disMatrix[j*problem.city_num*problem.city_num+curIndex*problem.city_num+curIndex1] +\r\n\t\t\t\t\t\t\tproblem.disMatrix[j*problem.city_num*problem.city_num+nextIndex*problem.city_num+nextIndex1] - \r\n\t\t\t\t\t\t\t(problem.disMatrix[j*problem.city_num*problem.city_num+curIndex*problem.city_num+nextIndex]+\r\n\t\t\t\t\t\t\tproblem.disMatrix[j*problem.city_num*problem.city_num+curIndex1*problem.city_num+nextIndex1]);\r\n\t\t\t\t\tif(gain<0) betterTimes++;\r\n\t\t\t\t\tsolution.object_val[j] = s.object_val[j] + gain;\r\n\t\t\t\t}\r\n\t\t\t\tif(betterTimes==0) continue;\r\n\t\t\t\tsolution.route = s.route.clone();\r\n\r\n\t\t\t\tif(problem.kdSet.add(solution)){\r\n\t\t\t\t\tproblem.converse(pos1, pos2, solution.route, 0);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "NBLK(int[][] origMap) {\r\n\r\n\t\t\r\n\t\t// suppose it's a matrix for numberlink\r\n\t\tn_row = origMap.length;\r\n\t\tn_col = origMap[0].length;\r\n\t\tlength = n_row * n_col;\r\n\t\tadjaMatrix=new int[length][length];\r\n\t\tStartPoint=new HashMap<Integer, Node>();\r\n\t\tEndPoint=new HashMap<Integer, Node>();\r\n\t\tnowMap= new HashMap<Integer,LinkedList<Integer>>();\r\n\t\t\r\n\t\tpaths=new HashMap<Integer, Stack<Node>>();\r\n\t\tallNodes= new HashMap<Integer,Node>();\r\n\t\t\r\n\t\t\r\n\t\tlastPath=0;\r\n\t\t\r\n\t\tcount=0;\r\n\t\tfor (int i = 0; i < n_row; i++) {\r\n\t\t\tfor (int j = 0; j < n_col; j++) {\r\n\t\t\t\tif (origMap[i][j] > -1) {\r\n\t\t\t\t\t//we can use that point to represent a blocked point (i,j) as matrix[i][j]=-1\r\n\t\t\t\t\tint index = i * n_col + j;\r\n\t\t\t\t\tNode n = new Node(i, j, index, origMap[i][j]);\r\n\t\t\t\t\tallNodes.put(index, n);\r\n\t\t\t\t\tLinkedList<Integer> neibors = new LinkedList<Integer>();\r\n\r\n\t\t\t\t\tif (i > 0 && origMap[i-1][j] > -1) {\r\n\t\t\t\t\t\t//left\r\n\t\t\t\t\t\tadjaMatrix[index][(i - 1) * n_col + j] = 1;\r\n\t\t\t\t\t\tadjaMatrix[(i - 1) * n_col + j][index] = 1;\r\n\t\t\t\t\t\tneibors.addLast((i - 1) * n_col + j);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (i < n_row - 1 && origMap[i+1][j] > -1) {\r\n\t\t\t\t\t\t//right\r\n\t\t\t\t\t\tadjaMatrix[index][(i + 1) * n_col + j] = 1;\r\n\t\t\t\t\t\tadjaMatrix[(i + 1) * n_col + j][index] = 1;\r\n\t\t\t\t\t\tneibors.addLast((i + 1) * n_col + j);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (j > 0 && origMap[i][j-1] > -1) {\r\n\t\t\t\t\t\t//top\r\n\t\t\t\t\t\tadjaMatrix[index][i * n_col + j - 1] = 1;\r\n\t\t\t\t\t\tadjaMatrix[i * n_col + j - 1][index] = 1;\r\n\t\t\t\t\t\tneibors.addLast(i * n_col + j - 1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (j < n_col - 1 && origMap[i][j+1] > -1) {\r\n\t\t\t\t\t\t//bottom\r\n\t\t\t\t\t\tadjaMatrix[index][i * n_col + j + 1] = 1;\r\n\t\t\t\t\t\tadjaMatrix[i * n_col + j + 1][index] = 1;\r\n\t\t\t\t\t\tneibors.addLast(i * n_col + j + 1);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tnowMap.put(index, neibors);\r\n\t\t\t\t\tif (origMap[i][j] > 0) {\r\n\r\n\t\t\t\t\t\tif (!StartPoint.containsKey(origMap[i][j])) {\r\n\t\t\t\t\t\t\tStartPoint.put(origMap[i][j], n);\r\n\t\t\t\t\t\t\tStack<Node> tp = new Stack<Node>();\r\n\t\t\t\t\t\t\ttp.push(n);\r\n\t\t\t\t\t\t\tpaths.put(origMap[i][j], tp);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tEndPoint.put(origMap[i][j], n);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "public static void main(String arg[]) {\n\t\tScanner in = new Scanner(System.in);\n\n\t\tn = in.nextInt();\n\t\tm = in.nextInt();\n\n\t\tmap = new int[n + 1][n + 1];\n\n\t\tinit();\n\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tint from = in.nextInt();\n\t\t\tint to = in.nextInt();\n\t\t\tmap[from][to] = map[to][from] = 1;\n\t\t}\n\n\t\tfloyd();\n\n\t\tint sum = 0;\n\t\tint min = 999999;\n\t\tint who = 0;\n\t\tfor (int i = 1; i <= n; i++) {\n\t\t\tfor (int j = 1; j <= n; j++) {\n\t\t\t\tsum += map[i][j];\n\t\t\t}\n\n\t\t\tif (min > sum) {\n\t\t\t\tmin = sum;\n\t\t\t\twho = i;\n\t\t\t}\n\n\t\t\tsum = 0;\n\t\t}\n\n\t\tSystem.out.println(who);\n\n\t}", "private void generateMap() {\n\n\t\t//Used to ensure unique locations of each Gameboard element\n\t\tboolean[][] spaceUsed = new boolean[12][12];\n\n\t\t//A running total of fences generated\n\t\tint fencesGenerated = 0;\n\n\t\t//A running total of Mhos generated\n\t\tint mhosGenerated = 0;\n\n\t\t//Fill the board with spaces and spikes on the edge\n\t\tfor (int i = 0; i < 12; i++) {\n\t\t\tfor (int j = 0; j < 12; j++) {\n\t\t\t\tmap[i][j] = new BlankSpace(i, j, board);\n\t\t\t\tif (i == 0 || i == 11 || j ==0 || j == 11) {\n\t\t\t\t\tmap[i][j] = new Fence(i, j, board);\n\t\t\t\t\tspaceUsed[i][j] = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//Generate 20 spikes in unique locations\n\t\twhile (fencesGenerated < 20) {\n\t\t\tint x = 1+(int)(Math.random()*10);\n\t\t\tint y = 1+(int)(Math.random()*10);\n\n\t\t\tif(spaceUsed[x][y]==false) {\n\t\t\t\tmap[x][y] = new Fence(x, y, board);\n\t\t\t\tspaceUsed[x][y] = true;\n\t\t\t\tfencesGenerated++;\n\t\t\t}\n\t\t}\n\n\t\t//Generate 12 mhos in unique locations\n\t\twhile (mhosGenerated < 12) {\n\t\t\tint x = 1+(int)(Math.random()*10);\n\t\t\tint y = 1+(int)(Math.random()*10);\n\n\t\t\tif(spaceUsed[x][y]==false) {\n\t\t\t\tmap[x][y] = new Mho(x, y, board);\n\n\t\t\t\tmhoLocations.add(x);\n\t\t\t\tmhoLocations.add(y);\n\n\t\t\t\tspaceUsed[x][y] = true;\n\n\t\t\t\tmhosGenerated++;\n\t\t\t}\n\t\t}\n\n\t\t//Generate a player in a unique location\n\t\twhile (true) {\n\t\t\tint x = 1+(int)(Math.random()*10);\n\t\t\tint y = 1+(int)(Math.random()*10);\n\n\t\t\tif(spaceUsed[x][y]==false) {\n\t\t\t\tmap[x][y] = new Player(x, y, board);\n\t\t\t\tplayerLocation[0] = x;\n\t\t\t\tplayerLocation[1] = y;\n\t\t\t\tnewPlayerLocation[0] = x;\n\t\t\t\tnewPlayerLocation[1] = y;\n\t\t\t\tspaceUsed[x][y] = true;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}", "public Percolation(int n) {\n if (n < 1) {\n throw new IllegalArgumentException();\n }\n\n gridDimension = n;\n\n unionFind = new WeightedQuickUnionUF(gridDimension * gridDimension + 2);\n fullSites = new WeightedQuickUnionUF(gridDimension * gridDimension + 1);\n\n bottomRoot = gridDimension * gridDimension + 1;\n topRoot = gridDimension * gridDimension;\n\n\n sites = new boolean[gridDimension][gridDimension];\n\n }", "public void testTwoWayDistribution() {\n for(int p = 0; p < 20; p++) {\n int[] landings = new int[2];\n for(long in = 0; in < 100000; in++) {\n long longHash = FPGenerator.std64.fp(p+\"a\"+in);\n// long longHash = rand.nextLong();\n// long longHash = ArchiveUtils.doubleMurmur((p+\":\"+in).getBytes());\n landings[conhash.bucketFor(longHash, 2)]++;\n }\n// System.out.println(landings[0]+\",\"+landings[1]);\n assertTrue(\"excessive changes\",Math.abs(landings[0]-landings[1]) < 2000); \n }\n }", "static String roadsInHackerland(int n, int[][] roads) {\n\t\tMap<Integer, List<int[]>> map = new HashMap<>();\n\t\tfor (int i = 0; i < roads.length; i++) {\n\t\t\tif (map.containsKey(roads[i][0])) {\n\t\t\t\tList<int[]> list = map.get(roads[i][0]);\n\t\t\t\tboolean isFound = false;\n\t\t\t\tfor (int j = 0; j < list.size(); j++) {\n\t\t\t\t\tif (list.get(j)[0] == roads[i][1]) {\n\t\t\t\t\t\tif (list.get(j)[1] > roads[i][2]) {\n\t\t\t\t\t\t\tlist.get(j)[1] = roads[i][2];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tisFound = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!isFound) {\n\t\t\t\t\tlist.add(new int[] { roads[i][1], roads[i][2] });\n\t\t\t\t\tmap.put(roads[i][0], list);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tList<int[]> valArr = new ArrayList<>();\n\t\t\t\tvalArr.add(new int[] { roads[i][1], roads[i][2] });\n\t\t\t\tmap.put(roads[i][0], valArr);\n\t\t\t}\n\n\t\t\tif (map.containsKey(roads[i][1])) {\n\t\t\t\tList<int[]> list = map.get(roads[i][1]);\n\t\t\t\tboolean isFound = false;\n\t\t\t\tfor (int j = 0; j < list.size(); j++) {\n\t\t\t\t\tif (list.get(j)[0] == roads[i][0]) {\n\t\t\t\t\t\tif (list.get(j)[1] > roads[i][2]) {\n\t\t\t\t\t\t\tlist.get(j)[1] = roads[i][2];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tisFound = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!isFound) {\n\t\t\t\t\tlist.add(new int[] { roads[i][0], roads[i][2] });\n\t\t\t\t\tmap.put(roads[i][1], list);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tList<int[]> valArr = new ArrayList<>();\n\t\t\t\tvalArr.add(new int[] { roads[i][0], roads[i][2] });\n\t\t\t\tmap.put(roads[i][1], valArr);\n\t\t\t}\n\t\t}\n\t\tBigInteger sum = BigInteger.ZERO;\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\tfor (int j = i + 1; j <= n; j++) {\n\t\t\t\tList<Integer> nodesArr = new ArrayList<>();\n\t\t\t\t// nodesArr.add(i);\n\t\t\t\tsumTotal = BigInteger.ZERO;\n\t\t\t\tgetMinDistance(i, j, BigInteger.ZERO, map, nodesArr);\n\t\t\t\tSystem.out.println(i + \"-\" + j + \" = \" + sumTotal);\n//\t\t\t\tSystem.out.println(\"------------------------\");\n\t\t\t\tsum = sum.add(sumTotal);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t\treturn sum.toString(2);\n\t}", "public static void main(String[] args) {\n Scanner s = new Scanner(System.in);\n GridlandMetro ts = new GridlandMetro();\n long rows = s.nextLong();\n long cols = s.nextLong();\n long numTracks = s.nextLong();\n HashMap<Long, List<Pair>> map_t = new HashMap();\n long numLampposts = 0L;\n\n\n for(long j=0; j<numTracks; j+=1L){\n\n long current_row = s.nextLong();\n long c1 = s.nextLong();\n long c2 = s.nextLong();\n if(!map_t.containsKey(current_row))\n map_t.put(current_row, new ArrayList<Pair>());\n map_t.get(current_row).add(ts.new Pair(c1,c2));\n\n }\n\n for(long i=(map_t.keySet().size()+1); i<=rows; i++)\n numLampposts += cols;\n\n for(Long current_key:map_t.keySet()){\n Collections.sort(map_t.get(current_key));\n long current_max = 1L;\n for(int i=0; i<map_t.get(current_key).size(); i++){\n if(current_max < map_t.get(current_key).get(i).start)\n numLampposts += map_t.get(current_key).get(i).start - current_max;\n if(current_max <= map_t.get(current_key).get(i).end)\n current_max = map_t.get(current_key).get(i).end + 1L;\n }\n numLampposts += cols-current_max+1;\n }\n\n\n\n\n System.out.println(numLampposts);\n }", "public void compressPairsGreedy(final List<GPairRecord<S, S>> pairApperances, final List<GPairRecord<S, S>> crossingPairs, final int largestTerminal) {\n\n BitSet bitSet = new BitSet(largestTerminal);\n BitSet leftSigma = new BitSet(largestTerminal);\n BitSet rightSigma = new BitSet(largestTerminal);\n\n List<List<Pair<S, Long>>> right = new ArrayList<>(largestTerminal);\n List<List<Pair<S, Long>>> left = new ArrayList<>(largestTerminal);\n\n // initial tables left and right\n for(int i = 0; i < largestTerminal; i++) {\n right.add(new ArrayList<Pair<S, Long>>());\n left.add(new ArrayList<Pair<S, Long>>());\n }\n\n // fill tables with k_{ab} and k_{ba}\n for(GPairRecord<S, S> record : pairApperances) {\n right.get(record.pair.a.getId()).add(new Pair<S, Long>(record.pair.b, record.getAppearences()));\n left.get(record.pair.b.getId()).add(new Pair<S, Long>(record.pair.a, record.getAppearences()));\n }\n\n for(GPairRecord<S, S> record : crossingPairs) {\n bitSet.set(record.pair.a.getId());\n bitSet.set(record.pair.b.getId());\n }\n\n int[] countR = new int[largestTerminal];\n int[] countL = new int[largestTerminal];\n\n for(int a = 0; a < bitSet.size(); a++) {\n if(bitSet.get(a)) {\n int[] count = null;\n if(countR[a] >= countL[a]) {\n leftSigma.set(a);\n count = countL;\n }\n else {\n rightSigma.set(a);\n count = countR;\n }\n\n Iterator<Pair<S, Long>> rightIterator = right.get(a).iterator();\n while (rightIterator.hasNext()) {\n Pair<S, Long> entry = rightIterator.next();\n count[entry.a.getId()] += entry.b;\n rightIterator.remove();\n }\n\n Iterator<Pair<S, Long>> leftIterator = left.get(a).iterator();\n while (leftIterator.hasNext()) {\n Pair<S, Long> entry = leftIterator.next();\n count[entry.a.getId()] += entry.b;\n leftIterator.remove();\n }\n }\n }\n\n long sumL = 0;\n long sumR = 0;\n\n // Sum up appearances: O(|G|)\n for(GPairRecord<S, S> record : pairApperances) {\n Pair<S,S> pair = record.pair;\n if(leftSigma.get(pair.a.getId()) && rightSigma.get(pair.b.getId())) {\n sumL += record.getAppearences();\n }\n\n if(rightSigma.get(pair.a.getId()) && leftSigma.get(pair.b.getId())) {\n sumR += record.getAppearences();\n }\n }\n\n // swap\n if(sumL < sumR) {\n BitSet tmp = rightSigma;\n rightSigma = leftSigma;\n leftSigma = tmp;\n }\n\n Iterator<GPairRecord<S, S>> pairRecordIterator = crossingPairs.iterator();\n while (pairRecordIterator.hasNext()) {\n Pair<S, S> pair = pairRecordIterator.next().pair;\n if(!leftSigma.get(pair.a.getId()) || !rightSigma.get(pair.b.getId())) {\n pairRecordIterator.remove();\n }\n }\n final BitSet fixedRightSigma = rightSigma;\n final BitSet fixedLeftSigma = leftSigma;\n\n // remove pairs we don't wanna compress: O(|G|)\n final List<GPairRecord<S,S>> uncrossedPairs = crossingPairs.stream()\n .filter(rec -> !rec.isCrossingPair())\n .filter(rec -> wordProperties.isPairAt(rec.node, rec.pair))\n .filter(rec -> fixedLeftSigma.get(rec.pair.a.getId()) && fixedRightSigma.get(rec.pair.b.getId()))\n .collect(Collectors.toList());\n\n // gather the uncrossed ones: O(|G|)\n if(!uncrossedPairs.isEmpty()) {\n final List<GPairRecord<S,S>> trash = new LinkedList<>();\n final Function<Pair<S, S>, Consumer<GPairRecord<S, S>>> consumerFunction = p ->\n {\n if(fixedLeftSigma.get(p.a.getId()) && fixedRightSigma.get(p.b.getId())) {\n return uncrossedPairs::add;\n }\n else {\n return trash::add;\n }\n };\n\n BiFunction<S, Integer, Boolean> doGreedyLeftPop = (nonTerminal, j) -> doLeftPop(nonTerminal, head -> head.isTerminal() && fixedRightSigma.get(head.getId()));\n\n BiFunction<S, Integer, Boolean> doGreedyRightPop = (nonTerminal, j) -> doRightPop(nonTerminal, tail -> tail.isTerminal() && fixedLeftSigma.get(tail.getId()));\n\n //pop: O(n+m)\n pop(phase, nonTerminal -> doGreedyLeftPop.apply(nonTerminal, 0), nonTerminal -> doGreedyRightPop.apply(nonTerminal, 0), consumerFunction);\n\n // O(|G|)\n sortPairs(uncrossedPairs);\n\n // O(|G|)\n compressUncrossedPairs(uncrossedPairs);\n }\n }", "private void detectBombs(int row, int col){\r\n int bombCount = 0; //Amount of bombs nearby\r\n //Check up\r\n if((row-1 >= 0) && row<map.length && col<map[0].length && col>=0 && map[row-1][col].getSafe() == false){\r\n bombCount++;\r\n }\r\n //Check down\r\n if((row+1 < map.length) && row>=0&& col<map[0].length && col>=0 && map[row+1][col].getSafe() == false){\r\n bombCount++;\r\n }\r\n //Check right\r\n if((col+1 < map[0].length) && col>=0 && row<map.length && row>=0 && map[row][col+1].getSafe() == false){\r\n bombCount++;\r\n }\r\n //Check left\r\n if((col-1 >= 0) && col<map[0].length && row<map.length && row>=0 && map[row][col-1].getSafe() == false){\r\n bombCount++;\r\n }\r\n //Check up right\r\n if((row-1 >= 0) && row<map.length && (col+1 < map[0].length) && col>=0 && map[row-1][col+1].getSafe() == false){\r\n bombCount++;\r\n }\r\n //Check up left\r\n if((row-1 >= 0) && row<map.length && (col-1 >= 0) && col<map[0].length&& map[row-1][col-1].getSafe() == false){\r\n bombCount++;\r\n }\r\n //Check down left\r\n if((row+1 < map.length) && row>=0 && (col-1 >= 0)&& col<map[0].length && map[row+1][col-1].getSafe() == false){\r\n bombCount++;\r\n }\r\n //check down right\r\n if((row+1 < map.length) && row>=0 && (col+1 < map[0].length)&& col>=0 && map[row+1][col+1].getSafe() == false){\r\n bombCount++;\r\n }\r\n if(row>=0 && col>=0 && row<map.length && col<map[0].length && !map[row][col].getVisual().equals(\"F\") && map[row][col].getSafe() == true){\r\n if(bombCount==0){\r\n map[row][col].setVisual(zero);\r\n }\r\n if(bombCount==1){\r\n map[row][col].setVisual(one);\r\n }\r\n if(bombCount==2){\r\n map[row][col].setVisual(two);\r\n }\r\n if(bombCount==3){\r\n map[row][col].setVisual(three);\r\n }\r\n if(bombCount==4){\r\n map[row][col].setVisual(four);\r\n }\r\n if(bombCount==5){\r\n map[row][col].setVisual(five);\r\n }\r\n if(bombCount==6){\r\n map[row][col].setVisual(six);\r\n }\r\n if(bombCount==7){\r\n map[row][col].setVisual(seven);\r\n }\r\n if(bombCount==8){\r\n map[row][col].setVisual(eight);\r\n }\r\n map[row][col].setRevealed(true);\r\n }\r\n\r\n\r\n //return bombCount;\r\n\r\n\r\n }", "public Percolation(final int n) {\n size = n;\n grid = new boolean[n][n];\n wqf = new WeightedQuickUnionUF(n * n);\n }", "private static void broadcastLandingLocations() {\n ArrayList<Pair<Integer, Integer>> ccBySize = new ArrayList<>();\n for (int cc = 1; cc < CONNECTED_COMPONENT_SIZES.size(); ++cc) {\n ccBySize.add(new Pair<Integer, Integer>(cc, CONNECTED_COMPONENT_SIZES.get(cc)));\n }\n // Sort connected components by size, decreasing\n ccBySize.sort(new Comparator<Pair<Integer, Integer>>() {\n @Override\n public int compare(Pair<Integer, Integer> o1, Pair<Integer, Integer> o2) {\n return o2.getSecond() - o1.getSecond();\n }\n });\n int[][] locationsWithinCC = new int[CONNECTED_COMPONENT_SIZES.size()][];\n ArrayList<HashSet<Integer>> landingCoordinates = new ArrayList<>(CONNECTED_COMPONENT_SIZES.size());\n for (int cc = 0; cc < CONNECTED_COMPONENT_SIZES.size(); ++cc) {\n locationsWithinCC[cc] = new int[CONNECTED_COMPONENT_SIZES.get(cc)];\n landingCoordinates.add(new HashSet<>());\n }\n // Indices within locationsWithinCC arrays\n int[] locationsWithinCCIndices = new int[CONNECTED_COMPONENT_SIZES.size()];\n for (int r = 0; r < MAP_HEIGHT; ++r) {\n for (int c = 0; c < MAP_WIDTH; ++c) {\n int cc = CONNECTED_COMPONENTS[r][c];\n if (cc == IMPASSIBLE_TERRAIN) continue;\n int coord = (r << 16) | c;\n locationsWithinCC[cc][locationsWithinCCIndices[cc]++] = coord;\n }\n }\n //System.out.println(Arrays.deepToString(locationsWithinCC));\n int communicationArrayIndex = 1;\n int totalNumCoords = 0; // Keep track of the size of a set of landing coordinates that spans all connected components\n // Fill communication array until we can no longer fit a set of totalNumCoords into the array\n while (COMMUNICATION_ARRAY_LENGTH - communicationArrayIndex >= totalNumCoords) {\n totalNumCoords = 0;\n // Choose (cc size)^(1/4) locations in each cc\n for (int cc = 1; cc < CONNECTED_COMPONENT_SIZES.size(); ++cc) {\n HashSet<Integer> chosenCoords = landingCoordinates.get(cc);\n // Clear any previously generated landing locations for each connected component\n chosenCoords.clear();\n // Generate new unique landing locations (not necessarily distinct from previously generated locations)\n int numDesiredCoords = (int) Math.pow(CONNECTED_COMPONENT_SIZES.get(cc), 1d/4d);\n int[] locations = locationsWithinCC[cc];\n for (; chosenCoords.size() < numDesiredCoords;) {\n int randCoord = locations[rand.nextInt(locations.length)];\n chosenCoords.add(randCoord);\n }\n totalNumCoords += numDesiredCoords;\n }\n if (totalNumCoords > COMMUNICATION_ARRAY_LENGTH - communicationArrayIndex) {\n // Prevent overflow of communication array\n break;\n }\n //for (int cc = 1; cc < CONNECTED_COMPONENT_SIZES.size(); ++cc) {\n // System.out.println(landingCoordinates.get(cc));\n //}\n // Write landing locations to communication array in decreasing order of connected component size\n for (Pair<Integer, Integer> ccSizePair : ccBySize) {\n int cc = ccSizePair.getFirst();\n for (Integer coord : landingCoordinates.get(cc)) {\n gc.writeTeamArray(communicationArrayIndex, coord);\n ++communicationArrayIndex;\n }\n }\n }\n gc.writeTeamArray(0, communicationArrayIndex - 1); // write number of generated landing locations\n }", "private void obtainRefiningPoints(ArrayList<double[]> points2d_in, Matrix P, double gridSize_in, int gridCount_in[], ArrayList<double[]> points2d_out, ArrayList<double[]> points3d_out) {\n\t\tdouble fuzziness = 25;\n\t\tfor (int x = (gridCount_in[0] > 1 ? 1 : 0); x < gridCount_in[0]; x += 2) {\n\t\t\tfor (int y = (gridCount_in[1] > 1 ? 1 : 0); y < gridCount_in[1]; y += 2) {\n\t\t\t\tfor (int z = 1; z < gridCount_in[2]; z += 2) {\n\t\t\t\t\tMatrix x3D = new Matrix(4, 1);\n\t\t\t\t\tx3D.set(0, 0, x * gridSize_in);\n\t\t\t\t\tx3D.set(1, 0, y * gridSize_in);\n\t\t\t\t\tx3D.set(2, 0, z * gridSize_in);\n\t\t\t\t\tx3D.set(3, 0, 1.0);\n\t\t\t\t\tMatrix x2D = P.mul(x3D);\n\t\t\t\t\tx2D = x2D.div(x2D.get(2));\n\t\t\t\t\tdouble minDistance = 100000;\n\t\t\t\t\tint minDistanceIndex = 0;\n\t\t\t\t\tfor (int j=0;j<points2d_in.size();j++) {\n\t\t\t\t\t\tdouble distance = Math.pow(x2D.get(0) - points2d_in.get(j)[0], 2) + Math.pow(x2D.get(1) - points2d_in.get(j)[1], 2);\n\t\t\t\t\t\tif (distance < minDistance) {\n\t\t\t\t\t\t\tminDistance = distance;\n\t\t\t\t\t\t\tminDistanceIndex = j;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (minDistance < fuzziness) {\n\t\t\t\t\t\tpoints2d_out.add(points2d_in.get(minDistanceIndex));\n\t\t\t\t\t\tpoints3d_out.add(new Matrix(x3D).data);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void generate_pairs(ArrayList<Point> pointSet) {\n\t\tfor (int i = 0; i < pointSet.size(); i++) {\n\t\t\tfor (int j = i + 1; j < pointSet.size(); j++) {\n\n\t\t\t\tPair new_pair;\n\t\t\t\ttry {\n\t\t\t\t\tnew_pair = new Pair(pointSet.get(i), pointSet.get(j));\n\t\t\t\t\tunmarked_pairs.add(new_pair);\n\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t// Dimensions don't match exception\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "public int hamming() {\n int distance = 0;\n for (int i = 0; i < _N; i++) {\n for (int j = 0; j < _N; j++) {\n if (_tiles[i][j] != _goal[i][j]) {\n distance++;\n }\n }\n }\n return distance;\n }", "public static int uniquePathsBU(int m, int n) {\n\t\tint[][] dp = new int[m][n];\n\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tfor (int j = 0; j < n; j++) {\n\t\t\t\tif (i == 0 && j == 0) {\n\t\t\t\t\tdp[i][j] = 1;\n\t\t\t\t} else {\n\t\t\t\t\tint down = 0, right = 0;\n\t\t\t\t\tif (i > 0) {\n\t\t\t\t\t\tdown = dp[i - 1][j];\n\t\t\t\t\t}\n\t\t\t\t\tif (j > 0) {\n\t\t\t\t\t\tright = dp[i][j - 1];\n\t\t\t\t\t}\n\t\t\t\t\tdp[i][j] = down + right;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn dp[m - 1][n - 1];\n\t}", "public static int distinctPaths4(int n) {\n\t\tint[][] mem = new int[n+1][n+1];\n\t\tfor(int j = 1; j <= n; ++j) {\n\t\t\tmem[1][j] = 1;\n\t\t\tmem[j][1] = 1;\n\t\t}\n\t\tfor(int i = 2; i <= n; ++i) {\n\t\t\tfor(int j = 2; j <= n; ++j) {\n\t\t\t\tmem[i][j] = mem[i-1][j] + mem[i][j-1];\n\t\t\t}\n\t\t}\n\t\treturn mem[n][n];\n\t}", "static int countWaysUtil(int n, int m) \n\t { \n\t int res[] = new int[n]; \n\t res[0] = 1; res[1] = 1; \n\t for (int i=2; i<n; i++) \n\t { \n\t res[i] = 0; \n\t for (int j=1; j<=m && j<=i; j++) \n\t res[i] += res[i-j]; \n\t } \n\t return res[n-1]; \n\t }", "private void updateMowerCords() {\n\t\tfor (int i = 0; i < this.map.size(); i++) {\r\n\t\t\tfor (int j = 0; j < this.map.get(i).size(); j++) {\r\n\t\t\t\tif (this.map.get(i).get(j) == this.mower) {\r\n\t\t\t\t\tthis.x = j;\r\n\t\t\t\t\tthis.y = i;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private int countPermuation(int n, int m){\n\t\tint res = 1;\n\t\tfor(int i = n - m + 1; i <= n; i++){\n\t\t\tres *= i;\n\t\t}\n\t\treturn res;\n\t}", "private static int findCollision(int[][] matrix, int n) {\n int count = 0;\n for (int i = 0; i <= n - 1; i++) {\n for (int j = 0; j <= n - 1; j++) {\n if (matrix[i][j] == 1) {\n // left row\n for (int k = j - 1; k >= 0; k--) {\n if (matrix[i][k] == 2) {\n break;\n }\n if (matrix[i][k] == 1) {\n count++;\n }\n }\n // right row\n for (int k = j + 1; k <= n - 1; k++) {\n if (matrix[i][k] == 2) {\n break;\n }\n if (matrix[i][k] == 1) {\n count++;\n }\n }\n // up col\n for (int k = i - 1; k >= 0; k--) {\n if (matrix[k][j] == 2) {\n break;\n }\n if (matrix[k][j] == 1) {\n count++;\n }\n }\n // down col\n for (int k = i + 1; k <= n - 1; k++) {\n if (matrix[k][j] == 2) {\n break;\n }\n if (matrix[k][j] == 1) {\n count++;\n }\n }\n // up left\n for (int k = i - 1, l = j - 1; k >= 0 && l >= 0; k--, l--) {\n if (matrix[k][l] == 2) {\n break;\n }\n if (matrix[k][l] == 1) {\n count++;\n }\n }\n // down left\n for (int k = i + 1, l = j - 1; k <= n - 1 && l >= 0; k++, l--) {\n if (matrix[k][l] == 2) {\n break;\n }\n if (matrix[k][l] == 1) {\n count++;\n }\n }\n // up right\n for (int k = i - 1, l = j + 1; k >= 0 && l <= n - 1; k--, l++) {\n if (matrix[k][l] == 2) {\n break;\n }\n if (matrix[k][l] == 1) {\n count++;\n }\n }\n // down right\n for (int k = i + 1, l = j + 1; k <= n - 1 && l <= n - 1; k++, l++) {\n if (matrix[k][l] == 2) {\n break;\n }\n if (matrix[k][l] == 1) {\n count++;\n }\n }\n }\n }\n }\n return count / 2;\n }", "public Percolation(int n) {\n // constructor\n count = n;\n uf = new WeightedQuickUnionUF(count * count + 2);\n idOpen = new int[n * n + 2];\n for (int j = 0; j < (n * n + 2); j++) {\n idOpen[j] = 0;\n }\n }", "public static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\n\t\tint n = in.nextInt();\n\t\tint[] x = new int[n];\n\t\tint[] y = new int[n];\n\t\tPoint[] point1 = new Point[n];\n\t\tArrayList<Point> point2 = new ArrayList<>();\n\t\tfor(int i = 0 ; i < n ; i++)\n\t\t{\n\t\t\tx[i] = in.nextInt();\n\t\t\ty[i] = in.nextInt();\n\t\t\tpoint1[i] = new Point( x[i] , y[i] );\n\t\t\tpoint2.add( new Point( x[i] , y[i] ));\n\t\t}\n\t\tHashMap<Point,Integer> map = new HashMap<>();\n\t\tHashSet<Point> set = new HashSet<>();\n\t\tset.addAll(point2);\n\t\t\n\t\t\n\t}", "public Percolation(int n){\n\t\tif (n <= 0)\n\t\t\tthrow new IllegalArgumentException(\"input must be greater than 0\");\n\t\tstoreVar = n; \n\t\tgrid = new boolean[n*n + 2]; \n\t\tfullgrid = new boolean[n*n + 2];\n\t\tvirtualTop = 0; \n\t\tvirtualBottom = grid.length-1; \n\t\tgrid[0] = true; \n\t\tgrid[grid.length-1] = true; \n\t\tfullgrid[0] = true;\n\t\tunionFind = new WeightedQuickUnionUF(grid.length);\n\t\tbackwash = new WeightedQuickUnionUF(n*n + 1);\n\t\topenSites = 0;\n\n\t}", "public void compute() {\n\n this.jddPtsInflexion.clear();\n ILineString lsInitialee = this.geom;\n\n ILineString lsInitiale = Operateurs.resampling(lsInitialee, 1);\n ILineString lsLisse = GaussianFilter.gaussianFilter(lsInitiale, 5, 1);\n\n double sumOfDistances = 0;\n double length = 70;// 200 m max\n double sumOfAngels = 0;\n // ArrayList<Double> angels=new ArrayList<Double>();\n ArrayList<Double> differences = new ArrayList<Double>();\n\n ArrayList<Double> distances = new ArrayList<Double>();\n\n IDirectPosition p1 = lsInitiale.coord().get(0);\n IDirectPosition p2 = lsInitiale.coord().get(1);\n\n distances.add(p1.distance2D(p2));\n sumOfDistances += distances.get(distances.size() - 1);\n\n double angel = Math.atan2(p1.getY() - p2.getY(), p1.getX() - p2.getX());\n\n angel = (angel + Math.PI) * 180 / Math.PI;\n\n // angels.add(angel);\n\n for (int i = 1; i < lsInitiale.coord().size() - 1; i++) {\n\n p1 = lsInitiale.coord().get(i);\n p2 = lsInitiale.coord().get(i + 1);\n\n distances.add(p1.distance2D(p2));\n sumOfDistances += distances.get(distances.size() - 1);\n\n double newAngel = Math\n .atan2(p1.getY() - p2.getY(), p1.getX() - p2.getX());\n\n // give the value that varie from 0 to 360-epsilon\n newAngel = (newAngel + Math.PI) * 180 / Math.PI;\n\n // angels.add(newAngel);\n\n while (sumOfDistances > length && differences.size() > 0) {\n sumOfDistances -= distances.get(0);\n\n sumOfAngels -= differences.get(0);\n\n distances.remove(0);\n // System.out.println(\"olddiff=\" + differences.get(0));\n differences.remove(0);\n\n }\n\n double diff = newAngel - angel;\n\n if (diff > 180)\n diff = -360 + diff;// for the case of angel=10 and newAngel=350;\n else if (diff < -180)\n diff = 360 + diff;\n\n differences.add(diff);\n sumOfAngels += diff;\n angel = newAngel;\n // System.out.println(\"sumOfAngels=\" + sumOfAngels);\n // System.out.println(\"angel=\" + newAngel);\n // System.out.println(\"diff=\" + diff);\n\n /*\n * for(int k=0;k<angels.size();k++){ double diff2=newAngel-angels.get(k));\n * if(diff2>180)diff2=360-diff2;// for the case of angel=10 and\n * newAngel=350; else if(diff2<-180)diff2=-360-diff2;\n * if(Math.abs(newAngel->200) {\n * \n * }\n * \n * \n * }\n */\n\n if (Math.abs(sumOfAngels) > 100) {\n\n double maxOfDiff = 0;\n int indexOfMaxOfDiff = -1;\n for (int k = 0; k < differences.size(); k++) {\n if (differences.get(k) > maxOfDiff) {\n maxOfDiff = differences.get(k);\n indexOfMaxOfDiff = k;\n\n }\n\n }\n double maxDistance = -1;\n int maxDistancePointIndex = -1;\n // if(i+differences.size()-indexOfMaxOfDiff-1>=jddPtsInflexion.size())\n for (int jj = 0; jj < differences.size(); jj++) {\n // jddPtsInflexion.add(lsInitiale.coord().get(i+differences.size()-indexOfMaxOfDiff-2));\n if (i + jj - indexOfMaxOfDiff >= 0\n && i + jj - indexOfMaxOfDiff < lsInitiale.coord().size()) {\n int currIndex = i + jj - indexOfMaxOfDiff;\n double distance = lsInitiale.coord().get(currIndex).distance2D(\n lsLisse.coord().get(currIndex));\n if (distance > maxDistance) {\n maxDistance = distance;\n maxDistancePointIndex = currIndex;\n }\n\n }\n\n }\n\n if (maxDistancePointIndex >= 0)\n this.jddPtsInflexion.add(lsInitiale.coord()\n .get(maxDistancePointIndex));\n\n differences.clear();\n sumOfDistances = distances.get(distances.size() - 1);\n distances.clear();\n sumOfAngels = 0;\n i++;\n\n }\n\n }\n\n }", "public static void main(String[] args) {\n\n\t\tint n = Integer.parseInt(args[0]);\n\t\tint m = Integer.parseInt(args[1]);\n\t\t\n\t\tint[][] positions = new int[m][m];\n\t\t\n\t\tdouble[] arr = new double[m];\n\t\tarr[0] = 0;\n\t\tarr[1] = 1;\n\t\tarr[2] = 2;\n\t\tarr[3] = 3;\n\t\tarr[4] = 4;\n\t\t\n\t\tfor (int i=0; i < n; i++) {\n\t\t\tshuffle(arr);\n\t\t\t\n\t\t\tfor (int j=0; j< arr.length; j++) {\n\t\t\t\tpositions[j][(int)arr[j]]++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tprintTable(positions);\n\t\t//Entries are close to N/M\n\t}", "public Percolation(int n) {\n if (n < 1) throw new IllegalArgumentException(\"n is not positive\");\n virtualTopId = 0;\n virtualBottomId = n * n + 1;\n size = n;\n grid = new boolean[n][n];\n final int componentAmount = n * n + 2;\n mainUnion = new WeightedQuickUnionUF(componentAmount);\n backwashAwareUnion = new WeightedQuickUnionUF(componentAmount);\n }", "void berechneUmfang() {\r\n\t\tfor (int i = 1; i < m_ANZAHL_POINTS; i++) {\r\n\t\t\tm_umfang += m_pointArray[i].distance(m_pointArray[i-1]);\t\t\r\n\t\t}\r\n\t}", "static void updatePossible(int[][] G, int[][][] P){\n //only makes changes to possibility array\n \n int k;\n \n for(int i=1; i<G.length; i++){\n for (int j=1; j<G[i].length; j++){\n if (G[i][j]>0) {\n int m = G[i][j]; //this is the candidate # being removed from P[][][]\n \n //remove m as candidate, from P[i][j][m] for rows\n for(int ii=1; ii<G.length; ii++){\n if (ii!=i){ //skip the current box\n if (P[ii][j][0]>1 && P[ii][j][m]>0){ //only change candidate values if it's not filled\n P[ii][j][m] = 0; //set candidate value to 0\n P[ii][j][0] -= 1; //subtract 1 from total candidates for this cell\n }\n }\n }\n \n //remove m from P[i][j][m] for columns\n for(int jj=1; jj<G.length; jj++){\n if (jj!=j){ //skip the current box\n if (P[i][jj][0]>1 && P[i][jj][m]>0){ //only change candidate values if it's not filled\n P[i][jj][m] = 0; //set candidate value to 0\n P[i][jj][0] -= 1; //subtract 1 from total candidates for this cell\n }\n }\n }\n \n //remove m from P[i][j][m] for box!\n int I = getAnchor(i);\n int J = getAnchor(j);\n for(int s=I; s<=I+2; s++){\n for(int t=J; t<=J+2; t++){\n if((s!=i)||(t!=j)){\n if (P[s][t][0]>1 && P[s][t][m]>0){ //only change candidate values if it's not filled\n P[s][t][m] = 0; //set candidate value to 0\n P[s][t][0] -= 1; //subtract 1 from total candidates for this cell\n }\n }\n }\n }\n \n }\n }\n }\n }", "static int[] OnepassSol1(int[]a, int n){\r\n Map<Integer, Integer> map = new HashMap<>();\r\n for (int i = 0; i < a.length; i++) {\r\n int complement = n - a[i];\r\n if (map.containsKey(complement)) {\r\n return new int[] { map.get(complement), i };\r\n }\r\n map.put(a[i], i);\r\n }\r\n int[] ans = {-1,-1};\r\n return ans;\r\n }", "public Percolation(int n) {\n if (n <= 0) throw new IllegalArgumentException(\"Bad Input\");\n else {\n size = n;\n // mainObject includes the vsite1 and vsite2 hence it is 2 nos. greater.\n mainObject = new WeightedQuickUnionUF(n * n + 2);\n\n grid = new boolean[n][n];\n vsite1 = 0;\n vsite2 = n*n+1;\n }\n }", "private void reachAllValidPoint(int[][] tempMap, int i, int j) {\n\n\t\ttempMap[i][j] = 0;\n\t\t\n\t\t//moving in edge\n\t\tif (j > 0\n\t\t\t\t&& tempMap[i][j - 1] == 1\n\t\t\t\t&& (mapElementArray[i][j - 1] instanceof Item\n\t\t\t\t\t\t|| mapElementArray[i][j - 1] instanceof Teleporter || mapElementArray[i][j - 1] instanceof PlayerSpawnPoint)) {\n\t\t\treachAllValidPoint(tempMap, i, j - 1);\n\t\t}\n\t\tif (j + 1 < width\n\t\t\t\t&& tempMap[i][j + 1] == 1\n\t\t\t\t&& (mapElementArray[i][j + 1] instanceof Item\n\t\t\t\t\t\t|| mapElementArray[i][j + 1] instanceof Teleporter || mapElementArray[i][j + 1] instanceof PlayerSpawnPoint)) {\n\t\t\treachAllValidPoint(tempMap, i, j + 1);\n\t\t}\n\t\tif (i - 1 >= 0\n\t\t\t\t&& tempMap[i - 1][j] == 1\n\t\t\t\t&& (mapElementArray[i - 1][j] instanceof Item\n\t\t\t\t\t\t|| mapElementArray[i - 1][j] instanceof Teleporter || mapElementArray[i][j - 1] instanceof PlayerSpawnPoint)) {\n\t\t\treachAllValidPoint(tempMap, i - 1, j);\n\t\t}\n\t\tif (i + 1 < height\n\t\t\t\t&& tempMap[i + 1][j] == 1\n\t\t\t\t&& (mapElementArray[i + 1][j] instanceof Item\n\t\t\t\t\t\t|| mapElementArray[i + 1][j] instanceof Teleporter || mapElementArray[i + 1][j] instanceof PlayerSpawnPoint)) {\n\t\t\treachAllValidPoint(tempMap, i + 1, j);\n\t\t}\n\t\t\n\t\t//moving at edge, must consider if this point is a RandPaar\n\t\tif (i == 0 && tempMap[height - 1][j] == 1\n\t\t\t\t&& !(mapElementArray[height - 1][j] instanceof Wall)\n\t\t\t\t&& !(mapElementArray[height - 1][j] instanceof InvisibleWall)\n\t\t\t\t&& !(mapElementArray[height - 1][j] instanceof GhostSpawnPoint)) {\n\t\t\treachAllValidPoint(tempMap, height - 1, j);\n\t\t} else if (i == height - 1 && tempMap[0][j] == 1\n\t\t\t\t&& !(mapElementArray[0][j] instanceof Wall)\n\t\t\t\t&& !(mapElementArray[0][j] instanceof InvisibleWall)\n\t\t\t\t&& !(mapElementArray[0][j] instanceof GhostSpawnPoint)) {\n\t\t\treachAllValidPoint(tempMap, 0, j);\n\t\t} else if (j == 0 && tempMap[i][width - 1] == 1\n\t\t\t\t&& !(mapElementArray[i][width - 1] instanceof Wall)\n\t\t\t\t&& !(mapElementArray[i][width - 1] instanceof InvisibleWall)\n\t\t\t\t&& !(mapElementArray[i][width - 1] instanceof GhostSpawnPoint)) {\n\t\t\treachAllValidPoint(tempMap, i, width - 1);\n\t\t} else if (j == width - 1 && tempMap[i][0] == 1\n\t\t\t\t&& !(mapElementArray[i][0] instanceof Wall)\n\t\t\t\t&& !(mapElementArray[i][0] instanceof InvisibleWall)\n\t\t\t\t&& !(mapElementArray[i][0] instanceof GhostSpawnPoint)) {\n\t\t\treachAllValidPoint(tempMap, i, 0);\n\t\t}\n\t}", "public void calculate() {\n\t\t\n\t\tHashMap<Integer, Vertex> vertices = triangulation.getVertices();\n\t\tHashMap<Integer, Face> faces = triangulation.getFaces();\n\n\t\tHashMap<Integer, Integer> chords = new HashMap<Integer, Integer>();\n\t\tList<Vertex> onOuterCircle = new LinkedList<Vertex>();\n\t\tList<Edge> outerCircle = new LinkedList<Edge>();\n\n\t\tfor (Vertex v : vertices.values()) {\n\t\t\tchords.put(v.getId(), 0);\n\t\t\tchildren.put(v.getId(), new LinkedList<Integer>());\n\t\t}\n\n\t\t// determine outer face (randomly, use the first face)\n\t\tFace outerFace = null;\n\t\tfor (Face f : faces.values()) {\n\t\t\touterFace = f;\n\t\t\tbreak;\n\t\t}\n\t\tif (outerFace == null) {\n\t\t\t// there are no faces at all in the embedding\n\t\t\treturn;\n\t\t}\n\n\t\tEdge e = outerFace.getIncidentEdge();\n\t\tvertexOrder[1] = e.getSource();\n\t\tvertexOrder[0] = e.getTarget();\n\t\tonOuterCircle.add(e.getTarget());\n\t\tonOuterCircle.add(e.getNext().getTarget());\n\t\tonOuterCircle.add(e.getSource());\n\t\touterCircle.add(e.getNext().getNext().getTwin());\n\t\touterCircle.add(e.getNext().getTwin());\n\t\t\n\t\t//System.out.println(\"outerCircle 0 \" + outerCircle.get(0).getId() + \" - source: \" + outerCircle.get(0).getSource().getId() + \" - target: \" + outerCircle.get(0).getTarget().getId());\n\t\t//System.out.println(\"outerCircle 1 \" + outerCircle.get(1).getId() + \" - source: \" + outerCircle.get(1).getSource().getId() + \" - target: \" + outerCircle.get(1).getTarget().getId());\n\t\t\n\n\t\tfor (int k=vertexOrder.length-1; k>1; k--) {\n\t\t\t//System.out.println(\"k: \" + k + \" - outerCircle size: \" + outerCircle.size());\n\t\t\t// chose v != v_0,v_1 such that v on outer face, not considered yet and chords(v)=0\n\t\t\tVertex nextVertex = null;\n\t\t\tint nextVertexId = -1;\n\t\t\tfor (int i=0; i<onOuterCircle.size(); i++) {\n\t\t\t\tnextVertex = onOuterCircle.get(i);\n\t\t\t\tnextVertexId = nextVertex.getId();\n\t\t\t\tif (nextVertexId != vertexOrder[0].getId() && nextVertexId != vertexOrder[1].getId()\n\t\t\t\t\t\t&& chords.get(nextVertexId) == 0) {\n\t\t\t\t\t// remove from list\n\t\t\t\t\tonOuterCircle.remove(i);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//System.out.println(\"nextVertexId: \" + nextVertexId);\n\n\t\t\t// found the next vertex; add it to the considered vertices\n\t\t\tvertexOrder[k] = nextVertex;\n\t\t\t\n\t\t\t// determine children\n\t\t\tList<Integer> childrenNextVertex = children.get(nextVertexId);\n\t\t\t\n\t\t\t// update edges of outer circle\n\t\t\tint index = 0;\n\t\t\t\n\t\t\twhile (outerCircle.get(index).getTarget().getId() != nextVertexId) {\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\tEdge outofNextVertex = outerCircle.remove(index+1);\n\t\t\t\n\t\t\t\n\t\t\t//System.out.println(\"outOfNextVertex \" + outofNextVertex.getId() + \" - source: \" + outofNextVertex.getSource().getId() + \" - target: \" + outofNextVertex.getTarget().getId());\n\t\t\tEdge intoNextVertex = outerCircle.remove(index);\n\t\t\t//System.out.println(\"intoNextVertex \" + intoNextVertex.getId() + \" - source: \" + intoNextVertex.getSource().getId() + \" - target: \" + intoNextVertex.getTarget().getId());\n\t\t\tEdge current = intoNextVertex.getNext();\n\t\t\t//System.out.println(\"current \" + current.getId() + \" - source: \" + current.getSource().getId() + \" - target: \" + current.getTarget().getId());\n\t\t\t\n\t\t\tint endIndex = index;\n\t\t\t\n\t\t\twhile (current.getId() != outofNextVertex.getId()) {\n\t\t\t\tEdge onCircle = current.getNext().getTwin();\n\t\t\t\touterCircle.add(endIndex, onCircle);\n\t\t\t\t\n\t\t\t\tchildrenNextVertex.add(0, onCircle.getSource().getId());\n\t\t\t\t\n\t\t\t\tendIndex++;\n\t\t\t\tcurrent = current.getTwin().getNext();\n\t\t\t\tonOuterCircle.add(onCircle.getTarget());\n\t\t\t}\n\t\t\t\n\t\t\tEdge lastEdge = outofNextVertex.getNext().getTwin();\n\t\t\touterCircle.add(endIndex, lastEdge);\n\t\t\t\n\t\t\tchildrenNextVertex.add(0, lastEdge.getSource().getId());\n\t\t\tchildrenNextVertex.add(0, lastEdge.getTarget().getId());\n\n\t\t\t// update chords\n\t\t\tfor (Vertex v : onOuterCircle) {\n\t\t\t\tEdge incidentEdge = v.getOutEdge();\n\t\t\t\tint firstEdgeId = incidentEdge.getId();\n\t\t\t\tint chordCounter = -2; // the 2 neighbours are on the outer circle, but no chords\n\t\t\t\tdo {\n\t\t\t\t\tif (onOuterCircle.contains(incidentEdge.getTarget())) {\n\t\t\t\t\t\tchordCounter++;\n\t\t\t\t\t}\n\t\t\t\t\tincidentEdge = incidentEdge.getTwin().getNext();\n\t\t\t\t} while (incidentEdge.getId() != firstEdgeId);\n\t\t\t\tchords.put(v.getId(), chordCounter);\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int q = sc.nextInt();\n\n for(int k = 0; k < q; k++) {\n int m = sc.nextInt();\n int n = sc.nextInt();\n\n // indicate number of pieces\n long x = 1;\n long y = 1;\n \n ArrayList<Long> c_y = new ArrayList<Long>();\n for(int i = 0; i < m - 1; i++) {\n c_y.add(sc.nextLong());\n }\n \n ArrayList<Long> c_x = new ArrayList<Long>();\n for(int i = 0; i < n - 1; i++) {\n c_x.add(sc.nextLong());\n }\n\n Collections.sort(c_y, Collections.reverseOrder());\n Collections.sort(c_x, Collections.reverseOrder());\n\n // cut: most expensive = cut first\n int index_X = 0;\n int index_Y = 0;\n long totalCost = 0;\n\n while(!(x == n && y == m)) {\n if(x < n && y < m) {\n // compare cost to decide whether cut horizontally or vertically\n if(c_y.get(index_Y) >= c_x.get(index_X)) {\n totalCost += c_y.get(index_Y) * x;\n y++;\n index_Y++;\n } else if(c_y.get(index_Y) < c_x.get(index_X)) {\n totalCost += c_x.get(index_X) * y;\n x++;\n index_X++; \n }\n } else if(x == n && y < m) {\n totalCost += c_y.get(index_Y) * x;\n index_Y++;\n y++;\n } else if(x < n && y == m) {\n totalCost += c_x.get(index_X) * y;\n index_X++;\n x++;\n }\n }\n\n totalCost = totalCost % (long)(Math.pow(10, 9) + 7);\n System.out.println(totalCost );\n }\n }", "public PVector cohesion (ArrayList<Boid> boids) {\n float neighbordist = 50;\n PVector sum = new PVector(0, 0); // Start with empty vector to accumulate all positions\n int count = 0;\n for (Boid other : boids) {\n float d = PVector.dist(position, other.position);\n if ((d > 0) && (d < neighbordist)) {\n sum.add(other.position); // Add position\n count++;\n }\n }\n if (count > 0) {\n sum.div(count);\n return seek(sum); // Steer towards the position\n } else {\n return new PVector(0, 0);\n }\n }", "@Override\n public void runAlgoritm(String[] input) {\n\n int n = Integer.parseInt(input[1]);\n int tablicaPunktow[][] = new int[n][3];\n\n int iterator = 2;\n for (int i = 0; i < n; i++) {\n for (int j = 0; j < 3; j++) {\n tablicaPunktow[i][j]= Integer.parseInt(input[iterator]);\n iterator++;\n }\n }\n int tablicaWynikow[][] = new int[n][2];\n for (int i = 0; i < n; i++) {\n tablicaWynikow[i][0] = tablicaPunktow[i][0];\n double x = Math.pow((double)tablicaPunktow[i][1], 2);\n double y = Math.pow((double)tablicaPunktow[i][2], 2);\n double sqrt = Math.sqrt(x + y);\n int round = (int)Math.round(sqrt);\n tablicaWynikow[i][1] = round;\n }\n for (int i = 0; i < n; i++) {\n for (int j = 0; j < n-1; j++) {\n if(tablicaWynikow[j][1]>tablicaWynikow[j+1][1]) {\n int temp[] = new int[2];\n temp[0]=tablicaWynikow[j][0];\n temp[1]=tablicaWynikow[j][1];\n tablicaWynikow[j][0]=tablicaWynikow[j+1][0];\n tablicaWynikow[j][1]=tablicaWynikow[j+1][0];\n tablicaWynikow[j+1][0]= temp[0];\n tablicaWynikow[j+1][1]= temp[1];\n }\n }\n }\n for (int i = 0; i < n; i++) {\n int punkt = tablicaWynikow[i][0];\n for (int j = 0; j < n; j++) {\n System.out.printf(\"Punkt: %d, X: %d, Y: %d\\n\", punkt, tablicaPunktow[j][1], tablicaPunktow[j][2]);\n }\n\n }\n }", "void B_time()\n {\n System.out.println(\"Ghost current position: ( \"+X+\",\"+Y+\")\");\n double[][] dup = new double[n][n];\n //int temp = rand.nextInt(10);\n for (int i = 0; i < n; i++)\n {\n for (int j = 0; j < n; j++)\n {\n double x = 0;\n //*****SIDEWAYS****\n\n if( (j-1 >= 0) && (j-1 < n))\n {\n double a = side_neighbour(i,j-1);\n x += arr[i][j-1] * sw * (1.0/a);\n }\n if( (j+1 >= 0) && (j+1 < n))\n {\n double a = side_neighbour(i,j+1);\n x += arr[i][j+1] * sw * (1.0/a);\n }\n if( (i-1 >= 0) && (i-1 < n))\n {\n double a = side_neighbour(i-1,j);\n x += arr[i-1][j] * sw * (1.0/a);\n }\n if( (i+1 >= 0) && (i+1 < n))\n {\n double a = side_neighbour(i+1,j);\n x += arr[i+1][j] * sw * (1.0/a);\n }\n\n //*****CORNERS****\n if( (i-1 >= 0) && (i-1 < n) && (j-1 >= 0) && (j-1 < n))\n {\n double a = corner_neighbours(i-1,j-1);\n x += arr[i-1][j-1] * c *(1.0/a);\n }\n if( (i+1 >= 0) && (i+1 < n) && (j+1 >= 0) && (j+1 < n))\n {\n double a = corner_neighbours(i+1,j+1);\n x += arr[i+1][j+1] * c *(1.0/a);\n }\n if( (i-1 >= 0) && (i-1 < n) && (j+1 >= 0) && (j+1 < n))\n {\n double a = corner_neighbours(i-1,j+1);\n x += arr[i-1][j+1] * c * (1.0/a);\n }\n if( (i+1 >= 0) && (i+1 < n) && (j-1 >= 0) && (j-1 < n))\n {\n double a = corner_neighbours(i+1,j-1);\n x += arr[i+1][j-1] * c * (1.0/a);\n }\n\n double a = corner_neighbours(i,j);\n x += arr[i][j] * c * (1.0/a);\n\n //arr[i][j] = x;\n dup[i][j] = x;\n }\n }\n\n\n\n arr = dup;\n B_print();\n curr_pos(X,Y);\n\n }", "public List<Integer> numIslands2(int m, int n, int[][] positions) {\n UnionFind uf = new UnionFind(m * n);\n List<Integer> res = new ArrayList<>();\n int[][] next = new int[][]{{1, 0}, {-1, 0}, {0, 1}, {0, -1}};\n\n for (int[] position : positions) {\n int currId = position[0] * n + position[1];\n // if it's a duplicate node - no need for extra computation\n if (uf.isLand(currId)) {\n res.add(uf.getNumOfConnectedComponents());\n continue;\n }\n\n // otherwise, add the node into the union find (set parent as itself)\n uf.turnToLand(currId);\n\n // check 4 neighbors and see whether we can connect with any nodes\n for (int[] step : next) {\n int neighborRow = position[0] + step[0], neighborCol = position[1] + step[1];\n int neighborId = neighborRow * n + neighborCol;\n // need to make sure the search is still in the grid + the neighbor is actually a land cell\n if (neighborRow >= 0 && neighborCol >= 0 && neighborRow < m && neighborCol < n && uf.isLand(neighborId)) {\n uf.union(currId, neighborId);\n }\n }\n // after union with the neighbors - get the number of updated connected components\n res.add(uf.getNumOfConnectedComponents());\n }\n return res;\n }", "public static int count(int x, int y, int n)\n\t{\n\t\tif(x == 0)\n\t\t{\n\t\t\tif(y ==0) return 0;\n\t\t\treturn n;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tint g =gcd(x,y);\n\t\t\tint pdx = y/g;\n\t\t\tint pdy = x/g;\n\t\t\tint xlat =(n-x)/pdx;\n\t\t\tint ylat =y/pdy;\n\t\t\treturn min(xlat, ylat);\n\t\t}\n\t}", "int getXYPairCount();", "public static int mergeStones(int[] stones, int K) {\n int N = stones.length;\n if ((N-1)%(K-1)!=0) return -1;\n\n // dp[i][j] stores from i to j if can merge, what is the min cost, if (Len(j, i)-1)%(K-1) == 0 that means it can merge to 1 pile, otherwise, we only calculate\n // (from i(start point) to the farest point which can finally merge to 1 pile)'s merge cost\n int[][] dp = new int[N][N];\n\n int[] sum = new int[N+1];\n for (int i=0; i<N; i++) sum[i+1] = sum[i]+stones[i];\n\n for (int L=K; L<=N; L++) { // L is the length of small range\n // i is the subPiles is start point\n for (int i=0; i<=N-L; i++) {\n // j is the end point, L 不一定是K的倍数\n int j=i+L-1;\n dp[i][j]=Integer.MAX_VALUE;\n\n // each time we need keep from i to m is a \"can-merge-to-one-pile\" piles set, so m step is K-1; because each time besides i, we add(K-1) to the piles\n // [i, i+K-1] length is K\n // 把区间[i, j] split to [i, m] and [m+1,j], the left range must be merged to one pile, the right one maybe can or can not\n for (int m=i; m<j; m+=K-1) {\n dp[i][j]=Math.min(dp[i][j], dp[i][m] + dp[m+1][j]);\n }\n if ((j-i)%(K-1)==0) {\n dp[i][j]+=sum[j+1] - sum[i]; // if [i, j] can merge to 1 pile, we need finally add each elem from i to j\n System.out.println(dp[i][j]);\n }\n }\n }\n\n return dp[0][N-1];\n }", "public MPolygon computeVertex_latLong(FOV f) {\r\n\r\n\t\tMPolygon mpolygon = new MPolygon();\r\n\r\n\t\tdouble radian1 = MPolygon.toRadian(450 - (f.getDirection() - f.gethAngle() / 2));\r\n\t\tdouble radian2 = MPolygon.toRadian(450 - (f.getDirection() - f.gethAngle() / 4));\r\n\t\tdouble radian3 = MPolygon.toRadian(450 - (f.getDirection() + f.gethAngle() / 4));\r\n\t\tdouble radian4 = MPolygon.toRadian(450 - (f.getDirection() + f.gethAngle() / 2));\r\n\t\tdouble radianD = MPolygon.toRadian(450 - f.getDirection());\r\n\t\tMPoint p1 = new MPoint();\r\n\r\n\t\tp1.x = f.getLatitude() + Math.cos(radian1) * (f.getVeiwDist() * 0.00001);\r\n\t\tp1.y = f.getLongitude() + Math.sin(radian1) * (f.getVeiwDist() * 0.00001);\r\n\t\tMPoint p2 = new MPoint();\r\n\t\tp2.x = f.getLatitude() + Math.cos(radian2) * (f.getVeiwDist() * 0.00001);\r\n\t\tp2.y = f.getLongitude() + Math.sin(radian2) * (f.getVeiwDist() * 0.00001);\r\n\t\tMPoint p3 = new MPoint();\r\n\t\tp3.x = f.getLatitude() + Math.cos(radian3) * (f.getVeiwDist() * 0.00001);\r\n\t\tp3.y = f.getLongitude() + Math.sin(radian3) * (f.getVeiwDist() * 0.00001);\r\n\t\tMPoint p4 = new MPoint();\r\n\t\tp4.x = f.getLatitude() + Math.cos(radian4) * (f.getVeiwDist() * 0.00001);\r\n\t\tp4.y = f.getLongitude() + Math.sin(radian4) * (f.getVeiwDist() * 0.00001);\r\n\t\tMPoint D = new MPoint();\r\n\t\tD.x = f.getLatitude() + Math.cos(radianD) * (f.getVeiwDist() * 0.00001);\r\n\t\tD.y = f.getLongitude() + Math.sin(radianD) * (f.getVeiwDist() * 0.00001);\r\n\t\tMPoint location = new MPoint();\r\n\t\tlocation.x = f.latitude;\r\n\t\tlocation.y = f.longitude;\r\n\t\tmpolygon.setP1(p1);\r\n\t\tmpolygon.setP2(p2);\r\n\t\tmpolygon.setP3(p2);\r\n\t\tmpolygon.setP4(p4);\r\n\t\tmpolygon.setD(D);\r\n\t\tmpolygon.setLocation(location);\r\n\r\n\t\treturn mpolygon;\r\n\r\n\t}", "public static Map<List<Integer>, List<List<Integer>>> CollectTableInstasnces(List<List<Integer>> candidateList,\n Map<Integer,Map<List<Integer>, List<List<Integer>>>> starNeighbor,\n Map<List<Integer>, List<List<Integer>>> tableInstanceSizekSub1,\n int k){\n\n\n // [A, B]:[[1,2],[1,3]]\n // Return table instances\n Map<List<Integer>, List<List<Integer>>> tableInstances = new HashMap<>();\n\n // convert candidate to hashset\n Set<List<Integer>> candidateSet = new HashSet<>(candidateList);\n\n for(List<Integer> candidate: candidateSet){\n if (starNeighbor.containsKey(candidate.get(0))){\n\n // get remain candidate list\n List<Integer> remainCandidateElement = candidate.subList(1, k+1);\n\n // store the table instance of the current candidate\n List<List<Integer>> realCliquesAll = new ArrayList<>();\n\n // Loop hashmap\n Iterator<Map.Entry<List<Integer>, List<List<Integer>>>> itr = starNeighbor.get(candidate.get(0)).entrySet().iterator();\n while (itr.hasNext()){\n Map.Entry<List<Integer>, List<List<Integer>>> entry = itr.next();\n // put remain instance\n List<List<Integer>> tempRemain = new ArrayList<>();\n\n for (Integer feature : remainCandidateElement) {\n List<Integer> remainPoint = entry.getValue().parallelStream().filter( point ->\n point.get(0).equals(feature))\n .map(inst -> inst.get(1))\n .collect(Collectors.toList());\n\n if (!remainPoint.isEmpty()) {\n tempRemain.add(remainPoint);\n }\n }\n\n if (tempRemain.size() == k){\n // store the first instance into it\n tempRemain.add(0, Arrays.asList(entry.getKey().get(1)));\n\n // Cartesian product tempRemain based on combinatoricslib lib\n List<List<Integer>> remainFeatureInstance = MyGenerator.cartesianProductInteger(tempRemain);\n\n // Check real cliques\n List<List<Integer>> realClique = remainFeatureInstance.parallelStream().filter( row -> {\n\n return tableInstanceSizekSub1.get(remainCandidateElement).contains(row.subList(1, k+1));\n\n }).collect(Collectors.toList());\n\n if (!realClique.isEmpty()){\n realCliquesAll.addAll(realClique);\n }\n\n }\n }\n // put in table instances\n if(!realCliquesAll.isEmpty()){\n tableInstances.put(candidate, realCliquesAll);\n }\n }\n\n }\n return tableInstances;\n }", "static void palabras(){\n palabras=(stateCountS-1)*(stateCountP-1);\n System.out.println(\"S: \"+(stateCountS-1)+\" P: \"+(stateCountP-1)+\"palabras: \"+palabras);\n int coincidencias=0;\n for(int i=0;i<100005;i++){\n for(int j=0;j<26;j++){\n if(gs[i][j]!=0 && gs[i][j]!=-1 && gp[i][j]!=0 && gp[i][j]!=-1 && gs[i][j]==gp[i][j]){\n ++coincidencias;\n }\n }\n \n }\n System.out.println(coincidencias);\n \n palabras=palabras-coincidencias;\n System.out.println(palabras);\n }", "public static int numberOfPairs(int[] a, long k) {\n\t\t\n\t\tArrayList<Integer> list = new ArrayList<>();\n\t\t\n\t\tfor(int x : a) {\n\t\t\tlist.add(x);\n\t\t}\n\n\t\tArrayList<String> distinct = new ArrayList<>();\n\t\t\n\t\tfor(Integer curr : list) {\n\t\t\t\n\t\t\tint indexCurr = list.indexOf(curr);\n\t\t\t\n\t\t\tint anotherOne = (int) (k - curr);\n\t\t\t\n\t\t\tlist.set(indexCurr, curr*(-1));\n\t\t\t\n\t\t\tif(list.contains(anotherOne)) {\n\t\t\t\t\n\t\t\t\tint indexAnotherOne = list.indexOf(anotherOne);\n\t\t\t\t\n\t\t\t\tif(indexAnotherOne!=indexCurr) {\n\t\t\t\t\tString Way1 = curr+\"\"+anotherOne;\n\t\t\t\t\tString Way2 = anotherOne+\"\"+curr;\n\t\t\t\t\tif(!distinct.contains(Way1) && !distinct.contains(Way2)) {\n\t\t\t\t\t\tdistinct.add(Way1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tlist.set(indexCurr, curr);\n\t\t\n\t\t}\n\t\t\n\t\treturn distinct.size();\n\t\t\n }", "public static void buildPtsNeighbors(ArrayList<Trigon> trigsList) {\r\n hexagons = new ArrayList<Trigon[]>();\r\n Trigon[] curPotNghbrs;\r\n int[] curTrigIdxs;\r\n int[][] neighborIdxs = new int[6][];\r\n int numTrigs = trigsList.size();\r\n\r\n for (int j = -NUM_TRIGS; j <= NUM_TRIGS; j++) { // j is vertical index of point\r\n for (int i = 0; i <= 2 * NUM_TRIGS - Math.abs(j); i++) { // i is horizontal index of point\r\n neighborIdxs[0] = new int[] { i - 1, j, UP_TRIG_NAME }; // 10.5 'clock direction\r\n neighborIdxs[1] = new int[] { i - 1, j - 1, DN_TRIG_NAME }; // 12 o'clock\r\n neighborIdxs[2] = new int[] { i, j, UP_TRIG_NAME }; // 1.5 'clock\r\n neighborIdxs[3] = new int[] { i - 1, j, DN_TRIG_NAME }; // 7.5 'clock\r\n neighborIdxs[4] = new int[] { i, j + 1, UP_TRIG_NAME }; // 6 'clock\r\n neighborIdxs[5] = new int[] { i, j, DN_TRIG_NAME }; // 4.5 'clock\r\n if (j > 0) {\r\n neighborIdxs[1] = new int[] { i, j - 1, DN_TRIG_NAME }; // correction for symmetry chng\r\n }\r\n if (j >= 0) {\r\n neighborIdxs[4] = new int[] { i - 1, j + 1, UP_TRIG_NAME }; // symmetry chng correction\r\n }\r\n\r\n // Need to look for trigons having the above indices above through list.\r\n Trigon curTrig;\r\n curPotNghbrs = new Trigon[6];\r\n nghbrLoop: // Label for the outer loop following we'll directly break out of from inner\r\n for (int potNghbr = 0; potNghbr < 6; potNghbr++) { // looking at pt's potential neighbors\r\n for (int trigIdx = 0; trigIdx < numTrigs; trigIdx++) {\r\n curTrig = trigsList.get(trigIdx);\r\n curTrigIdxs = curTrig.getIndicesIJT(); // mutable. change changes trig?!\r\n if (curTrigIdxs[0] == neighborIdxs[potNghbr][0] // .equals didn't work\r\n && curTrigIdxs[1] == neighborIdxs[potNghbr][1]\r\n && curTrigIdxs[2] == neighborIdxs[potNghbr][2]) {\r\n curPotNghbrs[potNghbr] = curTrig;\r\n potNghbr++; // Weird I know, helps skip loops, efficnc as potential nghbrs are ordered\r\n if (potNghbr == 6) { // i.e. we've finished the hexagon\r\n break nghbrLoop;\r\n }\r\n continue;\r\n }\r\n }\r\n // curPotNghbrs would be null\r\n }\r\n hexagons.add(curPotNghbrs);\r\n }\r\n }\r\n System.out.println(\"Number of board hexagons: \" + hexagons.size());\r\n }", "int countPairs(int[] X, int[] Y, int m, int n){\n int out = 0;\n\n // System.out.println(Arrays.toString(X));\n // System.out.println(Arrays.toString(Y));\n // System.out.println(m);\n // System.out.println(n);\n\n\n \n\n int[] NoOfY = new int[m+n]; \n\n for (int i = 0; i < n; i++){\n if (Y[i] < 5){\n NoOfY[Y[i]]++; \n } \n }\n\n Arrays.sort(Y);\n\n // Take every element of X and count pairs with it \n for (int i=0; i<m; i++) {\n out += count(X[i], Y, n, NoOfY); \n }\n\n\n\n return out;\n }", "int numOfPillars() {\n // there are one more coordinate line than blocks in each direction\n // since each block must be hinged on a coordinate line on each side\n return (ni+1) * (nj+1);\n }", "private void generateMap(){\n int[] blockStepX = {X_STEP, 0, -X_STEP, -X_STEP, 0, X_STEP};\n int[] blockStepY = {Y_STEP_ONE, Y_STEP_TWO, Y_STEP_ONE, -Y_STEP_ONE, -Y_STEP_TWO, -Y_STEP_ONE};\n int blockSpecialValue = 0;\n int cellSpecial = 0;\n\n mapCells[origin.x/10][origin.y/10] = new EschatonCell(new CellPosition(0, 0, 0),\n new Point(origin.x, origin.y), blockSpecialValue);\n\n cellGrid[0][0][0] = new EschatonCell(new CellPosition(0, 0, 0),\n new Point(origin.x, origin.y), blockSpecialValue);\n\n for (int distanceFromOrigin = 0; distanceFromOrigin < config.getSizeOfMap();\n distanceFromOrigin++){\n\n int[] blockXVals = {origin.x,\n origin.x + X_STEP * distanceFromOrigin,\n origin.x + X_STEP * distanceFromOrigin,\n origin.x,\n origin.x - X_STEP * distanceFromOrigin,\n origin.x - X_STEP * distanceFromOrigin};\n\n int[] blockYVals = {origin.y - Y_STEP_TWO * distanceFromOrigin,\n origin.y - Y_STEP_ONE * distanceFromOrigin,\n origin.y + Y_STEP_ONE * distanceFromOrigin,\n origin.y + Y_STEP_TWO * distanceFromOrigin,\n origin.y + Y_STEP_ONE * distanceFromOrigin,\n origin.y - Y_STEP_ONE * distanceFromOrigin};\n\n blockSpecialValue = getRandomNumber(distanceFromOrigin, 0, 0);\n\n for (int block = 0; block < NUMBER_OF_BLOCKS; block ++){\n\n int blockXOrdinal = blockXVals[block];\n int blockYOrdinal = blockYVals[block];\n\n for (int blockSize = 0; blockSize < distanceFromOrigin; blockSize++){\n if(blockSpecialValue == blockSize){\n cellSpecial = getRandomNumber(2, 1, 1);\n }else {\n cellSpecial = 0;\n }\n cellGrid [distanceFromOrigin][block+1][blockSize+1] = makeNewCell(\n new CellPosition(distanceFromOrigin,block+1, blockSize+1),\n new Point(blockXOrdinal + blockStepX[block] * (blockSize + 1),\n blockYOrdinal + blockStepY[block] * (blockSize + 1)), cellSpecial);\n }\n }\n }\n }", "public Percolation(int n) {\n\n if (n <= 0)\n throw new IllegalArgumentException(\"Size n cannot be 0 or less than 0\");\n // Create the grid and store the grid size\n mGridSize = n;\n mGrid = new boolean[n][n];\n\n mOpenSites = 0;\n\n for (int i = 0; i < n; i++) {\n mGrid[i] = new boolean[n];\n for (int j = 0; j < n; j++)\n mGrid[i][j] = false;\n }\n\n // Initialize the WeightedQuickUnionFind\n // 2 for extra virtual nodes - one at the top\n // and one at the bottom (index 0 and index n^2 + 1 respectively)\n mUnionFind = new WeightedQuickUnionUF(n * n + 2);\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(\"This is a 10 * 10 map, x axis and y axis start from 0 - 9.\");\n\t\tSystem.out.println(\"There are totally \"+MINE_NUMBER+\" mines, and your task is to find all the mines.\");\n\n\t\t// generate 10*10 grid\n\t\t/*\n\t\t * 0: not mine 1: mine 2: mine found 3: not mine shot\n\t\t * \n\t\t */\n\t\tint[][] map = new int[10][10];\n\t\t// repeated at least 5 times generate 5 mines\n\t\tint i = 0;\n\t\twhile (i < MINE_NUMBER) {\n\t\t\t// generate mines generally\n\t\t\tint x = (int) (Math.random() * 10); // 0-9\n\t\t\tint y = (int) (Math.random() * 10); // 0-9\n\t\t\tif (map[x][y] == 1) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tmap[x][y] = 1;\n\t\t\ti++;\n\t\t}\n\n\t\t// ready to accept user input\n\t\tScanner input = new Scanner(System.in);\n\t\t// how many mines been found\n\t\tint find = 0;\n\n\t\t// start to accept user input\n\t\twhile (find < MINE_NUMBER) {\n\t\t\tint clickX, clickY;\n\t\t\tSystem.out.println(\"please enter the x axis of mine\");\n\t\t\tclickX = input.nextInt();\n\t\t\tSystem.out.println(\"please enter the y axis of mine \");\n\t\t\tclickY = input.nextInt();\n\n\t\t\tif (map[clickX][clickY] == 1) {\n\t\t\t\tmap[clickX][clickY] = 2;\n\t\t\t\tfind++;\n\t\t\t\tSystem.out.println(\"You find a mine! Now you found \" + find + \" mines and \" + (MINE_NUMBER - find) + \" left!\");\n\n\t\t\t} else if (map[clickX][clickY] == 2) {\n\t\t\t\tSystem.out.println(\"You have found this target, try again!\");\n\t\t\t} else {\n\t\t\t\tmap[clickX][clickY] = 3;\n\t\t\t\tSystem.out.println(\"You miss!\");\n\t\t\t\thint(map, clickX, clickY);\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"You found all the mines! You win!\");\n\t\tinput.close();\n\t}", "public static int uniquePathsDP(int m, int n) {\n int [][] total = new int[m][n];\n for(int i=0;i<m;i++){\n for(int j=0;j<n;j++){\n if(i==0 || j==0)\n total[i][j]=1;\n else\n total[i][j]=total[i-1][j]+total[i][j-1];\n\n }\n }\n return total[m-1][n-1];\n }", "public Percolation(int n) {\n if (n < 1) {\n throw new IllegalArgumentException(\"index is out of boundary.\");\n }\n grid = new boolean[n][n];\n openNum = 0;\n uf = new WeightedQuickUnionUF(n * n + 2);\n uTopBottem();\n }", "protected int bestDirection(int _y, int _x)\n {\n int sX = -1, sY = -1;\n for (int i = 0; i < m; i++) {\n boolean breakable = false;\n for (int j = 0; j < n; j++) {\n if (map[i][j] == 'p' || map[i][j] == '5') {\n sX = i;\n sY = j;\n breakable = true;\n break;\n }\n }\n if(breakable) break;\n sX =0; sY = 0;\n }\n Pair s = new Pair(sX, sY);\n Queue<Pair> queue = new Queue<Pair>();\n int[][] distance = new int[m][n];\n for (int i = 0; i < m; i++)\n for (int j = 0; j < n; j++)\n distance[i][j] = -1;\n distance[sX][sY] = 0;\n queue.add(s);\n /*\n System.out.println(\"DEBUG TIME!!!!\");\n for(int i = 0; i < m; i++)\n {\n for(int j = 0; j < n; j++)\n System.out.print(map[i][j]);\n System.out.println();\n }\n System.out.println();\n */\n while (!queue.isEmpty())\n {\n Pair u = queue.remove();\n for (int i = 0; i < 4; i++)\n {\n int x = u.getX() + hX[i];\n int y = u.getY() + hY[i];\n if (!validate(x, y)) continue;\n if (distance[x][y] != -1) continue;\n if (!canGo.get(map[x][y])) continue;\n distance[x][y] = distance[u.getX()][u.getY()] + 1;\n queue.add(new Pair(x, y));\n }\n }\n\n //slove if this enemy in danger\n //System.out.println(_x + \" \" + _y);\n if (inDanger[_x][_y])\n {\n int direction = -1;\n boolean canAlive = false;\n int curDistance = dangerDistance[_x][_y];\n int distanceToBomber = m * n;\n if (curDistance == -1) return 0;\n for (int i = 0; i < 4; i++)\n {\n int x = _x + hX[i];\n int y = _y + hY[i];\n if (!validate(x, y)) continue;\n if (dangerDistance[x][y] == -1) continue;\n if (dangerDistance[x][y] < curDistance)\n {\n curDistance = dangerDistance[x][y];\n direction = i;\n distanceToBomber = distance[x][y];\n } else if (dangerDistance[x][y] == curDistance)\n {\n if (distanceToBomber == -1 || distanceToBomber > distance[x][y])\n {\n direction = i;\n distanceToBomber = distance[x][y];\n }\n }\n }\n if (direction == -1) direction = random.nextInt(4);\n allowSpeedUp = true;\n return direction;\n }\n // or not, it will try to catch bomber\n else\n {\n /*\n System.out.println(\"x = \" + _x + \"y = \" + _y);\n for(int i = 0; i < n; i++) System.out.printf(\"%2d \",i);\n System.out.println();\n for(int i = 0; i < m; i++)\n {\n for(int j = 0; j < n; j++)\n System.out.printf(\"%2d \",distance[i][j]);\n System.out.println();\n }\n System.out.println();\n System.out.println();\n */\n int direction = -1;\n int[] die = new int[4];\n for (int i = 0; i < 4; i++)\n die[i] = 0;\n int curDistance = distance[_x][_y];\n for (int i = 0; i < 4; i++)\n {\n int x = _x + hX[i];\n int y = _y + hY[i];\n if (!validate(x, y))\n {\n die[i] = 1;\n continue;\n }\n ;\n if (inDanger[x][y])\n {\n die[i] = 2;\n continue;\n }\n if (distance[x][y] == -1) continue;\n if (distance[x][y] < curDistance)\n {\n curDistance = distance[x][y];\n direction = i;\n }\n }\n if(curDistance < 4) allowSpeedUp = true;\n else allowSpeedUp = false; //TODO: TEST :))\n if (direction == -1)\n {\n for (int i = 0; i < 4; i++)\n if (die[i] == 0) return i;\n for (int i = 0; i < 4; i++)\n if (die[i] == 1) return i;\n return 0;\n } else return direction;\n }\n }", "public Percolation(int n) {\n if(n<=0) {\n throw new IllegalArgumentException();\n }\n size = n;\n numOpen = 0;\n // 0th position is unused in grid arrays, UF, UF2\n grid = new boolean[n+1][n+1];\n UF = new WeightedQuickUnionUF(n*n + 3);\n UF2 = new WeightedQuickUnionUF(n*n + 2);\n top = n*n+1;\n bottom = n*n+2;\n }", "public void iterate() {\n\n\t\tArrayList<int[]> pts = new ArrayList<int[]>();\n\t\tfor (int i = 0; i < POINTS_PER_ITER; i++) {\n\t\t\tint x = Window.mathRandom.nextInt(width);\n\t\t\tint y = Window.mathRandom.nextInt(width);\n\t\t\tpts.add(new int[] { x, y });\n\t\t}\n\n\t\tint[] bestPoint = new int[] {};\n\t\tdouble maxDist = 0;\n\t\tfor (int[] point : pts) {\n\t\t\tdouble dist = getDistFromOthers(point);\n\t\t\tif (dist > maxDist) {\n\t\t\t\tmaxDist = dist;\n\t\t\t\tbestPoint = point;\n\t\t\t}\n\t\t}\n\t\tif (check(bestPoint)) {\n\t\t\tpoints.add(bestPoint);\n\t\t} else {\n\t\t\tremainingPoints += 1;\n\t\t}\n\t}", "static long countTriplets(List<Long> arr, long r) {\n\n long triplets = 0;\n\n HashMap<Long, LinkedList<Integer>> powIndexesMap = new HashMap<>();\n for (int i = 0; i < arr.size(); i++) {\n Long number = arr.get(i);\n Long pow = Long.valueOf((long) logb(number, r));\n LinkedList<Integer> indexes;\n if (!powIndexesMap.containsKey(pow)) {\n indexes = new LinkedList<>();\n } else {\n indexes = powIndexesMap.get(pow);\n }\n indexes.add(i);\n powIndexesMap.put(pow, indexes);\n }\n\n for (int i = 0; i < arr.size(); i++) {\n Long number = arr.get(i);\n Long pow = Long.valueOf((long) logb(number, r));\n Long pow2 = pow + 1;\n Long pow3 = pow2 + 1;\n\n if (!powIndexesMap.containsKey(pow2) || !powIndexesMap.containsKey(pow3)) {\n continue;\n }\n Integer countPow2 = powIndexesMap.get(pow2).size();\n Integer countPow3 = powIndexesMap.get(pow3).size();\n\n if (countPow2 > 0 && countPow3 > 0) {\n triplets += (countPow2 * countPow3);\n }\n }\n return triplets;\n }", "protected LinkedList<FunQuadruple> generateCandidates(List<FunQuadruple> lk) {\n\n LinkedList<FunQuadruple> lkPlus1 = new LinkedList<>();\n if (lk.isEmpty()) {\n return lkPlus1;\n }\n Set<ColumnCombinationBitset> subsets = new HashSet<>();\n int k = lk.get(0).candidate.size();\n ColumnCombinationBitset union = new ColumnCombinationBitset();\n for (FunQuadruple subsetQuadruple : lk) {\n // TODO optimise: all bits are set? --> break\n // If subsetQuadruple represents a unique do not add it to subsets and union (it should be pruned).\n if (subsetQuadruple.count == 0) {\n continue;\n }\n union = subsetQuadruple.candidate.union(union);\n subsets.add(subsetQuadruple.candidate);\n }\n\n Map<ColumnCombinationBitset, Integer> candidateGenerationCount = new HashMap<>();\n\n List<ColumnCombinationBitset> lkPlus1Candidates;\n FunQuadruple lkPlus1Member;\n for (ColumnCombinationBitset subset : subsets) {\n lkPlus1Candidates = union.getNSubsetColumnCombinationsSupersetOf(\n subset, k + 1);\n // FIXME add key conditional here\n // Removed key conditional - should not be triggerable?\n for (ColumnCombinationBitset candidate : lkPlus1Candidates) {\n if (candidateGenerationCount.containsKey(candidate)) {\n int count = candidateGenerationCount.get(candidate);\n count++;\n candidateGenerationCount.put(candidate, count);\n } else {\n candidateGenerationCount.put(candidate, 1);\n }\n }\n }\n\n for (ColumnCombinationBitset candidate : candidateGenerationCount\n .keySet()) {\n if (candidateGenerationCount.get(candidate) == (k + 1)) {\n lkPlus1Member = new FunQuadruple(candidate, addPliGenerate(\n candidate).getRawKeyError());\n lkPlus1.add(lkPlus1Member);\n }\n }\n return lkPlus1;\n }", "public int uniquePathsWithObstacles2(int[][] obstacleGrid) {\n\t\tint R = obstacleGrid.length;\n\t\tint C = obstacleGrid[0].length;\n\n\t\t// The goal cell is obstacle. \n\t\tif (obstacleGrid[R - 1][C -1] == 1) {\n\t\t\treturn 0;\n\t\t}\n\n\t\t// The number of ways of reaching to the goal is 1. \n\t\tobstacleGrid[R - 1][C - 1] = 1;\n\n\t\t// First initialize the R - 1 row and C - 1 column before scanning all the cells. \n\t\tfor (int i = R - 2; i >= 0; i--) {\n\t\t\tif (obstacleGrid[i][C - 1] == 0 && obstacleGrid[i + 1][C - 1] == 1) {\n\t\t\t\t// No obstacle in this cell and the number of ways of reaching to the goal from this cell is \n\t\t\t\t// the same as that of reaching to the cell below it, plus the value of the cell, which is 1. \n\t\t\t\tobstacleGrid[i][C - 1] = 1;\n\t\t\t} else {\n\t\t\t\t// Obstacle in this cell. \n\t\t\t\tobstacleGrid[i][C - 1] = 0;\n\t\t\t}\n\t\t}\n\t\tfor (int j = C - 2; j >= 0; j--) {\n\t\t\tif (obstacleGrid[R - 1][j] == 0 && obstacleGrid[R - 1][j + 1] == 1) {\n\t\t\t\t// No obstacle in this cell and the number of ways of reaching to the goal from this cell is \n\t\t\t\t// the same as that of reaching to the cell to the right of it, plus the value of the cell, which is 1. \n\t\t\t\tobstacleGrid[R - 1][j] = 1;\n\t\t\t} else {\n\t\t\t\t// Obstacle in this cell. \n\t\t\t\tobstacleGrid[R - 1][j] = 0;\n\t\t\t}\n\t\t}\n\n\t\t// Scan through all the cells. \n\t\tfor (int i = R - 2; i >= 0; i--) {\n\t\t\tfor (int j = C - 2; j >= 0; j--) {\n\t\t\t\tif (obstacleGrid[i][j] == 0) {\n\t\t\t\t\t// No obstacle.\n\t\t\t\t\tobstacleGrid[i][j] = obstacleGrid[i + 1][j] + obstacleGrid[i][j + 1];\n\t\t\t\t} else {\n\t\t\t\t\t// Obstacle. \n\t\t\t\t\tobstacleGrid[i][j] = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn obstacleGrid[0][0];\n\t}", "public static List<List<Integer>> gen_size_k_candidate(Map<List<Integer>, Float> oldCandidate, Integer k){\n\n List<List<Integer>> sizeKPlusCandidate = new ArrayList<>();\n\n // size 2 candidate\n if( k <= 1){\n List<Integer> size1Candidate = new ArrayList<>();\n for (List<Integer> size1: oldCandidate.keySet()){\n size1Candidate.addAll(size1);\n }\n // sort\n Collections.sort(size1Candidate);\n // Generate\n sizeKPlusCandidate = CombinationGenerator.findsort(size1Candidate, 2);\n\n }else {\n List<List<Integer>> oldList = new ArrayList<>();\n oldList.addAll(oldCandidate.keySet());\n\n for(int iOld = 0; iOld < oldList.size()-1; iOld ++){\n for(int jOld =iOld+1; jOld < oldList.size(); jOld++){\n // check k element of feature is the same\n List<Integer> formerList = new ArrayList<>();\n List<Integer> laterList = new ArrayList<>();\n\n for (int fl=0; fl < k-1; fl++){\n formerList.add(oldList.get(iOld).get(fl));\n laterList.add(oldList.get(jOld).get(fl));\n }\n\n if (formerList.equals(laterList)){\n\n HashSet<Integer> tempCandidate = new HashSet<>();\n\n tempCandidate.addAll(oldList.get(iOld));\n tempCandidate.addAll(oldList.get(jOld));\n\n List<Integer> tempCandidateList = new ArrayList<>();\n tempCandidateList.addAll(tempCandidate);\n\n Collections.sort(tempCandidateList);\n // Prunning\n List<List<Integer>> prunningCandidate = CombinationGenerator.findsort(tempCandidateList, k);\n\n int flag = 0;\n for(List<Integer> checkPrun: prunningCandidate){\n if(oldCandidate.containsKey(checkPrun)){\n flag++;\n }\n }\n if (flag == k+1){\n sizeKPlusCandidate.add(tempCandidateList);\n }\n }\n }\n }\n }\n return sizeKPlusCandidate;\n }", "protected void virtual_n_squared() {\n\t\tint ns_i, ns_j, di, edge;\n\t\tint[] num_inters = new int[2];\n\t\t// NOTE: These were long-double, which is not accessible in java.\n\t\t// These may not have been doing anything on a given platform anyway.\n\t\tdouble eonn,ijsepsqrd, ije6, ije12, newe6, newe12;\n\t\tdouble denn, nnprb, ijlatsepsqrd, dl[] = new double[3], dp[] = new double[3], gstot;\n\t\tdouble truncEtot, fullEtot, dennOLD;\n\t\t// ANJ End of long-doubles.\n\t\tdouble max_circ_trunc2;\n\t\tdouble ijunscaledsepsqrd, unscaled_boxsqrd = 0.0;\n\t\t\n\t\t// Using a spherical truncation as big as the cell:\n\t\t// It implements a _fixed_length_ cut-off, and so the unscaled cell is used later:\n\t\tmax_circ_trunc2 = Math.pow((double)lsize[0][2]*0.5*(Math.sqrt(2.0/3.0)),2.0);\n\t\t\n\t\t// count the number of interactions included:\n\t\tnum_inters[0] = 0;\n\t\tnum_inters[1] = 0;\n\t\t\n\t\tnewe6 = 0.0; newe12 = 0.0; gstot = 0.0;\n\t\ttruncEtot = 0.0; fullEtot = 0.0;\n\t\tfor( ns_i = 0; ns_i < n; ns_i++ ) {\n\t\t\tfor( ns_j = ns_i; ns_j < n; ns_j++ ) {\n\t\t\t\tif( ns_i != ns_j) {\n\t\t\t\t\t\n\t\t\t\t\t// Calc relative lattice position:\n\t\t\t\t\tdl[0] = latt[c_lat][ns_j].x - latt[c_lat][ns_i].x;\n\t\t\t\t\tdl[1] = latt[c_lat][ns_j].y - latt[c_lat][ns_i].y;\n\t\t\t\t\tdl[2] = latt[c_lat][ns_j].z - latt[c_lat][ns_i].z;\n\t\t\t\t\t\n\t\t\t\t\t// Calc relative particle position:\n\t\t\t\t\tdp[0]=(latt[c_lat][ns_j].x+disp[ns_j].x)-(latt[c_lat][ns_i].x+disp[ns_i].x);\n\t\t\t\t\tdp[1]=(latt[c_lat][ns_j].y+disp[ns_j].y)-(latt[c_lat][ns_i].y+disp[ns_i].y);\n\t\t\t\t\tdp[2]=(latt[c_lat][ns_j].z+disp[ns_j].z)-(latt[c_lat][ns_i].z+disp[ns_i].z);\n\t\t\t\t\t\n\t\t\t\t\t// Shift particle to nearest image of the LATTICE SITE!\n\t\t\t\t\t// ...while also building up the square of the latt and particle displmt.\n\t\t\t\t\tijsepsqrd = 0.0; ijlatsepsqrd = 0.0;\n\t\t\t\t\tijunscaledsepsqrd = 0.0;\n\t\t\t\t\tedge = 0;\n\t\t\t\t\tfor( di = 0; di < 3; di++ ) {\n\t\t\t\t\t\tif( dl[di] < -0.5-NN_INC_TOL ) {\n\t\t\t\t\t\t\tdl[di] += 1.0;\n\t\t\t\t\t\t\tdp[di] += 1.0;\n\t\t\t\t\t\t} else if( dl[di] > 0.5-NN_INC_TOL ) {\n\t\t\t\t\t\t\tdl[di] -= 1.0;\n\t\t\t\t\t\t\tdp[di] -= 1.0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tijsepsqrd += dp[di]*dp[di]*box2[c_lat][di];\n\t\t\t\t\t\tijlatsepsqrd += dl[di]*dl[di]*box2[c_lat][di];\n\t\t\t\t\t\tif( di == 0 ) unscaled_boxsqrd = init_boxes[c_lat].x*init_boxes[c_lat].x;\n\t\t\t\t\t\tif( di == 1 ) unscaled_boxsqrd = init_boxes[c_lat].y*init_boxes[c_lat].y;\n\t\t\t\t\t\tif( di == 2 ) unscaled_boxsqrd = init_boxes[c_lat].z*init_boxes[c_lat].z;\n\t\t\t\t\t\tijunscaledsepsqrd += dl[di]*dl[di]*unscaled_boxsqrd;\n\t\t\t\t\t\tif( Math.abs(Math.abs(dl[di])-0.5) < NN_INC_TOL ) {\n\t\t\t\t\t\t\tedge = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif( edge == 0 ) {\n\t\t\t\t\t\t// particle-particle interaction:\n\t\t\t\t\t\tije6 = ij_inter_pow(ijsepsqrd,3.0); ije12 = ij_inter_pow(ijsepsqrd,6.0);\n\t\t\t\t\t\tnewe6 += ije6; newe12 += ije12;\n\t\t\t\t\t\t//System.out.printf(\"ES %i %i %g %g %g %g\\n\",ns_i,ns_j,sqrt(ijsepsqrd),ije6,ije12,lj_eta*(ije12-ije6));\n\t\t\t\t\t\tif( ijunscaledsepsqrd < max_circ_trunc2 ) {\n\t\t\t\t\t\t\tfullEtot += lj_eta*(ije12 - ije6);\n\t\t\t\t\t\t\tnum_inters[0]++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif( ijunscaledsepsqrd < max_dr2 ) {\n\t\t\t\t\t\t\ttruncEtot += lj_eta*(ije12 - ije6);\n\t\t\t\t\t\t\tnum_inters[1]++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// site-site interaction:\n\t\t\t\t\t\tijsepsqrd = ijlatsepsqrd;\n\t\t\t\t\t\tije6 = ij_inter_pow(ijsepsqrd,3.0); ije12 = ij_inter_pow(ijsepsqrd,6.0);\n\t\t\t\t\t\t//System.out.printf(\"GS %i %i %g %g %g %g\\n\",ns_i,ns_j,sqrt(ijsepsqrd),ije6,ije12,lj_eta*(ije12-ije6));\n\t\t\t\t\t\tnewe6 -= ije6; newe12 -= ije12;\n\t\t\t\t\t\tif( ijunscaledsepsqrd < max_circ_trunc2 ) fullEtot -= lj_eta*(ije12 - ije6);\n\t\t\t\t\t\tif( ijunscaledsepsqrd < max_dr2 ) truncEtot -= lj_eta*(ije12 - ije6);\n\t\t\t\t\t\t\n\t\t\t\t\t\tgstot += 4.0*(ije12-ije6);\n\t\t\t\t\t\t//System.out.printf(\"TOT %i,%i %e %e %e\\n\",ns_i,ns_j,newe6,newe12,newe12-newe6);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\teonn = lj_eta*(newe12 - newe6) + EN_SHIFT;\n//\t\tdennOLD = (eonn - calc_e_from_scratch(c_lat) );\n\t\tdennOLD = (eonn - truncEtot);\n\t\tdenn = fullEtot - truncEtot;\n\t\tnnprb = Math.exp(-denn);\n\t\tSystem.out.println(\" NN2 \"+dennOLD+\" \"+denn+\" \"+nnprb+\" \"+truncEtot+\" \"+fullEtot);\n\t\tif( !init_nncalc ) {\n\t\t\tSystem.out.println(\" NNTEST \"+Math.sqrt(max_circ_trunc2)+\" \"+ \n\t\t\t\t\t2.0*num_inters[0]/216.0+\" \"+ 2.0*num_inters[1]/216.0);\n\t\t\tinit_nncalc = true;\n\t\t}\n\t\treturn;\n\t}", "public static int calculate()\n {\n final List<Integer> oneToNine = IntStream.iterate(1, n -> n + 1)\n .limit(9)\n .boxed()\n .collect(toList());\n final List<List<Integer>> permutations = HeapPermutations.of(oneToNine);\n\n // System.out.println(permutations.size());\n //2- for each permutation\n // a. find all breaking 2 points to break\n // b. check first two sections' third is equal to the last section\n // c. if yes, add combintion to result, otherwise skip\n\n return permutations.stream()\n .flatMap(toTriples()) //find all combinations xx X yy = zz\n .filter(isPandigital()) // allow pandigital tripes through\n .map(Triple::getThird) // get the product\n .distinct() // get distinct products only given the problem statement does not allow repetition (see hint)\n .mapToInt(i -> i) // convert to primitive\n .sum(); // and finally get the sum\n }", "protected void make_it_order_n_squared( int latti ) {\n\t\tint ns_i, ns_j, ns_n;\n\t\t\n\t\tSystem.out.println(\" H Making lattice \"+latti+\" use a O(N^2) neighbour list...\\n\");\n\t\t\n\t\tfor( ns_i = 0; ns_i < n; ns_i++ ) {\n\t\t\tns_n = 0;\n\t\t\tfor( ns_j = 0; ns_j < n; ns_j++ ) {\n\t\t\t\tif( ns_i != ns_j ) {\n\t\t\t\t\tnns[latti][ns_i][ns_n] = ns_j;\n\t\t\t\t\tns_n++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tnns[latti][ns_i][ns_n] = NO_MORE_NNS;\n\t\t}\n\t}", "public void setPoints(int numOfIter) {\n\t\tint x = getX();\n\t\tint y = getY();\n\t\tint w = getW();\n\t\tint h = getH();\n\t\th = ((int) (getH() - w*0.29));\n\t\tint numOfSides = 3 * power(4, numOfIter);\n\t\n\t\t\n\t\tif(numOfIter == 0) {\n\t\t\txPointsD = new double[numOfSides];\n\t\t\tyPointsD = new double[numOfSides];\n\t\t\t\n\t\t\txPointsD[2] = x;\n\t\t\tyPointsD[2] = y + h;\n\t\t\t\n\t\t\txPointsD[1] = (double) x + ((double) w)/2;\n\t\t\tyPointsD[1] = y;\n\t\t\t\n\t\t\txPointsD[0] = x + w;\n\t\t\tyPointsD[0] = y + h;\n\t\t} else {\n\t\t\tsetPoints(numOfIter - 1);\n\t\t\tint numOfSidesBefore = xPoints.length;\n\t\t\tdouble[] xPointsDB = xPointsD;\n\t\t\tdouble[] yPointsDB = yPointsD;\n\t\t\txPointsD = new double[numOfSides];\n\t\t\tyPointsD = new double[numOfSides];\n\t\t\t\n\t\t\tfor(int i = 0; i < numOfSidesBefore; i++) {\n\t\t\t\txPointsD[4*i] = xPointsDB[i];\n\t\t\t\tyPointsD[4*i] = yPointsDB[i];\n\t\t\t\t\n\t\t\t\tdouble nextXPointsDB;\n\t\t\t\tdouble nextYPointsDB;\n\t\t\t\tif(i < numOfSidesBefore - 1) {\n\t\t\t\t\tnextXPointsDB = xPointsDB[i+1];\n\t\t\t\t\tnextYPointsDB = yPointsDB[i+1];\n\t\t\t\t} else {\n\t\t\t\t\tnextXPointsDB = xPointsDB[0];\n\t\t\t\t\tnextYPointsDB = yPointsDB[0];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//4i + 1 --> U = (2A+B)/3\n\t\t\t\txPointsD[4*i + 1] = (2 * xPointsDB[i] + nextXPointsDB)/3;\n\t\t\t\tyPointsD[4*i + 1] = (2 * yPointsDB[i] + nextYPointsDB)/3;\n\t\t\t\t\n\t\t\t\t//4i + 2 --> this one is complicated --> V = U + (AB/3)*(cos(ang(AB) + pi.3), sin(ang(AB) + pi/3))\n\t\t\t\tdouble angAB = Math.atan2(nextYPointsDB-yPointsDB[i], nextXPointsDB-xPointsDB[i]);\n\t\t\t\txPointsD[4*i + 2] = xPointsD[4*i + 1] + \n\t\t\t\t\t\t(Math.sqrt((nextXPointsDB - xPointsDB[i])*(nextXPointsDB - xPointsDB[i]) +\n\t\t\t\t\t\t\t\t(nextYPointsDB - yPointsDB[i])*(nextYPointsDB - yPointsDB[i]))/3.0) *\n\t\t\t\t\t\tMath.cos(angAB + Math.PI/3.0); \n\t\t\t\t\n\t\t\t\tyPointsD[4*i + 2] = yPointsD[4*i + 1] + \n\t\t\t\t\t\t(Math.sqrt((nextXPointsDB - xPointsDB[i])*(nextXPointsDB - xPointsDB[i]) +\n\t\t\t\t\t\t\t\t(nextYPointsDB - yPointsDB[i])*(nextYPointsDB - yPointsDB[i]))/3.0) *\n\t\t\t\t\t\tMath.sin(angAB + Math.PI/3.0);\n\t\t\t\t\n\t\t\t\t//4i + 3 --> W = (A + 2B)/3\n\t\t\t\txPointsD[4*i + 3] = (xPointsDB[i] + 2 * nextXPointsDB)/3;\n\t\t\t\tyPointsD[4*i + 3] = (yPointsDB[i] + 2 * nextYPointsDB)/3;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\txPoints = new int[numOfSides];\n\t\tyPoints = new int[numOfSides];\n\t\tfor(int i = 0; i < numOfSides; i++) {\n\t\t\txPoints[i] = (int) xPointsD[i];\n\t\t\tyPoints[i] = (int) yPointsD[i];\n\t\t}\n\t\t\n\t}" ]
[ "0.6305017", "0.6204376", "0.6091319", "0.57547796", "0.5754494", "0.57086", "0.5649609", "0.5632703", "0.5550383", "0.5545106", "0.54845756", "0.5474674", "0.54607934", "0.5435174", "0.54221576", "0.5385647", "0.5382415", "0.53444636", "0.5335512", "0.5326745", "0.53141034", "0.53126174", "0.53058785", "0.5296035", "0.52861744", "0.52425706", "0.5221593", "0.52202487", "0.5219788", "0.52150697", "0.5151996", "0.51012987", "0.5078156", "0.50729007", "0.5070051", "0.5067798", "0.5067374", "0.50624865", "0.5061264", "0.50597227", "0.50486183", "0.50319403", "0.50238496", "0.5012983", "0.49954408", "0.4992644", "0.49892253", "0.49881804", "0.49852765", "0.49835634", "0.49835548", "0.49823284", "0.4981225", "0.49809462", "0.49807096", "0.49736428", "0.49731654", "0.496724", "0.4965947", "0.49596763", "0.49583793", "0.4952037", "0.49471107", "0.4935826", "0.49006003", "0.49003214", "0.48991197", "0.48974916", "0.4894957", "0.48938954", "0.4893797", "0.48927924", "0.48921904", "0.4890189", "0.48891357", "0.48884848", "0.4880189", "0.48761323", "0.487589", "0.4874651", "0.48694107", "0.48612243", "0.48583463", "0.48497638", "0.48431945", "0.48400763", "0.4836966", "0.48361704", "0.4833962", "0.48337036", "0.48311308", "0.48280957", "0.48272762", "0.48269027", "0.48264867", "0.48245353", "0.48079574", "0.4806884", "0.48053652", "0.47985378" ]
0.6362325
0
Allow check current file for enabling this provider. For example some linemarkers require module extensions, and without it no sence generate linemarkers
default boolean isAvailable(@Nonnull PsiFile file) { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void onEnable() {\n PluginDescriptionFile pdfFile = this.getDescription();\n\n // Setup permissions\n Plugin permissionsPlugin = this.getServer().getPluginManager().getPlugin(\"Permissions\");\n\n if (permissionsPlugin == null) {\n log.info(\"[\" + pdfFile.getName() + \"] Permission system not detected, defaulting to all users\");\n usePermissions = false;\n } else {\n log.info(\"[\" + pdfFile.getName() + \"] Permission system detected\");\n usePermissions = true;\n this.permissionHandler = ((Permissions) permissionsPlugin).getHandler();\n }\n\n // Register commands\n getCommand(\"tradewolf\").setExecutor(new TradeWolfCommand(this));\n\n // Output to console that plugin is enabled\n log.info(pdfFile.getName() + \" version \" + pdfFile.getVersion() + \" enabled!\");\n }", "@Override\n \tpublic void onProviderEnabled(String provider) {\n \n \t}", "@Override\n public void onProviderEnabled(String provider) {\n }", "@Override\n public void onProviderEnabled(String provider) {\n }", "@Override\n public void onProviderEnabled(String provider) {\n }", "@Override\n public void onProviderEnabled(String provider) {\n }", "@Override\n public void onProviderEnabled(String provider) {\n }", "@Override\n\t\t\tpublic void onProviderEnabled(String provider) {\n\t\t\t\t\n\t\t\t}", "@Override\n public void onProviderEnabled(String provider) {\n\n }", "@Override\n public void onProviderEnabled(String provider) {\n\n }", "@Override\n public void onProviderEnabled(String provider) {\n\n }", "@Override\n public void onProviderEnabled(String provider) {\n\n }", "@Override\r\n public void onProviderEnabled(String provider) {\n }", "@Override\n\t\tpublic void onProviderEnabled(String provider) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void onProviderEnabled(String provider) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void onProviderEnabled(String provider) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void onProviderEnabled(String provider) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void onProviderEnabled(String provider) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void onProviderEnabled(String provider) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void onProviderEnabled(String provider) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void onProviderEnabled(String provider) {\n\t\t\t\n\t\t}", "@Override\n public void onProviderEnabled(String arg0) {\n\n }", "@Override\r\n\t\t\tpublic void onProviderEnabled(String provider) {\n\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void onProviderEnabled(String provider) {\n\r\n\t\t\t}", "@Override\n public void onProviderEnabled(String provider) {\n }", "@Override\n\tpublic void onProviderEnabled(String arg0) {\n\n\t}", "public void onEnable() {\n PluginDescriptionFile pdfFile = this.getDescription();\n System.out.println( pdfFile.getName() + \" version \" + pdfFile.getVersion() + \" is enabled!\" );\n }", "@Override\n\tpublic void onProviderEnabled(String provider) {\n\n\t}", "@Override\n\tpublic void onProviderEnabled(String provider) {\n\n\t}", "@Override\n\tpublic void onProviderEnabled(String provider) {\n\n\t}", "@Override\n\tpublic void onProviderEnabled(String provider) {\n\n\t}", "public void onProviderEnabled(String provider) {}", "@Override\n public void onProviderEnabled(String provider) {\n }", "@Override\n public void onProviderEnabled(String provider) {\n }", "@Override\n public void onProviderEnabled(String provider) {\n }", "@Override\n\tpublic void onProviderEnabled(String provider) {\n\t\t\n\t}", "@Override\n\tpublic void onProviderEnabled(String provider) {\n\t\t\n\t}", "@Override\n\tpublic void onProviderEnabled(String provider) {\n\t\t\n\t}", "@Override\n\tpublic void onProviderEnabled(String provider)\n\t{\n\t}", "@Override\r\n\t\tpublic void onProviderEnabled(String provider) {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void onProviderEnabled(String arg0) {\n\t\t\n\t}", "@Override\n\tpublic void onProviderEnabled(String arg0) {\n\t\t\n\t}", "@Override\n\tpublic void onProviderEnabled(String arg0) {\n\t\t\n\t}", "@Override\n public void onProviderEnabled(String provider) {\n\n }", "@Override\n public void onProviderEnabled(String provider) {\n\n }", "@Override\n\tpublic void onProviderEnabled(String provider) {\n\t}", "@Override\r\n\t\tpublic void onProviderEnabled(String provider)\r\n\t\t{\n\t\t\t\r\n\t\t}", "@Override\n\t\t\tpublic void onProviderEnabled(String arg0) {\n\t\t\t}", "@Override\r\n\tpublic void onProviderEnabled(String arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void onProviderEnabled(String provider) {\n\t}", "@Override\n\t public void onProviderEnabled(String provider)\n\t {\n\t \n\t }", "public void onProviderEnabled(String provider) {\n // ignore\n }", "@Override\n \t\tpublic void onProviderEnabled(String provider) {\n \t\t\t\n \t\t}", "public void onProviderEnabled(String provider) {\n\n }", "@Override\n \t\tpublic void onProviderEnabled(String provider) {\n \t\t}", "@Override\r\n\tpublic void onProviderEnabled(String arg0) {\n\r\n\t}", "public void onProviderEnabled(String provider) {\n\t }", "@Override\n public void onProviderEnabled(String s) {\n }", "@Override\n public void onProviderEnabled(String s) {\n }", "@Override\n\t\tpublic void onProviderEnabled(String provider) {\n\n\t\t}", "@Override\n\t\tpublic void onProviderEnabled(String provider) {\n\n\t\t}", "public void onEnable() {\n\r\n \tloadSettings();\r\n \tinitDbPool();\r\n \t\r\n // EXAMPLE: Custom code, here we just output some info so we can check all is well\r\n PluginDescriptionFile pdfFile = this.getDescription();\r\n\t\tlogger.info( pdfFile.getName() + \" version \" + pdfFile.getVersion() + \" is enabled!\" );\r\n }", "@Override\n\t\t\t\tpublic void onProviderEnabled(String provider)\n\t\t\t\t\t{\n\n\t\t\t\t\t}", "public void onProviderEnabled(String provider) {\n\t\t\t\n\t\t}", "public void onProviderEnabled(String provider) {\n\t\t\t\n\t\t}", "public void onProviderEnabled(String provider) {\n\t\t\t\n\t\t}", "public void onProviderEnabled(String provider)\n {\n }", "public void onProviderEnabled(String provider) {\n }", "public void onProviderEnabled(String provider) {\n }", "public void onProviderEnabled(String provider) {\n\n\n\n }", "public void onProviderEnabled(String provider) {\n\t\t\n\t}", "@Override\n public void onProviderEnabled(String provider) {\n Utils.debugLogging(getApplicationContext(), provider + \" has been enabled\");\n\n }", "public void onProviderEnabled(String provider) {\n\t\t\t}", "@Override\r\n public void onProviderEnabled(String provider) {\n\r\n }", "public void onProviderEnabled(String arg0) {\n\n\t}", "public void onProviderEnabled(String provider) {\n\n\t\t\t\t}", "public void onProviderEnabled(String provider) {\n\t\t}", "public void onProviderEnabled(String provider) {\n\t\t}", "@Override\n\tpublic void onProviderEnabled(String provider) {\n\t\t Toast.makeText(this, \"Enabled new provider \" + provider, Toast.LENGTH_SHORT).show();\n\t\t\n\t}", "@Override\n public void onEnabled(Context context) {\n }", "@Override\n public void onEnabled(Context context) {\n }", "@Override\n public void onEnabled(Context context) {\n }", "@Override\n public void onEnabled(Context context) {\n }", "@Override\n public void onEnabled(Context context) {\n }", "@Override\n public void onEnabled(Context context) {\n }", "@Override\n public void onEnabled(Context context) {\n }", "@Override\n public void onEnabled(Context context) {\n }", "@Override\n public void onEnabled(Context context) {\n }", "@Override\n public void onEnabled(Context context) {\n }", "@Override\n public void onEnabled(Context context) {\n }", "@Override\n public void onEnabled(Context context) {\n }", "@Override\n public void onEnabled(Context context) {\n }", "@Override\n public void onEnabled(Context context) {\n }", "@Override\n public void onEnabled(Context context) {\n }", "@Override\n public void onEnabled(Context context) {\n }", "@Override\n public void onEnabled(Context context) {\n }", "@Override\n public void onEnabled(Context context) {\n }", "@Override\n public void onEnabled(Context context) {\n }", "@Override\n public void onEnabled(Context context) {\n }", "@Override\n public void onEnabled(Context context) {\n }", "@Override\n public void onEnabled(Context context) {\n }" ]
[ "0.61499786", "0.6044308", "0.60300994", "0.60300994", "0.60300994", "0.60300994", "0.60300994", "0.6007073", "0.6001634", "0.6001634", "0.6001634", "0.6001634", "0.599914", "0.5998068", "0.5998068", "0.5998068", "0.5998068", "0.5998068", "0.5998068", "0.5998068", "0.5998068", "0.5997826", "0.59854966", "0.59854966", "0.5984269", "0.5980343", "0.59771097", "0.5976793", "0.5976793", "0.5976793", "0.5976793", "0.5976506", "0.597286", "0.597286", "0.597286", "0.59662277", "0.59662277", "0.59662277", "0.5963903", "0.5961236", "0.59607255", "0.59607255", "0.59607255", "0.59572643", "0.59572643", "0.5954567", "0.5952131", "0.5944475", "0.59402394", "0.5932985", "0.5928172", "0.59214324", "0.5918041", "0.5913169", "0.5911322", "0.5907742", "0.5905684", "0.5899906", "0.5899906", "0.5874404", "0.5874404", "0.5828662", "0.58249867", "0.5824319", "0.5824319", "0.5824319", "0.57895213", "0.5782346", "0.5782346", "0.5780262", "0.574883", "0.5727362", "0.5686095", "0.56849", "0.56745374", "0.5671084", "0.5641843", "0.5641843", "0.5630809", "0.5629679", "0.5629679", "0.5629679", "0.5629679", "0.5629679", "0.5629679", "0.5629679", "0.5629679", "0.5629679", "0.5629679", "0.5629679", "0.5629679", "0.5629679", "0.5629679", "0.5629679", "0.5629679", "0.5629679", "0.5629679", "0.5629679", "0.5629679", "0.5629679", "0.5629679" ]
0.0
-1
Get line markers for this PsiElement. NOTE for implementers: Please return line marker info for the exact element you were asked for, which is as small as possible. For example, instead of returning method marker for PsiMethod, return it for the PsiIdentifier which is a name of this method. More technical details: Highlighting (specifically, LineMarkersPass) queries all LineMarkerProviders in two passes (for performance reasons): first pass for all elements in visible area second pass for all the rest elements If providers returned nothing for both areas, its line markers are cleared. So if, for example, a method is halfvisible (e.g. its name is visible but a part of its body isn't) and some poorly written LineMarkerProvider returned info for the PsiMethod instead of PsiIdentifier then following would happen: the first pass would remove line marker info because the whole PsiMethod isn't visible the second pass would try to add line marker info back because LineMarkerProvider was called for the PsiMethod at last As a result, line marker icon would blink annoyingly.
@Nullable @RequiredReadAction LineMarkerInfo getLineMarkerInfo(@Nonnull PsiElement element);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected LineMarker<?>[] createMarkers()\n {\n // Create list\n List<LineMarker<?>> markers = new ArrayList<>();\n\n // Add markers for member Overrides/Implements\n JClassDecl cd = _textArea.getJFile().getClassDecl();\n if (cd != null)\n getSuperMemberMarkers(cd, markers);\n\n // Add markers for BuildIssues\n BuildIssue[] buildIssues = _textArea.getBuildIssues();\n for (BuildIssue issue : buildIssues)\n if (issue.getEnd() <= _textArea.length())\n markers.add(new LineMarker.BuildIssueMarker(_textPane, issue));\n\n // Add markers for breakpoints\n Breakpoint[] breakpoints = _textArea.getBreakpoints();\n if (breakpoints != null) {\n for (Breakpoint bp : breakpoints) {\n if (bp.getLine() < _textArea.getLineCount())\n markers.add(new LineMarker.BreakpointMarker(_textPane, bp));\n else _textArea.removeBreakpoint(bp);\n }\n }\n\n // Return markers\n return markers.toArray(new LineMarker[0]);\n }", "public List<Marker> getMarkers() {\n return this.markers.obtainAll();\n }", "public LineNumberDebugInfo[] lineNumbers();", "public SortedSet<Marker> getMarkers() {\n return variant.getSchedule().getMarkerManager().getMarkers(this);\n }", "public ArrayList<Line> getLines() {\n return currentLocation.getLines();\n }", "public LineSymbolPainter getLinePainter() {\n return linePainter;\n }", "public int getDecoratedLine (Node node);", "List<Integer> lineOffsets();", "List<Line> getLines();", "public List<Integer> getLines(){\n\t\treturn lineNumber;\n\t}", "public Coordinates intersectionAsLines() {\n return intersectionAsLines;\n }", "public boolean isShowLineMarkers() { return _showLineMarkers; }", "java.util.List<org.tensorflow.proto.profiler.XLine> \n getLinesList();", "public ArrayList<LineItem> getLineItems(){\n\t\t\n\t\treturn lineItems;\n\t}", "Marker getMarker();", "public List<StackTraceElement> getStackTraceLines() {\n return this.stackTraceLines;\n }", "public LineSymbolPainter getSymbolPainter() {\n return symbolPainter;\n }", "org.tensorflow.proto.profiler.XLineOrBuilder getLinesOrBuilder(\n int index);", "public ArrayList<Drawable> mark() {\n\t\tint _size = this.members.size();\n\t\tArrayList<Drawable> _returns = new ArrayList<Drawable>(_size);\n\t\tfor (int _index = 0; _index < _size; _index++)\n\t\t\t_returns.add(this.members.get(_index).mark());\n\t\treturn _returns;\n\t}", "public int getLineNumber();", "java.util.List<? extends org.tensorflow.proto.profiler.XLineOrBuilder> \n getLinesOrBuilderList();", "public String extractDecoratedLines (int fromLine, int fromColumn,\n\t\t\tint toLine, int toColumn);", "public String getMarker() {\n return this.marker;\n }", "public List getMethodLines() {\n return methodLines;\n }", "public List<OrderLine> getLignes() {\n\t\treturn _lignes;\n\t}", "public abstract List<MarkedRegion> mark(MethodNode methodNode);", "public List<UserMarker> getMarkers() {\n List<UserMarker> markers = new ArrayList<>();\n\n Query query = new Query(\"UserMarker\");\n PreparedQuery results = datastore.prepare(query);\n\n for (Entity entity : results.asIterable()) {\n try {\n double lat = (double) entity.getProperty(\"lat\");\n double lng = (double) entity.getProperty(\"lng\");\n String content = (String) entity.getProperty(\"content\");\n\n UserMarker marker = new UserMarker(lat, lng, content);\n markers.add(marker);\n // An exception can occur here for multiple reasons (Type casting error, any\n // property not existing, key error, etc...)\n } catch (Exception e) {\n System.err.println(\"Error reading marker.\");\n System.err.println(entity.toString());\n e.printStackTrace();\n }\n }\n return markers;\n }", "public List<Marker> getSelectedMarkers() {\n return this.selectedMarkers;\n }", "public List<Polyline> getAllLines() {\n return lines;\n }", "public Coordinates projectionAsLine() {\n return projectionAsLine;\n }", "public Marker getMarker() {\n return marker;\n }", "public int[] getLineNumbers() {\n return lineNos;\n }", "public List<String> getLines()\n\t{\n\t\treturn lines;\n\t}", "public static Collection<NotifyGruMarker> provideMarkerDescriptions( )\n {\n\n Collection<NotifyGruMarker> collectionNotifyGruMarkers = new ArrayList<>( );\n\n collectionNotifyGruMarkers.add( createMarkerDescriptions( MARK_MESSAGE, MARK_MESSAGE_DESC ) );\n\n collectionNotifyGruMarkers.add( createMarkerDescriptions( MARK_ID_ANOMALIE, MARK_ID_ANOMALIE_DESC ) );\n collectionNotifyGruMarkers.add( createMarkerDescriptions( MARK_NUMERO, MARK_NUMERO_DESC ) );\n collectionNotifyGruMarkers.add( createMarkerDescriptions( MARK_TYPE, MARK_TYPE_DESC ) );\n collectionNotifyGruMarkers.add( createMarkerDescriptions( MARK_ALIAS_ANOMALIE, MARK_ALIAS_ANOMALIE_DESC ) );\n collectionNotifyGruMarkers.add( createMarkerDescriptions( MARK_ALIAS_MOBILE_ANOMALIE, MARK_ALIAS_MOBILE_ANOMALIE_DESC ) );\n collectionNotifyGruMarkers.add( createMarkerDescriptions( MARK_ADRESSE, MARK_ADRESSE_DESC ) );\n collectionNotifyGruMarkers.add( createMarkerDescriptions( MARK_PRECISION, MARK_PRECISION_DESC ) );\n collectionNotifyGruMarkers.add( createMarkerDescriptions( MARK_PRIORITE, MARK_PRIORITE_DESC ) );\n collectionNotifyGruMarkers.add( createMarkerDescriptions( MARK_COMMENTAIRE, MARK_COMMENTAIRE_DESC ) );\n collectionNotifyGruMarkers.add( createMarkerDescriptions( MARK_LIEN_CONSULTATION, MARK_LIEN_CONSULTATION_DESC ) );\n\n collectionNotifyGruMarkers.add( createMarkerDescriptions( MARK_DATE_PROGRAMMATION, MARK_DATE_PROGRAMMATION_DESC ) );\n collectionNotifyGruMarkers.add( createMarkerDescriptions( MARK_DATE_DE_TRAITEMENT, MARK_DATE_DE_TRAITEMENT_DESC ) );\n collectionNotifyGruMarkers.add( createMarkerDescriptions( MARK_HEURE_DE_TRAITEMENT, MARK_HEURE_DE_TRAITEMENT_DESC ) );\n\n collectionNotifyGruMarkers.add( createMarkerDescriptions( MARK_DATE_ENVOI, MARK_DATE_ENVOI_DESC ) );\n collectionNotifyGruMarkers.add( createMarkerDescriptions( MARK_HEURE_ENVOI, MARK_HEURE_ENVOI_DESC ) );\n collectionNotifyGruMarkers.add( createMarkerDescriptions( MARK_EMAIL_USAGER, MARK_EMAIL_USAGER_DESC ) );\n\n collectionNotifyGruMarkers.add( createMarkerDescriptions( MARK_RAISONS_REJET, MARK_RAISONS_REJET_DESC ) );\n\n collectionNotifyGruMarkers.add( createMarkerDescriptions( MARK_URL_SONDAGE_DEMANDE, MARK_URL_SONDAGE_DEMANDE_DESC ) );\n collectionNotifyGruMarkers.add( createMarkerDescriptions( MARK_URL_SONDAGE_SERVICE, MARK_URL_SONDAGE_SERVICE_DESC ) );\n\n collectionNotifyGruMarkers.add( createMarkerDescriptions( MARK_CP, MARK_CP_DESC ) );\n\n collectionNotifyGruMarkers.add( createMarkerDescriptions( MARK_ID_TYPO, MARK_ID_TYPO_DESC ) );\n\n collectionNotifyGruMarkers.add( createMarkerDescriptions( MARK_ARRONDISSEMENT, MARK_ARRONDISSEMENT ) );\n\n return collectionNotifyGruMarkers;\n\n }", "@Override\n\tpublic Marker addMarker() {\n\t\treturn null;\n\t}", "int getLineNumber();", "public String getMarker() {\n return marker;\n }", "public String getMarker() {\n return marker;\n }", "org.tensorflow.proto.profiler.XLine getLines(int index);", "public Shape[] getMarkerShapes()\n{\n if(_markerShapes!=null) return _markerShapes;\n Shape shp0 = new Ellipse(0,0,8,8);\n Shape shp1 = new Polygon(4,0,8,4,4,8,0,4);\n Shape shp2 = new Rect(0,0,8,8);\n Shape shp3 = new Polygon(4,0,8,8,0,8);\n Shape shp4 = new Polygon(0,0,8,0,4,8);\n return _markerShapes = new Shape[] { shp0, shp1, shp2, shp3, shp4 };\n}", "private int getLineNumber() {\n int line = 0;\n if (_locator != null)\n line = _locator.getLineNumber();\n return line;\n }", "public int getLines() {\n\t\treturn this.linhas;\n\t}", "@Override\n\tpublic List<String> getLinesToExport()\n\t{\n\n\t\tList<String> returnList = new ArrayList<>();\n\t\tStringBuilder sb = new StringBuilder();\n\n\t\tsb.append(\"series\");\n\t\tsb.append(\"\\t\");\n\t\tsb.append(\"x\");\n\t\tsb.append(\"\\t\");\n\t\tsb.append(\"y\");\n\t\tsb.append(\"\\t\");\n\t\tsb.append(\"components delimited by ///\");\n\t\treturnList.add(sb.toString());\n\t\tfor (SciomeSeries<Number, Number> seriesData : getSeriesData())\n\t\t{\n\t\t\tfor (SciomeData<Number, Number> xychartData : seriesData.getData())\n\t\t\t{\n\t\t\t\tsb.setLength(0);\n\t\t\t\tDouble X = xychartData.getXValue().doubleValue();\n\t\t\t\tDouble Y = xychartData.getYValue().doubleValue();\n\t\t\t\tList extraValue = (List) xychartData.getExtraValue();\n\n\t\t\t\tStringBuilder components = new StringBuilder();\n\t\t\t\tfor (Object obj : extraValue)\n\t\t\t\t{\n\t\t\t\t\tif (components.length() > 0)\n\t\t\t\t\t\tcomponents.append(\"///\");\n\t\t\t\t\tcomponents.append(obj.toString());\n\t\t\t\t}\n\n\t\t\t\tsb.append(seriesData.getName());\n\t\t\t\tsb.append(\"\\t\");\n\t\t\t\tsb.append(X);\n\t\t\t\tsb.append(\"\\t\");\n\t\t\t\tsb.append(Y);\n\t\t\t\tsb.append(\"\\t\");\n\t\t\t\tsb.append(components.toString());\n\n\t\t\t\treturnList.add(sb.toString());\n\n\t\t\t}\n\t\t}\n\n\t\treturn returnList;\n\n\t}", "public int[] findDecoratedSpan (Document parseTree,\n\t\t\tint fromLine, int fromColumn,\n\t\t\tint toLine, int toColumn);", "public static ArrayList getLines() {\n return lines;\n }", "@Override\n protected void paintLine(Graphics gfx, TokenMarker tokenMarker, int line,\n int x) {\n \n // paint gutter\n paintGutterBg(gfx, line, x);\n \n paintLineBgColor(gfx, line, x + ta.getGutterWidth());\n \n paintGutterLine(gfx, line, x);\n \n // paint gutter symbol\n paintGutterText(gfx, line, x);\n \n paintErrorLine(gfx, line, x);\n \n super.paintLine(gfx, tokenMarker, line, x + ta.getGutterWidth());\n }", "public interface Line {\r\n /** Retourne les coordonnées du mier point */\r\n public int getX1();\r\n public int getY1();\r\n /** Retourne les coordonnées du deuxième point */\r\n public int getX2();\r\n public int getY2();\r\n}", "public List<AnnotationVertex> getAnnotations() {\n return previousLineAnnotations.get();\n }", "@Override\n public Line[] getLines(){\n Line[] arrayOfLines = new Line[]{topLine, rightLine, bottomLine, leftLine}; //stores the array of lines that form the rectangle\n return arrayOfLines;\n }", "public int getMarker() {\r\n\t\treturn this.marker;\r\n\t}", "public Marker getMarker() {\n return null;\n }", "public Marker getMarker() {\n return null;\n }", "public int getLineNumber() {\n return line;\n }", "public int getLineNo();", "public String[] getCodeLines()\n\t{\n\t\treturn codeLines;\n\t}", "public List<ArticLine> getArticLines() {\n\n if (articLines == null) {\n articLines = new ArrayList<ArticLine>();\n\n List<Element> paragraphs = br.ufrgs.artic.utils.FileUtils.getElementsByTagName(\"para\", omniPageXMLDocument.getDocumentElement());\n\n Integer lineCounter = 0;\n Boolean foundIntroOrAbstract = false;\n String previousAlignment = null;\n Element previousElement = null;\n if (paragraphs != null && !paragraphs.isEmpty()) {\n\n for (Element paragraphElement : paragraphs) {\n\n String alignment = getAlignment(paragraphElement);\n\n String paragraph = \"new\";\n\n List<Element> linesOfParagraph = br.ufrgs.artic.utils.FileUtils.getElementsByTagName(\"ln\", paragraphElement);\n\n if (linesOfParagraph != null && !linesOfParagraph.isEmpty()) {\n for (Element lineElement : linesOfParagraph) {\n ArticLine articLine = new ArticLine(lineCounter, lineElement, previousElement,\n averagePageFontSize, alignment, previousAlignment, topBucketSize, leftBucketSize);\n articLines.add(articLine);\n\n String textContent = articLine.getOriginalText();\n\n if (textContent != null && Pattern.compile(\"intro|abstract\", Pattern.CASE_INSENSITIVE).\n matcher(textContent).find()) {\n foundIntroOrAbstract = true;\n }\n\n if (!foundIntroOrAbstract) { //special case for headers\n articLine.setParagraph(\"header\");\n } else {\n articLine.setParagraph(paragraph);\n }\n\n paragraph = \"same\";\n previousElement = lineElement;\n previousAlignment = alignment;\n lineCounter++;\n }\n }\n }\n }\n }\n\n return articLines;\n }", "int getStartLineNumber();", "private void setMarkersNotConcreteFeatures(String line, IFile res,\r\n\t\t\tint lineNumber) {\r\n\t\tString[] splitted = line.split(CPPModelBuilder.OPERATORS, 0);\r\n\r\n\t\tfor (int i = 0; i < splitted.length; ++i) {\r\n\t\t\tif (!splitted[i].equals(\"\") && !splitted[i].contains(\"#\")) {\r\n\t\t\t\tsetMarkersOnNotExistingOrAbstractFeature(splitted[i],\r\n\t\t\t\t\t\tlineNumber, res);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public double[][] getMajorLinePositions() {\n return majorLinePositions;\n }", "public Object[] getAdditionalErrorDataWithLineInfo() {\n\t\tObject[] extendedErrorData;\n\t\tif (lineNumber >= 0 && positionWithinLine >= 0) {\n\t\t\tif (additionalErrorData != null) {\n\t\t\t\textendedErrorData = new Object[additionalErrorData.length + 2];\n\t\t\t\tfor (int i = 0; i < additionalErrorData.length; i++) {\n\t\t\t\t\textendedErrorData[i] = additionalErrorData[i];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\textendedErrorData = new Object[2];\n\t\t\t}\n\t\t\textendedErrorData[extendedErrorData.length - 2] = lineNumber;\n\t\t\textendedErrorData[extendedErrorData.length - 1] = positionWithinLine;\n\t\t} else if (lineNumber >= 0) {\n\t\t\tif (additionalErrorData != null) {\n\t\t\t\textendedErrorData = new Object[additionalErrorData.length + 1];\n\t\t\t\tfor (int i = 0; i < additionalErrorData.length; i++) {\n\t\t\t\t\textendedErrorData[i] = additionalErrorData[i];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\textendedErrorData = new Object[1];\n\t\t\t}\n\t\t\textendedErrorData[extendedErrorData.length - 1] = lineNumber;\n\t\t} else {\n\t\t\tif (additionalErrorData != null) {\n\t\t\t\textendedErrorData = new Object[additionalErrorData.length];\n\t\t\t\tfor (int i = 0; i < additionalErrorData.length; i++) {\n\t\t\t\t\textendedErrorData[i] = additionalErrorData[i];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\textendedErrorData = new Object[0];\n\t\t\t}\n\t\t}\n\n\t\treturn extendedErrorData;\n\t}", "public List<Marker> getMarkersInRect(RectF rectF) {\n return this.markers.obtainAllIn(rectF);\n }", "public GroupedReceiptLine[] getShippingRequestLinesToPrintOnReceipt() {\n List list = new ArrayList();\n if (currentShippingRequest != null) {\n CMSShippingRequest ship = (CMSShippingRequest)currentShippingRequest;\n POSLineItem[] lines = ship.getLineItemsArray();\n for (int i = 0; i < lines.length; i++) {\n list.add(GroupedReceiptLine.createGroupedReceiptLine(lines[i])[0]);\n }\n POSLineItem[] conlines = ship.getConsignmentLineItemsArray();\n for (int i = 0; i < conlines.length; i++) {\n list.add(GroupedReceiptLine.createGroupedReceiptLine(conlines[i])[0]);\n }\n POSLineItem[] prelines = ship.getPresaleLineItemsArray();\n for (int i = 0; i < prelines.length; i++) {\n list.add(GroupedReceiptLine.createGroupedReceiptLine(prelines[i])[0]);\n }\n }\n return (GroupedReceiptLine[])list.toArray(new GroupedReceiptLine[0]);\n }", "private DescribedMarker getDefaultMarker() {\n MarkerOverlay m = mapView.getMarkerOverlay();\n // add the marker overlay if not present\n if (m == null) {\n overlayManager.toggleOverlayVisibility(R.id.markers, true);\n m = mapView.getMarkerOverlay();\n }\n\n DescribedMarker marker = m.getHighlighted();\n if (marker == null) {\n List<DescribedMarker> markers = m.getMarkers();\n if (markers.size() > 0) {\n marker = markers.get(0);\n } else {\n // TODO add a new marker\n }\n }\n return marker;\n }", "public List getPoints(final double offsetDistance) {\n final List offsetPts = new ArrayList();\n final List lines = this.g.getGeometryComponents(LineString.class);\n for (final Iterator i = lines.iterator(); i.hasNext();) {\n final LineString line = (LineString)i.next();\n extractPoints(line, offsetDistance, offsetPts);\n }\n // System.out.println(toMultiPoint(offsetPts));\n return offsetPts;\n }", "public List getPoLineItems() {\r\n return poLineItems;\r\n }", "public int getPositionWithinLine() {\n\t\treturn positionWithinLine;\n\t}", "public int getLineNumber() {\n return line;\n }", "private Point[] findAllIntersectPoints(Line[] lines) {\n Point[] points = new Point[NUM_LINE * NUM_LINE];\n int count = 0;\n for (int i = 0; i < NUM_LINE - 1; i++) {\n for (int j = i + 1; j < NUM_LINE; j++) {\n if (lines[i].isIntersecting(lines[j])) {\n points[count] = lines[i].intersectionWith(lines[j]);\n count++;\n }\n }\n }\n return points;\n }", "public java.util.List<java.lang.Integer> getDependLineIDList()\n {\n final class DependLineIDList extends java.util.AbstractList<java.lang.Integer>\n {\n public java.lang.Integer get(int i)\n { return OOSOrderLineItemTypeImpl.this.getDependLineIDArray(i); }\n \n public java.lang.Integer set(int i, java.lang.Integer o)\n {\n java.lang.Integer old = OOSOrderLineItemTypeImpl.this.getDependLineIDArray(i);\n OOSOrderLineItemTypeImpl.this.setDependLineIDArray(i, o);\n return old;\n }\n \n public void add(int i, java.lang.Integer o)\n { OOSOrderLineItemTypeImpl.this.insertDependLineID(i, o); }\n \n public java.lang.Integer remove(int i)\n {\n java.lang.Integer old = OOSOrderLineItemTypeImpl.this.getDependLineIDArray(i);\n OOSOrderLineItemTypeImpl.this.removeDependLineID(i);\n return old;\n }\n \n public int size()\n { return OOSOrderLineItemTypeImpl.this.sizeOfDependLineIDArray(); }\n \n }\n \n synchronized (monitor())\n {\n check_orphaned();\n return new DependLineIDList();\n }\n }", "public java.util.List<org.apache.xmlbeans.XmlInt> xgetDependLineIDList()\n {\n final class DependLineIDList extends java.util.AbstractList<org.apache.xmlbeans.XmlInt>\n {\n public org.apache.xmlbeans.XmlInt get(int i)\n { return OOSOrderLineItemTypeImpl.this.xgetDependLineIDArray(i); }\n \n public org.apache.xmlbeans.XmlInt set(int i, org.apache.xmlbeans.XmlInt o)\n {\n org.apache.xmlbeans.XmlInt old = OOSOrderLineItemTypeImpl.this.xgetDependLineIDArray(i);\n OOSOrderLineItemTypeImpl.this.xsetDependLineIDArray(i, o);\n return old;\n }\n \n public void add(int i, org.apache.xmlbeans.XmlInt o)\n { OOSOrderLineItemTypeImpl.this.insertNewDependLineID(i).set(o); }\n \n public org.apache.xmlbeans.XmlInt remove(int i)\n {\n org.apache.xmlbeans.XmlInt old = OOSOrderLineItemTypeImpl.this.xgetDependLineIDArray(i);\n OOSOrderLineItemTypeImpl.this.removeDependLineID(i);\n return old;\n }\n \n public int size()\n { return OOSOrderLineItemTypeImpl.this.sizeOfDependLineIDArray(); }\n \n }\n \n synchronized (monitor())\n {\n check_orphaned();\n return new DependLineIDList();\n }\n }", "public int getLinePosition() {\n return linePosition;\n }", "public String getClientMarker() {\n\t\treturn clientMarker;\n\t}", "protected POSLineItemWrapper[] getWrappersForGroupings(POSLineItemGrouping[] groups) {\n Vector rtnVal = new Vector();\n for (int idx = 0; idx < groups.length; idx++) {\n POSLineItemGrouping grp = groups[idx];\n POSLineItemDetail[] details = grp.getLineItemDetailsArray();\n for (int dIdx = 0; dIdx < details.length; dIdx++) {\n POSLineItemWrapper wrap = new POSLineItemWrapper(details[dIdx]);\n for (Iterator it = rtnVal.iterator(); it.hasNext(); ) {\n if (((POSLineItemWrapper)it.next()).addWrapper(wrap)) {\n wrap = null;\n break;\n }\n }\n if (wrap != null) {\n rtnVal.add(wrap);\n }\n }\n }\n return ((POSLineItemWrapper[])rtnVal.toArray(new POSLineItemWrapper[0]));\n }", "protected String[] parseLine() {\n ArrayList<String> lines = new ArrayList<String>();\n StringBuffer line = new StringBuffer(current);\n while (line.length() > style.lineWidth) {\n int index = split(line);\n lines.add(line.substring(0, index));\n line = new StringBuffer(line.substring(index));\n if (line.length() != 0)\n line.insert(0, continueIndentString());\n }\n if (line.length() != 0)\n lines.add(line.toString());\n return lines.toArray(new String[0]);\n }", "protected int getMarkerPosition() {\n\t\treturn valueToMarkerPosition(getValue());\n\t}", "public static ArrayList<MapLocation> getLineBetweenPoints(MapLocation loc1, MapLocation loc2){\n int dx = loc2.getColumn() - loc1.getColumn();\n int dy = loc2.getRow() - loc1.getRow();\n double angle = Math.toDegrees(Math.atan2(dy, dx));\n if(angle < 0){\n angle += 360;\n }\n int oct = MapLocation.getOctant(angle);\n MapLocation locOct = MapLocation.switchToOctantZeroFrom(oct, new MapLocation(dy, dx));\n ArrayList<MapLocation> lineOct = MappingController.bresenham(new MapLocation(0,0), locOct);\n ArrayList<MapLocation> line = new ArrayList<MapLocation>();\n for(MapLocation loc : lineOct){\n line.add(MapLocation.sum(loc1, MapLocation.switchFromOctantZeroTo(oct, loc)));\n }\n return line;\n }", "public List getClassLines() {\n return classLines;\n }", "public Marker digitiseMarker(GridPoint gridPoint){\n\n MarkerOptions markerOptions = new MarkerOptions().gridPoint(gridPoint);\n markerOptions.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_GREEN));\n Marker marker = mMap.addMarker(markerOptions);\n return marker;\n\n }", "void markLine() {\n lineMark = cursor;\n }", "public TokenMarker getTokenMarker()\n {\n return tokenMarker;\n }", "private void drawLineInfoPanel(Canvas canvas,float centerY,float rightX) {\n if(!mDisplayLnPanel) {\n return;\n }\n float expand = mDpUnit * 3;\n String text = mLnTip + ((2 + getFirstVisibleLine() + getLastVisibleLine() / 2));\n float textWidth = mPaint.measureText(text);\n mRect.top = centerY - getLineHeight() / 2f - expand;\n mRect.bottom = centerY + getLineHeight() / 2f + expand;\n mRect.right = rightX;\n mRect.left = rightX - expand * 2 - textWidth;\n drawColor(canvas,mColors.getColor(ColorScheme.LINE_NUMBER_PANEL),mRect);\n float baseline = centerY - getLineHeight()/2 + getLineBaseLine(0);\n float centerX = (mRect.left + mRect.right) / 2;\n mPaint.setColor(mColors.getColor(ColorScheme.LINE_NUMBER_PANEL_TEXT));\n Paint.Align align = mPaint.getTextAlign();\n mPaint.setTextAlign(Paint.Align.CENTER);\n canvas.drawText(text,centerX,baseline,mPaint);\n mPaint.setTextAlign(align);\n }", "public java.util.List intersectionPoints(Line line) {\n List interPoints = new ArrayList();\n Line[] edges = new Line[4];\n edges[0] = this.getLeftLine();\n edges[1] = this.getRightLine();\n edges[2] = this.getUpperLine();\n edges[3] = this.getDownerLine();\n for (int i = 0; i < 4; i++) {\n if (line.isIntersecting(edges[i])) {\n interPoints.add(line.intersectionWith(edges[i]));\n }\n }\n if (!interPoints.isEmpty()) {\n return interPoints;\n }\n return null;\n }", "public void computeLine ()\r\n {\r\n line = new BasicLine();\r\n\r\n for (GlyphSection section : glyph.getMembers()) {\r\n StickSection ss = (StickSection) section;\r\n line.includeLine(ss.getLine());\r\n }\r\n\r\n if (logger.isFineEnabled()) {\r\n logger.fine(\r\n line + \" pointNb=\" + line.getNumberOfPoints() +\r\n \" meanDistance=\" + (float) line.getMeanDistance());\r\n }\r\n }", "@Override\n public Line getLine() {\n return line;\n }", "IRegion getLineInformation(int line) throws BadLocationException;", "public int getLinePos() {\n return linePos;\n }", "public ArrayList<Location> getLine(Location from, Location to) {\n // Add delta X and add delta Y (if vertical, delta x = 0, if horizontal, delta y = 0)\n if (to == null) {\n return new ArrayList();\n } // In the future need a way to get all the points up to the border so that it draws a complete line.\n\n ArrayList<Location> result = new ArrayList();\n int deltaX = (from.getX() - to.getX())/getPixelSize(); // Amount of \"pixels\" between two the locations (x-wise) if delta = 10, 2 pixels so increase by 5 each time //<>//\n int deltaY = (from.getY() - to.getY())/getPixelSize();\n\n // Ensures that the deltaX and deltaY are valid (might not need this because we already know the location is valid)\n //if (deltaX % getPixelSize() != 0 || deltaY % getPixelSize() != 0) { throw new IllegalArgumentException(); }\n\n int currentX = from.getX();\n int currentY = from.getY();\n\n // Code from: https://stackoverflow.com/questions/13988805/fastest-way-to-get-sign-in-java\n int xSign = (int) Math.signum(deltaX);\n int ySign = (int) Math.signum(deltaY);\n\n for (int i=0; i<Math.abs(deltaX + deltaY); i++) { // This should include \"to\". deltaX + deltaY will be the amount of blocks to go up/horizontal because one should always be 0.\n currentX -= xSign * getPixelSize();\n currentY -= ySign * getPixelSize();\n Location loc = getLocation(currentX, currentY);\n\n result.add(loc);\n if (loc == null) {\n return result;\n }\n }\n\n return result;\n }", "public int getLineColor() { return mLineColor; }", "public PropertyEditor getCellEditor() {\n Icon[] iconArray = new Icon[LineStyle.getIconSet().values().size()];\n\t\tint i = 0;\n for ( Icon newIcon : LineStyle.getIconSet().values()) {\n ((VisualPropertyIcon)newIcon).setIconHeight(16);\n ((VisualPropertyIcon)newIcon).setIconWidth(16);\n iconArray[i++] = newIcon;\n\t\t}\n\n\t\tlineCellEditor.setAvailableValues(LineStyle.getIconSet().keySet().toArray());\n lineCellEditor.setAvailableIcons(iconArray);\n\t\treturn lineCellEditor;\n }", "public int getLineNumber(String key) {\n\t\t\treturn lineNumbers.get(key);\n\t\t}", "public ArrayList<String> transportLinePathIDs()\r\n {\r\n Coordinate next_street1 = null;\r\n Coordinate next_street2 = null;\r\n Street next_street = null;\r\n ArrayList<String> line_coordinates_ids = new ArrayList<String>();\r\n\r\n for (int i = 0; i < getStreetsMap().size(); i++)\r\n {\r\n Street s = getStreetsMap().get(i);\r\n Coordinate this_street1 = s.getCoordinates().get(0);\r\n Coordinate this_street2 = s.getCoordinates().get(2);\r\n\r\n if (i + 1 < getStreetsMap().size())\r\n {\r\n next_street = getStreetsMap().get(i+1);\r\n next_street1 = next_street.getCoordinates().get(0);\r\n next_street2 = next_street.getCoordinates().get(2);\r\n }\r\n else\r\n {\r\n break;\r\n }\r\n\r\n for (Stop stop : getStopsMap())\r\n {\r\n if (stop.getStreet().equals(s))\r\n {\r\n line_coordinates_ids.add(stop.getId());\r\n }\r\n }\r\n\r\n if (s.getCoordinates().get(1) != null)\r\n {\r\n line_coordinates_ids.add(s.getId());\r\n }\r\n\r\n //11\r\n if (this_street1.getX() == next_street1.getX() && this_street1.getY() == next_street1.getY())\r\n {\r\n line_coordinates_ids.add(s.getId());\r\n }\r\n //12\r\n else if (this_street1.getX() == next_street2.getX() && this_street1.getY() == next_street2.getY())\r\n {\r\n line_coordinates_ids.add(s.getId());\r\n }\r\n // 21\r\n else if (this_street2.getX() == next_street1.getX() && this_street2.getY() == next_street1.getY())\r\n {\r\n line_coordinates_ids.add(s.getId());\r\n }\r\n //22\r\n else if (this_street2.getX() == next_street2.getX() && this_street2.getY() == next_street2.getY())\r\n {\r\n line_coordinates_ids.add(s.getId());\r\n }\r\n }\r\n\r\n line_coordinates_ids.add(getStopsMap().get(getStopsMap().size()-1).getId());\r\n return line_coordinates_ids;\r\n }", "public List<Polyline> getPolylines() {\n return this.polylines.obtainAll();\n }", "public int getLineType() {\n return lineType;\n }", "public int getLinePosition(int line) {\n\t\treturn linePositions.get(line);\n\t}", "public int getLineNumber()\r\n {\r\n return lineNum;\r\n }", "public Character getMorelinesSymbol();", "public Integer getLineNumber() {\r\n return this.lineNumber;\r\n }", "public Shape getMarkerShape(int anIndex)\n{\n switch(getType()) {\n case LINE_TYPE: return getMarkerShapes()[anIndex];\n default: return getMarkerShapes()[0];\n }\n}", "List<String> getLines();", "public String getLineName() {\n return lineName;\n }" ]
[ "0.6484999", "0.5697839", "0.5593281", "0.55330724", "0.5350956", "0.5208263", "0.5175248", "0.5171946", "0.51640904", "0.51628214", "0.5132686", "0.5092814", "0.50874835", "0.50517946", "0.49863845", "0.49635798", "0.49526107", "0.4941924", "0.49272904", "0.4925251", "0.49221146", "0.48949403", "0.48761606", "0.48756498", "0.48695642", "0.4860372", "0.48475808", "0.48454437", "0.48452556", "0.48249644", "0.4820304", "0.48180053", "0.478203", "0.4775194", "0.47703183", "0.47507095", "0.47354776", "0.47354776", "0.47265068", "0.47127226", "0.47030857", "0.4676915", "0.46668816", "0.46662045", "0.46642745", "0.46544424", "0.46531564", "0.46512485", "0.46500653", "0.46435535", "0.46374497", "0.46201164", "0.45921704", "0.4578843", "0.45741063", "0.45631632", "0.4543004", "0.45366013", "0.45101455", "0.450907", "0.4508601", "0.45069057", "0.4497169", "0.44843793", "0.44801772", "0.44779748", "0.4476549", "0.44734246", "0.4455883", "0.44502592", "0.44497526", "0.44472477", "0.44472164", "0.44392374", "0.44356823", "0.44267744", "0.44136357", "0.44112742", "0.4409654", "0.44085595", "0.4401291", "0.4396327", "0.43940258", "0.43912542", "0.43910044", "0.43874395", "0.43850827", "0.43778613", "0.43777525", "0.43742254", "0.43698332", "0.43680176", "0.43627712", "0.4358583", "0.4358009", "0.4354255", "0.43532264", "0.43505687", "0.4350412", "0.43494886" ]
0.67174524
0
Date Format to be used on a book's return date
public static void main(String[] args) throws IOException{ runProgram(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String format (Date date , String dateFormat) ;", "private String formatReleaseDate(String releaseDate) {\n SimpleDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd\");\n Date dateObject;\n try {\n dateObject = format.parse(releaseDate);\n }\n catch (ParseException pe) {\n Log.e(LOG_TAG, \"Error while retrieving movie information\");\n return releaseDate;\n }\n format = new SimpleDateFormat(\"LLL dd, yyyy\");\n\n return format.format(dateObject);\n }", "private String formatDate(String dateStr) {\n try {\n SimpleDateFormat fmt = new SimpleDateFormat(Properties.DATE_FORMAT_ALL);\n Date date = fmt.parse(dateStr);\n SimpleDateFormat fmtOut = new SimpleDateFormat(Properties.DATE_FORMAT);\n return fmtOut.format(date);\n } catch (ParseException e) {\n System.out.println( Properties.K_WARNING + \" \" + e.getMessage());\n }\n return \"\";\n }", "public String getPrintFormattedDate() {\n return this.date.format(DateTimeFormatter.ofPattern(\"MMM d yyyy\"));\n }", "DateFormat getDisplayDateFormat();", "private String formatDate(final Date date) {\r\n\t\tfinal Calendar calendar = Calendar.getInstance();\r\n\t\tcalendar.setTime(date);\r\n\r\n\t\tfinal String dayOfMonth = formatDayOfMonth(calendar);\r\n\t\tfinal String month = formatMonth(calendar);\r\n\t\tfinal String year = String.valueOf(calendar.get(Calendar.YEAR));\r\n\r\n\t\treturn String.format(\"%s/%s/%s\", year, month, dayOfMonth);\r\n\t}", "private String formatDate(Date date) {\n String resultDate;\n SimpleDateFormat dateFormat;\n dateFormat = new SimpleDateFormat(\"dd/MM/yyyy\");\n resultDate = dateFormat.format(date);\n return resultDate;\n }", "protected String getReturnDateString() { return \"\" + dateFormat.format(this.returnDate); }", "private String toDate(Date appDate) throws ParseException {\n\t\tCalendar cal = Calendar.getInstance();\n\t\tcal.setTime(appDate);\n\t\tString formatedDate = cal.get(Calendar.DATE) + \"/\" + (cal.get(Calendar.MONTH) + 1) + \"/\" + cal.get(Calendar.YEAR);\n\t\tSystem.out.println(\"formatedDate : \" + formatedDate); \n\t\treturn formatedDate;\n\t}", "java.lang.String getToDate();", "public String getFormatDate()\n {\n return formatDate;\n }", "java.lang.String getDate();", "protected String getRentDateString() { return \"\" + dateFormat.format(this.rentDate); }", "java.lang.String getFoundingDate();", "public String getEntryDateString() {\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy MMM dd\");\n return sdf.format(entryDate.getTime());\n }", "public static String formatDate(String date){\n String formatedDate = date;\n if (!date.matches(\"[0-9]{2}-[0-9]{2}-[0-9]{4}\")){\n if (date.matches(\"[0-9]{1,2}/[0-9]{1,2}/([0-9]{2}|[0-9]{4})\"))\n formatedDate = date.replace('/', '-');\n if (date.matches(\"[0-9]{1,2}.[0-9]{1,2}.([0-9]{2}|[0-9]{4})\")){\n if (formatedDate.matches(\"[0-9]{1}.[0-9]{1,2}.([0-9]{2}|[0-9]{4})\"))\n formatedDate = \"0\" + formatedDate;\n if (formatedDate.matches(\"[0-9]{2}.[0-9]{1}.([0-9]{2}|[0-9]{4})\"))\n formatedDate = formatedDate.substring(0, 3) + \"0\" + \n formatedDate.substring(3);\n if (formatedDate.matches(\"[0-9]{2}.[0-9]{2}.[0-9]{2}\")){\n String thisYear = String.valueOf(LocalDate.now().getYear());\n String century = thisYear.substring(0,2);\n /* If the last two digits of the date are larger than the two last digits of \n * the current date, then we can suppose that the year corresponds to the last \n * century.\n */ \n if (Integer.valueOf(formatedDate.substring(6)) > Integer.valueOf(thisYear.substring(2)))\n century = String.valueOf(Integer.valueOf(century) - 1);\n formatedDate = formatedDate.substring(0, 6) + century +\n formatedDate.substring(6); \n }\n }\n }\n return formatedDate;\n }", "public String dateFormatter(String fromDate) {\n\t\tString newDateString=\"\";\n\t\ttry {\n\t\t\tfinal String oldFormat = \"yyyy/MM/dd\";\n\t\t\tfinal String newFormat = \"yyyy-MM-dd\";\n\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(oldFormat);\n\t\t\tDate d = sdf.parse(fromDate);\n\t\t\tsdf.applyPattern(newFormat);\n\t\t\tnewDateString = sdf.format(d);\n\t\t} catch(Exception exp) {\n\t\t\tthrow ExceptionUtil.getYFSException(ExceptionLiterals.ERRORCODE_INVALID_DATE, exp);\n\t\t}\n\t\treturn newDateString;\n\t}", "public String toString() { //toString method\n String startDateString2= \"\"; //Initialize\n try{\n Date date1 = new SimpleDateFormat(\"yyyyMMdd\").parse(full_Date);\n DateFormat df2 = new SimpleDateFormat(\"MMM dd, yyyy\");\n startDateString2 = df2.format(date1);\n \n return startDateString2;\n }catch(ParseException e){\n e.printStackTrace();\n }\n return startDateString2;\n \n}", "public String getFileFormattedDate() {\n return this.date.format(DateTimeFormatter.ofPattern(\"yyyy-MM-dd\"));\n }", "private String formatDate(String dateString) {\n DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(\"LLL dd, yyyy\");\n LocalDate localDate = LocalDate.parse(dateString.substring(0, 10));\n return dateTimeFormatter.format(localDate);\n }", "private String formatDueDate(Date date) {\n\t\t//TODO locale formatting via ResourceLoader\n\t\t\n\t\tif(date == null) {\n\t\t\treturn getString(\"label.studentsummary.noduedate\");\n\t\t}\n\t\t\n\t\tSimpleDateFormat df = new SimpleDateFormat(\"dd/MM/yy\");\n \treturn df.format(date);\n\t}", "public String getFormatDate() {\n String formatDate = servletRequest.getHeader(ConstantsCustomers.CUSTOMER_FORMAT_DATE);\n if (StringUtil.isEmpty(formatDate)) {\n formatDate = jwtTokenUtil.getFormatDateFromToken();\n }\n if (StringUtil.isEmpty(formatDate)) {\n formatDate = ConstantsCustomers.APP_DATE_FORMAT_ES;\n }\n return formatDate;\n }", "public String toStringDateOfBirth() {\n\t\tDateTimeFormatter format = DateTimeFormatter.ofPattern(\"dd/MM/yyyy\");\n\t\treturn dateofbirth.format(format);\n\t}", "public String getDateConvert() {\n SimpleDateFormat dateFormat1 = new SimpleDateFormat(\"MMM dd yyyy - hh:mm\");\n SimpleDateFormat dateFormat2 = new SimpleDateFormat(\"a\");\n String date = dateFormat1.format(this.timePost) + dateFormat2.format(this.timePost).toLowerCase();\n return date;\n }", "String formatDateCondition(Date date);", "DateFormat getSourceDateFormat();", "private static String getDateStr() {\n\t\tDate date = Calendar.getInstance().getTime();\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"MMddyyy\");\n\t\tString dateStr = dateFormat.format(date);\n\t\treturn dateStr;\n\t}", "public String DateFormatted(){\n\t\tSimpleDateFormat simDate = new SimpleDateFormat(\"E, dd/MM/yy hh:mm:ss a\");\n\t\treturn simDate.format(date.getTime());\n\t}", "@Method(selector = \"stringFromDate:toDate:\")\n public native String format(NSDate fromDate, NSDate toDate);", "String getDate();", "String getDate();", "private String formatDate(Date dateObject) {\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"LLL dd, yyyy\");\n return dateFormat.format(dateObject);\n }", "public String getDateAsString(){\n\t\t//\tGet Date\n Date date = getDate();\n if(date != null)\n \treturn backFormat.format(date);\n\t\treturn null;\n\t}", "private String formatDate(Date dateObject) {\r\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"LLL dd, yyyy\");\r\n return dateFormat.format(dateObject);\r\n }", "public static String formatDate(Date date) {\n\t\tString newstring = new SimpleDateFormat(\"MM-dd-yyyy\").format(date);\n\t\treturn newstring;\n\t}", "public String getDateString(){\n return Utilities.dateToString(date);\n }", "public static String formatDate(String strDate) {\n return formatDate(strDate, false);\n }", "public static String dateToString(Date date)\r\n/* 19: */ {\r\n/* 20: 23 */ return sdfDate.format(date);\r\n/* 21: */ }", "public String convertDateToString(){\n\t\tString aDate = \"\";\n\t\taDate += Integer.toString(day);\n\t\taDate += \"/\";\n\t\taDate += Integer.toString(month);\n\t\taDate += \"/\";\n\t\taDate += Integer.toString(year);\n\t\treturn aDate;\n\t}", "private String formatDate(Date dateObject) {\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"LLL dd, yyyy\", Locale.getDefault());\n return dateFormat.format(dateObject);\n }", "private String easyDateFormat(final String format) {\n Date today = new Date();\n SimpleDateFormat formatter = new SimpleDateFormat(format);\n String datenewformat = formatter.format(today);\n return datenewformat;\n }", "private String getFormattedDate(String date) {\n SimpleDateFormat dateFormat = new SimpleDateFormat(getString(R.string.received_import_date_format));\n SimpleDateFormat desiredDateFormat = new SimpleDateFormat(getString(R.string.desired_import_date_format));\n Date parsedDate;\n try {\n parsedDate = dateFormat.parse(date);\n return desiredDateFormat.format(parsedDate);\n } catch (ParseException e) {\n // Return an empty string in case of issues parsing the date string received.\n e.printStackTrace();\n return \"\";\n }\n }", "public String Get_date() \n {\n \n return date;\n }", "public static String formartDate(String mDate) {\n\t\t\t// TODO Auto-generated method stub\n\t\t\t\n\t\t\tSimpleDateFormat inSDF = new SimpleDateFormat(\"mm/dd/yyyy\");\n\t\t\t SimpleDateFormat outSDF = new SimpleDateFormat(\"yyyy-mm-dd\");\n\n\t\t\t \n\t\t\t String outDate = \"\";\n\t\t\t \n\t\t\t if (mDate != null) {\n\t\t\t try {\n\t\t\t Date date = inSDF.parse(mDate);\n\t\t\t outDate = outSDF.format(date);\n\t\t\t \n\t\t\t \n\t\t\t } catch (Exception ex){ \n\t\t\t \tex.printStackTrace();\n\t\t\t }\n\t\t\t }\n\t\t\t return outDate;\n\t\t}", "public static void main(String[] args) {\n\t\tLocalDate today=LocalDate.now();\n\t\t\n\t\tDateTimeFormatter dtf=DateTimeFormatter.ofPattern(\"YYYY/MM/DD\");\n\t\tDateTimeFormatter dtf1=DateTimeFormatter.ofPattern(\"YYYY MM DD\");\n\t\t\n\t\tDateTimeFormatter dtfull=DateTimeFormatter.ofLocalizedDate(FormatStyle.FULL);\n\t\tDateTimeFormatter dtm=DateTimeFormatter.ofLocalizedDate(FormatStyle.MEDIUM);\n\t\tDateTimeFormatter dts=DateTimeFormatter.ofLocalizedDate(FormatStyle.SHORT);\n\t\t\n\t\t\n\t\tString afterformat=today.format(dtf);\n\t\tSystem.out.println(afterformat);\n\t\tString afterformat1=today.format(dtf1);\n\t\tSystem.out.println(afterformat1);\n\t\tString fd=today.format(dtfull);\n\t\tSystem.out.println(fd);\n\t\tString md=today.format(dtm);\n\t\tSystem.out.println(md);\n\t\tString sd=today.format(dts);\n\t\tSystem.out.println(sd);\n\t\t\n\t\t\n\n\t}", "public static void main(String[] args) {\n\t\t LocalDate ldt = LocalDate.of(2016,12,21);\n DateTimeFormatter format = DateTimeFormatter.ofPattern(\"yyyy-MMM-dd\");\n DateTimeFormatter format1 = DateTimeFormatter.ofPattern(\"YYYY-mmm-dd\");\n System.out.println(ldt.format(format));\n System.out.println(ldt.format(format1));\n\t}", "public static void main(String[] args) {\n String s = FormatFecha.format(FormatFecha.FMT_ISO, new Date());\n System.out.println(\"Fecha: \" + s);\n //\"10/6/2010\" 2010-06-10\n }", "public static String getFormattedDate(String dateStr, String toformat)\r\n\t{\r\n\t\tString mName = \"getFormattedDate()\";\r\n\t\tIDateFormatter dateFormatter = null;\r\n\t\tDateFormatConfig dateFormat = null;\r\n\t\tString formattedDate = null;\r\n\t\tdateFormat = getDateFormat(toformat);\r\n\t\ttry\r\n\t\t{\r\n\t\t\tdateFormatter = (IDateFormatter) ResourceLoaderUtils.createInstance(dateFormat.getFormatterClass(),\r\n\t\t\t\t\t(Object[]) null);\r\n\t\t\tformattedDate = dateFormatter.formatDate(dateStr, dateFormat.getJavaDateFormat());\r\n\t\t} catch (Exception exp)\r\n\t\t{\r\n\t\t\tlogger.cterror(\"CTBAS00112\", exp, mName);\r\n\r\n\t\t}\r\n\t\treturn formattedDate;\r\n\t}", "public String getFormatedDate() {\n DateFormat displayFormat = new SimpleDateFormat(\"EEEE', ' dd. MMMM yyyy\", Locale.GERMAN);\n return displayFormat.format(mEvent.getTime());\n }", "private String formatDate(String date)\n\t{\n\t\tif(date == null || date.isEmpty())\n\t\t{\n\t\t\treturn \"\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tString[] dateSplit = date.split(\"/\");\n\t\t\tif(dateSplit.length != 3)\n\t\t\t{\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn getMonthName(dateSplit[0]) + \" \"+ dateSplit[1]+\", \"+ dateSplit[2];\n\t\t\t}\n\t\t}\n\t}", "private String formatDate (Date date) {\n SimpleDateFormat sdf = new SimpleDateFormat(\"E, dd MMM yyyy HH:mm:ss\", Locale.ENGLISH);\n return sdf.format(date);\n }", "public String getDate(){\n String d=\"\";\n String m=\"\";\n if(day<10){\n d=0+(String.valueOf(day));\n }\n else{\n d=String.valueOf(day);\n }\n\n if(month<10){\n m=0+(String.valueOf(month));\n }\n else{\n m=String.valueOf(month);\n }\n //returning day/month/year\n return (d+\"/\"+m+\"/\"+String.valueOf(year));\n }", "public static void dateFormat() {\n }", "public static String date_d(String sourceDate,String format) throws ParseException {\n SimpleDateFormat sdf_ = new SimpleDateFormat(\"yyyy-MM-dd\");\n SimpleDateFormat sdfNew_ = new SimpleDateFormat(format);\n return sdfNew_.format(sdf_.parse(sourceDate));\n }", "public static String formatterDate(Date date){\n\t\tString retour = null;\n\t\tif(date != null){\n\t\t\tretour = dfr.format(date);\n\t\t}\n\t\treturn retour;\n\t}", "public String ConvertDate(){\r\n//\t\tDate date=JavaUtils.getSystemDate();\r\n//\t DateFormat df = new SimpleDateFormat(\"yyyy/MM/dd\");\r\n\t String pattern = \"yyyy-MM-dd\";\r\n\t SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);\r\n\r\n\t String date = simpleDateFormat.format(new Date());\r\n//\t System.out.println(date);\r\n\t \r\n//\t String s = df.format(date);\r\n//\t String result = s;\r\n//\t try {\r\n//\t date=df.parse(result);\r\n//\t } catch (ParseException e) {\r\n//\t // TODO Auto-generated catch block\r\n//\t e.printStackTrace();\r\n//\t }\r\n\t return date;\r\n\t }", "public String getDate()\n {\n SimpleDateFormat newDateFormat = new SimpleDateFormat(\"EE d MMM yyyy\");\n String MySDate = newDateFormat.format(this.dueDate);\n return MySDate;\n }", "private static void formatDate(Date i) {\n\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"MM/dd/yy\");\n\t\tformatter.setLenient(false);\n\t\tAnswer = formatter.format(i);\n\t}", "java.lang.String getFromDate();", "public String getBookReturningDate(int possibleDayCount){\n boolean leapYear=false;\n int dayLimit=0;\n int lastDayOfMonth=0;\n String d=\"\";\n String m=\"\";\n String y=\"\";\n String returningDate=\"\";\n if ((year%4==0&&year%100==0)||year%400==0){\n leapYear=true;\n }\n\n switch (month){\n //in the case of february if it's a leap year lastDayOf month will be changed\n case 2:\n if (leapYear==true){\n lastDayOfMonth=29;\n\n }\n else{\n lastDayOfMonth=28;\n }\n break;\n\n case 4: case 6:case 9:case 11:\n lastDayOfMonth=30;\n break;\n\n case 1: case 3: case 5: case 7: case 8: case 10: case 12:\n lastDayOfMonth=31;\n break;\n\n default:returningDate=\"invalid inputs\";\n }\n\n\n dayLimit=lastDayOfMonth-possibleDayCount;\n\n if(day<=dayLimit){\n d=String.valueOf(day+possibleDayCount);\n m=String.valueOf(month);\n y=String.valueOf(year);\n\n }\n\n //if any day exceeding dayLimit, will go to next month with a new day\n else{\n if(month==12) {\n //if it is december month will be 1 and year will be next year\n int newDay = possibleDayCount - (lastDayOfMonth - day);\n d = String.valueOf(newDay);\n m = \"1\";\n y=String.valueOf(year+1);\n }\n else{\n int newDay = possibleDayCount - (lastDayOfMonth - day);\n d = String.valueOf(newDay);\n m = String.valueOf(month + 1);\n y=String.valueOf(year);\n }\n\n }\n\n returningDate=(d+\"/\"+m+\"/\"+y);\n\n return returningDate;\n }", "private String stringifyDate(Date date){\n\t\tDateFormat dateFormatter = new SimpleDateFormat(\"yyyy-MM-dd\");\t\t\n\t\treturn dateFormatter.format(date);\n\t}", "public String getStringDate(){\n String finalDate = \"\";\n Locale usersLocale = Locale.getDefault();\n DateFormatSymbols dfs = new DateFormatSymbols(usersLocale);\n String weekdays[] = dfs.getWeekdays();\n int day = date.get(Calendar.DAY_OF_WEEK);\n String nameOfDay = weekdays[day];\n\n finalDate += nameOfDay + \" \" + date.get(Calendar.DAY_OF_MONTH) + \", \";\n\n String months[] = dfs.getMonths();\n int month = date.get(Calendar.MONTH);\n String nameOfMonth = months[month];\n\n finalDate += nameOfMonth + \", \" + date.get(Calendar.YEAR);\n\n return finalDate;\n }", "private String changeDateFormat (String oldDate) throws ParseException {\n // Source: https://stackoverflow.com/questions/3469507/how-can-i-change-the-date-format-in-java\n final String OLD_FORMAT = \"MM/dd/yyyy\";\n final String NEW_FORMAT = \"yyyyMMdd\";\n String newDateString;\n SimpleDateFormat sdf = new SimpleDateFormat(OLD_FORMAT);\n Date d = sdf.parse(oldDate);\n sdf.applyPattern(NEW_FORMAT);\n newDateString = sdf.format(d);\n return newDateString;\n }", "public String getDateString() {\n int year = date.get(Calendar.YEAR);\n int month = date.get(Calendar.MONTH); // month is stored from 0-11 so adjust +1 for final display\n int day_of_month = date.get(Calendar.DAY_OF_MONTH);\n return String.valueOf(month + 1) + '/' + String.valueOf(day_of_month) + '/' + year;\n }", "public static void main(String[] args) throws Exception{\n\t\t\t Date currentTime = new Date(95,7,6);\n\t\t\t SimpleDateFormat formatter = new SimpleDateFormat(\"dd/MMM/YYYY\");\n\t\t\t String dateString = formatter.format(currentTime);\n\t\t\t System.out.println(dateString);\n\t\t\t \n\t\t}", "public String changeDateFormat(String dateStr) {\n String inputPattern = \"MMM-dd-yyyy\";\n String outputPattern = \"MMMM dd, yyyy\";\n SimpleDateFormat inputFormat = new SimpleDateFormat(inputPattern);\n SimpleDateFormat outputFormat = new SimpleDateFormat(outputPattern);\n\n Date date = null;\n String str = null;\n\n try {\n date = inputFormat.parse(dateStr);\n str = outputFormat.format(date);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n return str;\n\n }", "public String toString() {\n\treturn String.format(\"%d/%d/%d\", year, month, day);\t\r\n\t}", "public static String toStringFormat_2(Date date) {\r\n\r\n\t\treturn dateToString(date, DATE_FORMAT_2);\r\n\t}", "public String formatForAmericanModel(Date data){\n //definido modelo americano\n DateFormat formatBR = new SimpleDateFormat(\"yyyy-MM-dd\");\n return formatBR.format(data);\n \n }", "private static String convertToDDMMYYYY(Date date) {\n\t\tString returnStr = \"\";\n\t\ttry {\n\t\tDateFormat format1 = new SimpleDateFormat(\"dd/MM/yyyy\");\n\t\treturnStr = format1.format(date);\n\t\t\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn returnStr;\n\t}", "java.lang.String getStartDateYYYYMMDD();", "private static void formatDate (XmlDoc.Element date) throws Throwable {\n\t\tString in = date.value();\n\t\tString out = DateUtil.convertDateString(in, \"dd-MMM-yyyy\", \"yyyy-MM-dd\");\n\t\tdate.setValue(out);\n\t}", "public String dateToString() {\n\t\treturn new String(year + \"/\"\n\t\t\t\t+ month + \"/\"\n\t\t\t\t+ day);\n }", "public String getArticleDate() {\n\t\t\t\tDateFormat dateFormat = new SimpleDateFormat(\"MMM dd, yyyy\");\n\t\t\t\tDate date = new Date();\n\t\t\t\treturn dateFormat.format(date);\n\t\t\t}", "public Date formatDate( String dob )\n throws ParseException {\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"MM/dd/yyyy\");\n dateFormat.setLenient(false);\n return dateFormat.parse(dob);\n }", "public static String formatDate(Date date) {\n final SimpleDateFormat formatter = new SimpleDateFormat(\"MM-dd-yyyy\");\n return formatter.format(date);\n }", "public static String formatDate(Date date){\n\t\tCalendar now = Calendar.getInstance(); // Gets the current date and time\n\t\tint currentYear = now.get(Calendar.YEAR);\n\t\tint dateYear = Integer.parseInt(new SimpleDateFormat(\"yyyy\").format(date));\n\n\t\tif (dateYear <= currentYear){\n\t\t\treturn new SimpleDateFormat(\"E MMM dd HH:mm\").format(date);\n\t\t} else {\n\t\t\treturn new SimpleDateFormat(\"E yyyy MMM dd HH:mm\").format(date);\n\t\t}\n\t}", "public static String formatDate(Date d) {\n\t\tint month = d.getMonth() + 1;\n\t\tint dayOfMonth = d.getDate();\n\t\tint year = d.getYear() + 1900;\n\t\tString y = \"\" + year;\n\t\tString m = \"\" + month;\n\t\tString dom = \"\" + dayOfMonth;\n\t\tif (month < 10) {\n\t\t\tm = \"0\" + m;\n\t\t}\n\t\tif (dayOfMonth < 10) {\n\t\t\tdom = \"0\" + dom;\n\t\t}\n\t\treturn m + \"/\" + dom + \"/\" + y.substring(2);\n\t}", "public String getFormattedDate() {\n return transactionDate.toString();\n }", "public static String dateStr(String input ){\n String mm = input.substring(0,2);\n String dd = input.substring(3,5);\n String yyyy = input.substring(6,10);\n return dd + \" - \" + mm + \" - \" + yyyy;\n }", "public String formatDate(Date date) {\n\t\tString formattedDate;\n\t\tif (date != null) {\n\t\t\tformattedDate = simpleDateFormat.format(date);\n\t\t\tformattedDate = formattedDate.substring(0,\n\t\t\t\t\tformattedDate.length() - 5);\n\t\t} else {\n\t\t\tformattedDate = Constants.EMPTY_STRING;\n\t\t}\n\t\treturn formattedDate;\n\t}", "public String getFormatedDate(Date date) {\r\n\t\tSimpleDateFormat sdf=new SimpleDateFormat(\"dd/mm/yyyy\");\r\n\t\treturn sdf.format(date);\r\n\t}", "public Date formatForDate(String data) throws ParseException{\n //definindo a forma da Data Recebida\n DateFormat formatUS = new SimpleDateFormat(\"dd-MM-yyyy\");\n return formatUS.parse(data);\n }", "public String toString() {\r\n\t\treturn String.format(\"%02d/%02d/%02d\", month, day, year);\r\n\r\n\t}", "public String getDateFormats()\n {\n return dateFormats;\n }", "public static String formartDateYOB(String mDate) {\n\t\t\t\t\n\t\t\t\tSimpleDateFormat inSDF = new SimpleDateFormat(\"dd/mm/yyyy\");\n\t\t\t\t SimpleDateFormat outSDF = new SimpleDateFormat(\"yyyy-mm-dd\");\n\n\t\t\t\t \n\t\t\t\t String outDate = \"\";\n\t\t\t\t \n\t\t\t\t if (mDate != null) {\n\t\t\t\t try {\n\t\t\t\t Date date = inSDF.parse(mDate);\n\t\t\t\t outDate = outSDF.format(date);\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t } catch (Exception ex){ \n\t\t\t\t \tex.printStackTrace();\n\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t return outDate;\n\t\t\t}", "@Override\n\tpublic String toString() {\n\t\ttry {\n\t\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"MM/dd/yyyy\");\n\t\t\tDate date = formatter.parse(month + \"/\" + day + \"/\" + year);\n\n\t\t\treturn formatter.format(date);\n\t\t} catch (Exception e) {\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\t}", "public java.sql.Date format(String date) {\n int i = 0;\n int dateAttr[];\n dateAttr = new int[3];\n for(String v : date.split(\"/\")) {\n dateAttr[i] = Integer.parseInt(v);\n i++;\n }\n\n GregorianCalendar gcalendar = new GregorianCalendar();\n gcalendar.set(dateAttr[2], dateAttr[0]-1, dateAttr[1]); // Year,Month,Day Of Month\n java.sql.Date sdate = new java.sql.Date(gcalendar.getTimeInMillis());\n return sdate;\n }", "public String getUserDateString() {\n\t\tString[] tmpArr = this.getUserDate();\n\t\tString year = tmpArr[0];\n\t\tString month = tmpArr[1];\n\t\tString day = tmpArr[2];\n\t\tString out = year + \"/\" + month + \"/\" + day;\n\t\treturn out;\n\t}", "public String formatDate (Date date){\r\n\t\tDateFormat df = new SimpleDateFormat(\"EEE, d MMM yyyy HH:mm:ss z\", Locale.ENGLISH);\r\n\t\treturn df.format(date);\r\n\t}", "public static void main(String[] args) throws ParseException {\n\n\t\tString startPattern = \"MMM yyyy\";\n\n\t\tString endPattern = \"MM-dd-yyyy\";\n\n\t\tString str = formateDate(\"mar 2019\", startPattern, endPattern);\n\t\tSystem.out.println(str);\n\n\t}", "public static String formartDateMpesa(String mDate) {\n\t\t\tSimpleDateFormat inSDF = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\t\t\tSimpleDateFormat outSDF = new SimpleDateFormat(\"dd-MM-yyyy\");\n\n\t\t\t String outDate = \"\";\n\t\t\t if (mDate != null) {\n\t\t\t try {\n\t\t\t Date date = inSDF.parse(mDate);\n\t\t\t outDate = outSDF.format(date);\n\t\t\t } catch (Exception ex){ \n\t\t\t \tex.printStackTrace();\n\t\t\t }\n\t\t\t }\n\t\t\t return outDate;\n\t\t}", "private String createDate(){\n SimpleDateFormat date = new SimpleDateFormat(\"EEE, MMM d, yyyy\");\n String stringDate = date.format(new Date()); \n return stringDate;\n }", "public static void main(String[] args) {\n\t\tLocalDate date = LocalDate.now();\n\t\tSystem.out.println(\"Original date: \"+date);\n\t\t\n\t\t//DateTimeFormatter formatter = DateTimeFormatter.ofLocalizedDate(FormatStyle.FULL);\n\t\tDateTimeFormatter formatter = DateTimeFormatter.ofLocalizedDate(FormatStyle.LONG);\n\t\tString formattedDate = date.format(formatter);\n\t\tSystem.out.println(\"Full: \"+formattedDate);\n\t}", "private static java.text.SimpleDateFormat getFormatter() {\r\n\r\n\t\treturn getDBLayer().getDateFormatter();\r\n\t}", "public String getReturnDate();", "protected static SimpleDateFormat dateFormat() {\n return dateFormat(true, false);\n }", "public static String getDate() {\n\t\tDate date = new Date();\n\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"ddMMYYYY\");\n\t\tString strDate = formatter.format(date);\n\t\treturn strDate;\n\t}", "public static String dateOnly() throws Exception {\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"dd-MM-yyyy\");\n\t\t// get current date time with Date()\n\t\tDate date = new Date();\n\t\t// Now format the date\n\t\tString date1 = dateFormat.format(date);\n\t\t// System.out.println(date1);\n\t\treturn date1;\n\t}", "public static String formatDate(java.util.Date uDate) {\n\t\tif (uDate == null) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\tSimpleDateFormat dateFormat = new SimpleDateFormat(\"dd/MM/yyyy\");\n\t\t\treturn dateFormat.format(uDate);\n\t\t}\n\t}", "public String getReleaseDate() {\n return dateFormatter.format(release);\n }" ]
[ "0.6819346", "0.67497617", "0.67402095", "0.67003214", "0.66826", "0.6657064", "0.6628185", "0.6562603", "0.6548502", "0.6536948", "0.65368927", "0.6521958", "0.6520355", "0.65171444", "0.648329", "0.647564", "0.6469443", "0.64599365", "0.6455544", "0.6447702", "0.64298344", "0.6423404", "0.641812", "0.63985074", "0.63969", "0.6382234", "0.63716197", "0.6371598", "0.6358047", "0.6354451", "0.6354451", "0.63448805", "0.6334073", "0.63338137", "0.6317586", "0.6289172", "0.6265794", "0.6262766", "0.6252762", "0.62492764", "0.62489593", "0.6244324", "0.62210983", "0.6215787", "0.6212443", "0.62047553", "0.61951894", "0.61926675", "0.61860776", "0.6171584", "0.6168997", "0.6166425", "0.61628914", "0.61567456", "0.61543787", "0.61530066", "0.61476207", "0.6143865", "0.6143362", "0.61409265", "0.61351186", "0.61348957", "0.61235964", "0.6116479", "0.6110951", "0.6108623", "0.61068505", "0.6103794", "0.6103774", "0.6094979", "0.60788625", "0.6074797", "0.6073672", "0.6062452", "0.6060388", "0.60444725", "0.6044323", "0.6043438", "0.60407144", "0.6033445", "0.60310537", "0.60300493", "0.6015634", "0.60145175", "0.60141456", "0.6012763", "0.6007674", "0.60028756", "0.6002814", "0.5998011", "0.59956634", "0.5994253", "0.59816825", "0.598105", "0.5978144", "0.5975526", "0.5967134", "0.5962331", "0.5951066", "0.5931919", "0.5931902" ]
0.0
-1
/initialize ALL_GENRES ArrayList so later methods can access indices for respective Genres. ALL_GENRES has capacity 13 because there are 13 Genres; therefore, each index represents a specific Genre.
private static void initializeAllGenresList(){ for(int i = 0; i < 13; i ++){ ALL_GENRES.add(new HashSet<String>()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ArrayList<MovieGenreModel> getAllGenres() {\n\t\treturn null;\n\t}", "@NonNull\n public final List<Genres> getGenres() {\n return this.genres;\n }", "protected float[] getGenes() {\n\t\t\treturn genes;\n\t\t}", "public Set<String> getGenres() {\r\n return this.genres;\r\n }", "private void createGenres() {\n ArrayList<String> gen = new ArrayList<>();\n //\n for (Movie mov : moviedb.getAllMovies()) {\n for (String genre : mov.getGenre()) {\n if (!gen.contains(genre.toLowerCase()))\n gen.add(genre.toLowerCase());\n }\n }\n\n Collections.sort(gen);\n\n genres = gen;\n }", "public ObservableList<String> getAllGenres(){\n return allGenres;\n }", "public final void setGenres(@NonNull final List<Genres> genresParam) {\n this.genres = genresParam;\n }", "public ArrayList<Integer> getGen() {\n\treturn _gen;\n }", "public Geneset(){\r\n\t\tthis.geneSetElements=new ArrayList();\r\n\t\r\n\t}", "public void generateGenes() {\n\t\tfor(int i = 0; i < geneNumber; i++){\n\t\t\tdouble[] vector = new double[NUM_HEURISTICS];\n\t\t\tfor(int j = 0; j < NUM_HEURISTICS; j++){\n\t\t\t\t// To get a number in [-0.5, 0.5)\n\t\t\t\tvector[j] = Math.random() - 0.5;\n\t\t\t}\n\t\t\tGene newGene = new Gene(vector, true);\n\t\t\tgenepool.add(newGene);\n\t\t}\n\t}", "public Album setGenres(Set<String> genres) {\r\n this.genres = genres;\r\n return this;\r\n }", "public abstract Set<Genome> getAvailableGenomes();", "public ArrayList<Genome_ga> makeGenomeList(int length){\n\t\tArrayList<Genome_ga> genomelist = new ArrayList<Genome_ga>();\r\n\t\tfor(int i =0; i<length;i++) {\r\n\t\t\tgenomelist.add(make1Genome());\r\n\t\t}\r\n\r\n\t\tgenomelist = evg.evalGenomeList(genomelist);\r\n\r\n\t\treturn genomelist;\r\n\t}", "public Genome() {\n this.code = new int[GENOME_SIZE];\n for (int i = 0; i < 8; ++i) {\n this.code[i] = i;\n }\n for (int i = 8; i < Genome.GENOME_SIZE; ++i) {\n this.code[i] = r.nextInt(8);\n }\n this.repairGenome();\n Arrays.sort(this.code);\n this.calculatePopularity();\n }", "private void initializePopulation() {\n // reset the population\n population = new ArrayList<Genotype>();\n\n // set the population to an array of random genotypes\n for (int i = 0; i < populationSize; i++) {\n population.add(new Genotype(chromosomeSize));\n }\n\n // evaluate the population\n // evaluatePopulation();\n }", "@Override\n\tpublic List<Genre> displayAllGenres() throws MovieException {\n\t\treturn obj.displayAllGenres();\n\t}", "public void modifyGenres(ArrayList<String> genreList)// --> Bytter ut Genre-arrayen med en ny array over de nye sjangerene for lokalet.\n\t{\n\t\tgenres = genreList;\n\t}", "@GET\n public List<JsonGenre> getAll() {\n \tList<Genre> genres = genreDao.getGenres();\n \tLOGGER.info(\"find \"+genres.size()+\" genres in the database\");\n \tArrayList<JsonGenre> ls = new ArrayList<JsonGenre>();\n \tfor (Genre s:genres) {\n \t\tls.add(new JsonGenre(s.getId(), s.getName()));\n \t}\n \treturn ls;\n }", "@Override\n\tpublic List<Generator> getAll() {\n\t\treturn new ArrayList<>();\n\t}", "public void setGenre(ArrayList<String> genre) {\n this.genre = genre;\n }", "protected int numGenes() {\n\t\treturn genes.size();\n\t}", "public Map<String, Gene> getGenes() {\n return genes;\n }", "public Genepool(int numGenes) {\n\t\tgeneNumber = numGenes;\n\t\tgenepool = new ArrayList<Gene>();\n\t\toffspringPool = new ArrayList<Gene>();\n\t\tgenerateGenes();\n\t}", "ImmutableList<SchemaOrgType> getGenreList();", "@Nullable\n GenresPage getGenres();", "public ArrayList<IGeneSetElement> getGenesetElements(){\r\n\t\treturn geneSetElements;\r\n\t}", "private Itemsets() {\n\t\t\tfrequentItemsets = new LinkedHashMap<Itemset, Integer>();\n\t\t\tinfrequentItemsets = new LinkedHashMap<Itemset, Integer>();\n\t\t}", "public void initialiseGodList() {\n PlayerCreator playerCreator = new PlayerCreator();\n for (int i = 0; i < playerCreator.getArrayGods().size(); i++)\n godListNames.add(playerCreator.getArrayGods().get(i).getGodName());\n }", "public SecondaryGenres() {\n }", "private static List<Gene> getGenePool() {\n List<Gene> list = new ArrayList<>();\n\n Item item1 = new Item();\n item1.setName(\"Swiss Army Knife\");\n item1.setWeight(0.08125);\n item1.setVal(15);\n Gene gene1 = new Gene(item1);\n\n Item item2 = new Item();\n item2.setName(\"Duct Tape\");\n item2.setWeight(1.3);\n item2.setVal(3);\n Gene gene2 = new Gene(item2);\n\n Item item3 = new Item();\n item3.setName(\"Rope (50 feet)\");\n item3.setWeight(7);\n item3.setVal(10);\n Gene gene3 = new Gene(item3);\n\n Item item4 = new Item();\n item4.setName(\"Satellite phone\");\n item4.setWeight(2);\n item4.setVal(8);\n Gene gene4 = new Gene(item4);\n\n Item item5 = new Item();\n item5.setName(\"Elmer's Glue\");\n item5.setWeight(0.25);\n item5.setVal(2);\n Gene gene5 = new Gene(item5);\n\n Item item6 = new Item();\n item6.setName(\"Toilet Paper Roll\");\n item6.setWeight(.5);\n item6.setVal(4);\n Gene gene6 = new Gene(item6);\n\n Item item7 = new Item();\n item7.setName(\"Binoculars\");\n item7.setWeight(3);\n item7.setVal(5);\n Gene gene7 = new Gene(item7);\n\n Item item8 = new Item();\n item8.setName(\"Compass\");\n item8.setWeight(0.0573202);\n item8.setVal(15);\n Gene gene8 = new Gene(item8);\n\n Item item9 = new Item();\n item9.setName(\"Jug (pre-filled with water)\");\n item9.setWeight(4);\n item9.setVal(6);\n Gene gene9 = new Gene(item9);\n\n Item item10 = new Item();\n item10.setName(\"Flashlight\");\n item10.setWeight(2);\n item10.setVal(4);\n Gene gene10 = new Gene(item10);\n\n Item item11 = new Item();\n item11.setName(\"Box of paper clips\");\n item11.setWeight(.9);\n item11.setVal(2);\n Gene gene11 = new Gene(item11);\n\n Item item12 = new Item();\n item12.setName(\"Gloves (1 pair)\");\n item12.setWeight(.8125);\n item12.setVal(3);\n Gene gene12 = new Gene(item12);\n\n Item item13 = new Item();\n item13.setName(\"Scissors\");\n item13.setWeight(0.2);\n item13.setVal(2);\n Gene gene13 = new Gene(item13);\n\n Item item14 = new Item();\n item14.setName(\"Signal Flair (4pk)\");\n item14.setWeight(4);\n item14.setVal(5);\n Gene gene14 = new Gene(item14);\n\n Item item15 = new Item();\n item15.setName(\"Water Purifying System\");\n item15.setWeight(0.5125);\n item15.setVal(4);\n Gene gene15 = new Gene(item15);\n\n Item item16 = new Item();\n item16.setName(\"Whistle\");\n item16.setWeight(0.075);\n item16.setVal(2);\n Gene gene16 = new Gene(item16);\n\n Item item17 = new Item();\n item17.setName(\"Sleeping Bag\");\n item17.setWeight(0.38125);\n item17.setVal(4);\n Gene gene17 = new Gene(item17);\n\n Item item18 = new Item();\n item18.setName(\"Insect Repellent\");\n item18.setWeight(1.15);\n item18.setVal(3);\n Gene gene18 = new Gene(item18);\n\n Item item19 = new Item();\n item19.setName(\"Trowel\");\n item19.setWeight(0.31875);\n item19.setVal(3);\n Gene gene19 = new Gene(item19);\n\n Item item20 = new Item();\n item20.setName(\"Lighter\");\n item20.setWeight(.2);\n item20.setVal(4);\n Gene gene20 = new Gene(item20);\n\n Item item21 = new Item();\n item21.setName(\"Safety Horn\");\n item21.setWeight(.21);\n item21.setVal(3);\n Gene gene21 = new Gene(item21);\n\n Item item22 = new Item();\n item22.setName(\"Headlamp\");\n item22.setWeight(.8);\n item22.setVal(4);\n Gene gene22 = new Gene(item22);\n\n Item item23 = new Item();\n item23.setName(\"Freeze Dried Food Kit\");\n item23.setWeight(2);\n item23.setVal(6);\n Gene gene23 = new Gene(item23);\n\n Item item24 = new Item();\n item24.setName(\"Sunscreen\");\n item24.setWeight(.5);\n item24.setVal(4);\n Gene gene24 = new Gene(item24);\n\n Item item25 = new Item();\n item25.setName(\"Trekking Pole (Adjustable)\");\n item25.setWeight(1.3);\n item25.setVal(4);\n Gene gene25 = new Gene(item25);\n\n Item item26 = new Item();\n item26.setName(\"Counter Assault Bear Spray\");\n item26.setWeight(.5);\n item26.setVal(4);\n Gene gene26 = new Gene(item26);\n\n Item item27 = new Item();\n item27.setName(\"Insect Spray\");\n item27.setWeight(.5);\n item27.setVal(3);\n Gene gene27 = new Gene(item27);\n\n Item item28 = new Item();\n item28.setName(\"Hand sanitizer\");\n item28.setWeight(.625);\n item28.setVal(3);\n Gene gene28 = new Gene(item28);\n\n Item item29 = new Item();\n item29.setName(\"Mirror\");\n item29.setWeight(.5);\n item29.setVal(3);\n Gene gene29 = new Gene(item29);\n\n Item item30 = new Item();\n item30.setName(\"First Aid Kit\");\n item30.setWeight(3);\n item30.setVal(6);\n Gene gene30 = new Gene(item30);\n\n list.add(gene1);\n list.add(gene2);\n list.add(gene3);\n list.add(gene4);\n list.add(gene5);\n list.add(gene6);\n list.add(gene7);\n list.add(gene8);\n list.add(gene9);\n list.add(gene10);\n list.add(gene11);\n list.add(gene12);\n list.add(gene13);\n list.add(gene14);\n list.add(gene15);\n list.add(gene16);\n list.add(gene17);\n list.add(gene18);\n list.add(gene19);\n list.add(gene20);\n list.add(gene21);\n list.add(gene22);\n list.add(gene23);\n list.add(gene24);\n list.add(gene25);\n list.add(gene26);\n list.add(gene27);\n list.add(gene28);\n list.add(gene29);\n list.add(gene30);\n\n return list;\n }", "public int addGenreToPlayList(){\n\t\t\n\t\tint pos =0;\n\t\t\n\t\tboolean out = false;\n\t\t\n\t\tfor(int i=0; (i<genresList.length)&&(out==false);i++){\n\t\t\n\t\tif(genresList[i] == null){\n\t\t\tout = true;\n\t\t\tpos = i;\n\t\t}\n\t\t}\n\t\treturn pos;\n\t}", "public void setRandomGenes(int i){\n if (i > populationSize){\n throw new IllegalArgumentException(\"The number of random genes per generation must not be greater than the population size\");\n }\n randGenes = i;\n }", "public String getGeneList() {\n return geneList;\n }", "public List<Registery> getAllRegisteryItems() {\n\t\treturn allRegisteryItems;\n\t}", "public ArrayList<BigInteger> getAll() {\n\t\treturn primes;\n\t}", "private void init() {\n UNIGRAM = new HashMap<>();\n }", "public GeneticEngine() {\n avgFitnesses = new ArrayList<Double>();\n highFitnesses = new ArrayList<Double>();\n population = null;\n crossoverProbability = 0.07;\n mutationProbability = 0.001;\n maxGenerations = Integer.MAX_VALUE;\n }", "protected void initializePopulation () {\n\t\tfor (int i = 0; i < this.speciesSize; i++) {\n\t\t\tthis.detectors.add(DetectorFactory.makeDetector(this.featuresLength, this.typeBias, this.generalityBias));\n\t\t}\n\t}", "public GAIndividual()\n {\n m_fitness = 0;\n m_genome = new ArrayList<Integer>();\n }", "public boolean isSetGenres() {\n return this.genres != null;\n }", "protected Set<Integer> getInnovations() {\n\t\treturn genes.keySet();\n\t}", "public ArrayList getAll() {\r\n\t\tArrayList list = new ArrayList();\r\n\t\tlist.addAll(getParticles());\r\n\t\tlist.addAll(getConstraints());\r\n\t\tlist.addAll(getComposites());\r\n\t\treturn list;\r\n\t}", "private ArrayList<String> initList(String[] vastitems){\n return new ArrayList<>(Arrays.asList(vastitems));\n }", "public String getGenresString(){\n String genres =\"\";\n for (String str : allGenres){\n genres += str +\", \";\n }\n return genres;\n }", "public int[] getGenes() {\r\n\t\tint[] genes = new int[9];\r\n\t\tgenes[0] = this.command.ordinal();\r\n\t\tif(this.senseDir == null){\r\n\t\t\tgenes[1] = -1;\r\n\t\t}else{\r\n\t\t\tgenes[1] = this.senseDir.ordinal();\r\n\t\t}\r\n\t\tif(this.turnDir == null){\r\n\t\t\tgenes[2] = -1;\r\n\t\t}else{\r\n\t\t\tgenes[2] = this.turnDir.ordinal();\r\n\t\t}\r\n\t\tgenes[3] = this.marker;\r\n\t\tgenes[4] = this.p;\r\n\t\tgenes[5] = this.st1;\r\n\t\tgenes[6] = this.st2;\r\n\t\tif(this.condition == null){\r\n\t\t\tgenes[7] = -1;\r\n\t\t}else{\r\n\t\t\tgenes[7] = this.condition.ordinal();\r\n\t\t}\r\n\t\tgenes[8] = this.senseMarker;\r\n\t\treturn genes;\r\n\t}", "public void populateGenreMap(ItemContainer itemContainer) {\n\t\tfor (Genres genre : itemContainer.getGenres()) {\n\t\t\tif (everyGenre.containsKey(genre.getGenre())) {\n\t\t\t\tTreeSet<Genres> genres = everyGenre.get(genre.getGenre());\n\t\t\t\tgenres.add(genre);\n\t\t\t\teveryGenre.put(genre.getGenre(), genres);\n\t\t\t} else {\n\t\t\t\tTreeSet<Genres> tempSet = new TreeSet<Genres>();\n\t\t\t\ttempSet.add(genre);\n\t\t\t\teveryGenre.put(genre.getGenre(), tempSet);\n\t\t\t}\n\t\t}\n\t}", "public static ArrayList<Long> getPopular(){\n return new ArrayList<Long>();\n }", "public java.util.List<java.lang.String> getGeneIds() {\n return geneIds;\n }", "public boolean isSetGenres() {\r\n return this.genres != null;\r\n }", "public java.util.List<java.lang.String> getGeneIds() {\n return geneIds;\n }", "public ArrayList(int initialCapacity, int growthFactor) {\n\t\tthis.storedObjects = new Object[initialCapacity];\n\t\tthis.growthFactor = growthFactor;\n\t}", "public List<Ramen> getAllRamen(){\r\n //return ramens;\r\n // Originally (above) for hardcoded list, but now it's looking into Crud Repository\r\n List<Ramen> ramens = new ArrayList<>();\r\n ramenRepository.findAll() //An iterable\r\n .forEach(ramens::add); //Lambda expression. For each in iterable, adds to ramens\r\n return ramens;\r\n }", "public void setGenre(String genreStr) {\n String genresRemovedCommas = genreStr.replaceAll(COMMA, EMPTY);\r\n String[] genresArray = genresRemovedCommas.split(SPACE);\r\n Collections.addAll(genres, genresArray);\r\n }", "@Override\n\tpublic GalaxyNote[] galList() {\n\t\treturn null;\n\t}", "public void initialize() {\r\n\t\tfor (iPhone iphone : iphoneList) {\r\n\t\t\tadd(iphone);\r\n\t\t}\r\n\t}", "@Override protected List<String> initialize(int size){\n container.clear();\n container.addAll(Arrays.asList(Generated.array(String.class, new RandomGenerator.String(), size)));\n return container;\n }", "protected static ArrayList<String> GenNumber() {\n\n ArrayList<String> initialList = new ArrayList<>();\n\n initialList.add(\"1\"); //Add element\n initialList.add(\"2\");\n initialList.add(\"3\");\n initialList.add(\"4\");\n initialList.add(\"5\");\n initialList.add(\"6\");\n initialList.add(\"7\");\n initialList.add(\"8\");\n initialList.add(\"9\");\n\n Collections.shuffle(initialList); //Random the position\n\n return initialList;\n }", "@Override\n\tpublic List<Generator> getAll() {\n\n\t\tList<Generator> result = new ArrayList<>();\n\n\t\ttry (Connection c = context.getConnection(); \n\t\t\tStatement stmt = c.createStatement()) {\n\n\t\t\tResultSet rs = stmt.executeQuery(getAllQuery);\n\n\t\t\twhile (rs.next()) {\n \tGenerator generator = new Generator(\n \t\trs.getInt(1),\n \t\trs.getString(2),\n \t\trs.getString(3),\n \t\trs.getInt(4),\n \t\trs.getInt(5),\n \t\trs.getInt(6)\n \t);\n\t\t\t\tresult.add(generator);\n\t\t\t}\n\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn result;\n\t\t}\n\t\treturn result;\n\n\t}", "private void populateGenres(){\n try{\n Connection conn = DriverManager.getConnection(\n \"jdbc:sqlite:\\\\D:\\\\Programming\\\\Java\\\\Assignments\\\\CIS_452\\\\Music_Library\\\\album_library.sqlite\");\n Statement stmnt = conn.createStatement();\n ResultSet results = stmnt.executeQuery(\"SELECT DISTINCT genre FROM artist ORDER BY genre\");\n\n while(results.next()){\n String genre = results.getString(1);\n genreList.add(genre);\n }\n conn.close();\n } catch(SQLException e) {\n System.out.println(\"Error connecting to database: \" + e.getMessage());\n }\n }", "public ArrayList61B(int initialCapacity) { \n\t\tif (initialCapacity < 1) {\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\telse {\n\t\t\tthis.size = initialCapacity;\n\t\t\tthis.arrayList = (E[]) new Object[this.size];\n\t\t\tthis.numberOfElements = 0;\n\t\t}\n\t}", "public void initializePopulation(){\n\t\t// create the population\n\t\tfor(int i = 0; i < POPULATION_SIZE; i++){\n\t\t\t// get a random length for the building sequence\n\t\t\tint randArraySize = randomGenerator.nextInt(possiblePieces.length-1)+1;\n\t\t\t\n\t\t\tBuildingPiece[] pieceSequence = new BuildingPiece[randArraySize];\n\t\t\tfor(int j = 0; j < randArraySize; j++){\n\t\t\t\t// get a random possible piece and insert it into the sequence\n\t\t\t\tint randIndex = randomGenerator.nextInt(possiblePieces.length);\n\t\t\t\tpieceSequence[j] = possiblePieces[randIndex];\n\t\t\t}\n\t\t\t\n\t\t\t/* add a new number sequence with the newly created \n\t\t\t * sequence from the input */\n\t\t\tpopulation.add(new Building(pieceSequence, generation, possiblePieces));\n\t\t}\n\t}", "public RandomizedCollection() {\n map = new HashMap<>();\n arr = new ArrayList<>();\n }", "private void initialize() {\n\n\t\tint totalSets, iSet;\n\t\tInformationSet infoSet = null;\n\t\tTreeNode treeNode = null;\n\n\t\tArrayList informationSetList = efg.getInformationSets(iPlayer);\n\n\t\ttotalSets = informationSetList.size();\n\n\t\tmovesLists = new ArrayList[totalSets];\n\t\tprobsLists = new ArrayList[totalSets];\n\n\t\tfor (iSet = 0; iSet < totalSets; iSet++) {\n\t\t\tmovesLists[iSet] = new ArrayList();\n\t\t\tprobsLists[iSet] = new ArrayList();\n\t\t}\n\n\t\tfor (iSet = 0; iSet < totalSets; iSet++) {\n\t\t\tinfoSet = (InformationSet) informationSetList.get(iSet);\n\t\t\ttreeNode = infoSet.getTreeNode(0);\n\t\t\tmovesLists[iSet] = treeNode.getMovesList();\n\t\t}\n\t}", "public void populateRiver()\n\t{\n\t\twhile (emptyIndices.size() != 10) // 10 animals requirement at start\n\t\t{\n\t\t\tswitch (rng.nextInt(3))\n\t\t\t{\n\t\t\tcase 0:\n\t\t\t\triver[rng.nextInt(20)] = new Bear();\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\triver[rng.nextInt(20)] = new Fish();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\triver[rng.nextInt(20)] = null;\n\t\t\t}\n\t\t\tfindEmpty(); // force emptyIndices update\n\t\t}\n\t}", "public OCRSet(int initialCapacity) {\r\n this.map = new HashMap<Integer, E>(initialCapacity);\r\n }", "public static void createArrays() {\r\n\t\tRandom rand = new Random();\r\n\t\tfor (int i = 0; i < N; i++) {\r\n\t\t\tint size = rand.nextInt(5) + 5;\r\n\t\t\tTOTAL += size;\r\n\t\t\tArrayList<Integer> numList = new ArrayList<>();\r\n\t\t\tfor (int j = 0; j < size; j++) {\r\n\t\t\t\tint value = rand.nextInt(1000) + 1;\r\n\t\t\t\tnumList.add(value);\r\n\t\t\t}\r\n\t\t\tCollections.sort(numList);\r\n\t\t\tarrayMap.put(i + 1, numList);\r\n\t\t}\r\n\t}", "public ArrayList(int initCapacity) {\n elements = new Object[initCapacity];\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic void init()\n\t{\n\t\tscore = 0;\n\t\tlives = 3;\n\t\tgameTime = 0;\n\n\t\t\t/*initialize an array of array lists\n\t\t\tfor storing game objects currently in world\t\t\t\n\t\t\tAsteroids: index 0\n\t\t\tPlayer ship: index 1\n\t\t\tNon player ship: index 2\n\t\t\tenemy missile: index 3\n\t\t\tfriendly missile: index 4\n\t\t\tSpace station: index 5\n\t\t\t*/\t\t\n\t\t\tgameObj = new ArrayList[6];\n\t\t\tfor(int i = 0; i<gameObj.length; i++)\n\t\t\t{\n\t\t\t\tgameObj[i] = new ArrayList<GameObject>();\n\t\t\t}\n\t}", "void initialize() {\n for (Map.Entry<String, Gauge<Long>> entry : gaugeList.entrySet()) {\n registerWithSuffix(entry.getKey(), 0, entry.getValue());\n }\n }", "public void initialize() {\n final Double optimismRate = new Double(0.0);\n _counts.clear();\n _values.clear();\n\n for (Integer index : Range.closed(0, _armsNo - 1).asSet(DiscreteDomains.integers())) {\n _counts.add(index, optimismRate.intValue());\n _values.add(index, optimismRate);\n }\n }", "private void populateGeofencesList() {\n ArrayList<GeofenceObjects> returnlist = currentList;\n geofences.clear();\n for (GeofenceObjects geofenceObjects : returnlist) {\n geofences.add(geofenceObjects.getGeofenceName());\n }\n }", "public void fillGarage() {\n\t\n\t\tfor (int i = 0; i < 10; i++) { // 10 cars\n\t\t\taddVehicle(new Car(\"Silver\", \"Audi\", \"petrol\", 250, 4, 40000));\n\t\t}\n\t\tfor (int i = 0; i < 20; i++) { // 20 motorcycles\n\t\t\taddVehicle(new Motorcycle(\"Red\", \"Suzuki\", \"petrol\", 300, 2, 80000));\n\t\t}\n\t\tfor (int i = 0; i < 3; i++) { // 3 buses \n\t\t\taddVehicle(new Bus(\"White\", \"Volvo\", \"diesel\", 140, 4, 100000));\n\t\t}\n\t\t\n\t}", "private void buildGenerations(BDD initialGeneration){\n\t\tBDD currentGeneration = initialGeneration;\n\t\tint i = 0;\n\t\t\n\t\tthis.generations.add(currentGeneration.copy());\n\t\n\t\twhile(i++ < endGenerations){\n\n\t\t\tBDD nextGeneration = getNextGeneration(currentGeneration);\n\t\t\tthis.generations.add(nextGeneration);\n\t\t\t\n\t\t\tcurrentGeneration.free();\n\t\t\tcurrentGeneration = nextGeneration.copy();\n\t\t}\t\t\n\t}", "public static List getList() {\r\n return Arrays.asList(ALL);\r\n }", "@Override\n\tpublic ArrayList<Representation> getALL() {\n\t\treturn null;\n\t}", "@Override\n protected List<String> initialize(int size) {\n String[] ia = Generated.array(String.class,\n new RandomGenerator.String(), size);\n return Arrays.asList(ia);\n }", "public Golfer() \n {\n name = \"__\";\n homeCourse = \"__\";\n idNum = 9999;\n this.name = name;\n this.homeCourse = homeCourse;\n this.idNum = idNum;\n final int LENGTH = 20;\n Score[] values = new Score[LENGTH];\n values = this.scores;\n }", "public ArrayList<T> getAll() {\n\t\treturn new ArrayList<T>(this.data.values());\n\t}", "public static SortBuilder[] allInstances() {\n \t\treturn (SortBuilder[]) allInstances.toArray(new SortBuilder[allInstances.size()]);\n \t}", "public Chromosome(ArrayList<Teacher_lesson> list){\n\t\tthis.genes=new int[array_size];\n\t\tRandom r= new Random();\n\t\tfor(int i=0;i<genes.length;i++){\n\t\t\t\n\t\t\tthis.genes[i]=r.nextInt(number_of_professors);\n\t\t}\n\t\tthis.DataList=list;\n\t\tthis.calculateFitness();\n\t}", "public static void generatePopulation() {\n population = setupArray(POP_SIZE, NUM_RULES, GENE_SIZE, COND_LEN);\n\n for (Individual individual : population) {\n for (int i = 0; i < individual.getGene().length; i++) {\n individual.gene[i] = bits.get(new Random().nextInt(2));\n }\n individual.generateRulebase();\n }\n }", "public RandomizedSet_380() {\n elementsList = new ArrayList<>();\n valToIndex = new HashMap<>();\n }", "public void random_init()\r\n\t{\r\n\t\tRandom random_generator = new Random();\r\n\t\t\r\n\t\tfor(int i=0;i<chromosome_size;i++)\r\n\t\t{\r\n\t\t\tchromosome[i] = random_generator.nextInt(num_colors)+1;\r\n\t\t}\r\n\t}", "private void populate()\n\t{\n\t\tages = new int[] { 15, 18, 16, 16, 15, 16 }; \n\t}", "private void prepareArrayLists() {\n mArrQueries = new ArrayList<>(Arrays.asList(DiscoverConstants.RESTAURANT, DiscoverConstants.MUSEUM, DiscoverConstants.HOTEL, DiscoverConstants.CLUB));\n mArrRecyclerViews = new ArrayList<>(Arrays.asList(rvRestaurants, rvMuseums, rvHotels, rvClubs));\n mArrAdapters = new ArrayList<>(Arrays.asList(mAdapterRestaurants, mAdapterMuseums, mAdapterHotels, mAdapterClubs));\n mArrBusinesses = new ArrayList<>(Arrays.asList(mRestaurants, mMuseums, mHotels, mClubs));\n }", "public static ArrayList<Individuo> mutaHeuristica(ArrayList<Individuo> genAnt,int nB){\n ArrayList<Individuo> aux = genAnt;\n ArrayList<Integer> genesS = new ArrayList<>();\n int nM = (int) (genAnt.size()*0.2); //determina cuantos individuos van a ser mutados\n int iS,gS,i=0,n,c;\n byte gaux[],baux;\n Random r = new Random();\n while(i<nM){\n gS = r.nextInt(nB+1);//selecciona el numero de genes aleatoriamente\n iS = r.nextInt(genAnt.size());//selecciona un individuo aleatoriamente\n gaux = aux.get(iS).getGenotipo();//obtenemos genotipo de ind seleccionado\n c=0;\n System.out.println(gS);\n //seleccionamos genes a ser permutados\n while(c != gS){\n n = r.nextInt(nB);\n if(!genesS.contains(n)){\n genesS.add(n);\n System.out.print(genesS.get(c)+\" \");\n c++;\n }\n }\n System.out.println(\"\");\n //aux.remove(iS);//quitamos elemento\n //aux.add(iS, new Individuo(gaux,genAnt.get(0).getTipoRepre()));//añadimos elemento mutado\n i++;\n }\n return aux;\n }", "public ArrayList() {\n elements = new Object[DEFAULT_CAPACITY];\n }", "public RandomizedSet() {\r\n\t\tbucket = new BucketItem[BUCKET_SIZE];\r\n\t}", "public List<Entry> getAllLiterature() {\n List<Entry> allLiterature = new ArrayList<>();\n for (Entry l : litRegister) {\n allLiterature.add(l);\n }\n return allLiterature;\n }", "public void initializeListings() {\n\t listings = new ArrayList<Listing>();\n\t Listings listingsToStore = Listings.getInstance();\n\t Iterator<Saveable> listingIterator = listingsToStore.iterator();\n\t\n\t int counter = 0;\n\t while (listingIterator.hasNext()) {\n\t\t Listing currentListing = listingsToStore.getListing(counter);\n\t\t for (int i = 0; i < listingIds.size(); i++) {\n\t\t\t \n\t\t\t if (currentListing.getInternalId() == listingIds.get(i)) {\n\t\t\t\t \n\t\t\t\t listings.add(currentListing);\n\t\t\t }\n\t\t }\n\t\t counter++;\n\t\t listingIterator.next();\n\t }\n\t \n }", "static void add_the_general_registers(){\n\t\tgeneral_registers.add('A');\n\t\tgeneral_registers.add('B');\n\t\tgeneral_registers.add('C');\n\t\tgeneral_registers.add('D');\n\t\tgeneral_registers.add('E');\n\t\tgeneral_registers.add('H');\n\t\tgeneral_registers.add('L');\n\t}", "@Override\n\tpublic void getAllFamilies() {\n\n\t}", "public synchronized List<SampleProject> getAll() {\n\t\tif (samples==null) {\n\t\t\tsamples = new ArrayList<SampleProject>();\n\t\t\tregisterLocalSamples();\n\t\t}\n\t\treturn samples;\n\t}", "private void createItemsetsOfSize1() {\n itemsets = new ArrayList<>();\n for (int i = 0; i < numItems; i++) {\n String[] cand = {words.get(i)};\n itemsets.add(cand);\n }\n }", "private List<String> build() {\n List<String> ags = new ArrayList<>();\n ags.add(\"European Union Chromosome 3 Arabidopsis Sequencing Consortium\");\n ags.add(\"Institute for Genomic Research\");\n ags.add(\"Kazusa DNA Research Institute\");\n return ags;\n }", "public BundlesG() {\r\n // Put the default conversions\r\n addRangeIntegers();\r\n }", "public Object[] getGlobalResourceList() {\n return this.getList(AbstractGIS.INQUIRY_GLOBAL_RESOURCE_LIST);\n }", "public ArrayListOfIntsWritable(int initialCapacity)\n {\n super(initialCapacity);\n }", "private static List<Integer> initLista(int tamanho) {\r\n\t\tList<Integer> lista = new ArrayList<Integer>();\r\n\t\tRandom rand = new Random();\r\n\r\n\t\tfor (int i = 0; i < tamanho; i++) {\r\n\t\t\tlista.add(rand.nextInt(tamanho - (tamanho / 10) + 1)\r\n\t\t\t\t\t+ (tamanho / 10));\r\n\t\t}\r\n\t\treturn lista;\r\n\t}", "@Override\n\tpublic void init() throws ServletException {\n\t\tsuper.init();\n\t\tfor (int i = 0; i < 20; i++) {\n\t\t\tname = \"arror\" + i + 1;\n\t\t\tlist.add(name);\n\t\t}\n\t}" ]
[ "0.6715576", "0.64658713", "0.62545973", "0.62059546", "0.6161807", "0.611298", "0.60261446", "0.6002234", "0.5937734", "0.59339267", "0.5818893", "0.58159417", "0.58038723", "0.5690011", "0.56325465", "0.56214327", "0.56048787", "0.5580748", "0.554599", "0.5463471", "0.5417118", "0.5378713", "0.5369082", "0.5365173", "0.5351916", "0.5329776", "0.53289616", "0.53190213", "0.52955365", "0.5282538", "0.52626014", "0.52447075", "0.523429", "0.52219665", "0.5210746", "0.5200646", "0.51842606", "0.5182931", "0.5181667", "0.51671064", "0.51534235", "0.5152489", "0.5151834", "0.5151726", "0.51496625", "0.51493883", "0.5147195", "0.51453507", "0.5143358", "0.5136278", "0.5122264", "0.5121129", "0.50929815", "0.5084367", "0.5076247", "0.5073882", "0.5068973", "0.5060619", "0.50194985", "0.5019195", "0.5013742", "0.50100034", "0.5008396", "0.50002563", "0.49929157", "0.4988444", "0.4984646", "0.49829003", "0.49611765", "0.49493507", "0.4948836", "0.49475613", "0.49474835", "0.4942367", "0.49406797", "0.49404326", "0.4939168", "0.49369296", "0.4923315", "0.49226093", "0.49198115", "0.49194175", "0.49148366", "0.49064416", "0.49064097", "0.4905456", "0.49024233", "0.49000075", "0.48934472", "0.4891763", "0.48844314", "0.4873969", "0.48692003", "0.48687878", "0.48675552", "0.48674297", "0.48655915", "0.4863942", "0.48627338", "0.4861208" ]
0.7990544
0
/Method run when user starts the Library Management System.
public static void runProgram() throws IOException{ ALL_STUDENTS.add(new StudentDetails()); //dummy StudentDetails object set to index 0 of the ArrayList. This is to ensure no student can have his/her Id set to 0. initializeAllGenresList(); Scanner string_input = new Scanner(System.in); //stores string input from the user boolean authenticated = false; //stores whether user entered correct username and password combination while(!authenticated){ String username_input; String password_input; System.out.println("Enter username: "); username_input = string_input.next(); //store input for username System.out.println("Enter password: "); password_input = string_input.next(); //store input for password authenticated = authenticateUser(username_input, password_input); //checks whether correct username and password combination was entered } System.out.println(); /*load all the BookDetails objects in the books.txt file into ALL_BOOKS, then * load all the StudentDetails objects in the students.txt file into ALL_STUDENTS */ if(loadBooks() && loadStudents()){ //if there's no error loading all the BookDetails and StudentDetails System.out.println(); displayMainMenu(); int menu_option = getIntegerInput(); //ensures user input is an integer value executeMenuOption(menu_option); //execute menu option entered by user } else{ System.out.println("Sorry an error occurred while loading! Please check documentation to fix error and then restart the program."); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void startLibrary();", "public void init()\n {\n _appContext = SubAppContext.createOMM(System.out);\n _serviceName = CommandLine.variable(\"serviceName\");\n initGUI();\n }", "void onSystemReady();", "public void startApp()\r\n\t{\n\t}", "private void startUp () {\n NativeMethodBroker.loadLibrary(false);\n try {\n start_up();\n } catch (UnsatisfiedLinkError e) {\n try {\n NativeMethodBroker.loadLibrary(true);\n NativeMethodBroker.traceln(AX_PROGRESS, \"There apparently were problems \" +\n \"in initially loading JavaContainer.dll. \" +\n \"It appears to be ok now. Error message \" +\n \"was \" + e.getMessage());\n start_up();\n } catch (UnsatisfiedLinkError e2) {\n NativeMethodBroker.traceln(AX_ERROR, fatalErrorMessage +\n \" Error message was: \" + e2.getMessage());\n // Really should exit here.\n // System.exit(-1);\n }\n }\n }", "public void start() {\r\n\t\tif (FormsContext.isFormsServicesApp()) {\r\n\t\t\tinitialOpenLWWindows = new LWWindowOperator().getWindowTitles();\r\n\t\t} else {\r\n\r\n\t\t}\r\n\t}", "private void appInitialization(){\n openRom();\n openGuide();\n setOffset(0);\n addressChanged();\n }", "public void autonomousInit() {\n \n }", "public void autonomousInit() {\n\t\t\n\t}", "public void start() {\n\t\tSystem.out.println(\"开启系统1\");\r\n\t}", "public void autonomousInit() {\n }", "public void autonomousInit() {\n }", "public void autonomousInit() {\n\t\tautonomousCommand.start();\r\n\t}", "public void init() {\r\n\t\tGetRunningProgramsGR request = new GetRunningProgramsGR(\r\n\t\t\t\tRunningServicesListViewAdapter.this.runningServicesActivity.getApplicationContext());\r\n\t\trequest.setServerName(RunningServicesListViewAdapter.this.serverName);\r\n\t\tnew GuiRequestHandler(RunningServicesListViewAdapter.this.runningServicesActivity,\r\n\t\t\t\tRunningServicesListViewAdapter.this, true).execute(request);\r\n\t}", "public void autonomousInit(){\n\t \t//resetAndDisableSystems();\n\t\t \n\t \tautonomousCommand = (Command) autoChooser.getSelected();\n\t \tautonomousCommand.start();\n\t \t\n\t \t\n\t }", "public void startup() {\n neutral();\n }", "public void startUp() {\n\t\t/* Language of App */\n\t\t\n\t\t/* Init Icons */\n\t\tPaintShop.initIcons(display);\n\t\t/* Init all components */\n\t\tinitComponents();\n\t\t\n\t\t\n\t}", "public abstract void startup();", "protected void onFirstTimeLaunched() {\n }", "@Override\r\n\t\t\t\tpublic void autInitProcess() {\n\t\t\t\t\t\r\n\t\t\t\t}", "@Override\r\n\t\t\t\tpublic void autInitProcess() {\n\t\t\t\t\t\r\n\t\t\t\t}", "@Override\r\n\t\t\tpublic void autInitProcess() {\n\t\t\t}", "@Override\r\n\t\t\tpublic void autInitProcess() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void autInitProcess() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void autInitProcess() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void autInitProcess() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void autInitProcess() {\n\t\t\t\t\r\n\t\t\t}", "public void autonomousInit() {\n \tNetworkCommAssembly.start();\n }", "public void startup(){}", "@Override\n public void startup() {\n }", "public void start() {\n System.out.println(\"OBRMAN started\");\n ApamManagers.addManager(this, 3);\n OBRMan.obr = new OBRManager(null, repoAdmin);\n obr.startWatchingRepository();\n }", "private void initializeStartup()\n {\n /* Turn off Limelight LED when first started up so it doesn't blind drive team. */\n m_limelight.turnOffLED();\n\n /* Start ultrasonics. */\n m_chamber.startUltrasonics();\n }", "public void autonomousInit() {\n if (autonomousCommand != null) autonomousCommand.start();\n }", "public void startup() {\n\t\tstart();\n }", "@Override\r\n\tpublic void launch() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void launch() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void launch() {\n\t\t\r\n\t}", "public void onSystemReady() {\n updateCurrentProfileIds();\n this.mInjector.reportCurWakefulnessUsageEvent();\n }", "public void Initialse() {\n\t\tappSettings = ctx.getSharedPreferences(APP_SETTINGS, 0);\n\t\tSharedPreferences.Editor prefEditor = appSettings.edit();\n\t\tprefEditor.putBoolean(BLOCK, true); // master switch\n\t\tprefEditor.putBoolean(NOTIFY, true); // controls whether a notification appears in status bar ans notifications lit\n\t\tprefEditor.putBoolean(REMOVE_CALLS, false); // determines whether calls are removed form the call log\n\t\t// add INIT to prevent this code from being called again\n\t\tprefEditor.putBoolean(INIT, true); // flag to allow subsequent loads to recognise that defaults are set\n\t\tprefEditor.putString(TEST, ctx.getString(R.string.test_number));\n\t\tprefEditor.putBoolean(RULES_EXIST, false); // added to control whether app kicks off commshandler\n\t\t\n\t\tprefEditor.commit();\n \n\t}", "public void open() {\n timer.schedule(new ChangeLibraryStateTask(requestManager, this), new Date(), MILLISECOND_DAY);\n }", "public void start()\n {\n uploadDataFromFile();\n menu.home();\n home();\n }", "void startup();", "void startup();", "public void start(){\r\n if (isInitOk){\r\n if (firstStart) {\r\n firstStart = false;\r\n String userHome = System.getProperty(\"user.home\");\r\n String installDirName = userHome + File.separator + \".jogl_ext\"\r\n + File.separator + installDirectory; // should manage jogl versions here\r\n\r\n final File installDir = new File(installDirName);\r\n\r\n Thread refresher = new Thread() {\r\n public void run() {\r\n refreshJOGL(installDir);\r\n }\r\n };\r\n refresher.setPriority(Thread.NORM_PRIORITY - 1);\r\n refresher.start();\r\n } else if (joglStarted) {\r\n // we have to start again the applet (start can be called multiple times,\r\n // e.g once per tabbed browsing\r\n subApplet.start();\r\n }\r\n }\r\n }", "public void start(){\n LogManager.getLogManager().reset();\r\n\r\n // Get the logger for \"org.jnativehook\" and set the level to off.\r\n Logger logger = Logger.getLogger(GlobalScreen.class.getPackage().getName());\r\n logger.setLevel(Level.OFF);\r\n try {\r\n GlobalScreen.registerNativeHook();\r\n } catch (NativeHookException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n GlobalScreen.addNativeKeyListener(new KeyboardHook());\r\n\r\n }", "protected void initialize() {\n \tSystem.out.println(\"HoldGear STARTING!!\");\n }", "public void start() {\n\t\tinstanceConfigUpdated();\n\n\t\tnew Thread(getUsageData, \"ResourceConsumptionManager : GetUsageData\").start();\n\n\t\tLoggingService.logInfo(MODULE_NAME, \"started\");\n\t}", "void doManualStart();", "protected void initialize() {\n \tclaw = Robot.getClaw();\n\n \tclaw.open();\n }", "public void startApp() {\n if (midletPaused) {\n resumeMIDlet ();\n } else {\n initialize ();\n startMIDlet ();\n }\n midletPaused = false;\n }", "public void startApp() {\n if (midletPaused) {\n resumeMIDlet ();\n } else {\n initialize ();\n startMIDlet ();\n }\n midletPaused = false;\n }", "protected void initialize() {\n\t\tRobot.firstAutonomousCommandDone = true;\n\t}", "@Override\n public void autonomousInit() {\n\n autonomousCommand = new Autonomous(start.getSelected(), chooser.getSelected());\n \n autonomousCommand.start();\n }", "public void startApp() {\n if (midletPaused) {\n resumeMIDlet();\n } else {\n initialize();\n startMIDlet();\n }\n midletPaused = false;\n }", "public void starting();", "public void startProgram() {\n this.displayBanner();\n// prompt the player to enter their name Retrieve the name of the player\n String playersName = this.getPlayersName();\n// create and save the player object\n User user = ProgramControl.createPlayer(playersName);\n// Display a personalized welcome message\n this.displayWelcomeMessage(user);\n// Display the Main menu.\n MainMenuView mainMenu = new MainMenuView();\n mainMenu.display();\n }", "protected void initialize() {\n \tSystem.out.println(\"initialize ReturnToStart\");\n \tRobot.claw.goRetract();\n \tRobot.claw.goUp();\n \tRobot.claw.goOpen();\n \tRobot.claw.spinStop();\n }", "public void startupProcess() {\n Timer startupTimer = new Timer();\n TimerTask startupTask = new TimerTask() {\n @Override\n public void run() {\n finishStartup();\n }\n };\n if (this.offlineButton.isSelected() == true) {\n this.statusLed.setStatus(\"warning\");\n } else {\n this.statusLed.setStatus(\"ok\");\n }\n this.statusLed.setSlowBlink(true);\n this.offlineButton.setDisable(true);\n this.shutdownButton.setDisable(true);\n startupTimer.schedule(startupTask, 10000l);\n }", "@Override\n\tpublic void teleopInit() {\n\t\tservoCIMCommand.start();\n\t\tmonitorCommand.start();\n\t\twindowCommand.start();\n\t\t\n\t}", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t\tmApplication = null;\n\t\tContext appCtx = getApplicationContext();\n\t\tif (appCtx instanceof DSCApplication) {\n\t\t\tmApplication = (DSCApplication) appCtx;\n\t\t}\n\t\tif (mApplication != null) {\n\t\t\tmApplication.initFolderObserverList(false);\n\t\t}\n\t}", "public void onInstalled() {\n }", "public void setLaunched();", "@Override\n public void onRoboboManagerStarted(RoboboManager robobom) {\n robobo = robobom;\n\n //dismiss the wait dialog\n waitDialog.dismiss();\n\n //start the \"custom\" robobo application\n\n startRoboboApplication();\n\n }", "public void startCommandLine() {\r\n Object[] messageArguments = { System.getProperty(\"app.name.display\"), //$NON-NLS-1$\r\n System.getProperty(\"app.version\") }; //$NON-NLS-1$\r\n MessageFormat formatter = new MessageFormat(\"\"); //$NON-NLS-1$\r\n formatter.applyPattern(Messages.MainModel_13.toString());\r\n TransportLogger.getSysAuditLogger().info(\r\n formatter.format(messageArguments));\r\n }", "@Override\n public void autonomousInit() {\n }", "@Override\n public void autonomousInit() {\n }", "@Override\n public void firstApplicationStartup()\n {\n System.out.println(\"firstApplicationStartup\");\n \n }", "public void onEnable()\n\t{\n\t\t//Tells the user that the plugin is starting up.\n\t\tlog.info(\"Started up.\");\n\t}", "public void initApp() {\r\n\t\tUtilities.program=this;\r\n\t\ttouchList = new Hashtable<Integer, Touch>();\r\n\r\n\t\t// DB\r\n\t\tqueryManager = new QueryManager(this);\r\n\r\n\t\tlong timer = System.currentTimeMillis();\r\n\t\tresults = queryManager.getCrashesALL();\r\n\t\tSystem.out.println(System.currentTimeMillis() - timer);\r\n\t\ttimer = System.currentTimeMillis();\r\n\r\n\t\t// MARKERS\r\n\t\tUtilities.markerShape = loadShape(\"marker.svg\");\r\n\t\tmarkerList = updateMarkerList();\r\n\t\t\r\n\t\t\r\n\t\t// GRID\r\n\t\tgm = new GridManager(this, map, results);\r\n\t\tSystem.out.println(\"InitApp1\");\r\n\t\tgm.computeGridValues();\r\n\t\tSystem.out.println(System.currentTimeMillis() - timer);\r\n\t\t\r\n\t\t// OTHER\r\n\t\tUtilities.font = this.loadFont(\"Helvetica-Bold-100.vlw\");\r\n\t\t\r\n\t\t\r\n\t}", "public void onModuleLoad() {\r\n\t\trpcService = GWT.create(ContactService.class);\r\n\t\teventBus = new HandlerManager(null);\r\n\t\tappViewer = new AppController(rpcService, eventBus);\r\n\t\tappViewer.go(RootPanel.get(\"initView\"));\r\n\t}", "@Override\n public void autonomousInit() {\n \n }", "private void start() {\r\n\t\t// Clear the log file.\r\n\t\tBPCC_Logger.clearLogFile();\r\n\t\t\r\n\t\t// Initialize BPCC_Util static fields.\r\n\t\tBPCC_Util.initStaticFields();\r\n\t\t\r\n\t\t// Set logging level desired for test.\r\n\t\tBPCC_Util.setLogLevel(LogLevelEnum.DEBUG);\r\n\t\t\r\n\t\t// Initialize class global variables.\r\n\t\tinitVars();\r\n\t\t\r\n\t\tcreateAndShowGUI();\r\n\t}", "public void initialize() {\n\n getStartUp();\n }", "public void onLoad()\n\t{\n\t\tJLog.info(\" --- INIT --- \");\n\t\t\n\t}", "public void onStart() {\n super.onStart();\n if (PreferenceManager.getDefaultSharedPreferences(this.f3712b).getBoolean(\"FirstBootVersionUp2\", false)) {\n Intent intent = new Intent(this.f3712b, GuidanceMenuActivity.class);\n intent.putExtra(\"Reconnect\", false);\n startActivity(intent);\n } else {\n startActivity(new Intent(this.f3712b, TermsAgreementActivity.class));\n }\n finish();\n }", "@Override\n\tpublic void autonomousInit() {\n\t}", "public void ligar() {\n\t\t\n\t\ttry {\n\t\t\tthis.sistemaOperacional.iniciarSistema();\n\t\t} catch(Exception e) {\n\t\t\tSystem.out.println(\"Nao foi possivel iniciar o sistema:\");\n\t\t\tSystem.out.println(\"\\t\" + e.getMessage());\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(1);\n\t\t}\n\t}", "void onDefaultInstallmentSet();", "protected void initSDK() {\n\t\tSMSSDK.initSDK(this,\"672e0e8c7203\",\"c3728cc22e8e1d75501de2a100b4586c\");\n\t\tEventHandler eventHandler = new EventHandler() {\n\t\t\tpublic void afterEvent(int event, int result, Object data) {\n\t\t\t\tMessage msg = new Message();\n\t\t\t\tmsg.arg1 = event;\n\t\t\t\tmsg.arg2 = result;\n\t\t\t\tmsg.obj = data;\n\t\t\t\thandler.sendMessage(msg);\n\t\t\t}\n\t\t};\n\t\n\t\tSMSSDK.registerEventHandler(eventHandler);\n\t\tready=true;\n\t}", "public void libraryLoaded();", "@Override public void init() {\n drive = MecanumDrive.standard(hardwareMap); // Comment this line if you, for some reason, don't need to use the drive motors\n\n // Uncomment the next three lines if you need to use the gyroscope\n // gyro = IMUGyro.standard(hardwareMap);\n // gyro.initialize();\n // gyro.calibrate();\n\n // Uncomment the next two lines if you need to use the vision system\n // vision = new Vision(hardwareMap);\n // vision.init();\n\n // Uncomment the next line if you have a servo\n // myServo = hardwareMap.get(Servo.class, \"myServo\");\n\n /** Place any code that should run when INIT is pressed here. **/\n }", "protected void onOSGiConnected() {\n osgiNotified = true;\n }", "public void start() {\n\t\tinitializeComponents();\r\n\r\n\t\tint userChoice;\r\n\r\n\t\tdo {\r\n\t\t\t// Display start menu\r\n\t\t\tview.displayMainMenu();\r\n\r\n\t\t\t// Get users choice\r\n\t\t\tuserChoice = view.requestUserChoice();\r\n\r\n\t\t\t// Run the respective service\r\n\t\t\tswitch (userChoice) {\r\n\t\t\t\tcase 1:\r\n\t\t\t\t\tservice.register();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 2:\r\n\t\t\t\t\tservice.login();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 3:\r\n\t\t\t\t\tservice.forgotPassword();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 4:\r\n\t\t\t\t\tservice.logout();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 5:\r\n\t\t\t\t\tservice.displayAllUserInfo(); // Secret method\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tSystem.out.println(\"Invalid choice\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} while (userChoice != 4);\r\n\t}", "@Override\n protected void appStart() {\n }", "public void notifyStartup();", "public void startScreen()\n {\n onSales = false;\n \n numItemsAdded = 0; \n Menu guiMenu = new Menu(\"File\", \"NewSale\\nClose\\nExit\", 24, Color.BLACK, Color.WHITE, Color.BLACK,Color.WHITE, new FileCommands());\n clearScreen();\n addObject(guiMenu, 200, 50);\n }", "private final void doSetup() {\r\n \tsetEnvironmentVariables();\r\n \t\r\n \tcreateAppWindows();\r\n \t\r\n \tcreateAppPages();\r\n\r\n \t//Set the default resource bundle. This necessary even for non-L10N tests, because even they\r\n \t// need to call localizeFieldLocators()\r\n\t\tsetResourceBundle(DDConstants.DEFAULT_L10N_BUNDLE);\r\n\t\t\r\n\t\t//MUST be called after super.setup!!!\r\n \t//NOTE that ddUser is the equivalent of a user that is found in the setup screen.\r\n \t// The user that logs in to the app is known as the auto user. Until we figure out\r\n \t// whether that model applies, don't call this.\r\n \t//setDDUser();\r\n }", "void startScript() {\n\n\t\tif (UIHANDLER_WS_NAME.equalsIgnoreCase((String) core.readDataPool(\n\t\t\t\tDP_ACTUAL_UIHANDLER, preferences.getString(\n\t\t\t\t\t\tPropName_UIHander, UIHANDLER_WS_NAME)))) {\n\n\t\t\t// startButtonLabel.setIcon(resourceMap.getIcon(\"startButtonLabel.icon\"));\n\t\t\tcore.getSystemIF().openBrowser();\n\t\t} else {\n\t\t\tArchive ActiveArchive = (Archive) mSourceSpinner.getSelectedItem();\n\t\t\tif (ActiveArchive == null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tpreferences\n\t\t\t\t\t.edit()\n\t\t\t\t\t.putString(PropName_ScriptName,\n\t\t\t\t\t\t\tActiveArchive.getFileName()).commit();\n\t\t\tcore.writeDataPool(DP_ACTIVE_ARCHIVE, ActiveArchive);\n\t\t\tcore.startScriptArchive(ActiveArchive);\n\n\t\t\t// ----------------------------------------------------------\n\t\t\t// prepare the \"load Script\" message\n\t\t\tDiagnose.showDialog = true;\n\t\t\t// the following trick avoids a recreation of the Diagnose\n\t\t\t// TapActivity as long as the previous created one is still\n\t\t\t// in memory\n\t\t\tIntent i = new Intent();\n\t\t\ti.setClass(MainActivity.this, DiagnoseTab.class);\n\t\t\ti.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);\n\t\t\tstartActivity(i);\n\n\t\t}\n\n\t}", "@Override protected void startup() {\n show(new MIDLetParamsView(this));\n }", "protected void initialize() {\n\t\t// set the target for the PID subsystem\n\t\tRobot.minipidSubsystem.setSetpoint(90);\n\n\t\t// set the minimum and maximum output limits for the PID subsystem\n\t\tRobot.minipidSubsystem.setOutputLimits(-80, 80);\n\n\t\t// Disable safety checks on drive subsystem\n\t\tRobot.driveSubsystem.robotDrive.setSafetyEnabled(false);\n\t\t\n\t\tRobot.camera.setBrightness(0);\n\n\t}", "public void start() {\n\t\tFile splashFile = new File(\"Splash\", \"title\");\r\n\t\tsplashString = TextFileReader.getContents(splashFile);\r\n\t\tsendOutput(splashString);\r\n\t\tsendOutput(\"Version \" + versionNum);\r\n\t\tsendOutput(\"by \" + author);\r\n\t\tprintMenu();\r\n\t}", "@Override\n\tpublic void autonomousInit() {\n\t\tif (autonomousCommand != null)\n\t\t\tlowGearCommand.start();\n\t\tautonomousCommand.start();\n\t}", "@Override\n protected void startUp() {\n }", "public void start(){\n dbConnector = new DBConnector();\n tables = new HashSet<String>();\n tables.add(ALGORITHMS_TABLE);\n tables.add(DATA_STRUCTURES_TABLE);\n tables.add(SOFTWARE_DESIGN_TABLE);\n tables.add(USER_TABLE);\n }", "@Override\n public void initZygote(StartupParam startupParam) {\n if (Utils.isNotSamsungRom()) {\n XposedBridge.log(\"FFK: com.samsung.device.jar or com.samsung.device.lite.jar not found!\");\n }\n\n getModuleSharedPreferences();\n }", "public void startApplication() {\n\t\tgameView = new GameGUI(this);\n\t\t\n\t\t/*\n\t\t * Create bonus GUI now.\n\t\t * TODO: Use swing worker thread to create bonus GUI\n\t\t * \t\t that way if GUI had more bells and whistles to it\n\t\t * \t\t the bonus GUI creation wouldn't take up processing time\n\t\t * \t\t on the main thread.\n\t\t */\n\t\tcreateBonusGUI();\n\t\t\n\t\t//GUI created and ready to show to the user\n\t\tgameView.allowVisibility();\n\t\tGameSounds.startBackgroundMusic();\n\t}", "public void onStart() {\n super.onStart();\n getStockVerification();\n }", "private void start() {\n\n\t}", "public static void proManMain(){\n\n //Displaying the menu options by using the system out method\n System.out.println(\"1 - Create a new Project Manager Profile\");\n System.out.println(\"2 - Search for Project Manager Profile\\n\");\n\n System.out.println(\"0 - Continue\");\n }", "public synchronized void startup() {\n\n if (mThread == null) {\n mThread = new CounterThread();\n new Thread(mThread).start();\n }\n Log.d(TAG, \"startup\");\n }", "public void onStart(){ \r\n\t\t//ensure bluetooth is enabled \r\n\t\tensureBluetoothIsEnabled();\r\n\t\tsuper.onStart(); \t\r\n\t}" ]
[ "0.65996957", "0.63126725", "0.61934173", "0.61700916", "0.6146069", "0.6130279", "0.60836923", "0.605541", "0.6030838", "0.6014014", "0.6005894", "0.6005894", "0.599538", "0.5987402", "0.59820855", "0.5976596", "0.59685653", "0.595503", "0.59293497", "0.5910331", "0.5910331", "0.59030265", "0.58941424", "0.58941424", "0.58941424", "0.58941424", "0.58941424", "0.587987", "0.5876392", "0.58354044", "0.58324695", "0.58211535", "0.58079684", "0.5804839", "0.5803277", "0.5803277", "0.5803277", "0.5787016", "0.57866544", "0.5785351", "0.57805985", "0.5768341", "0.5768341", "0.57418835", "0.5738736", "0.57292116", "0.57265675", "0.56916386", "0.56784093", "0.56693375", "0.56693375", "0.5668775", "0.5667752", "0.56541777", "0.56239885", "0.5621919", "0.5615324", "0.56143445", "0.5609253", "0.56089973", "0.5608406", "0.56065845", "0.5597809", "0.5594247", "0.55907303", "0.55907303", "0.5588765", "0.558808", "0.5585051", "0.5568533", "0.5560565", "0.5556092", "0.55536324", "0.5552631", "0.55514455", "0.55440503", "0.5532384", "0.5532298", "0.55301297", "0.55214304", "0.5519889", "0.55182534", "0.5510969", "0.55076045", "0.55072457", "0.5501735", "0.5495716", "0.549568", "0.54953974", "0.5494185", "0.5493183", "0.54874015", "0.54863244", "0.5484499", "0.5482668", "0.54817694", "0.5475379", "0.5473052", "0.54702663", "0.5469202", "0.54668367" ]
0.0
-1
/Get user input. Ensure user input is an integer value
private static int getIntegerInput() { Scanner integer_input = new Scanner(System.in); boolean valid_inputType = false; int menu_option = -1; /*Repeatedly asks user to enter input until user enters an integer value as input*/ while(!valid_inputType){ try{ menu_option = integer_input.nextInt(); //get menu option to execute valid_inputType = true; } catch(Exception e){ System.out.println("ERROR! Invalid Input Type: Input must be a number"); System.out.println("Re-enter input: "); integer_input = new Scanner(System.in); //clears value previously in integer_input so that user can enter a new value into menu_option. } } return menu_option; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static int validateInput() {\n Scanner genericInt = new Scanner(System.in);\n int number = 0;\n if (genericInt.hasNextInt()) {\n number = genericInt.nextInt();\n return number;\n }\n else {\n validateInput();\n }\n return number;\n }", "private int getUserInput() {\n java.util.Scanner scanner = new java.util.Scanner(System.in);\n int input = scanner.nextInt();\n while(input < 1 || input > 3) {\n System.out.println(\"only enter 1 2 or 3.\");\n input = scanner.nextInt();\n }\n return input;\n }", "private static int getIntFromUser(String prompt)\n\t {\n\t System.out.print(prompt); // Prompt user to enter input value\n\t return input.nextInt(); // Read and return user's response\n\t }", "public static int userInput() {\n\n\t\tScanner myscanner = new Scanner(System.in);\n\t\tSystem.out.println(\"Enter Number\");\n\t\tint userinput = 0;\n\n\t\t// validation to accept only numbers\n\t\ttry {\n\t\t\tuserinput = myscanner.nextInt();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Please enter only numbers\");\n\t\t}\n\n\t\treturn userinput;\n\n\t}", "public int userInputInteger() {\n Scanner scanner = new Scanner(System.in);\n int userInputInteger;\n try {\n userInputInteger = Integer.parseInt(scanner.nextLine());\n } catch (NumberFormatException e) {\n System.out.print(\"Please input a valid Integer number: \");\n return userInputInteger();\n } finally {\n System.out.print(\"\");\n }\n return userInputInteger;\n }", "public static int queryMenuInput(){\n System.out.println(queryMenu);\n String input = sc.nextLine();\n String[] valid = {\"1\",\"2\",\"3\",\"4\"};\n if(Arrays.asList(valid).contains(input)){\n return Integer.parseInt(input);\n } else {\n return -1;\n }\n }", "int getNumericalUserInput() {\n String input = userInput.next();\n int i = -1; //holds converted input\n boolean success = false;\n\n while (!success) {\n if (input.toLowerCase().equals(\"c\")) {\n i = -1;\n success = true;\n } else {\n try {\n i = Integer.parseInt(input);\n success = true;\n } catch (NumberFormatException e) {\n System.out.println(\"Invalid entry.\");\n break;\n }\n }\n }\n return i;\n }", "public static int integerValidation() {\n\t\tboolean flag = true;\n\t\tint input = 0;\n\t\tString temp = \"\";\n\t\twhile (flag) {\n\t\t\ttry {\n\t\t\t\ttemp = in.nextLine().trim();\n\t\t\t\tinput = Integer.parseInt(temp);\n\t\t\t\tflag = false;\n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.out.println(\"Please Enter a valid input\");\n\t\t\t}\n\t\t}\n\t\treturn input;\n\t}", "public int user_integer() {\n Scanner input = new Scanner(System.in);\n boolean conditional = true;\n while (conditional) {\n boolean condition = input.hasNextInt();\n if (condition) {\n int user_input = input.nextInt();\n conditional = false; \n return user_input; \n }\n else {\n System.out.println(\"Invalid Input!\");\n conditional = true;\n input.next();\n }\n }\n return 0;\n }", "private static int IntInput(){\n\t\tScanner input = new Scanner(System.in); \n\t\t// set the interger Value to less then the threshold minimum (-1)\n\t\tint Value = -1 ;\n\t\twhile (Value < 0){\n\t\t\tValue = input.nextInt();\n\t\t\tif (Value < 0){\n\t\t\t\tSystem.out.printf(\"The number must be greater than or equal to to 0 \\nPlease enter a different value: \");\n\t\t\t}\n\t\t\telse{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn Value;\n\t}", "public static int mainMenuInput(){\n System.out.println(mainMenu);\n String input = sc.nextLine();\n String[] valid = {\"1\",\"2\",\"3\"};\n if(Arrays.asList(valid).contains(input)){\n return Integer.parseInt(input);\n } else {\n return -1;\n }\n }", "public static int getUserInput(){\r\n String input;\r\n Integer selection;\r\n while(true){\r\n try {\r\n input = JOptionPane.showInputDialog(null, \"Please enter the desired side size or press cancel for default size,\\n\"\r\n + \"you should enter a valid integer between 3 and 100.\");\r\n if (input == null) {\r\n selection = DEFAULT_SIZE;\r\n }\r\n else {\r\n selection = Integer.parseInt(input);\r\n if (selection > UPPER_BOUND) selection = UPPER_BOUND;\r\n else if (selection < LOWER_BOUND) selection = LOWER_BOUND;\r\n }\r\n break;\r\n }\r\n catch (NumberFormatException e){\r\n continue;\r\n }\r\n }\r\n return selection;\r\n \r\n }", "private static int getInt()\n\t{\n\t\tScanner kb;\n\t\tint Val;\n\t\tkb = new Scanner(System.in);\n\t\tSystem.out.println();\n\t\tSystem.out.print(\"Please enter a VALID POSITIVE INTEGER: \");\n\t\t\n\t\twhile (!kb.hasNextInt())\n\t\t{\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println(\"Your options are clearly stated. Your failure is disapointing!\");\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.print(\"Please enter a VALID POSITIVE INTEGER this time: \");\n\t\t\tkb = new Scanner(System.in);\n\t\t}\n\t\t\n\t\tVal = kb.nextInt();\n\t\t\n\t\twhile (Val < 0)\n\t\t{\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println(\"Fail. Try harder!\");\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.print(\"Please enter a VALID POSITIVE INTEGER: \");\n\t\t\t\n\t\t\twhile (!kb.hasNextInt())\n\t\t\t{\n\t\t\t\tSystem.out.println();\n\t\t\t\tSystem.out.println(\"Your options are clearly stated. Your failure is disapointing!\");\n\t\t\t\tSystem.out.println();\n\t\t\t\tSystem.out.print(\"Please enter a VALID POSITIVE INTEGER this time: \");\n\t\t\t\tkb = new Scanner(System.in);\n\t\t\t}\n\t\t\tVal = kb.nextInt();\n\t\t\t\n\n\t\t}\n\t\t\n\t\t\n\t\treturn Val;\n\t\t\n\t}", "public static int inputInteger()\n\t{\n\t\treturn(sc.nextInt());\n\t}", "public static int checkInt() {\n\t\tboolean is_Nb = false; int i = 0;\r\n\t\tdo {\r\n\t\t\ttry {\r\n\t\t\t\ti = Integer.parseInt(scan.nextLine());\r\n\t\t\t\tis_Nb= true;\r\n\t\t\t\tif(i<0) {\r\n\t\t\t\t\tSystem.out.println(\"Enter a positive number\");\r\n\t\t\t\t\tis_Nb = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcatch(NumberFormatException e) {\r\n\t\t\t\tSystem.out.println(\"Enter a number\");\r\n\t\t\t}\r\n\t\t}while(!is_Nb);\r\n\t\treturn i;\r\n\t}", "public static int inputInt(String prompt) {\n String errorMsg = \"Must be a positive integer >= 0\\n\";\n\n int input = -1;\n // keep prompting user until int >= 0 is input\n while (input < 0) {\n // print prompt\n System.out.print(prompt);\n\n // if the user input an int\n if (GolferScoresTree.scanner.hasNextInt()) {\n // scan the user input\n input = GolferScoresTree.scanner.nextInt();\n\n // if the input is < 0, it is invalid\n if (input < 0) {\n // print error message defining a valid value\n System.out.println(errorMsg);\n // loops and prompt user for another input\n }\n }\n // else if the user did not input an int, input is invalid\n else {\n System.out.println(errorMsg);\n }\n }\n\n return input;\n }", "public static int inputInt(String p) {\n String tmp;\n int i = 0;\n\n do {\n System.out.print(p);\n try {\n tmp = in.nextLine();\n if (Integer.parseInt(tmp) == Integer.parseInt(tmp)) {\n i = Integer.parseInt(tmp);\n }\n break;\n } catch (Exception e) {\n System.err.print(\"You must be enter interger number, enter again.\\n\");\n }\n } while (true);\n return i;\n }", "public static Integer getInteger()\n {\n Integer i = 0;\n while(true)\n {\n try\n {\n System.out.print(\"Please enter an integer\");\n i = Integer.parseInt(in.nextLine());\n break;\n }\n catch(Exception e)\n {\n System.out.println(\"Not a valid Integer\");\n }\n }\n return i; \n }", "private static int getIntReply(String prompt) {\n System.out.print(prompt + \": \");\n String input = sc.nextLine();\n if (input.charAt(0) < 48 || input.charAt(0) > 57) {\n System.out.println(\"Invalid input\");\n return -1;\n } else return Integer.parseInt(input);\n }", "private int validateIntegerInput(int input) {\n if (input < 1 ) {\n input = -1;\n }\n return input;\n }", "private static int getN ()\n\t{\n\t int inputInt = 1;\n\t BufferedReader in = new BufferedReader (new InputStreamReader (System.in));\n\t String inStr = new String();\n\n\t try\n\t {\n\t inStr = in.readLine ();\n\t inputInt = Integer.parseInt(inStr);\n\t }\n\t catch (IOException e)\n\t {\n\t System.out.println (\"Could not read input, choosing 1.\");\n\t }\n\t catch (NumberFormatException e)\n\t {\n\t System.out.println (\"Entry must be a number, choosing 1.\");\n\t }\n\n\t return (inputInt);\n\t}", "private Integer askInt(String label){\n try{\n System.out.println(label);\n String input = in.nextLine();\n if (input.isEmpty()){\n return null;\n }\n else {\n return Integer.parseInt(input);\n }\n }\n catch(NumberFormatException e){\n return askInt(label);\n }\n }", "private static int getInt(String prompt) {\n \t\n Scanner input;\n \n int result = 10; // default if there's no input\n \n \n try {\n \n \tinput = new Scanner(System.in);\n \n System.out.println(prompt);\n \n result = input.nextInt(); //take input\n \n //in case user enters something else than int\n } catch (NumberFormatException e) {\n System.out.println(\"Could not convert to int\");\n System.out.println(e.getMessage());\n System.out.println(\"Value has been set to default (10)\");\n \n //other error exception\n } catch (Exception e) {\n System.out.println(\"There was an error with System.in\");\n System.out.println(e.getMessage()); \n System.out.println(\"Value has been set to default (10)\");\n }\n return result;\n }", "private static int getNumberAnswer(){\r\n\t\tint answer=0;\r\n\t\tBoolean isNumber = false ;\r\n\t\tdo {\r\n\t\t\ttry{\r\n\t\t\t\tanswer = Integer.parseInt(input.nextLine());\r\n\t\t\t\tisNumber =true;\r\n\t\t\t}\r\n\t\t\tcatch(NumberFormatException e){\r\n\t\t\t\tSystem.out.println(\"Nope, that's not a number/integer.\");\r\n\t\t\t\tSystem.out.println(\"Provide an integer answer.\");\r\n\t\t\t\tSystem.out.println();\r\n\t\t\t\tisNumber = false;\r\n\t\t\t}\r\n\t\t} while (!isNumber);\r\n\t\treturn answer;\r\n\t}", "private int errorCheckingInt(String display) {\n\n\t\tint tempChoice;\n\t\tScanner input = new Scanner(System.in);\n\n\t\twhile (true) {\n\t\t\tSystem.out.print(\"\\n\" + display);\n\t\t\ttry {\n\t\t\t\ttempChoice = input.nextInt();\n\t\t\t\tif(display.equals(\"Enter number of kids: \")) { //only for kids\n\t\t\t\t\tif(tempChoice < 0)\n\t\t\t\t\t\tthrow new IllegalArgumentException(\"Error input\\n\");\n\t\t\t\t}\n\t\t\t\telse if (tempChoice < 1)\n\t\t\t\t\tthrow new IllegalArgumentException(\"Error input\\n\");\n\t\t\t\tbreak;\n\t\t\t} catch (InputMismatchException e) {\n\t\t\t\tSystem.out.println(\"Error input \\n\");\n\t\t\t\tinput.next();\n\t\t\t} catch (IllegalArgumentException e) {\n\t\t\t\tSystem.out.println(e);\n\t\t\t}\n\t\t}\n\n\t\tinput.nextLine();\n\n\t\treturn tempChoice;\n\t}", "public static int getValidInteger() {\n\n // This keeps looping until integer input is received.\n while (!scnr.hasNextInt()) {\n scnr.nextLine(); // clear the buffer\n System.out.print(\"Please enter an integer! \");\n }\n\n int integerNum = scnr.nextInt();\n scnr.nextLine();\n\n return integerNum;\n }", "boolean isInt(TextField input);", "protected static int easyIn() {\n // ADDITIONAL CHECKS?\n int a;\n debug(\"Please enter your selection: \");\n scanner = new Scanner(System.in);\n\t\ta = scanner.nextInt();\n return a;\n }", "public int getInt(String prompt) {\n do {\n try {\n String item = getToken(prompt);\n Integer num = Integer.valueOf(item);\n return num.intValue();\n }\n catch (NumberFormatException nfe) {\n System.out.println(\"Please input a number \");\n }\n } while (true);\n }", "public int getInt(String prompt) {\n do {\n try {\n String item = getToken(prompt);\n Integer num = Integer.valueOf(item);\n return num.intValue();\n }\n catch (NumberFormatException nfe) {\n System.out.println(\"Please input a number \");\n }\n } while (true);\n }", "public static int readChoice() {\n int input;\n // returns only if a correct value is given.\n do {\n System.out.print(\"Please make your choice: \");\n try { // read the integer, parse it and break.\n input = Integer.parseInt(in.readLine());\n break;\n }catch (Exception e) {\n System.out.println(\"Your input is invalid!\");\n continue;\n }//end try\n }while (true);\n return input;\n }", "protected Integer inputToInt(String input) {\n try {\n return Integer.parseInt(input);\n } catch (NumberFormatException e) {\n System.out.println(\"Please input a number\");\n return inputToInt(getInput());\n }\n }", "public static int getInt(String prompt) {\n Scanner sc = new Scanner(System.in);\n int userInput;\n\n System.out.println(prompt);\n\n try {\n userInput = sc.nextInt();\n sc.close();\n return userInput;\n } catch (InputMismatchException e) {\n return getInt(prompt);\n }\n\n }", "private int takeChangeInput() {\n\t\tSystem.out.println(\"Enter desired change amount\");\n\n\t\tString amount = scan.next();\n\t\twhile (!amount.matches(\"\\\\d+\")) {\n\t\t\tSystem.out.println(\"Invalid input, please try again.\");\n\t\t\tamount = scan.next();\n\t\t}\n\n\t\tint change = Integer.valueOf(amount);\n\n\t\treturn change;\n\t}", "public static int checkInput() {\r\n\t\tint num = 0;\r\n\t\tboolean error = true; // check for error\r\n\r\n\t\tdo {\r\n\t\t\ttry {\r\n\t\t\t\t// input has to be an integer and not negative number\r\n\t\t\t\tnum = input.nextInt();\r\n\t\t\t\tif (num < 0)\r\n\t\t\t\t\tthrow new InputMismatchException();\r\n\t\t\t\terror = false;\r\n\r\n\t\t\t} catch (InputMismatchException e) {\r\n\r\n\t\t\t\tSystem.out.print(\"Wrong input, try again...: \");\r\n\t\t\t\tinput.nextLine();\r\n\t\t\t}\r\n\t\t\t// loop continue while there is an error\r\n\t\t} while (error);\r\n\r\n\t\treturn num;\r\n\t}", "private int getInput()\n {\n int input = 0;\n Scanner scanner = new Scanner(System.in);\n\n try {\n input = scanner.nextInt();\n }\n catch(Exception e) {\n System.out.println(\"Vælg et tal fra menuen.\");\n scanner.nextLine();\n }\n\n return input;\n }", "private int takeCoinInput() {\n\t\tSystem.out.println(\"Enter a denomination\");\n\n\t\tString denomination = scan.next();\n\t\twhile (!denomination.matches(\"\\\\d+\")) {\n\t\t\tSystem.out.println(\"Invalid input, please try again.\");\n\t\t\tdenomination = scan.next();\n\t\t}\n\n\t\tint coin = Integer.valueOf(denomination);\n\n\t\treturn coin;\n\t}", "public int checkValidate() {\n while (true) {\n if (scanner.hasNextInt()) {\n // Get input from user\n int choice = scanner.nextInt();\n scanner.nextLine(); // Remove enter key\n return choice; // Return choice\n } else {\n // Show out error if not an interger number\n System.out.println(\"Your inputted not an integer number!\");\n System.out.print(\"Choice again: \"); // Retype\n scanner.next();\n }\n }\n }", "public static int getInt (String ask)\r\n {\r\n boolean badInput = false;\r\n String input = new String(\"\");\r\n int value = 0;\r\n do {\r\n badInput = false;\r\n input = getString(ask);\r\n try {\r\n value = Integer.parseInt(input);\r\n }\r\n catch(NumberFormatException e){\r\n badInput = true;\r\n }\r\n }while(badInput);\r\n return value;\r\n }", "public static int getInt()\n {\n int num=0;\n while (true)\n {\n Scanner keyboard = new Scanner(System.in);\n try{\n num = keyboard.nextInt();\n return num;\n }\n catch (java.util.InputMismatchException textException)\n {\n System.out.printf(\"result:\");\n }\n }\n }", "private int receiveNumberInput() {\n int number;\n while (true) {\n try {\n String temp = userInput.nextLine();\n number = Integer.parseInt(temp);\n break;\n } catch (NumberFormatException e) {\n System.out.println(\"Invalid Input. Please enter a valid number.\");\n continue;\n }\n\n }\n return number;\n }", "public static int awaitInt(String prefix) {\r\n System.out.print(prefix);\r\n Scanner scanner = new Scanner(System.in);\r\n String inputString = scanner.nextLine().trim().toUpperCase();\r\n\r\n try {\r\n int inputInt = Integer.parseInt(inputString);\r\n return inputInt;\r\n } catch (NumberFormatException e) {\r\n System.out.println(\"Please enter a valid number\");\r\n return awaitInt(prefix);\r\n }\r\n }", "private int intKeyboardInput() {\n\t\tint input = 0;\n\t\tboolean tryAgain = true;\n\t\twhile (tryAgain) {\n\t\t\ttry {\n\t\t\t\tScanner scanner = new Scanner(System.in);\n\t\t\t\tinput = scanner.nextInt();\n\t\t\t\ttryAgain = false;\n\t\t\t} catch (InputMismatchException ime) {\n\t\t\t\tSystem.out.println(\"Invalid input.\");\n\t\t\t}\n\t\t}\n\t\treturn input;\n\t}", "private static Long userInputInt(String message) {\n\t\tLong result = 0L;\n\t\tboolean answer = false;\n\t\twhile (!answer) {\n\t\t\tSystem.out.println(message);\n\t\t\ttry {\n\t\t\t\tresult = scanner.nextLong();\n\t\t\t\tif (result >= 0) {\n\t\t\t\t\tanswer = true;\n\t\t\t\t} else {\n\t\t\t\t\tSystem.err.println(\"Please could you indicate a positive number.\");\n\t\t\t\t}\n\t\t\t} catch (InputMismatchException e) {\n\t\t\t\tSystem.err.println(\"Your answer is not a correct number, please try again.\");\n\t\t\t} finally {\n\t\t\t\tscanner.nextLine();\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}", "public static int getUserOption(){\n\n String numberAsString;\n int userOption;\n java.util.Scanner scanner = new java.util.Scanner(System.in);\n\n listMenuOptions();\n numberAsString = scanner.nextLine();\n userOption = Integer.parseInt(numberAsString); // Convert string to a integer\n while ( ( userOption < 0 )|| (userOption > 4 ) ) { // check if input is valid\n System.out.println(\"You did not enter a valid option. Try again.\");\n listMenuOptions();\n numberAsString = scanner.nextLine();\n userOption = Integer.parseInt(numberAsString); // Convert string to a integer\n }\n return userOption;\n }", "public static int userInput(int maxNum) {\n Scanner scan = new Scanner(System.in);\n int userInput = 0;\n\n // unchecked exception for user input\n do {\n try {\n System.out.println(\"Please input a number between 1 and \" + maxNum);\n userInput = Integer.parseInt(scan.nextLine());\n } catch (NumberFormatException e) {\n System.out.println(\"Not a number. Please try again.\");\n }\n } while (userInput < 1 || userInput > maxNum);\n\n System.out.println(\"You entered \" + userInput + \"\");\n\n return userInput;\n }", "private static int getUserOption () {\n\t\tBufferedReader myReader = new BufferedReader(new InputStreamReader(System.in));\n\n\t\tint input;\n\t\t\n\t\tdo {\n\t\t\tlistMainMenuOptions();\n\n\t\t\ttry {\n\t\t\t\tinput = Integer.parseInt(myReader.readLine());\n\n\t\t\t\tif ((input < 1) || (input>9)) {\n\t\t\t\t\tSystem.out.println(\"Please type in a number between 1-9 according to your choice\");\n\t\t\t\t}\n\n\t\t\t}catch (Exception e) {\n\t\t\t\tSystem.out.println(\"Character invalid. Please enter a number from 1-9 according to your choice\");\n\t\t\t\tinput = 0;\n\t\t\t}\n\t\t\t\n\t\t}while ((input < 1) || (input>9));\n\n\t\treturn input;\n\t\t\n\t}", "private int getValidInput(Set<Integer> validInputs) throws IOException{\n\t\tBoolean validInput = false;\n\t\tString input = \"\";\n\t\tint menuNum = -1;\n\t\t//while we don't have a valid input\n\t\twhile (!validInput){\n\t\t\t//get new input\n\t\t\tinput = br.readLine();\n\t\t\t\n\t\t\ttry{\n\t\t\t\tmenuNum = Integer.parseInt(input);\n\t\t\t\t//if the set of valid inputs does not contain the given number, print error message\n\t\t\t\tif (!validInputs.contains(menuNum)) print(\"Invalid Entry. Please provide a valid number.\");\n\t\t\t\t//else stop the loop\n\t\t\t\telse validInput = true;\n\t\t\t}\n\t\t\t//if the user provided a string value, print an error message\n\t\t\tcatch(NumberFormatException nfe){\n\t\t\t\tprint(\"Invalid entry. Please provide a number input.\");\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn menuNum;\n\t}", "public static int getInput() {\n Scanner in = new Scanner(System.in);\n\n return in.nextInt();\n }", "public static Integer scanInt() {\n\t\tboolean is_Nb = false; int i = 0;\r\n\t\tdo {\r\n\t\t\ttry {\r\n\t\t\t\ti = Integer.parseInt(scan.nextLine());\r\n\t\t\t\tis_Nb= true;\r\n\t\t\t}\r\n\t\t\tcatch(NumberFormatException e) {\r\n\t\t\t\tSystem.out.println(\"Enter a number\");\r\n\t\t\t}\r\n\t\t}while(!is_Nb);\r\n\t\treturn i;\r\n\t}", "private static void determineIsPositiveInt() {\n System.out.println(\"Enter a number:\");\r\n Scanner s = new Scanner(System.in);\r\n int i = Integer.parseInt(s.nextLine());\r\n if (i > 0)\r\n System.out.println(\"Positive i\");\r\n else if (i == 0)\r\n System.out.println(\"i=0\");\r\n else\r\n System.out.println(\"Negative i\");\r\n }", "public int getInteger(String prompt) {\r\n\t\tdo {\r\n\t\t\ttry {\r\n\t\t\t\tString item = getToken(prompt);\r\n\t\t\t\tInteger number = Integer.valueOf(item);\r\n\t\t\t\treturn number.intValue();\r\n\t\t\t} catch (NumberFormatException nfe) {\r\n\t\t\t\tSystem.out.println(\"Please input a number.\");\r\n\t\t\t}\r\n\t\t} while (true);\r\n\t}", "public static Integer getInteger(String prompt)\n {\n Integer i = 0;\n while(true)\n {\n try\n {\n System.out.print(prompt + \" \");\n i = Integer.parseInt(in.nextLine());\n break;\n }\n catch(Exception e)\n {\n System.out.println(\"Not a valid Integer\");\n }\n }\n return i; \n }", "public static int getIntInput(Scanner console, int min, int max)\n {\n if (console.hasNextInt())\n {\n int num = console.nextInt();\n console.nextLine();\n if (min <= num && num <= max)\n {\n return num;\n }\n }\n console.nextLine();\n System.out.print(\"Invalid input. Please enter an integer between \" + min + \" and \" + max +\": \");\n return getIntInput(console, min, max);\n }", "public static int readInt(){\n\t\tSystem.out.println();\n\t\tstringInput = readInput();\n\t\ttry{\n\t\t\tintInput = Integer.parseInt(stringInput);\n\t\t}\n\t\tcatch (NumberFormatException ex) {\n\t\t System.err.println(\"Not a valid number: \" + stringInput);\n\t\t}\n\t\treturn intInput; \t\t\n\t}", "public static int promptUserForInt(String prompt){\n Scanner scannerln = new Scanner(System.in);\n System.out.print(prompt);\n return scannerln.nextInt();\n }", "public static int getInt(String prompt) throws Exception {\n if (scanner == null) {\n throw new Exception(\"Input Utility's scanner is not set\");\n }\n String localPrompt = prompt;\n boolean validInput = false;\n int num = 0;\n\n // enter the number\n do {\n if (localPrompt != null) {\n System.out.print(localPrompt);\n }\n try { // If (works)\n num = scanner.nextInt();\n scanner.nextLine();\n validInput = true;\n } catch (InputMismatchException ime) { // else (fails)\n System.out.println(\"That is not an integer.\");\n scanner.nextLine();\n if (localPrompt == null)\n localPrompt = \"Enter an integer: \";\n num = 0;\n }\n } while (!validInput);\n return num;\n }", "private boolean isInteger(String userInput){\n if (userInput.matches(\"[0-9]+\")) {\n return true;\n }\n return false;\n }", "public int getUserIntInput(String question) {\r\n System.out.print(question);\r\n while (!scanner.hasNextInt()) {\r\n scanner.next();\r\n }\r\n int result = scanner.nextInt();\r\n return result;\r\n }", "public static int inputValidInteger(String prompt, int low, int high) {\n\t\tboolean inputCorrect = false;\n\t\tint input = Integer.MIN_VALUE;\n\t\t\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\twhile (!inputCorrect) {\n\t\t\ttry {\n\t\t\t\tSystem.out.print(prompt);\n\t\t\t\tinput = (Integer.parseInt(br.readLine()));\n\t\t\t\tif (input < low || input > high)\n\t\t\t\t\tthrow new Exception();\n\t\t\t\telse\n\t\t\t\t\tinputCorrect = true;\n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.out.println (\"Please enter a positive number between \" + \n\t\t\t\t\t\tlow + \" and \" + high);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn input;\n\t}", "static int promptForNumber() {\n String input;\n int value = -1;\n\n\n while (value == -1) {\n System.out.print(\">\");\n\n if (Menus.reader.hasNext()) {\n input = Menus.reader.nextLine().strip();\n try {\n value = Integer.parseInt(input);\n } catch (NumberFormatException e) {\n value = -1;\n }\n }\n }\n return value;\n }", "public static int f_number_user() {\n Scanner keyboard = new Scanner(System.in);\n System.out.println(\"Input the number\");\n int number = keyboard.nextInt();\n return number;\n }", "private static int coordinateInput() {\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n int coordinate;\n while (true) {\n try {\n String coordinateString;\n coordinateString = reader.readLine();\n if (!coordinateString.matches(\"[-+]?\\\\d+\")) {\n System.out.println(Text.GAME_NUMBER_FORMAT);\n } else {\n coordinate = Integer.parseInt(coordinateString);\n if (coordinate < 0 || coordinate >= Settings.FIELD_SIZE) {\n System.out.println(String.format(Text.GAME_WRONG_NUMBER, Settings.FIELD_SIZE - 1));\n } else {\n break;\n }\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return coordinate;\n }", "public static int CommandLineInput() {\n\t\t\n\t\ttry{\n\t\t\t\n\t\t\tScanner input = new Scanner(System.in);\n\t\t\t\n\t\t\tSystem.out.println(\"Input the number of Philosophers: \");\n\t\t\tString line = input.nextLine();\n\t\t\tinput.close();\n\t\t\t\n\t\t\tint set = Integer.parseInt(line);\t\n\t\t\t\n\t\t\tif(set <= 0){\t\n\t\t\t\tSystem.out.println(set + \" is not a positive decimal integer\");\n\t\t\t\tSystem.out.println(\"Useage: java DiningPhilosophers [\"+DEFAULT_NUMBER_OF_PHILOSOPHERS+\"]\");\n\t\t\t\tSystem.out.println(\" \");\n\t\t\t\tSystem.out.println(\"WARNING: The default \"+ DEFAULT_NUMBER_OF_PHILOSOPHERS+\" philosophers will setting on the table.\");\n\t\t\t\treturn DEFAULT_NUMBER_OF_PHILOSOPHERS;\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"There are \"+set+\" philosophers setting on the table\");\n\t\t\t\tSystem.out.println(\" \");\n\t\t\t\treturn set;\n\t\t\t}\n\t\t\t\n\t\t} catch(NumberFormatException e){\n\t\t\n\t\t\tSystem.out.println(\"WARNING: Illegal input!\");\n\t\t\tSystem.out.println(\"WARNING: The default \"+ DEFAULT_NUMBER_OF_PHILOSOPHERS+\" philosophers will setting on the table.\");\n\t\t\tSystem.out.println(\" \");\n\t\t\treturn DEFAULT_NUMBER_OF_PHILOSOPHERS;\n\t\t\t}\n\t\t}", "public static int checkInt() {\n\n\t{\n\t\tint userInput;\n\t\tboolean validInt = false;\n\t\tuserInput = 0;\n\t\tdo\n\t\t{\n\t\t\t\n\t\t\tScanner sc = new Scanner(System.in);\n\t\t\t\n\t\t\t//checks if the next entered value is an integer\n\t\t\tif (sc.hasNextInt())\n\t\t\t{\n\t\t\t // do-while loop breaks here\n\t\t\t\tuserInput = sc.nextInt();\n\t\t\t\tvalidInt = true;\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\tUserInterface.displayError(\"Input is not an integer. Please enter again\");\n\t\t\t}\n\t\t}while(validInt == false);\n\t\treturn userInput;\n\t}\n\n}", "private int ProcessInstruction(String input) {\n\t\tif (InputFileChecks.isStringInteger(input)) {\n\t\t\tint inputVal = Integer.parseInt(input);\n\t\t\tif (inputVal >=0 && inputVal <= 6) {\n\t\t\t\treturn inputVal;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"Please return a proper input. Input provided: \" + input + \". Please input a from 0-6\");\n\t\treturn -1;\n\t}", "public static int verifica() {\n boolean naoEInt = true;\n int valor = 0;\n while (naoEInt) {\n Scanner leitor = new Scanner(System.in);\n System.out.println(\"=====================\");\n try {\n valor = leitor.nextInt();\n naoEInt = false;\n } catch (Exception e) {\n System.out.println(\"Os dados digitados não são válidos!\");\n }\n }\n return valor;\n }", "public static int readInt(String prompt){\n\t\tSystem.out.print(prompt+\": \");\n\t\tstringInput = readInput();\n\t\ttry{\n\t\t\tintInput = Integer.parseInt(stringInput);\n\t\t}\n\t\tcatch (NumberFormatException ex) {\n\t\t System.err.println(\"Not a valid number: \" + stringInput);\n\t\t}\n\t\treturn intInput; \t\t\n\t}", "public static int getInteger(int min, int max) {\n Scanner scanner = new Scanner(System.in);\n System.out.print(\"Enter a number between 1 and 10: \");\n String userInput = scanner.next();\n int userNum = Integer.parseInt(userInput);\n boolean valid = true;\n\n if (userNum < min || userNum > max) {\n do {\n System.out.print(\"Enter a number between 1 and 10: \");\n userInput = scanner.next();\n userNum = Integer.parseInt(userInput);\n if (userNum < min || userNum > max) {\n valid = false;\n } else {\n valid = true;\n }\n } while (!valid);\n }\n return userNum;\n }", "public static int getNumber(){\r\n\t\tint number=0;\r\n\t\twhile(true){\r\n\t\t\tString value = \"\" + input.next().charAt(0);\r\n\t\t\tif(Character.isDigit(value.charAt(0))){\r\n\t\t\tnumber = Integer.parseInt(value);\r\n\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"Incorrect input! try again.\");\r\n\t\t}\r\n\t\treturn number;\r\n\t}", "public static int input(int grade){\n Scanner myScanner=new Scanner(System.in);\n boolean flag=true;\n while(flag){ \n if(myScanner.hasNextInt()){\n while(flag){\n grade=myScanner.nextInt();\n if(grade>=0&&grade<=100){ \n flag=false;break;}\n else{\n System.out.println(\"ERROR: Please input an integer between 0-100.\");// if input is not in range 0-100, then reinput\n System.out.print(\"Please input again: \");\n flag=true; }}}\n else{\n System.out.println(\"ERROR: Please input an integer.\"); // if input is not an integer, then reinput\n System.out.print(\"Please input again: \");\n myScanner.next();flag=true;}}\n return grade; }", "public Integer getData() {\r\n Scanner cs = new Scanner(System.in);\r\n int data = 0;\r\n while (true) {\r\n try {\r\n data = cs.nextInt();\r\n break;\r\n } catch (InputMismatchException e) {\r\n System.out.println(\"You should insert an Integer\");\r\n cs.next();\r\n }\r\n }\r\n return data;\r\n }", "private int getValidInteger(String msg) {\n\t\twhile (!scan.hasNextInt() || (choice = scan.nextInt()) < 1) {\n\t\t\tSystem.out\n\t\t\t\t\t.print(\"Error ---> Enter Positive Integer Value:\\n\" + msg);\n\t\t\tscan.next();\n\t\t}\n\n\t\treturn choice;\n\t}", "static int checkIfInt(int check)\n {\n Scanner input = new Scanner(System.in);\n String str;\n int temp=0;\n int hold = 0;\n do{\n output(check);\n if(input.hasNextInt())\n {\n temp = input.nextInt();\n if(temp >0)\n {\n break;\n }\n }\n str = input.nextLine();\n if(check != 1)\n {\n count++;\n }\n System.out.println(\"Sorry. That's not a valid input\");\n }while(hold == 0);\n return temp;\n }", "public static int askForInt(String message){\n int value = Integer.parseInt(JOptionPane.showInputDialog(message));\n return value;\n }", "public static int selectionScreensIntInput(int lowerBound,int upperBound){\n System.out.println(\"Enter a number:\");\n int num = 0;\n //while they don't input a valid choice(lower bound-upper bound\n while(num == 0) {\n try {\n int input = getIntegerInput();\n if (input >= lowerBound && input <= upperBound) {\n num = input;\n }else{\n System.out.println(\"That is not a valid number, please try again\\n\" +\n \"Enter a number:\");\n }\n } catch (InputMismatchException e) {\n System.out.println(\"That is not a valid number, please try again\\n\" +\n \"Enter a number:\");\n }\n }\n return num;\n }", "public String user_string() {\n Scanner input = new Scanner(System.in);\n boolean conditional = true;\n while (conditional) {\n boolean condition = input.hasNextInt();\n if (!condition) {\n String user_input = input.nextLine();\n conditional = false; \n return user_input; \n }\n else {\n System.out.println(\"Invalid Input!\");\n conditional = true;\n input.next();\n }\n }\n return \"0\";\n }", "public static int prompt_input1(int mx){\n System.out.print(\"Please select your option: \");\n String choice = in.nextLine(); \n boolean invalid = !U.isInteger(choice);\n int c=-1;\n if(!invalid)c = Integer.parseInt(choice)-1;\n while(invalid||c<0||c>=mx){\n System.out.println(\"Invalid Input.\");\n System.out.printf(\"%s %d %s %d: \",\"Enter your choice between\",1,\"-\",mx);\n choice = in.nextLine(); \n invalid = !U.isInteger(choice);\n if(!invalid)c = Integer.parseInt(choice)-1;\n //System.err.println(\"choice: \"+choice);\n }\n return c;\n }", "private void getInput() {\n\t\tScanner scan = new Scanner(System.in);\r\n\t\tSystem.out.println(\"Enter a number\");\r\n\t\tn=scan.nextInt();\r\n\r\n\t}", "private static String validateInputStr() {\n String str = \"\";\n Scanner genericString = new Scanner(System.in);\n if (!genericString.hasNextInt()) {\n str = genericString.nextLine();\n return str;\n }\n else {\n validateInputStr();\n }\n return str;\n }", "private long validateInput() {\n\t\tdouble[] inputs = getUserInputFromUIControls();\n\t\tif (inputs == null) {\n\t\t\treturn 9;\n\t\t}\n\t\tif (inputs[8] != 0.0) {\n\t\t\treturn (long) inputs[8];\n\t\t}\n\t\tif (inputs[0] > 90.0 || inputs[0] < -90.0) {\n\t\t\treturn 1;\n\t\t}\n\t\tif (inputs[1] > 180.0 || inputs[1] < -180.0) {\n\t\t\treturn 2;\n\t\t}\n\t\t// Year can be any number that can be fit within an integer.\n\t\tif (inputs[2] > Integer.MAX_VALUE || inputs[2] < Integer.MIN_VALUE) {\n\t\t\treturn 3;\n\t\t}\n\t\tif (inputs[3] > 12.0 || inputs[3] < 1.0) {\n\t\t\treturn 4;\n\t\t}\n\t\tif (inputs[4] > 31.0 || inputs[4] < 1.0) {\n\t\t\treturn 5;\n\t\t}\n\t\tif (inputs[5] > 23.0 || inputs[5] < 0.0) {\n\t\t\treturn 6;\n\t\t}\n\t\tif (inputs[6] > 59.0 || inputs[6] < 0.0) {\n\t\t\treturn 7;\n\t\t}\n\t\tif (inputs[7] > 59.0 || inputs[7] < 0.0) {\n\t\t\treturn 8;\n\t\t}\n\t\treturn 0;\n\t}", "private static int userInterface()\n {\n int uinput = 0;\n boolean badInput = true;\n\n System.out.println(\"This program will print a table of x\");\n System.out.println(\"and f(x) for x from 0 to the user\");\n System.out.println(\"inputted integer with f(x) being\");\n System.out.println(\"equal to:\");\n System.out.println(\"x^2 for x < 5\");\n System.out.println(\"x^2 - 3x - 10 for 5 <= x < 10\");\n System.out.println(\"x^2 - 7x - 8 for 10 <= x.\");\n \n Scanner read = new Scanner(System.in);\n System.out.print(\"Enter number of x: \");\n \n while (badInput)\n {\n if (read.hasNextInt())\n {\n uinput = read.nextInt();\n \t \tbadInput = false;\n\n if (uinput <= 0)\n {\n System.out.print(\"Enter a positive integer: \");\n badInput = true;\n }\n }\n else\n {\n \tSystem.out.print(\"Enter a positive integer: \");\n \t \tbadInput = true;\n \t }\n read.nextLine();\n }\n\n return uinput;\n }", "private int getNumber() {\n while (!scanner.hasNextInt()) {\n scanner.nextLine();\n System.out.print(\"Please, Enter a munber : \");\n }\n return scanner.nextInt();\n }", "int promptNumber();", "public static int ReadNum(InputStream input,PrintStream output) {\r\n\t\t//Scanner in = new Scanner(System.in);\r\n\t\tScanner in = new Scanner(new FilterInputStream(input){public void close(){}});\r\n\t\tin.reset();\r\n\t\toutput.println(\"Please provide with a positive intiger.\\nNegative intiger will terminate the loop\");\r\n\t\tint num;\r\n\t\ttry {\r\n\t\t\tnum = Integer.parseInt(in.next()); // To do: Verify user input\r\n\t\t} catch (InputMismatchException e) { // Catch input mismatch Exception\r\n\t\t\toutput.printf(\"Invalid input:\\\"%s\\\" :( . Please provide an integer.\\n\",in.next());\r\n\t\t\tnum = ReadNum(input, output);\r\n\t\t}finally{\r\n\t\t\t//do nothing\r\n\t\t\t//\r\n\t\t}\r\n\t\tin.close();\r\n\t\treturn num;\r\n\t}", "public static int getInt(Scanner sc, String prompt) {\n\t\tint i = 0;\n\t\tboolean isValid = false;\n\t\twhile (isValid == false) {\n\t\t\tSystem.out.print(prompt);\n\t\t\tif (sc.hasNextInt()) {\n\t\t\t\ti = sc.nextInt();\n\t\t\t\tisValid = true;\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"Error! Invalid integer value. Try again.\");\n\t\t\t}\n\t\t\tsc.nextLine(); // discard any other data entered on the line\n\t\t}\n\t\treturn i;\n\t}", "public static int getInt(int min, int max, String prompt) throws Exception {\n if (scanner == null) {\n throw new Exception(\"Input Utility's scanner is not set\");\n }\n String localPrompt = prompt;\n boolean validInput = false;\n int num = 0;\n do {\n if (localPrompt != null) {\n System.out.print(localPrompt);\n }\n try {\n num = scanner.nextInt();\n scanner.nextLine();\n validInput = true;\n } catch (InputMismatchException ime) {\n System.out.println(\"That is not an integer.\");\n scanner.nextLine();\n if (localPrompt == null)\n localPrompt = String.format(\"Enter a integer between %d and %d: \", min, max);\n num = 0;\n }\n if (num < min || num > max) {\n System.out.printf(\"\\nThe number %d is out of range\\n\", num);\n if (localPrompt == null)\n localPrompt = String.format(\"Enter an integer between %d and %d: \", min, max);\n validInput = false;\n }\n } while (!validInput);\n return num;\n }", "public boolean checkInteger(String input, int gridSize)\n {\n Scanner console = new Scanner(System.in);\n boolean error = true;\n boolean value = true;\n int result = 0;\n while(error)\n {\n if(checkInput(input) == true)\n {\n result = Integer.parseInt(input);\n if(result >= 0 && result < gridSize)\n {\n error = false;\n }\n else\n {\n System.out.println(\"Please enter a value between 0 and \"+(gridSize-1));\n value = false;\n error = false;\n }\n }\n else\n {\n System.out.println(\"Wrong Input, please enter correct input\");\n value = false;\n error = false;\n }\n }\n return value;\n }", "public static int promptInt(Scanner console) {\n int num = 0;\n try {\n num = console.nextInt();\n } catch (InputMismatchException e) {\n console.next();\n }\n return num;\n }", "private static void input(Scanner userScn)\n {\n // Prompt\n //System.out.print(\"Degree value of polynomial? (1-4): \");\n Prompt();\n\n // Sanitation logic... .next() should catch all\n if(!userScn.hasNextInt())\n {\n userScn.next();\n Prompt();\n }\n else if((d = userScn.nextInt()) > MaxDegree || d < MinDegree) // super efficient\n {\n Prompt();\n }\n else // exits with valid input\n {\n System.out.println(\"Your polynomial degree is: \" + d);\n }\n }", "private int read()\r\n {\r\n Scanner keyboard = new Scanner(System.in);\r\n System.out.println(\"Enter the number: \");\r\n int i = keyboard.nextInt();\r\n if (i > 999999999){\r\n System.out.println(\"The number you have introduced is too big!\");\r\n i = read();\r\n }\r\n if (i < 0){\r\n System.out.println(\"The number you have introduced is negative!\");\r\n i = read();\r\n }\r\n return i;\r\n }", "private static int getUserAnimalByType() {\n\t\tBufferedReader myReader = new BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\tint input;\n\t\t\n\t\tdo {\n\n\t\t\ttry {\n\t\t\t\tinput = Integer.parseInt(myReader.readLine());\n\t\t\t\t\n\t\t\t\tif ((input < 1) || (input > 6)) {\n\t\t\t\t\tSystem.out.println(\"please type in a number between 1-6.\");\n\t\t\t\t}\n\t\t\t\n\t\t\t}catch (Exception e) {\n\t\t\t\tSystem.out.println(\"Character invalid. Please enter a number between 1-6.\");\n\t\t\t\tinput = 0;\n\t\t\t}\t\n\t\t}while((input < 1) || (input > 6));\n\t\t\n\t\treturn input;\n\t\t\n\t}", "public static int f_number_user(){\n Scanner keyboard=new Scanner(System.in);\r\n int digits;\r\n System.out.println(\"input the entire number \");\r\n digits=keyboard.nextInt();\r\n return digits;\r\n }", "public static int check() {\r\n\t\tint num = 0;\r\n\t\tdo {\r\n\t\t\ttry {\r\n\t\t\t\tnum = input.nextInt();\t\t\t// unos \r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tcatch (Exception e) {\t\t\t\t// hvatanje greske\r\n\t\t\t\tSystem.out.println(\"Pogresan unos, probajte ponovo\");\r\n\t\t\t\tinput.nextLine();\r\n\t\t\t}\r\n\t\t} while (true);\r\n\t\treturn num;\r\n\t}", "public int getChoice(String prompt) {\n System.out.print(prompt);\n try {\n return Integer.valueOf(scanner.nextLine());\n } catch (Exception e) {\n // if user does not enter a valid integer, -1 is returned to indicate invalid input\n return -1;\n }\n }", "private static int getUserOption()\n {\n\t// Reads the users input.\n\tBufferedReader optionReader = new BufferedReader(new InputStreamReader(System.in));\n\n\ttry\n\t {\n\t\treturn(Integer.parseInt(optionReader.readLine()));\n\t }\n\tcatch(Exception ex)\n\t {\n\t\treturn(-1);\n\t }\n }", "private static int getUserChoice() {\n System.out.println(\"Please choose your operation: \");\n return intScanner.nextInt();\n }", "public static int check() {\r\n\t\tint num = 0;\r\n\t\tboolean check = true;\r\n\t\tdo {\r\n\t\t\ttry {\r\n\t\t\t\tnum = input.nextInt();\r\n\t\t\t\tif (num < 0) {\r\n\t\t\t\t\tnum = Math.abs(num);\r\n\t\t\t\t}\r\n\t\t\t\tcheck = false;\r\n\t\t\t}\r\n\t\t\tcatch (Exception e) {\t\t\t\t\t\t// hvatanje greske i ispis da je unos pogresan\r\n\t\t\t\tSystem.out.println(\"You know it's wrong input, try again mate:\");\r\n\t\t\t\tinput.nextLine();\r\n\t\t\t}\r\n\t\t} while (check);\r\n\t\treturn num;\r\n\t}", "public static Integer getIntegerFromDialog(String prompt){\n Integer i = 0;\n while(true)\n {\n try\n {\n i = Integer.parseInt(JOptionPane.showInputDialog(prompt + \" \"));\n break;\n }\n catch(Exception e)\n {\n //System.out.println(\"Not a valid Integer\");\n break;\n }\n }\n return i;\n }", "public int readInt(String prompt);" ]
[ "0.78675014", "0.78086126", "0.74934494", "0.74889153", "0.74702495", "0.7431342", "0.74153817", "0.73740804", "0.7364632", "0.7336809", "0.7328739", "0.7310216", "0.72623986", "0.72375154", "0.7180543", "0.71777785", "0.71756303", "0.7156812", "0.7137302", "0.71129686", "0.7107571", "0.7100491", "0.70929533", "0.70898676", "0.70784456", "0.7065591", "0.70619845", "0.7047629", "0.70465744", "0.70465744", "0.70291495", "0.6998406", "0.69977826", "0.6979697", "0.696954", "0.6963072", "0.6937284", "0.693429", "0.6928129", "0.69197494", "0.69143224", "0.691046", "0.69086957", "0.68949795", "0.68756306", "0.6869801", "0.6848616", "0.6842713", "0.6834683", "0.6831809", "0.6817466", "0.68005013", "0.6787051", "0.67524534", "0.6747826", "0.67458934", "0.67439246", "0.6741742", "0.6741339", "0.67368585", "0.6723057", "0.67074883", "0.6701885", "0.67012256", "0.6688398", "0.66870844", "0.6676445", "0.6676068", "0.6664819", "0.6662068", "0.6646861", "0.66432387", "0.6630233", "0.66272354", "0.6593997", "0.65722626", "0.6571977", "0.6561015", "0.6553767", "0.6526355", "0.65242994", "0.6521663", "0.6518086", "0.6511928", "0.6497572", "0.6496505", "0.6493605", "0.64891464", "0.6485668", "0.6479548", "0.6473861", "0.646619", "0.64567536", "0.64414936", "0.6440159", "0.6438171", "0.6437125", "0.64347076", "0.6428067", "0.64236987" ]
0.76127344
2
Runs a respective method based on user's input.
private static void executeMenuOption(int user_option) throws IOException{ boolean exit = false; while(!exit){ switch(user_option){ case 1: System.out.println(); addNewBook(); break; case 2: System.out.println(); checkoutBook(); break; case 3: System.out.println(); returnBook(); break; case 4: System.out.println(); queryBook(); break; case 5: System.out.println(); printFinedStudents(); break; default: System.out.println(); saveChanges(); //Overwrite the students.txt and books.txt files with the content of the ALL_STUDENTS and ALL_BOOKS data structures respectively exit = true; //exit program break; } if(!exit){ //if user has not exited the program, then display the main menu again and get user's input for the menu option System.out.println(); displayMainMenu(); user_option = getIntegerInput(); //get menu option to execute } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void method(int choice) {\n switch(choice) {\n case 1:\n method1();\n break;\n case 2:\n method2();\n break;\n default:\n System.out.println(\"Choice not available. Default choice:\");\n method1();\n\n }\n }", "void run(AnswerType parameter);", "abstract protected String performAction(String input);", "public static void main(String[] args) {\n Scanner userInput = new Scanner(System.in);\n\n //Program waiting for an input.\n System.out.println(\"Type a word and lets see if it's an abecedarian: \");\n String word = userInput.next();\n\n //Invokes method.\n if (isAbecedarian(word)) {\n System.out.println(\"The word is abecedarian!\");\n }else {\n System.out.println(\"The word is not abecedarian!\");\n }\n\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(\"What task: \");\r\n\t\tint option = scan.nextInt();\r\n\t\tswitch (option) {\r\n\t\tcase 1:\r\n\t\t\tpositionalNumbers();\r\n\t\t\tbreak;\r\n\t\tcase 2:\r\n\t\t\tpassword();\r\n\t\t\tbreak;\r\n\t\tcase 3:\r\n\t\t\tmean();\r\n\t\t\tbreak;\r\n\t\tcase 4:\r\n\t\t\tbase();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}", "protected abstract void execute(INPUT input);", "static void perform_call(String passed){\n\t\tint type = type_of_call(passed);\n\t\tswitch(type){\n\t\tcase 1:\n\t\t\tcall_without_condition(passed);\n\t\t\tbreak;\n\t\t}\n\t}", "public abstract void execute(InputCalc input, Calculator calculator);", "public void doIt(Input in);", "public abstract String run(String args);", "public static void main(String[] args) {\n\t\tMagicCalculator magic = new MagicCalculator();\n\t\t\n\t\tScanner input = new Scanner(System.in);\n\t\tSystem.out.println(\"Pick a number\");\n\t\tint number = Integer.parseInt(input.nextLine());\n\t\tSystem.out.println(\"Pick another number\");\n\t\tint number2 = Integer.parseInt(input.nextLine());\n\t\tinput.close();\n\t\t\n\t\t//Uses classes inherited from parent class Calculator\n\t\tmagic.Add(number, number2);\n\t\tmagic.Subtract(number, number2);\n\t\tmagic.Multiplication(number, number2);\n\t\tmagic.Division(number, number2);\n\t\t\n\t\tmagic.SquareRoot(number);\n\t\tmagic.SquareRoot(number2);\n\t\t\n\t\t//Uses its own classes\n\t\tmagic.FindSine(number, number2);\n\t\tmagic.FindCosine(number, number2);\n\t\tmagic.FindTangent(number, number2);\n\t\t\n\t\tmagic.FindFactorial(number);\n\t\t//magic.FindFactorial(number2);\n\t\t\n\t\t\n\t}", "@Override\n\tpublic void run()\n\t{\n\t\tswitch (ubiToolType)\n\t\t{\n\t\tcase PUNKT:\n\t\t\tdoPoint();\n\t\t\tbreak;\n\t\tcase KREIS:\n\t\t\tdoCircle();\n\t\t\tbreak;\n\t\tcase LINIE:\n\t\t\tdoLine();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t}", "private static void command() {\n Scanner reader = new Scanner(System.in);\n System.out.print(\"Write action (buy, fill, take):\\n> \");\n String input = reader.next();\n\n switch (input) {\n case \"buy\" :\n buy();\n break;\n case \"fill\" :\n fill();\n break;\n case \"take\" :\n take();\n break;\n default:\n System.out.println(\"not accepted command\");\n }\n }", "public void doOperations(){\n try {\n UtilityMethods.print(\"Let's create some mammals.! Please choose the mammal to create.\\n1. Labrador\\n2. Golden Retriver\\n3. Bat\");\n Scanner reader = new Scanner(System.in);\n String text = reader.nextLine();\n switch (text) {\n case \"1\":\n UtilityMethods.print(\"You can call him \" + createLabrador().getName());\n break;\n case \"2\":\n UtilityMethods.print(\"You can call him \" + createGolderRetriver().getName());\n break;\n case \"3\":\n UtilityMethods.print(\"You can call him \" + createBat().getName());\n break;\n default:\n break;\n }\n reader.close();\n } catch (Exception e) {\n UtilityMethods.print(e.getMessage());\n }\n }", "public static void userSelection(){\n\t\tint selection;\n\t\tScanner input = new Scanner(System.in);\n\t\tSystem.out.println(\"Which program would you like to run?\");\n\t\tselection=input.nextInt();\n\n\t\tif(selection == 1)\n\t\t\tmazeUnion();\n\t\tif(selection == 2)\n\t\t\tunionPathCompression();\n\t\tif(selection == 3)\n\t\t\tmazeHeight();\n\t\tif(selection == 4)\n\t\t\tmazeSize();\n\t\tif(selection == 5)\n\t\t\tsizePathCompression();\n\t}", "public void execute() {\n\t\ttry {\n\t\t\tMethod method = this.getClass().getMethod(parseMethod(), new Class[0]);\n\t\t\tmethod.invoke(this, new Object[0]);\n\t\t} catch (NoSuchMethodException | SecurityException e) {\n\t\t\tSystem.out.println(\"Unknown option: \" + command);\n\t\t} catch (IllegalAccessException | IllegalArgumentException e) {\n\t\t\tSystem.out.println(\n\t\t\t\t\t\"Invalid usage of: \" + command + \", the following error \" + \"was given: \" + e.getMessage());\n\t\t} catch (InvocationTargetException e) {\n\t\t\tSystem.out.println(\"An error occurred while executing '\" + command + \"'. The \"\n\t\t\t\t\t+ \"following error was given: \" + e.getCause());\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void paymentMethod() {\n try {\n System.out.println(\"You can pay in 4 ways\");\n String[] functions = new String[]{\"Cash\", \"Debit / Credit card\", \"Pay to Attender\", \"Use Premium account\", \"Exit\"};\n for (int i = 0; i < functions.length; i++) {\n System.out.println(i + 1 + \": \" + functions[i]);\n }\n int option1 = scanner.nextInt();\n functionInvoker(option1);\n } catch (Exception e) {\n System.out.println(\"Enter Valid input.\");\n e.printStackTrace();\n }\n }", "void hellsKitchen() {\n location = \"hellsKitchen\";\n System.out.print(\"______________________________________________________________\\n\");\n System.out.println(\"\\n////// HELLS KITCHEN //////\");\n System.out.println(\"\\nYou have entered Hells Kitchen!\");\n System.out.println(\"Hells Kitchen looks dark and gloomy. Dark allys everywhere.\");\n\n System.out.println(\"Please enter [1] if you would like explore | Enter [2] if you would like to go back to base: \");\n userSwings = input.nextInt();\n\n if (userSwings == 1) {\n System.out.print(\"______________________________________________________________\\n\");\n System.out.println(\"\\nYour spider-sense goes off!!\");\n System.out.println(\"You hear sirens, it sounds like a crime!\");\n\n System.out.println(\"Do you wish to help? Enter 'yes' or 'no\");\n String userChoice = input.nextLine();\n userChoice = input.nextLine();\n\n //If user wishes to fight crime, run a crime method within the crime class\n if (userChoice.equals(\"yes\")) {\n c.carHijack();\n avengersTower();\n } else if (userChoice.equals(\"no\")) {\n avengersTower();\n }\n } else if (userSwings == 2) {\n avengersTower();\n } else {\n System.out.println(\"Please enter either 1 or 2!!\");\n hellsKitchen();\n }\n }", "public static void main(String[] args) {\n\n Method();\n Method(10);\n Method(\"Hello\");\n Method(10, 20);\n // Multiple methods can have the same name as long as the number and/or type of parameters are different.\n \n }", "private static void chooseMethod(int choice, Data data) {\n\t\taddToLog(\"user chose option #\" + choice);\n\t\tif (choice == 1) {\n\t\t\tmethodOne(data);\n\t\t} else if (choice == 2) {\n\t\t\tmethodTwo(data);\n\t\t} else if (choice == 3) {\n\t\t\tmethodThree(data);\n\t\t} else {\n\t\t\tSystem.out.println(\"Exiting...\");\n\t\t\taddToLog(\"program ended\");\n\t\t\ttry {\n\t\t\t\tlog.close();\n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.err.println(\"Error closing the Log File\");\n\t\t\t\tSystem.err.println(\"Exiting...\");\n\t\t\t\tSystem.exit(1);\n\t\t\t}\n\t\t\tSystem.exit(0);\n\t\t}\n\t}", "public static void main(String[] args) {\r\n Scanner keyboard = new Scanner(System.in);\r\n byte option;\r\n\r\n f_menu();\r\n\r\n System.out.println(\"Select the kind of figure to calculate:\\n1.Triangle\\n2.Square\\n3.Circle\");\r\n option = keyboard.nextByte();\r\n\r\n while (option<1 || option>3){\r\n System.err.println(\"ERROR, The input must be between 1 and 2\\nRetry:\");\r\n option = keyboard.nextByte();\r\n }\r\n\r\n switch (option){\r\n case 1: f_triangle();\r\n break;\r\n case 2: f_square();\r\n break;\r\n case 3: f_circle();\r\n }\r\n }", "public GamePlay executeStrategy(String method_name, GamePlay game_play) {\n\t\tif (method_name.equalsIgnoreCase(\"REINFORCE\")) {\n\t\t\tthis.strategy.reinforce(game_play);\n\t\t} else if (method_name.equalsIgnoreCase(\"ATTACK\")) {\n\t\t\tthis.strategy.attack(game_play);\n\t\t} else if (method_name.equalsIgnoreCase(\"FORTIFY\")) {\n\t\t\tthis.strategy.fortify(game_play);\n\t\t}\n\n\t\treturn game_play;\n\t}", "public static void main(String[] args) {\n // call directly since we are in same class\n //sayHelloWorld7Times();\n // alternatively call using class name\n MethodPractice.sayHelloWorld7Times();\n\n // you can call static method of other class\n // using className.methodName(...)\n MethodIntro.sayHello();\n calculateMathProblem();\n\n }", "void centralPark() {\n location = \"centralPark\";\n System.out.print(\"______________________________________________________________\\n\");\n System.out.println(\"\\n////// CENTRAL PARK //////\");\n System.out.println(\"\\nYou have entered Central Park!\");\n System.out.println(\"The park is busy, birds are tweeting, families are having picnic's. The trees are low, swinging is not great here!\");\n\n System.out.println(\"Please enter [1] if you would like explore | Enter [2] if you would like to go back to base: \");\n userSwings = input.nextInt();\n\n if (userSwings == 1) {\n System.out.print(\"______________________________________________________________\\n\");\n System.out.println(\"\\nYour spider-sense goes off!!\");\n System.out.println(\"You hear sirens, it sounds like a crime!\");\n\n System.out.println(\"Do you wish to help? Enter 'yes' or 'no\");\n String userChoice = input.nextLine();\n userChoice = input.nextLine();\n\n //If user wishes to fight crime, run a crime method within the crime class\n if (userChoice.equals(\"yes\")) {\n c.burgulary();\n avengersTower();\n } else if (userChoice.equals(\"no\")) {\n avengersTower();\n }\n } else if (userSwings == 2) {\n avengersTower();\n } else {\n System.out.println(\"Please enter either 1 or 2!!\");\n centralPark();\n }\n }", "private void processInput(String command) {\r\n\r\n if (command.equals(\"1\")) {\r\n displayListings();\r\n } else if (command.equals(\"2\")) {\r\n listYourCar();\r\n } else if (command.equals(\"3\")) {\r\n removeYourCar(user);\r\n } else if (command.equals(\"4\")) {\r\n checkIfWon();\r\n } else if (command.equals(\"5\")) {\r\n saveCarListings();\r\n } else if (command.equals(\"6\")) {\r\n exitApp = true;\r\n } else {\r\n System.out.println(\"Invalid selection\");\r\n }\r\n }", "static void processInput(int option){\n\t\t\n\t\tswitch (option){\n\t\t\tcase 1:\t\tlistMovies();\n\t\t\t\t\t\tbreak;\n\t\t\tcase 2:\t\tshowMovieDetails();\n\t\t\t\t\t\tbreak;\n\t\t\tcase 3:\t\taddMovie();\n\t\t\t\t\t\tbreak;\n\t\t\tcase 4:\t\taddExampleSet();\n\t\t\t\t\t\tbreak;\n\t\t\tcase 5:\t\texit();\n\t\t\t\t\t\tbreak;\n\t\t\tdefault: \tSystem.out.println(\"Wrong input\");\n\t\t\t\t\t\tbreak;\n\t\t}\n\t}", "abstract void runRoutine();", "public void executeTask10 () {\n double a = UserInput.input(\"Input a:\");\n double b = UserInput.input(\"Input b:\");\n\n //Methods which take TWO parameters - sides of rectangle and returns perimeter and area:\n double s = RectangleCalculator.calculateArea(a, b);\n double p = RectangleCalculator.calculatePerimeter(a, b);\n\n //Print to the console finaly results:\n Printer.print(\"Square with a = \" + a + \" and b = \" + b + \": \");\n Printer.print(\"S = \" + s);\n Printer.print(\"P = \" + p);\n }", "@Override\n public void functionInvoker(int option1) {\n switch (option1) {\n //Add different functions below\n case 1: {\n System.out.println(\"You paid: Rs \" + bill);\n paymentStatus=true;\n break;\n }\n case 2: {\n if (balance >= bill) {\n System.out.println(\"Rs\" + bill + \" has been deducted from your credit card\");\n amount = balance - bill;\n paymentStatus=true;\n } else {\n System.out.println(\"Your account balance is not sufficient\");\n System.out.println(\"Select Another method of payment\");\n paymentMethod();\n }\n break;\n }\n case 3: {\n System.out.println(\"Rs\" + bill + \" should be paid to our attender\");\n paymentStatus=true;\n break;\n }\n case 4: {\n if (premiumSubscription) {\n if (balance >= bill) {\n System.out.println(\"Rs\" + bill + \" has been deducted from your premium account\");\n amount = balance - bill;\n paymentStatus=true;\n }\n } else {\n System.out.println(\"Your account balance is not sufficient\");\n System.out.println(\"Select Another method of payment\");\n paymentMethod();\n }\n break;\n }\n case 5: {\n System.exit(0);\n break;\n }\n default:\n System.out.println(\"Choose correctly\");\n paymentMethod();\n }\n }", "public abstract void input();", "public static void main(String[] args) {\n\t\tint firstValue = fnInputFirst();\r\n\t\tfnChoice(firstValue);\r\n\t\t//test(args);\r\n\t\t\r\n\t}", "private void run() \n{\n String answer;\t//console answer\n \tboolean error;\t//answer error flag\n \terror = false;\n \tdo {\t\t\t\t\t\t\t//get the right answer\n \t \t//Take user input\n \t \t//System.out.println(\"\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\");\n \t\t\tSystem.out.println(\"Would you like to enter GUI or TIO?\");\n \t\t\tanswer = console.nextLine();\n \t \tif(answer.equals(\"GUI\"))\n \t\t\t{\n \t\t\t\terror = false;\n \t\t\t\tlaunchGUI();\n \t\t\t}else if(answer.equals(\"TIO\"))\n \t\t\t{\n \t\t\t\terror = false;\n \t\t\t\tlaunchTIO();\n \t\t\t}else\n \t\t\t{\n \t\t\t\t//Error: Not correct format\n \t\t\t\terror = true;\n \t\t\t\tSystem.out.println(\"I couldn't understand your answer. Please enter again \\n\");\n \t\t\t}\n \t\t}while (error == true);\n\n}", "public void enterOption(int choice) {\n Method[] methods = playingDevice.getClass().getDeclaredMethods();\r\n methods[choice].setAccessible(true);\r\n try {\r\n if(methods[choice].getGenericParameterTypes().length==0) {\r\n methods[choice].invoke(playingDevice);\r\n } else {\r\n System.out.println(\"Invoke konnte nicht ausgefuehrt werden, da Parameter erwartet werden.\");\r\n }\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n // RANDOM METHODE WÄHLEN\r\n // INVOKE\r\n }", "public void callmetoo(){\r\n\tSystem.out.println(\"This is a concrete method\");\r\n\t}", "void callMethod(String name, Object... args)\n throws ScriptRunnerException;", "public abstract void doCommand(String command);", "private static void instructions()\n {\n System.out.println(\"Input integer on console to invoke method of your choice as follows:\\n\");\n System.out.println( \"0 User's Home Page BY DATE\\n\"\n + \"1 User's Home Page BY USER\\n\"\n + \"2 User's Home Page BY CONVERSATION\\n\"\n + \"3 LeaderBoard MOST SOCIAL\\n\"\n + \"4 LeaderBoard MOST TALKATIVE\\n\"\n + \"5 LeaderBoard LEAST TALKATIVE\\n\"\n + \"-1 To Quit\");\n }", "String userInput(String question);", "public void run(String[] args) throws Exception\n {\n ArgParser parser = new ArgParser(args);\n determineEvalMethod(parser);\n }", "public void parseUserInput(String[] args)\n {\n this.args = args;\n// Class cls = this.getClass();\n Method method;\n String parameter;\n int parameterPrefix = USER_OPTION.length();\n\n for (int parameterIndex=0; parameterIndex<args.length; parameterIndex++)\n {\n // Parse the input to find the corresponding function\n try\n {\n parameter = args[parameterIndex].substring(parameterPrefix);\n method = UserInput.class.getDeclaredMethod(parameter, Integer.class);\n parameterIndex = (int) method.invoke(this, parameterIndex);\n }\n catch (NoSuchMethodException | IllegalAccessException e )\n {\n throw new RuntimeException(\"Unhandled parameter: \" + args[parameterIndex] + \"\\n\" + e);\n }\n catch (InvocationTargetException e)\n {\n// e.printStackTrace();\n throw new RuntimeException(\"Missing or wrong parameters for the option: \" + args[parameterIndex] + \"\\n\" + e);\n }\n }\n }", "void financialDistrict() {\n location = \"financialDistrict\";\n\n System.out.print(\"______________________________________________________________\\n\");\n System.out.println(\"\\n////// FINANCIAL DISTRICT //////\");\n System.out.println(\"\\nYou have entered the Financial District!\");\n System.out.println(\"People are everywhere, traffic is busy. The buildings are high, great for swinging!\");\n\n //Ask user if they want to explore financial district or go back to base\n System.out.println(\"Please enter [1] if you would like explore | Enter [2] if you would like to go back to base: \");\n userSwings = input.nextInt();\n\n if (userSwings == 1) {\n System.out.print(\"______________________________________________________________\\n\");\n System.out.println(\"\\nYour spider-sense goes off!!\");\n System.out.println(\"You hear sirens, it sounds like a crime!\");\n\n System.out.println(\"Do you wish to help? Enter 'yes' or 'no\");\n String userChoice = input.nextLine();\n userChoice = input.nextLine();\n\n //If user wishes to fight crime, run a crime method within the crime class\n if (userChoice.equals(\"yes\")) {\n c.kidnap();\n avengersTower();\n } else if (userChoice.equals(\"no\")) {\n avengersTower();\n }\n } else if (userSwings == 2) {\n avengersTower();\n } else {\n System.out.println(\"Please enter either 1 or 2!!\");\n financialDistrict();\n }\n }", "private void doOperation(String[] separatedInput) {\n\t\tswitch (separatedInput.length) {\n\t\tcase 1 -> {\n\t\t\tswitch (separatedInput[0]) {\n\t\t\tcase \"P\" -> display();\n\t\t\tcase \"C\" -> checkout();\n\t\t\tdefault -> System.out.println(\"Invalid command!\");\n\t\t\t}\n\t\t}\n\t\tcase 4 -> {\n\t\t\tString itemName = separatedInput[1];\n\t\t\tdouble itemPrice = Double.parseDouble(separatedInput[2]);\n\t\t\tboolean itemTaxable = Boolean.parseBoolean(separatedInput[3]);\n\t\t\tGroceryItem itemObj = new GroceryItem(itemName, itemPrice, itemTaxable);\n\t\t\tswitch (separatedInput[0]) {\n\t\t\tcase \"A\" -> add(itemObj, itemName);\n\t\t\tcase \"R\" -> remove(itemObj, itemName, itemPrice);\n\t\t\tdefault -> System.out.println(\"Invalid command!\");\n\t\t\t}\n\t\t}\n\t\tdefault -> System.out.println(\"Invalid command!\");\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tMethods mRef = new Methods();\n\t\tmRef.sayHello(); // Calling a Method or Executing a Method\n\n\t\tmRef.addNums(\"John\",10, 20);\n\t\tmRef.addNums(\"Jennie\",20, 60);\n\t\tmRef.addNums(\"Jack\",30, 70);\n\t\tmRef.addNums(\"Jim\",40, 80);\n\t\t\n\t\t\n\t\tfloat result = mRef.calculateAreaOfCircle(2.2f);\n\t\tSystem.out.println(\"result is \"+result);\n\t\t\n\t\tSystem.out.println(\"----------------\");\n\t\t\n\t\tMethods.sayHelloAgain(); // Calling a Method or Executing a Method\n\t\t\n\t\tSystem.out.println(\"----------------\");\n\t\tMethods.printTable(5);\n\t\tSystem.out.println(\"----------------\");\n\t\tMethods.printTable(17);\n\t}", "public void run(int choice) {\n\t\tswitch(choice) {\n\t\tcase 0:\n\t\t\tthis.startBook();\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\tthis.home();\n\t\t\tbreak;\n\t\t}\n\t}", "public void chooseFunction(){\n\t\t\n\t\tString commands=keyBoard.nextLine();\n\t\t\n\t\tswitch(interp.getFunctionName(commands)){\n\t\t\tcase \"addplayer\":\n\t\t\t\tplayerMgr.addPlayer(interp.getParameter(commands));\n\t\t\t\tbreak;\n\t\t\tcase \"removeplayer\":\n\t\t\t\tif(interp.getParameter(commands)==null){\n\t\t\t\t\tplayerMgr.removePlayer();\n\t\t\t\t}else{\n\t\t\t\t\tplayerMgr.removePlayer(interp.getParameter(commands));\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"editplayer\":\n\t\t\t\tplayerMgr.editPlayer(interp.getParameter(commands));\n\t\t\t\tbreak;\n\t\t\tcase \"resetstats\":\n\t\t\t\tif(interp.getParameter(commands)==null){\n\t\t\t\t\tplayerMgr.resetStats();\n\t\t\t\t}else{\n\t\t\t\t\tplayerMgr.resetStats(interp.getParameter(commands));\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"displayplayer\":\n\t\t\t\tif(interp.getParameter(commands)==null){\n\t\t\t\t\tplayerMgr.displayPlayer();\n\t\t\t\t}else{\n\t\t\t\t\tplayerMgr.displayPlayer(interp.getParameter(commands));\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"rankings\":\n\t\t\t\tplayerMgr.displayRanking();\n\t\t\t\tbreak;\n\t\t\tcase \"playgame\":\n\t\t\t\tplayerMgr.assignPlayerToGM(interp.getParameter(commands),gameMgr);\n\t\t\t\tgameMgr.playGame();\n\t\t\t\tbreak;\n\t\t\tcase \"exit\":\n\t\t\t\tSystem.out.println();\n\t\t\t\tSystem.exit(0);\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t}", "private void voteCommand(){\n out.println(\"\\r\\nEnter stock and vote (e.g. A1 for YES, B0 for NO). Enter 'X' to exit.\");\n String voteInput = in.nextLine();\n\n switch(voteInput.toUpperCase()){\n case \"A1\":castVote(game.apple, 1);\n break;\n case \"A0\":castVote(game.apple, 0);\n break;\n case \"B1\":castVote(game.bp, 1);\n break;\n case \"B0\":castVote(game.bp, 0);\n break;\n case \"C1\":castVote(game.cisco, 1);\n break;\n case \"C0\":castVote(game.cisco, 0);\n break;\n case \"D1\":castVote(game.dell, 1);\n break;\n case \"D0\":castVote(game.dell, 0);\n break;\n case \"E1\":castVote(game.ericsson, 1);\n break;\n case \"E0\":castVote(game.ericsson, 0);\n break;\n case \"X\":command();\n break;\n default:\n out.println(\"Invalid input: Please enter a stock (e.g. A) and a vote (0 or 1)\" + \"\\r\\n\");\n voteCommand();\n break;\n }\n\n }", "public static void main(String[] args) {\n\t\tInvoker invoker=new Invoker();\n\t\tSystem.out.println(\"请选择米家模式:\\n 1.离家模式\\n 2.回家模式\\n 0.退出\");\n\t\tScanner console = new Scanner(System.in);\n\t\tString input = console.next();\n\t\tswitch(input) {\n\t\tcase \"1\":LeaveHome(invoker);\n\t\t break;\n\t\tcase \"2\":BackHome(invoker);\n\t\t break;\n\t\tcase \"3\":break;\n\t\t}\n\t\t\n\t}", "public void run() \n\t\t{\n\t\t\tboolean exitMenu = false;\n\t\t\tdo \n\t\t\t{\t\t\t\t\t\n\t\t\t\tmenu.display();\n\t\t\t\tint choice = menu.getUserSelection();\n\t\t\t\t// the above method call will return 0 if the user did not\n\t\t\t\t// entered a valid selection in the opportunities given...\n\t\t\t\t// Otherwise, it is valid...\n\t\t\t\tif (choice == 0)\n\t\t\t\t{\n\t\t\t\t\t// here the user can be informed that fail to enter a\n\t\t\t\t\t// valid input after all the opportunities given....\n\t\t\t\t\t// for the moment, just exit....\n\t\t\t\t\texitMenu = true;\n\t\t\t\t}\n\t\t\t\telse if (choice == 1) \n\t\t\t\t{\n\t\t\t\t\t// here goes your code to initiate action associated to\n\t\t\t\t\t// menu option 1....\n\t\t\t\t\tProjectUtils.operationsOnNumbers();\n\t\t\t\t}\n\t\t\t\telse if (choice == 2)\n\t\t\t\t{\n\t\t\t\t\tProjectUtils.operationsOnStrings();\n\t\t\t\t}\n\t\t\t\telse if (choice == 3) \n\t\t\t\t{\n\t\t\t\t\tProjectUtils.showStatistics();\n\t\t\t\t}\n\t\t\t\telse if (choice == 4)\n\t\t\t\t{\n\t\t\t\t\texitMenu = true; \n\t\t\t\t\tProjectUtils.println(\"Exiting now... \\nGoodbye!\");\n\t\t\t\t}\n\t\t\t} while (!exitMenu);\n\t\t}", "public static void main(String[] args) {\n\t\t\tmeth(args);\r\n\t\t\targument_test:meth(args);\r\n\t}", "public static void main(String[] args){\n\t\treadMenu();\n\t\t//However, Greet cannot be called like that, we have to access it \n\t\t//through an object of the Methods class\n\t\t//Like the below\n\n\t\tMethods newObject = new();\n\t\tnewObject.Greet(\"David\");\n\t\t//It prints to the screen \"Hello David\"\n\n\t\t//Call the Multiply and Add methods..\n\t\tnewObject.Multiply(25, 4);\n\t\t//You should get 100 printed as result of 25 x 4\n\n\t\t//Add method....\n\t\tnewObject.Add(129, 150);\n\n\t\tpublic void Greet(){\n\t\t\tSystem.out.println(\"Hello! Welcome to Subaru.\");\n\t\t}\n\t\t//To call this method...\n\t\tGreet();\n\n\n\t\t//Let's demonstrate our Method overloading herre\n\t\t//using the same newObject created from our Methods Class...\n\n\t\tnewObject.Multiply(2,3,4); // prints 24\n\n\t\tnewObject.Add(12,34,55) // prints the result of adding the 3 numbers\n\n\t\t//If the user supplies floating point / decimal numbers..\n\t\tnewObject.Multiply(2.5, 10.5);\n\t\t//Add\n\t\tnewObject.Add(123.4949, 23333.3838);\n\n\t\t//By this Polymorphic manipulation, we have made our program \n\t\t//smarter in identifying various user-supplied inputs...\n\n\t}", "public void runMenu(String menu){\n ui.printToUser(!played ? \"Hello, would you like to play a game of BattleShip?\" : \"Hello again!, \\nwould you like to play another game of BattleShip?\");\n char choice = ui.getUserAnswer(menu);\n\n switch(choice){\n case 'A':\n try{\n setUpTheGame();\n } catch(UserCancelsException e){\n ui.printToUser(\"Shame you couldn't finish the game, too much of a challenge is it...?\");\n }\n run();\n break;\n case 'B':\n closeProgram();\n break;\n case 'C':\n printHighestScore();\n run();\n break;\n default:\n ui.printToUser(\"Couldn't understand the input, please choose again.\");\n run();\n break;\n }\n }", "void callMethod(Object obj, String name, Object... args)\n throws ScriptRunnerException;", "public synchronized void doStuff(String input) {\n\n\t\tif (input.equalsIgnoreCase(\"refresh\") || input.equalsIgnoreCase(\"\")) {\n\t\t\tgetSquare().refresh();\n\t\t} else if (input.equalsIgnoreCase(\"exit\")) {\n\t\t\tSystem.exit(0);\n\t\t} else if (input.equalsIgnoreCase(\"delete restaurants\")) {\n\t\t\tgetSquare().deleteAllPlaceblesOfType(Restaurant.class);\n\t\t\tSystem.out.println(\"All Restaurants deleted\");\n\t\t} else if (input.equalsIgnoreCase(\"delete hotels\")) {\n\t\t\tgetSquare().deleteAllPlaceblesOfType(Hotel.class);\n\t\t\tSystem.out.println(\"All Hotels deleted\");\n\t\t} else if (input.equalsIgnoreCase(\"delete fences\")) {\n\t\t\tgetSquare().deleteAllPlaceblesOfType(Fence.class);\n\t\t\tSystem.out.println(\"All Fences deleted\");\n\t\t} else if (input.equalsIgnoreCase(\"delete people\")) {\n\t\t\tgetSquare().deleteAllPlaceblesOfType(Person.class);\n\t\t\tSystem.out.println(\"All People deleted\");\n\t\t} else if (input.equalsIgnoreCase(\"clear\")) {\n\t\t\tgetSquare().clear();\n\t\t\tSystem.out.println(\"Square cleared\");\n\t\t} else if (input.startsWith(\"set sleep time to \")) {\n\t\t\ttry {\n\t\t\t\tchar[] sleepTimeStr = new char[input.length() - 18];\n\t\t\t\tinput.getChars(18, input.length(), sleepTimeStr, 0);\n\t\t\t\t\n\t\t\t\tint newSleepTime = Integer.parseInt(String.valueOf(sleepTimeStr));\n\t\t\t\tsetSleepTime(newSleepTime);\n\t\t\t} catch (NumberFormatException e) {\n\t\t\t\tSystem.out.println(\"Invalid input\");\n\t\t\t}\n\t\t}\n\n\t\tdrawer.setPlacebles(square.getPlacebles());\n\t\tdrawer.repaint();\n\n\t}", "public static void processUserInput(String input){\n\t\t\n\t\t\tAlgorithm1 alg1 = new Algorithm1(input, distance, inputMap);\n\t\t\t// Calculates shortest path using distance file for distance metric\n\t\t\t// Prints the path nodes\n\t\t\t// Prints the distance\n\t\t\talg1.getShortestPath();\n\t\t\t\n\t\t\t\n\t\t\tAlgorithm2 alg2 = new Algorithm2(input, distance, inputMap);\n\t\t\t// Calculates shortest path using both input and distance file for distance metric\n\t\t\t// Prints the path nodes\n\t\t\t// Prints the distance\n\t\t\talg2.getShortestPath();\n\t\t\t\n\t\t\t\n\t}", "protected abstract String answer();", "public void run()\n\t {\n\t stdin = new Scanner(System.in);\n\t boolean done = false;\n\t while ( !done )\n\t {\n\t String command = stdin.next();\n\t char ccommand=command.charAt(0);\n\t switch (ccommand) \n\t { \n\t case 'I': add('I');\n\t\t\t break; \n\t case 'O': add('O');\n\t break;\n\t case 'N': add('N');\n\t break;\n\t case 'R': remove();\n\t break;\n\t case 'P': print();\n\t break;\n\t case 'Q': \n\t System.out.println(\"Program terminated\");\n\t done = true;\n\t break;\n\t default: //deal with bad command here \n\t System.out.println(\"Command\"+\"'\"+command+\"'\"+\"not supported!\");\t\t\n\t } \n\t }\n\t }", "public static void main(String[] args) {\n /*if (args.length < 1)\n error(\"No output method given\");\n else if (args.length > 1)\n error(\"Expected 1 argument, received \" + args.length);\n else if (args[0].toLowerCase().equals(\"cli\"))*/\n new CLI().main();\n /*else if (args[0].toLowerCase().equals(\"gui\"))\n new GUI().main();*/\n /*else\n error(args[0] + \" is not a valid argument\");*/\n }", "public static void main(String[] args) {\n\t\t//Scanner for input. Nothing really new here\n\t\tScanner input = new Scanner(System.in);\n\n\t\t//We prompt the user to type in something\n\t\tSystem.out.print(\"Type in a name: \");\n\t\tString name = input.nextLine();\n\n\t\t//Now we use the switch to match our input\n\t\t//Note: You can only switch Strings in\n\t\t//Java 7 and above\n\t\tswitch(name){\n\n\t\tcase \"Tom\": \n\t\t\t//If the user typed in Tom, then \n\t\t\t//this case will be executed. \n\t\t\tSystem.out.println(\"We hate Tom\");\n\t\t\t//break means stop here and leave the switch\n\t\t\tbreak;\n\n\t\tcase \"Jerry\":\n\t\t\t//If the user typed in Jerry, then this\n\t\t\t//case will be executed\n\t\t\tSystem.out.println(\"Jerry mouse is pretty cool\");\n\t\t\tbreak;\n\t\t\t\n\t\t//Default means, if the switch couldn't match\n\t\t//any of the other cases, it should do this.\n\t\tdefault:\n\t\t\tSystem.out.println(\"Sorry Tom & Jerry only\");\n\t\t\t\n\t\t}\n\t}", "public static void main(String[] args)\n\t{\n\t\t\n\t\t\n\t\tSystem.out.println (\"Which Magpie do you want to test? 2, 3 or 4\");\n\t\t\n\t\tScanner in = new Scanner (System.in);\n\t\tString tester = in.nextLine();\n\t\t\n\t\tif (tester.equals(\"2\")) {\n\t\t \t //testMagPie2(); \n\t\t \t }\n\t\t else \n\t\t if (tester.equals(\"3\")) {\n\t\t /// testMagPie3(); \n\t\t }\n\t\t else \n\t\t if (tester.equals(\"4\")) \n\t\t { \n\t\t testMagPie4(); \n\t\t }\n\t\t else System.out.println(\"Sorry you did not follow directions, try again\"); \n\t\t \n\t\t\n\t}", "public void callit();", "protected void execute() {\n \tswitch (auto) {\n \tcase RightRightRight:\n \t\tRightRightRight();\n \t\tbreak;\n \tcase RightRightLeft:\n \t\tRightRightLeft();\n \t\tbreak;\n \tcase RightLeftRight:\n \t\tRightLeftRight();\n \t\tbreak;\n \tcase RightLeftLeft:\n \t\tRightLeftLeft();\n \t\tbreak;\n \tcase LeftRightRight:\n \t\tLeftRightRight();\n \t\tbreak;\n \tcase LeftRightLeft:\n \t\tLeftRightLeft();\n \t\tbreak;\n \tcase LeftLeftRight:\n \t\tLeftLeftRight();\n \t\tbreak;\n\t\tcase LeftLeftLeft:\n\t\t\tLeftLeftLeft();\n\t\t\tbreak;\n\t\t}\n \t\n\t\t//Robot.drivebase.DriveTank(1, 1);\n\t\t//new drivecar(1, 1, 5);\n \t\n }", "private static void runApplication(Scanner scanner) {\n\n System.out.println(\">>---------------------------------------------------------<<\");\n\n friendList.printList(FriendList.head);\n\n System.out.println(\"Type 'add' to add a new friend or 'remove' to remove a existing friend: \");\n System.out.println(\"You can also type 'sort' to sort the friend list alphabetically by last names\");\n\n String option = scanner.nextLine().toLowerCase();\n\n if (option.contentEquals(\"add\")) {\n\n addFriend(scanner);\n\n } else if (option.contentEquals(\"remove\")) {\n\n removeFriend(scanner);\n\n } else if (option.contentEquals(\"sort\")) {\n\n sortList(scanner);\n\n } else {\n\n runApplication(scanner);\n\n }\n }", "public static void main(String[] args) {\n\t\t\n\t\t System.out.println(\"Which operation you want to execute \\n 1.Display Data base.\\n 2.Insert into table \\n 3.Update the values \\n 4.Delete values\");\n \t\t Scanner in1=new Scanner(System.in);\n \t\t int a = in1.nextInt(); \n System.out.println(\"You entered integer \"+a);\n switch (a) {\n \t case 1:\n \t\t display();\n \t\t break;\n case 2:\n \t insert();\n \t break;\n case 3:\n \t update();\n \t break;\n case 4:\n \t remove();\n \t break;\n default:\n \t System.out.println(\"you entered wrong keyword...........\");\n \t }\n \n\t}", "private void method(String name) {\n app.method(name);\n }", "void timeSquare() {\n location = \"timeSquare\";\n System.out.print(\"______________________________________________________________\\n\");\n System.out.println(\"\\n////// TIME SQUARE //////\");\n System.out.println(\"\\nYou have entered Time Square!\");\n System.out.println(\"The billboards are lit, the sun glistens off the bright lights.\");\n\n System.out.println(\"Please enter [1] if you would like explore | Enter [2] if you would like to go back to base: \");\n int userSwings = input.nextInt();\n\n if (userSwings == 1) {\n System.out.print(\"______________________________________________________________\\n\");\n System.out.println(\"\\nYour spider-sense goes off!!\");\n System.out.println(\"You're in the center of time square. The place is covered in red smoke..\");\n System.out.println(\"There is something strange going on..\");\n\n System.out.println(\"\\nWould you like to explore further or go back?\");\n System.out.println(\"Enter [1] to explore | Enter [2] to go back\");\n int userChoice = input.nextInt();\n\n //Run story method in story class\n if (userChoice == 1) {\n s.story();\n } else if (userChoice == 2) {\n timeSquare();\n }\n } else if (userSwings == 2) {\n avengersTower();\n } else {\n System.out.println(\"Please enter either 1 or 2!!\");\n timeSquare();\n }\n }", "public void runProgram()\n\t{\n\t\tintro();\n\t\tfindLength();\n\t\tguessLetter();\n\t\tguessName();\n\t}", "public static void execute(String className) {\r\n\t\tFile clazz = new File(Constants.MAZE_CODE_DIR);\r\n\t\ttry {\r\n\t\t\tURLClassLoader classLoader = URLClassLoader.newInstance(new URL[] {clazz.toURI( )\r\n\t\t\t\t\t.toURL( )});\r\n\t\t\tClass<?> forName = Class.forName(className, true, classLoader);\r\n\t\t\tMethod declaredMethod = forName.getDeclaredMethod(\"algorithm\", new Class[0]); //$NON-NLS-1$\r\n\t\t\tdeclaredMethod.invoke(forName.newInstance( ), new Object[0]);\r\n\t\t}\r\n\t\tcatch (Exception e) {\r\n\t\t\tlogClass.error(\"Error: \" + e.getMessage( ) + Constants.LINE_SEPARATOR, e); //$NON-NLS-1$\r\n\t\t}\r\n\t}", "private void run()\r\n\t{\r\n\t\tboolean programLoop = true;\r\n\t\t\r\n\t\twhile(programLoop)\r\n\t\t{\r\n\t\t\tmenu();\r\n\t\t\tSystem.out.print(\"Selection: \");\r\n\t\t\tString userInput = input.nextLine();\r\n\t\t\t\r\n\t\t\tint validInput = -1;\r\n\t\t\t\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tvalidInput = Integer.parseInt(userInput);\r\n\t\t\t}\r\n\t\t\tcatch(NumberFormatException e)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"Please enter a valid selection.\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tSystem.out.println();\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tswitch(validInput)\r\n\t\t\t{\r\n\t\t\t\tcase 0: forInstructor();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\tcase 1: addSeedURL();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\tcase 2: addConsumer();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\tcase 3: addProducer();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\tcase 4: addKeywordSearch();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\tcase 5: printStats();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t//case 10: debug(); //Not synchronized and will most likely cause a ConcurrentModificationException\r\n\t\t\t\t\t\t //break;\t//if multiple Producer and Consumer Threads are running.\r\n\t\t\t\tdefault: break;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint num = scan.nextInt();\n\t\tresult(num);\n\t}", "public static void main(String[] args) {\n if(args==null||args.length == 0 || args[0] == null)\n {\n notRecognized();\n return;\n }\n else\n {\n if(args[0].equals(\"update\"))\n {\n update();\n return;\n }\n else if(args[0].equals(\"help\")) \n {\n help();\n return;\n }\n else if(args[0].equals(\"access\")&&args.length>=2)\n {\n access(args[1]);\n return;\n }\n else\n {\n notRecognized();\n }\n }\n }", "Object executeMethodCall(String actionName, String inMainParamValue) throws APIException;", "public abstract void call();", "public void takeInput() {\n\t\tboolean flag = true;\n\t\tMain test = new Main();\n\t\twhile(flag) {\n\t\t\tLOGGER.info(\"Enter an option 1.Calculate Simple Interest 2.Calculate Compound Interest 3.exit\");\n\t\t\tint val = sc.nextInt();\n\t\t\tswitch(val) {\n\t\t\tcase 1:\n\t\t\t\ttest.takeInputForSimpleInterest();\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\ttest.takeInputForCompoundInterest();\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tflag = false;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tLOGGER.info(\"Enter valid input\");\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args) {\n\n\t\tStudentLogic stdobj = new StudentLogic();\n\t\tstdobj.userInput();\n\t\tstdobj.display();\n\t}", "public abstract String chooseAnswer();", "public static void main(String[] args){\n //The driver of the methods created above\n //first display homeowork header\n homeworkHeader();\n //calls driver method\n System.out.println(\"Calling driver method:\");\n driver(true);//runs choice driver\n //when prompted for a choice input 9 to see test driver\n System.out.println(\"End calling of driver method\");\n \n }", "public static void main(String[] args) {\n menu();\r\n int num = 0;\r\n try {\r\n Scanner scan = new Scanner(System.in);\r\n num = scan.nextInt();\r\n } catch (InputMismatchException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n switch (num)\r\n {\r\n case 1:\r\n commercial();\r\n break;\r\n case 2:\r\n residential();\r\n case 3:\r\n System.out.println(\"Your session is over\");\r\n default:\r\n System.out.println(\"\");\r\n }\r\n\r\n }", "private boolean processCommand(Command command)//Method was given\n {\n if(command.isUnknown())\n {\n System.out.println(\"I don't know what you mean...\");\n return false;\n }\n\n String commandWord = command.getCommandWord();\n if (commandWord.equals(\"help\"))\n printHelp();\n else if (commandWord.equals(\"go\"))\n goRoom(command);\n else if (commandWord.equals(\"talk\"))\n talkToCharacter(currentRoom);\n else if (commandWord.equals(\"grab\"))\n {\n secondWord = command.getSecondWord();\n if (secondWord == null)\n {\n System.out.println(\"Grab what?\");\n }\n else\n {\n grabItem(secondWord);\n }\n }\n else if (commandWord.equals(\"eat\"))\n {\n secondWord = command.getSecondWord();\n if (secondWord == null)\n {\n System.out.println(\"Eat what?\");\n }\n else\n {\n eatItem(secondWord);\n }\n }\n else if (commandWord.equals(\"inventory\")) \n player.getInventory();\n else if (commandWord.equals(\"drop\"))\n {\n secondWord = command.getSecondWord();\n if (secondWord == null)\n {\n System.out.println(\"Drop what?\");\n }\n else\n {\n dropItem(secondWord);\n }\n }\n else if (commandWord.equals(\"inspect\"))\n {\n secondWord = command.getSecondWord();\n if (secondWord == null)\n {\n System.out.println(\"Inspect what?\");\n }\n else\n {\n inspectItem(secondWord);\n }\n }\n else if (commandWord.equals(\"quit\"))\n {\n if(command.hasSecondWord())\n System.out.println(\"Quit what?\");\n else\n return true; // signal that we want to quit\n }\n else if (commandWord.equals(\"look\"))\n {\n System.out.println(currentRoom.longDescription());\n }\n return false;\n }", "@Override\n public void run() {\n chosenActionUnit.run(getGame(), inputCommands);\n }", "public interface Calculator {\n public int exec(int a, int b);\n}", "public void getCommand() {\n\t\t\n\t\tSystem.out.println(\"Enter a command:\");\n\t\tString Input = reader.nextLine(); //takes the user's input and places it in String Input\n\t\t\n\t\t//in the collection of commands, will run loop once for each item in that collection and \n\t\t//stores the item it is looking in the variable created\n\t\tfor (Commandable command : Commands) { \n\t\t\t\n\t\t\tif (command.matchCommand(Input)) {\n\t\t\t\t\n\t\t\t\tcommand.doCommand();\n\t\t\t\treturn;\t//this ends the method to break out of the loop\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"Command not recognized\");\n\t}", "public abstract void runAlgorithm();", "public static void launch(Scanner userinput) {\n int userint; //initializes the variable before hand so it can be modified to catch exception without compile issues\n userint = userinput.nextInt();//handled to take int for the function poschecker\n methods.poschecker(userint);//function to validate if its positive\n }", "private Object executeMethod(Object target, CallStatement callStatement)\n throws EngineException {\n try {\n CallStatement.CallStatementEntry entry = \n callStatement.getEntries().get(callStatement.getEntries().size() -1);\n Method[] methods = target.getClass().getMethods();\n for (Method method: methods) {\n if (methodsMatch(method,entry)) {\n return method.invoke(target, parameters.toArray(new Object[0]));\n }\n }\n } catch (EngineException ex) {\n throw ex;\n } catch (Exception ex) {\n throw new EngineException(\"Failed to execute the method because : \" \n + ex.getMessage(),ex);\n }\n throw new java.lang.NoSuchMethodError(\n \"No method matching the requirments was found\");\n }", "public void executeTask11 () {\n double r = UserInput.input(\"Input rsdius:\");\n\n //Methods which take one parameter - radius of circle and returns perimeter and lenth:\n double l = CircleCalculator.calculateLength(r);\n double s = CircleCalculator.calculateArea(r);\n\n //Print to the console finaly results:\n Printer.print(\"Circle with r = \" + r + \": \");\n Printer.print(\"L = \" + l);\n Printer.print(\"S = \" + s);\n }", "public static void main(String[] args) \r\n {\r\n // TODO: Read the input from the user and call produceAnswer with an equation\r\n \tScanner in = new Scanner(System.in);\r\n \tString problem = in.nextLine();\r\n \tin.close();\r\n \tSystem.out.printf(\"Result: %s\" , produceAnswer(problem));\r\n }", "public static void main(String[] args) {\n String query,input;\n int numberOfInputs;\n Scanner scan=new Scanner(System.in);\n numberOfInputs=scan.nextInt();\n for(int i=0;i<numberOfInputs;i++){\n query=scan.next();\n if(query.equals(\"add\")){\n input=scan.next();\n add(input);\n }\n if(query.equals(\"find\")){\n input=scan.next();\n find(input);\n }\n }\n\n }", "public static void main(String[] args)\n {\n Scanner sc = new Scanner(System.in);\n System.out.println(\"Enter the first word\");\n String r = sc.next();\n System.out.print(\"Enter the second word\");\n String s = sc.next();\n\n\n System.out.println(decide(r,s));\n }", "void run(String name, int v);", "protected void handleInput(String input) {}", "public void run(){\n\t\t\ttry{\n\t\t\t\twhile(true){\n\t\t\t\t\tScanner keyboard = new Scanner(System.in);\n\t\t\t\t\tString line = keyboard.nextLine();\n\t\t\t\t\tString[] command = line.split(\" \");\n\t\t\t\t\tSystem.out.println(execute(line));\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}catch(Exception ex){\n\t\t\t\tSystem.err.println(\"Incorrect command \\\"help\\\" for info\");\n\t\t\t\tex.printStackTrace();\n\t\t\t\trun();\n\t\t\t}\n\t\t\t\n\t\t}", "public static void main(String[] args) {\n\t\t\n\t\tmethodoverloading mol = new methodoverloading();\n\t\toverriding ovr = new overriding();\n\t\t\n\t\tSystem.out.println(mol.sum(5, 7));\n\t\tSystem.out.println(mol.sum(10, 5, 8));\n\t\tmol.print();\n\t\t\n\t\t\n\t\t\n\t\t\n\n\t}", "@Override\n @SneakyThrows\n public void nextRound() {\n Interpreter interpreter = Zuul.getInstance().getInterpreter();\n /*\n Getting player's input\n */\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n\n interpreter.handleCommand(this, reader.readLine());\n }", "public static void main(String[] args) {\n\t\tchar op;\n\t\tScanner sc = new Scanner(System.in);\n\t\tSystem.out.println(\"Enter two numbers : \");\n\t\tint iNum1 = sc.nextInt();\n\t\tint iNum2 = sc.nextInt();\n\t\t\n\t\tSystem.out.println(\"Enter an operator \");\n\t\top = sc.next().charAt(0);\n\t\t\n\t\tarithmeticOp(iNum1, iNum2, op);\n\n\t}", "K invoke(Map<String, Method> methods, T object);", "public static void main(){\n\t\tint option = getUserOption();\n\t\t/** switch case option start below */\n\t\tswitch (option){\n\t\t\tcase 1 : ToScreen.listEmployee(employee.getAllEmployee(), true); main();\n\t\t\t\tbreak;\n\t\t\tcase 2 : listStaffByCategory();\n\t\t\t\tbreak;\n\t\t\tcase 3 : ToScreen.listAdminStaffTask(employee.getAllAdminStaff(), true);main();\n\t\t\t\tbreak;\n\t\t\tcase 4 : searchStaffByName();\n\t\t\t\tbreak;\n\t\t\tcase 5 : ToScreen.listAnimal(animals.getAllAnimals(), true); main();\n\t\t\t\tbreak;\n\t\t\tcase 6 : ListAnimalByType();\n\t\t\t\tbreak;\n\t\t\tcase 7 : searchAnimalByName();\n\t\t\t\tbreak;\n\t\t\tcase 8 : MenuReception.main();\n\t\t\t\tbreak;\n\t\t\tcase 9 : System.exit(0);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tmain();\n\t\t}\n\t}", "public MatchResult exec(String input) {\n this.input = input;\n return exec();\n }", "public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n System.out.println(\" Please enter a number: \");\n X x = new X(scanner.nextInt());\n x.x();\n\n }", "private void menu(){\n System.out.println(\"\");\n System.out.println(\"Round: \"+round);\n System.out.println(\"Please choose your action: \");\n\n Scanner tokenizer = parser.getCommand(); // prompt the user to put a new command in\n Command command = parser.parseCommand(tokenizer); // send the \"scanner\" result to make it into a command\n processCommand(command); // process the command\n\n }", "void call();", "Object executeMethodCall(ActionType actionType, String actionName, Map<String, Object> inParams) throws APIException;" ]
[ "0.65585214", "0.64937127", "0.64111304", "0.6333231", "0.62972754", "0.6124886", "0.6105442", "0.6097531", "0.60514045", "0.6045504", "0.60434204", "0.6025304", "0.60233784", "0.6022628", "0.6010998", "0.598056", "0.5970565", "0.5966897", "0.5950902", "0.5908966", "0.5854383", "0.5833619", "0.58303535", "0.582293", "0.5797995", "0.5783597", "0.5772068", "0.57482165", "0.5733559", "0.5730419", "0.57252216", "0.57170355", "0.57164663", "0.5703257", "0.5701187", "0.56844014", "0.5676979", "0.566719", "0.5660841", "0.5647605", "0.5620422", "0.5607122", "0.56065995", "0.55979437", "0.5591172", "0.55850357", "0.558167", "0.55777645", "0.5569123", "0.5566902", "0.5555787", "0.5554562", "0.55539083", "0.55475277", "0.55446815", "0.55382735", "0.55122757", "0.55107886", "0.54880786", "0.54862994", "0.5478051", "0.5456745", "0.5455242", "0.54459274", "0.5440871", "0.5439768", "0.543938", "0.5438007", "0.54331166", "0.54320556", "0.542879", "0.54258865", "0.54125667", "0.5409251", "0.540819", "0.5404015", "0.539674", "0.53953695", "0.5392082", "0.5388586", "0.5387073", "0.5385348", "0.5383666", "0.5383249", "0.5378325", "0.53707033", "0.53686875", "0.5364664", "0.5362228", "0.53574336", "0.53473604", "0.5344985", "0.53313583", "0.53300107", "0.53223544", "0.5320914", "0.53208923", "0.53189135", "0.531043", "0.5308901", "0.5308143" ]
0.0
-1
/Overwrite the students.txt and books.txt files with the content of the ALL_STUDENTS and ALL_BOOKS data structures respectively
private static void saveChanges() throws IOException{ writeToStudentsFile(); //copy all the StudentDetails objects in ALL_STUDENTS and write them to the students.txt file writeToBooksFile(); //copy all the BookDetails objects in ALL_BOOKS and write them to the books.txt file System.out.println("All Changes Successfully Saved!"); System.out.println("Thanks for using the Library Management System"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void writeToBooksFile() throws IOException{\n\t\tFileWriter fw = new FileWriter(BOOKS_FILE, false); //overwrites the students.txt file\n\t\tBufferedWriter bw = new BufferedWriter(fw);\n\t\t\n\t\tSet<Integer> keys = ALL_BOOKS.keySet(); //returns list of all keys in ALL_BOOKS\n\t\tfor(int key : keys){\n\t\t\tbw.write(ALL_BOOKS.get(key).ParseForTextFile()); //writes the Parsed Form of the BookDetails object to the books.txt file\n\t\t}\n\t\tbw.close();\n\t}", "private static void writeToStudentsFile() throws IOException{\n\t\tFileWriter fw = new FileWriter(STUDENTS_FILE, false); //overwrites the students.txt file\n\t\tBufferedWriter bw = new BufferedWriter(fw);\n\t\t\n\t\tIterator<StudentDetails> iter = ALL_STUDENTS.listIterator(1); //Get all StudentDetails objects from index 1 of ALL_STUDENTS. This is because the value at index 0 is just a dummy student\n\t\twhile(iter.hasNext()){\n\t\t\tStudentDetails student = iter.next();\n\t\t\tbw.write(student.ParseForTextFile()); //writes the Parsed Form of the StudentDetails object to the students.txt file\n\t\t}\n\t\t\n\t\tbw.close();\n\t}", "static void createAuthorsFile () throws IOException {\n\t\tBufferedReader dataFile = new BufferedReader(new FileReader(DATAFILE));\n\t\tString inputLine;\n\t\t\n\t\tPrintWriter isbnLabeledDataFile = new PrintWriter(new FileWriter(ISBNLABELLEDDATAFILE));\n\t\t\n\t\tSet<String> books = new HashSet<String>();\n\t\twhile ((inputLine = dataFile.readLine()) != null) {\n\t\t\tif (inputLine.indexOf('\\t') == -1) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tString[] fields = inputLine.split(\"\\t\");\n\t\t\tif (fields.length != 4) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tfinal String bookId = fields[1];\n\t\t\tif (books.contains(bookId)) {\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\tbooks.add(bookId);\n\t\t\t\tString authorString = getAuthorString(bookId);\n\t\t\t\tisbnLabeledDataFile.println(bookId + \"\\t\" + authorString);\n\t\t\t\tout.println(bookId + \"\\t\" + authorString);\n\t\t\t}\n\t\t}\n\t\tdataFile.close();\n\t\tisbnLabeledDataFile.close();\n\t}", "public void processFiles(){\n\t\tfor(String fileName : files) {\n\t\t\ttry {\n\t\t\t\tloadDataFromFile(fileName);\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\tSystem.out.println(\"Can't open file: \" + fileName);\n\t\t\t\tSystem.out.println();\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tprintInOrder();\n\t\t\tstudents.clear();\n\t\t}\n\t}", "static void writeStudentsToFile(Student[] students, String filename) {\n\t\ttry (FileWriter out = new FileWriter(filename)) {\n\n\t\t\tfor (Student s : students)\n\t\t\t\tout.write(s.toString() + \"\\n\");\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void Add() {\n\t\t\tString names2 = StudentNum.getText();\n\t\t\tString names1 = Studentname.getText();\n\t\t\tStudentname.setText(\"\");\n\t\t\tStudentNum.setText(\"\");\n\t\t\tif (!names2.equals(\"Student Number\")) {\n\t\t\t\tFile directory = new File(\"Schools\\\\\" + names2 + \".hi\");\n\t\t\t\tif (!directory.exists()) {\n\t\t\t\t\tif (directory.mkdir()) {\n\t\t\t\t\t\tworklabel.setText(\"Student has been added\");\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tPrintWriter out;\n\t\t\t\t\t\t\tPrintWriter out2;\n\t\t\t\t\t\t\tout = new PrintWriter(new FileWriter(\"Schools\\\\\"\n\t\t\t\t\t\t\t\t\t+ names2 + \".hi\" + \"\\\\\"\n\t\t\t\t\t\t\t\t\t+ \"Student Information.txt\", true));\n\t\t\t\t\t\t\tout.println(\"Student Name: \" + names1);\n\t\t\t\t\t\t\tout.println(\"Student Number: \" + names2);\n\t\t\t\t\t\t\tout.println(\"Address:\");\n\t\t\t\t\t\t\tout.println(\"Postal Code:\");\n\t\t\t\t\t\t\tout.println(\"Phone Number:\");\n\t\t\t\t\t\t\tout.println(\"Contact #1 Name:\");\n\t\t\t\t\t\t\tout.println(\"Contact #1 Number:\");\n\t\t\t\t\t\t\tout.println(\"Contact #1 Email:\");\n\t\t\t\t\t\t\tout.println(\"Contact #2 Name:\");\n\t\t\t\t\t\t\tout.println(\"Contact #2 Number:\");\n\t\t\t\t\t\t\tout.println(\"Contact #2 Email:\");\n\t\t\t\t\t\t\tout.println(\"Medical Alert #1:\");\n\t\t\t\t\t\t\tout.println(\"Medical Alert #2:\");\n\t\t\t\t\t\t\tout.println(\"Medical Alert #3:\");\n\t\t\t\t\t\t\tout.println(\"Medical Alert #4:\");\n\t\t\t\t\t\t\tout.println(\"Medical Alert #5:\");\n\t\t\t\t\t\t\tout.println(\"Accomodation #1:\");\n\t\t\t\t\t\t\tout.println(\"Accomodation #2:\");\n\t\t\t\t\t\t\tout.println(\"Accomodation #3:\");\n\t\t\t\t\t\t\tout.println(\"Accomodation #4:\");\n\t\t\t\t\t\t\tout.println(\"Accomodation #5:\");\n\t\t\t\t\t\t\tout.println(\"Volunteer Hours:\");\n\t\t\t\t\t\t\tout2 = new PrintWriter(new FileWriter(\"Schools\\\\\"+ names2+\".hi\" + \"\\\\\" + \"Transcript.txt\",true));\n\t\t\t\t\t\t\tout2.println(\"Course Code\t\tMark\tPassed\tAbsences\tLate\");\n\t\t\t\t\t\t\tout.close();\n\t\t\t\t\t\t\tout2.close();\n\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tworklabel.setText(\"Invalid\");\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public void WriteStudentstoFile(String path) {\n\t\tPrintWriter writer = null;\n\t\ttry {\n\t\t\twriter = new PrintWriter(path, \"UTF-8\");\n\t\t\tArrayList<Student> data = GetAllStudentData();\n\t\t\tfor (int i = 0; i <= data.size() - 1; i++) {\n\t\t\t\tString f = data.get(i).regID + \",\" + data.get(i).name + \",\" + data.get(i).fatherName + \",\"\n\t\t\t\t\t\t+ data.get(i).section + \",\" + data.get(i).department;\n\t\t\t\twriter.println(f);\n\t\t\t}\n\t\t\twriter.close();\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(e);\n\t\t}\n\t}", "private static void saveStudentsList(List<Student> students, File file) throws IOException {\n saveStudentsList(students, new FileOutputStream(file));\n }", "public void flushSudentsContentInFile(String path) {\n\t\ttry (Writer writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(path, false), \"UTF-8\"))) {\n\t\t\tfinal String[] res = new String[] { \"\" };\n\t\t\tthis.getStudents().forEach(student -> {\n\t\t\t\tString ress = student.toString();\n\t\t\t\tres[0] += ress + \"\\n\";\n\t\t\t});\n\t\t\twriter.write(res[0]);\n\t\t\twriter.flush();\n\t\t} catch (Exception e) {\n\t\t\tthrow new RuntimeException(\"File write failed.\", e);\n\t\t}\n\t}", "public void saveBooks(){\n\t\ttry{\t\n\t\t\tPrintWriter pw = new PrintWriter(new FileWriter(\"../bin/books.csv\"));\t\n\t\t\tIterator bookIterator = bookMap.keySet().iterator();\n\t\t\twhile(bookIterator.hasNext() != false){\n\t\t\t\tString current = bookIterator.next().toString();\n\t\t\t\tfor(int i=0;i<bookMap.get(current).size();i++){\t\n\t\t\t\t\tpw.write(bookMap.get(current).get(i).getTitle() \n\t\t\t\t\t\t+ \",\" + bookMap.get(current).get(i).getAuthor()\n\t\t\t\t\t\t+ \",\" + bookMap.get(current).get(i).getYear()\n\t\t\t\t\t\t+ \",\" + bookMap.get(current).get(i).getType()\n\t\t\t\t\t\t+ \",\" + bookMap.get(current).get(i).getId());\n\t\t\t\t\tpw.write(\"\\n\");\n\t\t\t\t}\n\t\t\t}\t\n\t\t\tpw.close();\n\t\t\tSystem.out.println(\"\\tDone!\");\n\t\t}catch(IOException e){\n\t\t\tSystem.out.println(e.toString());\n\t\t}\n\n\t}", "public void initializeBookStore() throws IOException{\r\n //creates new file called \"Book.txt\". \r\n file = new File(\"Book.txt\");\r\n //adds/writes into the file created. \r\n in = new FileWriter(\"Book.txt\", true);\r\n write = new BufferedWriter(in);\r\n \r\n if(file.length() == 0){\r\n write.write(data);\r\n write.newLine();\r\n write.close();\r\n }\r\n }", "private static boolean loadStudents() throws IOException{\n\t\tBufferedReader reader = new BufferedReader(new FileReader(STUDENTS_FILE));\n\t\tboolean error_loading = false; //stores whether there was an error loading a student\n\t\t\n\t\tString line = reader.readLine(); //read the properties of each student in the students.txt file\n\t\t/*read students.txt file, set the input for each studentDetails object and add each StudentDetails object to ALL_STUDENTS ArrayList*/\n\t\twhile(line != null){\n\t\t\tStudentDetails student = new StudentDetails();\n\t\t\tString[] details = line.split(\"\\t\"); //the properties of each StudentDetails object are separated by tab spaces in the students.txt file\n\t\t\tfor(int i = 0; i < details.length; i ++){\n\t\t\t\tif(!setStudentInput(i, details[i], student)){ //checks if there was an error in setting the StudentDetails object's properties with the values in the students.txt file\n\t\t\t\t\tSystem.out.println(\"ERROR Loading Students\");\n\t\t\t\t\terror_loading = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(error_loading) //if there was an error loading a book then stop the process of loading books\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tALL_STUDENTS.add(student);\n\t\t\t/*Add Students who have been fined (total fine > 0) to the FINED_STUDENTS Hashtable*/\n\t\t\taddFinedStudentsToTable(student);\n\t\t\tline = reader.readLine();\n\t\t}\n\t\treader.close();\n\t\t\n\t\tif(!error_loading){\n\t\t\tSystem.out.println(\"Loading Students - Complete!\");\n\t\t\treturn true;\n\t\t}\n\t\treturn false; //error encountered while loading books\n\t}", "void create() {\n\t\ttry {\n\t\t\tFile file = new File(\"Student.txt\");\n\t\t\t//File named Student.txt is created\n\t\t\tboolean x = file.createNewFile();\n\t\t\tif (x) {\n\t\t\t\tSystem.out.println(\"File has been created successfully! \");\n\t\t\t//Message of successful creation after new file is created\n\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"File already present\");\n\t\t\t\t//message if file already exists\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Exception Occurred:\");\n\n\t\t}\t\t\t\t\n\t\t\n\t\t\t\t\n\t\ttry {\n\t\tPrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter(\"Student.txt\", true)));\n\t\tint x = 1;\n\t\t\n\t\tdo {\n\t\t\tScanner sc = new Scanner(System.in);\n\t\t\tint y;\n\t\t\t//take input from user for name,roll no and mobile no.\n\t\t\t\n\t\t\tSystem.out.print(\"\\nEnter Student Name: \");\n\t\t\tstudentname = br.readLine();\n\t\t\t\n\t\t\tSystem.out.print(\"Student Roll no: \");\n\t\t\trollno = Integer.parseInt(br.readLine());\t\t\n\t\t\t\n\t\t\tSystem.out.print(\"Mobile Number: \");\n\t\t\tmob_no = Integer.parseInt(br.readLine());\n\t\t\t\n\t\t\tSystem.out.print(\"Marks : \");\n\t\t\tmarks = Float.parseFloat(br.readLine());\n\t\t\t\n\t\t\t//display student data\n\n\t\t\tpw.println(studentname + \"\\t\" + rollno + \"\\t\" + marks + \"\\t\" + mob_no);\n\t\t\t\n\t\t\tSystem.out.println(\"Do you want to enter more records? \\n1) Yes\\n2) No\");\n\t\t\t\n\t\t\ty = sc.nextInt();\n\t\t\t\n\t\t\tif(y == 2) {\n\t\t\t\tx = 0;\n\t\t\t}\n\t\t}while(x==1); //loop to add more records\n\t\tpw.close();\n\t\t}catch(IOException e) {\n\t\t\tSystem.out.println(e);\n\t\t}\n\t\t\n\t}", "public void saveToFile()\n\t{\t\n\t\tsetCourseToFileString(courseToFileString);\n\t\t\ttry \n\t {\n\t FileWriter fw = new FileWriter(fileName);\n\t fw.write (this.getCourseToFileString ( ));\n\t for(Student b : this.getStudents ( ))\t \t\n\t \tfw.write(b.toFileString ( ));\n\t \tfw.close ( );\n\t } \n\t catch (Exception ex) \n\t {\n\t ex.printStackTrace();\n\t }\n\t\t\tthis.saveNeed = false;\n\n\t}", "public void setupFiles() {\n File inputDataFile = new File(inputFileName);\n try {\n inputFile = new Scanner(inputDataFile);\n FileWriter outputDataFileOA = new FileWriter(outputFileNameOA);\n FileWriter outputDataFileLL = new FileWriter(outputFileNameLL);\n outputFileOA = new PrintWriter(outputDataFileOA);\n outputFileLL = new PrintWriter(outputDataFileLL);\n outputFileOA.println(\"Output from open addressing hash table:\");\n outputFileOA.println();\n outputFileLL.println(\"Output from linked list hash table:\");\n outputFileLL.println();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "static void createNewFile(String path) \n\t\t{\n\t\tLinkedList<String> defaultData = new LinkedList<String>();\n\t\tdefaultData.add(\"1,Frank,West,98,95,87,78,77,80\");\n\t\tdefaultData.add(\"2,Dianne,Greene,78,94,88,87,95,92\");\n\t\tdefaultData.add(\"3,Doug,Lei,78,94,88,87,95,92\");\n\t\tdefaultData.add(\"4,James,Hewlett,69,92,74,77,89,91\");\n\t\tdefaultData.add(\"5,Aroha,Wright,97,92,87,83,82,92\");\n\t\t\n\t\ttry \n\t\t{\n\t\t\tPrintWriter newFile = new PrintWriter(path, \"UTF-8\"); // Create .txt file in given path\n\t\t\t\n\t\t\tfor (String s : defaultData) \n\t\t\t{\n\t\t\t\tnewFile.println(s); // Write To file\n\t\t\t}\n\t\t\t\n\t\t\tnewFile.close(); // Close File\n\t\t\t\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (UnsupportedEncodingException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tSystem.out.println(\"studentData.txt Created Successfully!\");\n\t\t\n\t}", "public void saveNewRollManager()\n\t{\n\t JFileChooser chooser = new JFileChooser(); //allows the user to choose a file\n\t chooser.setCurrentDirectory(new File(\"/home/me/Documents\"));\t//sets the directory of where to find the file\n\t int retrival = chooser.showSaveDialog(null);\n\t if (retrival == JFileChooser.APPROVE_OPTION) {\n\t try \n\t {\n\t FileWriter fw = new FileWriter(chooser.getSelectedFile()+\".txt\");\n\t fw.write (getCourseToFileString ( ));\n\t for(Student b : getStudents ( ))\t \t\n\t \tfw.write(b.toFileString ( ));\n\t \tfw.close ( );\n\t \t;\n\t } \n\t catch (Exception ex) \n\t {\n\t ex.printStackTrace();\n\t }\n\t\t\tthis.saveNeed = false;\n\n\t }\n\t \n\t}", "public static void saveStudentCourses(ArrayList<StudentCourse> CourseToUpdate) throws IOException {\n\t\tArrayList <String> courseList = new ArrayList<String>() ;// to store Courses data\n\n for (int i = 0 ; i < CourseToUpdate.size() ; i++) {\n\t\t\t\tStudentCourse course = CourseToUpdate.get(i);\n\t\t\t\tStringBuilder stringBuild = new StringBuilder();\n\t\t\t\tstringBuild.append(course.getUserid().trim());\n\t\t\t\tstringBuild.append(SEPARATOR);\n\t\t\t\tstringBuild.append(course.getUsername().trim());\n\t\t\t\tstringBuild.append(SEPARATOR);\n\t\t\t\tstringBuild.append(course.getCourseID().trim());\n\t\t\t\tstringBuild.append(SEPARATOR);\n\t\t\t\tstringBuild.append(course.getIndexID());\n\t\t\t\tstringBuild.append(SEPARATOR);\n\t\t\t\tstringBuild.append(course.getRegisterStatus());\n\t\t\t\t\n\t\t\t\tcourseList.add(stringBuild.toString()) ;\n\t\t\t}\n\t\t\tIO.write(Main.studentcoursepath.toString(), courseList);\n\t}", "public void save() {\n\t\tFileOutputStream fos;\n\t\ttry {\n\t\t\tfos = new FileOutputStream(\"studentData.dat\");\n\n\t\t\tObjectOutputStream oos;\n\t\t\ttry {\n\t\t\t\toos = new ObjectOutputStream(fos);\n\n\t\t\t\toos.writeObject(studentList);\n\t\t\t\toos.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\tSystem.out.println(\"File is finished writing to the hard drive\");\n\t}", "private void prepareStudentDirectories() {\n //---------- get all directories in the top level directory ----------\n ArrayList<File> listOfFiles = getFilesInDirectory(TopAssignmentsDirectory, true);\n\n /* for directories that don't conform to Moodle names, we will label\n them \"anonymous 1\", \"anonymous 2\", etc... */\n int anonymousCounter = 1;\n\n //---------- go through the list and identify subdirectories ----------\n for (File file : listOfFiles) {\n if (file.isDirectory()) { //check that it is a directory\n\n Assignment newAssignment = new Assignment();\n\n //attempt to extract the student's name\n String studentName = extractStudentNameFromMoodleDirectoryName(file.getName());\n newAssignment.assignmentDirectory = file.toString();\n\n\n if (studentName == null) {\n console(\"skipping directory \" + file.getName());\n } else if (studentName.equals(\"\")) {\n newAssignment.studentName = \"Anonymous \" + anonymousCounter;\n anonymousCounter++;\n //add this assignment to the assignments ArrayList\n assignments.add(newAssignment);\n } else {\n //student name successfully extracted: add to the assignmentDirectories dictionary\n newAssignment.studentName = studentName;\n //add this assignment to the assignments ArrayList\n assignments.add(newAssignment);\n }\n\n }\n }\n }", "private void populateBooks() {\n\n PrintWriter out;\n try {\n out = new PrintWriter(\"books.txt\");\n String ISBN, title, publisher, publicationPlace, shelfNum;\n int cost, copyrightYear, subjectCounter = 0, shelfNumCounter = 0, floor = 1, aisle = 1, shelf = 1, isbnCounter = 0;\n\n for (int subject = 0; subject < 6; subject++) {\n for (int book = 0; book < 20; book++) {\n title = BOOKS[randomInt(0, BOOKS.length - 1)];\n copyrightYear = randomInt(1970, 2012);\n shelfNum = \"\";\n shelfNum += Integer.toString(floor);\n shelfNum += Integer.toString(aisle);\n shelfNum += Integer.toString(shelf);\n for (int edition = 1; edition < 4; edition++) {\n publisher = PUBLISHERS[randomInt(0,\n PUBLISHERS.length - 1)];\n publicationPlace = PUBLICATION_PLACES[randomInt(0,\n PUBLICATION_PLACES.length - 1)];\n cost = randomInt(10, 200);\n ISBN = \"\";\n ISBN += Integer.toString(subject) + \"-\";\n ISBN += String.format(\"%03d\", randomInt(0, 999)) + \"-\";\n ISBN += String.format(\"%05d\", isbnCounter++) + \"-\";\n ISBN += edition;\n out.println(\"INSERT INTO `4400`.`Book` (`isbn`, `title`, `cost`, `isReserved`, `edition`, `publisher`, `publicationPlace`, `copyrightYear`, `shelfNumber`, `subjectName`) VALUES \"\n + \"('\"\n + ISBN\n + \"', '\"\n + title\n + \"', '\"\n + cost\n + \"', '0', '\"\n + edition\n + \"', '\"\n + publisher\n + \"', '\"\n + publicationPlace\n + \"', '\"\n + copyrightYear\n + \"', '\"\n + shelfNum\n + \"', '\"\n + SUBJECTS[subject] + \"');\");\n copyrightYear++;\n }\n if (shelfNumCounter++ == 3) {\n shelfNumCounter = 0;\n if (shelf++ == 2) {\n shelf = 1;\n aisle++;\n\n }\n }\n }\n\n if (subjectCounter++ == 1) {\n subjectCounter = 0;\n floor++;\n aisle = 1;\n shelf = 1;\n }\n }\n System.out.println(\"RAN\");\n out.close();\n } catch (final FileNotFoundException e) {\n System.out.println(\"TEST\");\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }", "void clearRecords() {\n\t\ttry {\n\t\tPrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter(\"Student.txt\")));\n\t\tpw.close();\n\t\tSystem.out.println(\"\\nAll Records cleared successfully !\");\n\t\tfor (int i = 0; i < 999999999; i++);\n\t\t}catch (IOException e) {\n\t\t\tSystem.out.println(e);\n\t\t}\n\t}", "public static void mainx(String[] args) {\n\t\tPrintWriter outputFile = null;\r\n\t\t\r\nSystem.out.println(\"Test Teacher Dictionary write\");\r\n\t\t\r\n\t\ttry {\r\n\t\t\toutputFile = new PrintWriter(new FileOutputStream(\"teacherdictionary.txt\"));\r\n\t\t}catch (FileNotFoundException e){\r\n\t\t\tSystem.out.println(\"Unable to open file.\");\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\toutputFile.println(\"<ENTRYSTART>\");\r\n\t\toutputFile.println(\"<ID>ZAK_B\");\r\n\t\toutputFile.println(\"<NAME>Zakaria Baani\");\r\n\t\toutputFile.println(\"<EMAIL>zakb@debug.fakecentury.edu\");\r\n\t\toutputFile.println(\"<ENTRYEND>\");\r\n\t\toutputFile.println(\"<ENTRYSTART>\");\r\n\t\toutputFile.println(\"<ID>MAH_E\");\r\n\t\toutputFile.println(\"<NAME>Mahmoud Eid\");\r\n\t\toutputFile.println(\"<EMAIL>mahe@debug.fakecentury.edu\");\r\n\t\toutputFile.println(\"<ENTRYEND>\");\r\n\t\toutputFile.println(\"<ENTRYSTART>\");\r\n\t\toutputFile.println(\"<ID>BRI_J\");\r\n\t\toutputFile.println(\"<NAME>Brian Jenson\");\r\n\t\toutputFile.println(\"<EMAIL>brij@debug.fakecentury.edu\");\r\n\t\toutputFile.println(\"<ENTRYEND>\");\r\n\t\t\r\n\t\toutputFile.close();\r\n\t\t\r\n\t\tTeacherDictionary teachers = new TeacherDictionary();\r\n\t\tSystem.out.println(teachers);\r\n\t\t\r\n\t\r\n\t\ttry {\r\n\t\t\toutputFile = new PrintWriter(new FileOutputStream(\"classdictionary.txt\"));\r\n\t\t}catch (FileNotFoundException e){\r\n\t\t\tSystem.out.println(\"Unable to open file.\");\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\nSystem.out.println(\"Test Room Dictionary write\");\r\n\t\t\r\n\t\ttry {\r\n\t\t\toutputFile = new PrintWriter(new FileOutputStream(\"roomdictionary.txt\"));\r\n\t\t}catch (FileNotFoundException e){\r\n\t\t\tSystem.out.println(\"Unable to open file.\");\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\toutputFile.println(\"<ENTRYSTART>\");\r\n\t\toutputFile.println(\"<ID>W101\");\r\n\t\toutputFile.println(\"<NAME>West 101\");\r\n\t\toutputFile.println(\"<CAPACITY>25\");\r\n\t\toutputFile.println(\"<ENTRYEND>\");\r\n\t\toutputFile.println(\"<ENTRYSTART>\");\r\n\t\toutputFile.println(\"<ID>E2213\");\r\n\t\toutputFile.println(\"<NAME>East 2213\");\r\n\t\toutputFile.println(\"<CAPACITY>45\");\r\n\t\toutputFile.println(\"<ENTRYEND>\");\r\n\t\toutputFile.println(\"<ENTRYSTART>\");\r\n\t\toutputFile.println(\"<ID>E1001\");\r\n\t\toutputFile.println(\"<NAME>East 1001\");\r\n\t\toutputFile.println(\"<CAPACITY>60\");\r\n\t\toutputFile.println(\"<ENTRYEND>\");\r\n\t\t\r\n\t\toutputFile.close();\r\n\t\t\r\n\t\tRoomDictionary rooms = new RoomDictionary();\r\n\t\tSystem.out.println(rooms);\r\n\t\t\r\n\t\t\r\n\t\t/*\r\n\t\t * class\r\n\t\t * \r\n\t\t * <ENTRYSTART>\r\n\t\t * <TITLE>\r\n\t\t * <TEACHER>\r\n\t\t * <STUDENTCOUNT>\r\n\t\t * <STUDENTLIST>\r\n\t\t * <SCHEDULE>\r\n\t\t * <ENTRYEND>\r\n\t\t * \r\n\t\t */\r\n\t\t\r\n\t\tSystem.out.println(\"Test Class Dictionary write\");\r\n\t\t\r\n\t\ttry {\r\n\t\t\toutputFile = new PrintWriter(new FileOutputStream(\"classdictionary.txt\"));\r\n\t\t}catch (FileNotFoundException e){\r\n\t\t\tSystem.out.println(\"Unable to open file.\");\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\toutputFile.println(\"<ENTRYSTART>\");\r\n\t\toutputFile.println(\"<TITLE>MATH 2081_1\");\r\n\t\toutputFile.println(\"<TEACHER>BRIAN_J\");\r\n\t\toutputFile.println(\"<SCHEDULE>MATH 2081_1\");\r\n\t\t\t\toutputFile.println(\"<STUDENTCOUNT>15\");\r\n\t\toutputFile.println(\"<STUDENTLIST>CATHY4\");\r\n\t\toutputFile.println(\"<STUDENTLIST>DAN5\");\r\n\t\toutputFile.println(\"<STUDENTLIST>EVE6\");\r\n\t\t\t\toutputFile.println(\"<ENTRYEND>\");\r\n\t\toutputFile.println(\"<TITLE>PHYS 1082_1\");\r\n\t\toutputFile.println(\"<TEACHER>MAHMOOD_E\");\r\n\t\toutputFile.println(\"<SCHEDULE>PHYS 1082_1\");\r\n\t\t\t\toutputFile.println(\"<STUDENTCOUNT>20\");\r\n\t\toutputFile.println(\"<STUDENTLIST>FRANK7\");\r\n\t\toutputFile.println(\"<STUDENTLIST>GRACE8\");\r\n\t\toutputFile.println(\"<STUDENTLIST>HENRY9\");\r\n\t\t\t\toutputFile.println(\"<ENTRYEND>\");\r\n\t\t\t\toutputFile.println(\"<ENTRYSTART>\");\r\n\t\t\t\toutputFile.println(\"<TITLE>CSCI 1082_2\");\r\n\t\t\t\toutputFile.println(\"<TEACHER>ZACH_B\");\r\n\t\t\t\toutputFile.println(\"<SCHEDULE>CSCI 1082_2\");\r\n\t\t\t\t\t\toutputFile.println(\"<STUDENTCOUNT>15\");\r\n\t\t\t\toutputFile.println(\"<STUDENTLIST>AARON1\");\r\n\t\t\t\toutputFile.println(\"<STUDENTLIST>AMY2\");\r\n\t\t\t\toutputFile.println(\"<STUDENTLIST>BOB3\");\r\n\t\t\t\t\t\toutputFile.println(\"<ENTRYEND>\");\r\n\t\t\r\n\t\toutputFile.close();\r\n\t\t\r\n\t\t///\r\n\t\t//DictionaryFile testDictionary = new DictionaryFile(\"classdictionary.txt\",\"ClassDictionary\");\r\n\t\tClassDictionary testDictionary = new ClassDictionary();\r\n//\t\tSystem.out.println(testDictionary.getEntryCount());\r\n//\t\tSystem.out.println(testDictionary.getOpenStatus());\r\n//\t\tSystem.out.println(testDictionary.isValid());\r\n\t\tSystem.out.println(testDictionary);\r\n\t\t\r\n\t\tCalendar calendar = new GregorianCalendar();\r\n\t\tSimpleDateFormat df = new SimpleDateFormat(\"yyyyMMddHH\");\r\n\t\tSystem.out.println(df.format(calendar.getTime()));\r\n\r\n\t}", "private void updateFile() {\n\t\tPrintWriter outfile;\n\t\ttry {\n\t\t\toutfile = new PrintWriter(new BufferedWriter(new FileWriter(\"stats.txt\")));\n\t\t\toutfile.println(\"15\"); // this is the number\n\t\t\tfor (Integer i : storeInfo) {\n\t\t\t\toutfile.println(i); // we overwrite the existing files\n\t\t\t}\n\t\t\tfor (String s : charBought) {\n\t\t\t\toutfile.println(s); // overwrite the character\n\t\t\t}\n\t\t\tfor (String s : miscBought) {\n\t\t\t\toutfile.println(s);\n\t\t\t}\n\t\t\toutfile.close();\n\t\t}\n\t\tcatch (IOException ex) {\n\t\t\tSystem.out.println(ex);\n\t\t}\n\t}", "public void saveUsers() {\n\t\ttry {\n\t\t\t\n\t\t\tFile xmlFile = new File(\"Users.xml\");\n\t\t\tDocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\n\t\t\tDocumentBuilder builder = factory.newDocumentBuilder();\n\t\t\tDocument document = builder.parse(xmlFile);\n\t\t\tElement users = document.getDocumentElement();\n\t\t\t\n\t\t\tArrayList<Student> u = ManageUsers.getActiveList();\n\t\t\tfor (int i = 0; i < u.size(); i++) {\n\t\t\t\t// Grab the info for a specific student\n\t\t\t\tStudent s = u.get(i);\n\t\t\t\tString fName = s.getFirstName();\n\t\t\t\tString lName = s.getLastName();\n\t\t\t\tint ucid = s.getUcid();\n\t\t\t\tint currentBorrowing = s.getCurrentBorrowing();\n\t\t\t\tboolean isActive = true;\n\t\t\t String username = s.getUsername();\n\t\t\t String password = s.getPassword();\n\t\t\t boolean isLibrarian = s.getIsLibrarian();\n\t\t\t \n\t\t\t Element student = document.createElement(\"student\");\n\t\t\t \n\t\t\t // Make a new element <student>\n\t\t\t // Add the element to the xml as a child of <Users>\n\t\t\t // Add the above fields (fName, etc.) as child nodes to the new student node\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Something went wrong with writing to the xml\");\n\t\t\tSystem.out.println(e);\n\t\t}\n\t}", "public void loadBooks() {\n\t\ttry {\n\t\t\tScanner load = new Scanner(new File(FILEPATH));\n\t\t\tSystem.out.println(\"Worked\");\n\n\t\t\twhile (load.hasNext()) {\n\t\t\t\tString[] entry = load.nextLine().split(\";\");\n\n\t\t\t\t// checks the type of book\n\t\t\t\tint type = bookType(entry[0]);\n\n\t\t\t\t// creates the appropriate book\n\t\t\t\tswitch (type) {\n\t\t\t\tcase 0:\n\t\t\t\t\tcreateChildrensBook(entry); // creates a Childrensbook and adds it to the array\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tcreateCookBook(entry);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tcreatePaperbackBook(entry);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tcreatePeriodical(entry);\n\t\t\t\t\tbreak;\n\t\t\t\tcase -1:\n\t\t\t\t\tSystem.out.println(\"No book created\");\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tSystem.out.println(\"Error\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tload.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"Did not read in file properly, restart the program, and check filepath of books.txt.\");\n\t\t}\n\t}", "static void writeFile(){\n try{\n Path contactsListPath = Paths.get(\"contacts\",\"contacts.txt\");\n Files.write(contactsListPath, contactList);\n } catch(IOException ioe){\n ioe.printStackTrace();\n }\n //refreshes list of Contact objs\n fileToContactObjs();\n }", "public void createFiles() {\r\n try {\r\n FileWriter file = new FileWriter(registerNumber + \".txt\");\r\n file.write(\"Name : \" + name + \"\\n\");\r\n file.write(\"Surname : \" + surname + \"\\n\");\r\n file.write(\"Registration Number : \" + registerNumber + \"\\n\");\r\n file.write(\"Position : \" + position + \"\\n\");\r\n file.write(\"Year of Start : \" + yearOfStart + \"\\n\");\r\n file.write(\"Total Salary : \" + Math.round(totalSalary) + \".00 TL\" +\"\\n\");\r\n file.close();\r\n }\r\n catch(IOException e) {\r\n e.printStackTrace();\r\n }\r\n }", "public static void setSemester() {\r\n\t\tarrays = ReadingAndWritingInFile.readObject(\"MarketingDepartment.txt\");\r\n\t\taverageandidofemployees = (ArrayList<ArrayList<Double>>) arrays[0];\r\n\t\tdegreespersemester = (ArrayList<ArrayList<Double>>) arrays[1];\r\n\t\tidperemployee = (ArrayList<Double>) arrays[2];\r\n\t\tObject[] arrays2 = ReadingAndWritingInFile.readObject(\"HRDepartment.txt\");\r\n\t\tArrayList<ArrayList<Double>> averageandidofemployees2 = (ArrayList<ArrayList<Double>>) arrays2[0];\r\n\t\tArrayList<ArrayList<Double>> degreespersemester2 = (ArrayList<ArrayList<Double>>) arrays2[1];\r\n\t\tArrayList<Double> idperemployee2 = (ArrayList<Double>) arrays2[2];\r\n\t\tObject[] arrays3 = ReadingAndWritingInFile.readObject(\"AccountingDepartment.txt\");\r\n\t\tArrayList<ArrayList<Double>> averageandidofemployees3 = (ArrayList<ArrayList<Double>>) arrays3[0];\r\n\t\tArrayList<ArrayList<Double>> degreespersemester3 = (ArrayList<ArrayList<Double>>) arrays3[1];\r\n\t\tArrayList<Double> idperemployee3 = (ArrayList<Double>) arrays3[2];\r\n\t\tObject[] arrays4 = ReadingAndWritingInFile.readObject(\"ITDepartment.txt\");\r\n\t\tArrayList<ArrayList<Double>> averageandidofemployees4 = (ArrayList<ArrayList<Double>>) arrays4[0];\r\n\t\tArrayList<ArrayList<Double>> degreespersemester4 = (ArrayList<ArrayList<Double>>) arrays4[1];\r\n\t\tArrayList<Double> idperemployee4 = (ArrayList<Double>) arrays4[2];\r\n\t\tint times = ReadingAndWritingInFile.readNumber(\"Times.txt\");\r\n\t\tif (times == 1) {\r\n\t\t\t++times;\r\n\t\t\ttry {\r\n\t\t\t\tnew FileWriter(\"Times.txt\").close();\r\n\t\t\t\tFileOutputStream wr = new FileOutputStream(\"Times.txt\");\r\n\t\t\t\twr.write(times);\r\n\t\t\t\twr.close();\r\n\t\t\t} catch (FileNotFoundException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i <= averageandidofemployees.size() - 1; i++) {\r\n\t\t\t\tidperemployee.add(i, averageandidofemployees.get(i).get(1));\r\n\t\t\t\tdegreespersemester.add(new ArrayList<Double>());\r\n\t\t\t\tdegreespersemester.get(i).add(0, averageandidofemployees.get(i).get(0));\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i <= averageandidofemployees2.size() - 1; i++) {\r\n\t\t\t\tidperemployee2.add(i, averageandidofemployees2.get(i).get(1));\r\n\t\t\t\tdegreespersemester2.add(new ArrayList<Double>());\r\n\t\t\t\tdegreespersemester2.get(i).add(0, averageandidofemployees2.get(i).get(0));\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i <= averageandidofemployees3.size() - 1; i++) {\r\n\t\t\t\tidperemployee3.add(i, averageandidofemployees3.get(i).get(1));\r\n\t\t\t\tdegreespersemester3.add(new ArrayList<Double>());\r\n\t\t\t\tdegreespersemester3.get(i).add(0, averageandidofemployees3.get(i).get(0));\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i <= averageandidofemployees4.size() - 1; i++) {\r\n\t\t\t\tidperemployee4.add(i, averageandidofemployees4.get(i).get(1));\r\n\t\t\t\tdegreespersemester4.add(new ArrayList<Double>());\r\n\t\t\t\tdegreespersemester4.get(i).add(0, averageandidofemployees4.get(i).get(0));\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tint count2;\r\n\t\t\tfor (int i = 0; i <= averageandidofemployees.size() - 1; i++) {\r\n\t\t\t\tcount2 = 1;\r\n\t\t\t\tfor (int j = 0; j <= idperemployee.size() - 1; j++) {\r\n\t\t\t\t\tif (String.valueOf(averageandidofemployees.get(i).get(1))\r\n\t\t\t\t\t\t\t.equals(String.valueOf(idperemployee.get(j)))) {\r\n\t\t\t\t\t\tdegreespersemester.get(j).add(degreespersemester.get(j).size(),\r\n\t\t\t\t\t\t\t\taverageandidofemployees.get(i).get(0));\r\n\t\t\t\t\t\tcount2 = 0;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (count2 == 1) {\r\n\t\t\t\t\tidperemployee.add(idperemployee.size(), averageandidofemployees.get(i).get(1));\r\n\t\t\t\t\tdegreespersemester.add(new ArrayList<Double>());\r\n\t\t\t\t\tdegreespersemester.get(degreespersemester.size() - 1).add(0, averageandidofemployees.get(i).get(0));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tfor (int i = 0; i <= averageandidofemployees2.size() - 1; i++) {\r\n\t\t\t\tcount2 = 1;\r\n\t\t\t\tfor (int j = 0; j <= idperemployee2.size() - 1; j++) {\r\n\t\t\t\t\tif (String.valueOf(averageandidofemployees2.get(i).get(1))\r\n\t\t\t\t\t\t\t.equals(String.valueOf(idperemployee2.get(j)))) {\r\n\t\t\t\t\t\tdegreespersemester2.get(j).add(degreespersemester2.get(j).size(),\r\n\t\t\t\t\t\t\t\taverageandidofemployees2.get(i).get(0));\r\n\t\t\t\t\t\tcount2 = 0;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (count2 == 1) {\r\n\t\t\t\t\tidperemployee2.add(idperemployee2.size(), averageandidofemployees2.get(i).get(1));\r\n\t\t\t\t\tdegreespersemester2.add(new ArrayList<Double>());\r\n\t\t\t\t\tdegreespersemester2.get(degreespersemester2.size() - 1).add(0,\r\n\t\t\t\t\t\t\taverageandidofemployees2.get(i).get(0));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i <= averageandidofemployees3.size() - 1; i++) {\r\n\t\t\t\tcount2 = 1;\r\n\t\t\t\tfor (int j = 0; j <= idperemployee3.size() - 1; j++) {\r\n\t\t\t\t\tif (String.valueOf(averageandidofemployees3.get(i).get(1))\r\n\t\t\t\t\t\t\t.equals(String.valueOf(idperemployee3.get(j)))) {\r\n\t\t\t\t\t\tdegreespersemester3.get(j).add(degreespersemester3.get(j).size(),\r\n\t\t\t\t\t\t\t\taverageandidofemployees3.get(i).get(0));\r\n\t\t\t\t\t\tcount2 = 0;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (count2 == 1) {\r\n\t\t\t\t\tidperemployee3.add(idperemployee3.size(), averageandidofemployees3.get(i).get(1));\r\n\t\t\t\t\tdegreespersemester3.add(new ArrayList<Double>());\r\n\t\t\t\t\tdegreespersemester3.get(degreespersemester3.size() - 1).add(0,\r\n\t\t\t\t\t\t\taverageandidofemployees3.get(i).get(0));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i <= averageandidofemployees4.size() - 1; i++) {\r\n\t\t\t\tcount2 = 1;\r\n\t\t\t\tfor (int j = 0; j <= idperemployee4.size() - 1; j++) {\r\n\t\t\t\t\tif (String.valueOf(averageandidofemployees4.get(i).get(1))\r\n\t\t\t\t\t\t\t.equals(String.valueOf(idperemployee4.get(j)))) {\r\n\t\t\t\t\t\tdegreespersemester4.get(j).add(degreespersemester4.get(j).size(),\r\n\t\t\t\t\t\t\t\taverageandidofemployees4.get(i).get(0));\r\n\t\t\t\t\t\tcount2 = 0;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (count2 == 1) {\r\n\t\t\t\t\tidperemployee4.add(idperemployee4.size(), averageandidofemployees4.get(i).get(1));\r\n\t\t\t\t\tdegreespersemester4.add(new ArrayList<Double>());\r\n\t\t\t\t\tdegreespersemester4.get(degreespersemester4.size() - 1).add(0,\r\n\t\t\t\t\t\t\taverageandidofemployees4.get(i).get(0));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\tfor (int i = averageandidofemployees.size() - 1; i >= 0; i--) {\r\n\t\t\taverageandidofemployees.remove(i);\r\n\t\t}\r\n\t\tfor (int i = averageandidofemployees2.size() - 1; i >= 0; i--) {\r\n\t\t\taverageandidofemployees2.remove(i);\r\n\t\t}\r\n\t\tfor (int i = averageandidofemployees3.size() - 1; i >= 0; i--) {\r\n\t\t\taverageandidofemployees3.remove(i);\r\n\t\t}\r\n\t\tfor (int i = averageandidofemployees4.size() - 1; i >= 0; i--) {\r\n\t\t\taverageandidofemployees4.remove(i);\r\n\t\t}\r\n\t\tReadingAndWritingInFile.writeObject(\"MarketingDepartment.txt\", averageandidofemployees, degreespersemester,\r\n\t\t\t\tidperemployee);\r\n\t\tReadingAndWritingInFile.writeObject(\"HRDepartment.txt\", averageandidofemployees2, degreespersemester2,\r\n\t\t\t\tidperemployee2);\r\n\t\tReadingAndWritingInFile.writeObject(\"AccountingDepartment.txt\", averageandidofemployees3, degreespersemester3,\r\n\t\t\t\tidperemployee3);\r\n\t\tReadingAndWritingInFile.writeObject(\"ITDepartment.txt\", averageandidofemployees4, degreespersemester4,\r\n\t\t\t\tidperemployee4);\r\n\t}", "private void set_values(File f1){\n FileWriter writer= null;\n try{\n writer=new FileWriter(f1);\n writer.write(\"###################################################################################\\r\\n\"+\n \"This is the master file of the individual Student-\"+student_name+\"\\r\\n\"+\n \"##################################################################################\\r\\n\"+\n \"Name- \"+student_name+\"\\r\\n\"+\n \"Roll no- \"+student_rollno+\"\\r\\n\"+\n \"Gender- \"+student_gender+\"\\r\\n\"+\n \"Semester- 3\\r\\n\"+\n \"Subjects offered:-\\r\\n\"+\n \"(1)OOP\\r\\n\"+\n \"(2)DE\\r\\n\"+\n \"(3)DSA\\r\\n\"+\n \"*****************************************************************************\\r\\n\"+\n \"Quiz data\\r\\n\"+\n \"*****************************************************************************\\r\\n\"+\n \"Subject- OOP\\r\\n\"+\n \"List of Quizes taken with their marks\\r\\n\"+\n \"-----------------------------------------------------------------------------\\r\\n\"+\n \"Chap_1- \"+OOP[0]+\"\\r\\n\"+\n \"Chap_2- \"+OOP[1]+\"\\r\\n\"+\n \"Chap_3- \"+OOP[2]+\"\\r\\n\"+\n \"Chap_4- \"+OOP[3]+\"\\r\\n\"+\n \"-----------------------------------------------------------------------------\\r\\n\"+\n \"Subject- DE\\r\\n\"+\n \"List of Quizes taken with their marks\\r\\n\"+\n \"-----------------------------------------------------------------------------\\r\\n\"+\n \"Chap_1- \"+DE[0]+\"\\r\\n\"+\n \"Chap_2- \"+DE[1]+\"\\r\\n\"+\n \"Chap_3- \"+DE[2]+\"\\r\\n\"+\n \"-----------------------------------------------------------------------------\\r\\n\"+\n \"Subject- DSA\\r\\n\"+\n \"List of Quizes taken with their marks\\r\\n\"+\n \"-----------------------------------------------------------------------------\\r\\n\"+\n \"Chap_1- \"+DSA[0]+\"\\r\\n\"+ \n \"Chap_2- \"+DSA[1]+\"\\r\\n\"+\n \"Chap_3- \"+DSA[2]+\"\\r\\n\"+\n \"*****************************************************************************\\r\\n\"+\n \"Total marks- \"+total_marks+\"\\r\\n\"+\n \"Average- \"+average+\"\\r\\n\"+\n \"*****************************************************************************\\r\\n\");\n writer.close();\n }catch(IOException e){\n System.out.println(\"An error occured\");\n }\n }", "private void updateFile() {\n try {\n this.taskStorage.save(this.taskList);\n this.aliasStorage.save(this.parser);\n } catch (IOException e) {\n System.out.println(\"Master i am unable to save the file!\");\n }\n }", "private void librarian()throws IOException\n {\n //File Handling starts here with reading into each of the different files to obtain set of books along with relevant data.\n FileReader fauthor = new FileReader(\"BookAuthorList.txt\"); \n BufferedReader bufferAuthor = new BufferedReader(fauthor);\n\n FileReader fgenre = new FileReader(\"BookGenreList.txt\"); \n BufferedReader bufferGenre = new BufferedReader(fgenre);\n\n FileReader fname = new FileReader(\"BookNameList.txt\"); \n BufferedReader bufferName = new BufferedReader(fname);\n\n FileReader fnumber = new FileReader(\"BookNumberList.txt\"); \n BufferedReader bufferNumber = new BufferedReader(fnumber);\n\n for(int i=0; i<linecount; i++) //instance variable linecount\n {\n book[i] = new Book(\"1000\", \"Book Name\", \"Author of Book\", \"Genre of Book\"); //instantiating array element to avoid NullPointerException\n book[i].code = bufferNumber.readLine();\n book[i].author = bufferAuthor.readLine();\n book[i].genre = bufferGenre.readLine();\n book[i].name = bufferName.readLine();\n }\n /*\n * The following for loop trims each of the lines obtained from the file, to remove spaces and help maintain equal number of characters.\n */\n for(int i=0; i<linecount; i++) //trimming\n {\n book[i].code = book[i].code.trim();\n book[i].author = book[i].author.trim();\n book[i].genre = book[i].genre.trim();\n book[i].name = book[i].name.trim();\n }\n\n for(int i=0; i<linecount; i++) //add set number of lines. this helps in making tabular forms\n {\n /*\n * Utilising concatenation from Library classes here. \n * Function spaces is called.\n */\n book[i].code = book[i].code.concat(Spacebar.spaces(5 - book[i].code.length()));\n book[i].author = book[i].author.concat(Spacebar.spaces(25 - book[i].author.length()));\n book[i].genre = book[i].genre.concat(Spacebar.spaces(15 - book[i].genre.length()));\n book[i].name = book[i].name.concat(Spacebar.spaces(70 - book[i].name.length()));\n }\n }", "public static void init() {\n\t\tList<Object> objects = FileManager.readObjectFromFile(\"student.dat\");\n\t\tfor (Object o : objects)\n\t\t\tStudentList.add((Student) o);\n\t}", "public void overWriteLine(String tag, String newtext) throws Exception{\n\t\t\n\t\tPrintWriter writer = new PrintWriter(new BufferedWriter(new FileWriter(this.scholarship + \" \" + this.student + \".temp\")));\n\t\tBufferedReader br = new BufferedReader(new FileReader(this.appfile));\n\t\t\n\t\tString line;\n\t\t\n\t\twhile ((line = br.readLine()) != null) {\n\t\t\tif (line.equals(tag)) {\n\t\t\t\twriter.println(line);\n\t\t\t\tline = br.readLine();\n\t\t\t\tline = newtext;\n\t\t\t}\n\t\t\n\t\t\twriter.println(line);\n\t\t}\n\t\t\n\t\tbr.close();\n\t\twriter.close();\t\n\t\t\n\t\tFile f = new File(this.appfile);\n\t\tboolean b = f.delete();\n\t\tFile f1 = new File(this.appfile);\n\t\tFile f2 = new File(this.scholarship + \" \" + this.student + \".temp\");\n\t\tb = f2.renameTo(f1);\n\t\tFile f3 = new File(this.scholarship + \" \" + this.student + \".temp\");\n\t\tb = f3.delete();\n\t}", "private void enterAll() {\n\n String sku = \"Java1001\";\n Book book1 = new Book(\"Head First Java\", \"Kathy Sierra and Bert Bates\", \"Easy to read Java workbook\", 47.50, true);\n bookDB.put(sku, book1);\n\n sku = \"Java1002\";\n Book book2 = new Book(\"Thinking in Java\", \"Bruce Eckel\", \"Details about Java under the hood.\", 20.00, true);\n bookDB.put(sku, book2);\n\n sku = \"Orcl1003\";\n Book book3 = new Book(\"OCP: Oracle Certified Professional Jave SE\", \"Jeanne Boyarsky\", \"Everything you need to know in one place\", 45.00, true);\n bookDB.put(sku, book3);\n\n sku = \"Python1004\";\n Book book4 = new Book(\"Automate the Boring Stuff with Python\", \"Al Sweigart\", \"Fun with Python\", 10.50, true);\n bookDB.put(sku, book4);\n\n sku = \"Zombie1005\";\n Book book5 = new Book(\"The Maker's Guide to the Zombie Apocalypse\", \"Simon Monk\", \"Defend Your Base with Simple Circuits, Arduino and Raspberry Pi\", 16.50, false);\n bookDB.put(sku, book5);\n\n sku = \"Rasp1006\";\n Book book6 = new Book(\"Raspberry Pi Projects for the Evil Genius\", \"Donald Norris\", \"A dozen friendly fun projects for the Raspberry Pi!\", 14.75, true);\n bookDB.put(sku, book6);\n }", "private static void updateFile(City [] cities , boolean append) throws IOException{\n PrintWriter write = new PrintWriter(new FileOutputStream(\"rainfall.txt\",append)); //to append , use append = true || to reset the full file append = false\n for(City obj:cities){\n String out = \"\";\n out += String.format(\"%-20s %-20s\",obj.getCityName(), obj.getCountryName());\n write.print(out);\n for(double rainfall:obj.getAverageMonthlyRainfall())\n write.printf(\"%-10.1f\",rainfall);\n write.println();\n }\n System.out.print(\"\\nrainfall.txt file has been updated...\");\n write.close();\n }", "public void handleStudents() {\n students.forEach(System.out::println);\n producer.saveAttendance(students, course);\n }", "@Override\n\tpublic void readWriteAllBirds() {\n\t\tBirdDataParser bdp= new BirdDataParser();\n\t\tfor (Birds b: Birds.values()) {\n\t\t\ttry {\n\t\t\t\tbdp.readInput(b.getName(),b.getName()+\".txt\");\n\t\t\t\tbdp.generateOutput(b.getName()+\"_out.txt\");\n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.out.println(e.getMessage());\n\t\t\t}\n\t\t}\n\n\t}", "public static void main(String[] args) throws Exception {\n\t\t\n\t\tPrintWriter pw = new PrintWriter(new FileWriter(\"first.txt\"));\n\t\tpw.println(\"Happy Birthday...\");\n\t\tpw.println(\"Smoking is injurious to health.\");\n\t\tpw.println(\"Hows you doing..\");\n\t\tpw.println(\"Dont be fool..\");\n\t\tpw.flush();\n\t\t\n\t\tFileReader fr = new FileReader(\"first.txt\");\n\t\tBufferedReader br = new BufferedReader(fr);\n\t\t\n\t\tBufferedWriter bwn = new BufferedWriter(new FileWriter(\"Second.txt\",true));\n\t\t\n\t\tString s = br.readLine(); // Reading line of First.txt and storing into String \n\t\t // This String pass into Second.txt write() method to write in Second.txt\n\t\twhile(s!=null) {\n\t\t\tbwn.write(s); // Writing first.txt line in Second.txt file // This Step is important\n\t\t\tbwn.newLine();\n\t\t\ts=br.readLine();\n\t\t}\n\t\tbwn.flush();\n\t\t\n\t}", "public List<Student> getAllStudents() throws IOException {\n\t\tstudentList = studentListGenerator.generateList(\"StudentList.txt\");\n\t\treturn studentList;\n\t}", "public static void populateLists() throws IOException\n\t{\n\n\t\tFile loginInfo = new File(\"loginDetails.txt\");\n\t\tFile topics = new File(\"task.txt\");\n\t\tFile games = new File(\"game.txt\");\n\t\tFile questions = new File(\"Questions.txt\");\n\t\tFile topic = new File(\"Topics.txt\");\n\t\t//File userinfo=new File\n Scanner fileReader;\n\t\tString[] temp;\n\t\t\n\t\tloginDetails.add(new ArrayList<String>());\n\t\tloginDetails.add(new ArrayList<String>());\n\t\tloginDetails.add(new ArrayList<String>());\n\t\t\n\t\ttopicsMenu.add(new ArrayList<String>());\n\t\ttopicsMenu.add(new ArrayList<String>());\n\n\t\tgameMenu.add(new ArrayList<String>());\n\t\tgameMenu.add(new ArrayList<String>());\n\t\ttopicMenu.add(new ArrayList<String>());\n\t\ttopicMenu.add(new ArrayList<String>());\n\n\n\t\tfor(int i=0; i<9; i++)\n\t\t\tquestionDetails.add(new ArrayList<String>());\n if(loginInfo.exists())\n\t\t{\n\t\t\tfileReader = new Scanner(loginInfo);\n\t\t\t\n\t\t\twhile(fileReader.hasNext())\n\t\t\t{\n\t\t\t\ttemp = fileReader.nextLine().split(\",\");\n\t\t\t\tfor(int i=0; i<loginDetails.size(); i++)\n\t\t\t\t\tloginDetails.get(i).add(temp[i]);\n\t\t\t}\n\t\t\tfileReader.close();\n\t\t}writeToFile(loginInfo,\"\");\n if(topics.exists())\n\t\t{\n\t\t\tfileReader = new Scanner(topics);\n\n\t\t\twhile(fileReader.hasNext())\n\t\t\t{\n\t\t\t\ttemp = fileReader.nextLine().split(\",\");\n\t\t\t\tfor(int i=0; i<topicsMenu.size(); i++)\n\t\t\t\t\ttopicsMenu.get(i).add(temp[i]);\n\t\t\t}\n\t\t\tfileReader.close();\n\t\t}\n\t\t if(topic.exists())\n\t\t{\n\t\t\tfileReader = new Scanner(topic);\n\n\t\t\twhile(fileReader.hasNext())\n\t\t\t{\n\t\t\t\ttemp = fileReader.nextLine().split(\",\");\n\t\t\t\tfor(int i=0; i<topicMenu.size(); i++)\n\t\t\t\t\ttopicMenu.get(i).add(temp[i]);\n\t\t\t}\n\t\t\tfileReader.close();\n\t\t}\n\t\tif(games.exists())\n\t\t{\n\t\t\tfileReader = new Scanner(games);\n\n\t\t\twhile(fileReader.hasNext())\n\t\t\t{\n\t\t\t\ttemp = fileReader.nextLine().split(\",\");\n\t\t\t\tfor(int i=0; i<gameMenu.size(); i++)\n\t\t\t\t\tgameMenu.get(i).add(temp[i]);\n\t\t\t}\n\t\t\tfileReader.close();\n\t\t}\n if(questions.exists())\n\t\t{\n\t\t\tfileReader = new Scanner(questions);\n while(fileReader.hasNext())\n\t\t\t{\n\t\t\t\ttemp = fileReader.nextLine().split(\",\");\n\t\t\t\tfor(int i=0; i<questionDetails.size(); i++)\n\t\t\t\t\tquestionDetails.get(i).add(temp[i]);\n\t\t\t}\n\t\t\tfileReader.close();\n\t\t}\n }", "private void downloadStudentList(){\n\t\t// wrzucenie poprzedniej listy (newlist) do oldList \n\t\toldStudentList = newStudentList;\n\t\t\n\t\t// sprawdzenie czy adresy/sciezki sa podane \n\t\tif(urlAdress.equals(\"\") && filePath.equals(\"\")){\n\t\t\tthrow new CrawlerException(\"Nie podano adresu URL i �cie�ki do pliku!\");\n\t\t}\n\t\t// pobranie nowej listy studentow do newList\n\t\tif(!urlAdress.equals(\"\")){\n\t\t\tdownloadFromUrl();\n\t\t}else if(!filePath.equals(\"\")){\n\t\t\tdownloadFromFile();\n\t\t}\n\t}", "public static void main(String[] args) throws IOException {\r\n\t\t\r\n\t\ttry {\r\n\t\tString inputfile = args[0]+\".txt\";\r\n\t\tString outputfile = args[1]+\".txt\";\r\n\t\tString outputfile2 = args[2]+\".txt\";\r\n\r\n\r\n\r\n\t\tFileInputStream textFile1 = new FileInputStream(inputfile);\r\n\t\tScanner scan = new Scanner(textFile1);\r\n\t\tBinaryTree bst = new BinaryTree();\r\n\t\t\r\n\t\t//reading input files and storing\r\n\t\twhile(scan.hasNextLine()){\r\n\t\t\t\r\n\t\tString s = scan.nextLine();\r\n\t\tchar code=s.charAt(0);\r\n\t\tint id = Integer.parseInt(s.substring(1, 8));\r\n\t\t\tString nah=s.substring(8,8+25);\r\n\t\t\tString name= nah.trim();\r\n\t\t\tString department=s.substring(33,37);\r\n\t\t\tString program=s.substring(37,40);\r\n\t\t\tchar year=s.charAt(41);\r\n\t\t\tNode n= new Node();\r\n\t\t\tStudent stu = new Student();\r\n\t\t\tn.code=code;\r\n\t\t\tstu.id=id;\r\n\t\t\tstu.name=name;\r\n\t\t\tstu.department=department;\r\n\t\t\tstu.program=program;\r\n\t\t\tstu.year=year;\r\n\t\t\tif(code=='I')\r\n\t\t\t\tbst.insert(stu);\r\n\t\t\telse if(code=='D')\r\n\t\t\t\tbst.deleteKey(stu);\r\n\t\t\telse\r\n\t\t\t\tSystem.out.println(\"Wrong code detected in input file. Should be I or D\");\r\n\t\t\t//System.out.println(\"Code: \" + code + \" ID: \" + stu.id + \" Name: \" + stu.name+ \" Dep: \" + stu.department + \" Program: \" + stu.program + \" Year: \"+ stu.year);\r\n\t\t}\r\n\t\t //Just changing the Stream so it will print to a file instead of console.\r\n\t\t PrintStream printStream = new PrintStream(new FileOutputStream(outputfile));\r\n\t\t System.setOut(printStream);\r\n\t\t System.out.println(\"\\nInorder traversal of binary tree is \");\r\n\t\t System.out.println(String.format(\"%-10s %-7s %-4s %-4s %-4s \",\"Name\",\" ID\",\"Department\",\"Program\",\"Year\"));\r\n\t\t bst.printInorder(outputfile);\r\n\t\t PrintStream printStream2 = new PrintStream(new FileOutputStream(outputfile2));\r\n\t\t System.setOut(printStream2);\r\n\t\t System.out.println(\"\\nBreadthFirst traversal of binary tree is \");\r\n\t\t System.out.println(String.format(\"%-10s %-7s %-4s %-4s %-4s \",\"Name\",\" ID\",\"Department\",\"Program\",\"Year\"));\r\n\t\t bst.printLevelOrder(outputfile2);\r\n\t\t \r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\tSystem.out.println(\"usage\");\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.exit(1);\r\n\t\t}\r\n\t\r\n\t}", "public static void runProgram() throws IOException{\n\t\tALL_STUDENTS.add(new StudentDetails()); //dummy StudentDetails object set to index 0 of the ArrayList. This is to ensure no student can have his/her Id set to 0.\n\t\tinitializeAllGenresList();\n\t\tScanner string_input = new Scanner(System.in); //stores string input from the user\n\t\tboolean authenticated = false; //stores whether user entered correct username and password combination\n\t\t\n\t\twhile(!authenticated){\n\t\t\tString username_input;\n\t\t\tString password_input;\n\t\t\tSystem.out.println(\"Enter username: \");\n\t\t\tusername_input = string_input.next(); //store input for username\n\t\t\tSystem.out.println(\"Enter password: \");\n\t\t\tpassword_input = string_input.next(); //store input for password\n\t\t\tauthenticated = authenticateUser(username_input, password_input); //checks whether correct username and password combination was entered\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\t\t/*load all the BookDetails objects in the books.txt file into ALL_BOOKS, then\n\t\t * load all the StudentDetails objects in the students.txt file into ALL_STUDENTS\n\t\t */\n\t\tif(loadBooks() && loadStudents()){ //if there's no error loading all the BookDetails and StudentDetails\n\t\t\tSystem.out.println();\n\t\t\tdisplayMainMenu();\n\t\t\tint menu_option = getIntegerInput(); //ensures user input is an integer value\n\t\t\texecuteMenuOption(menu_option);\t//execute menu option entered by user\n\t\t}\n\t\t\n\t\telse{\n\t\t\tSystem.out.println(\"Sorry an error occurred while loading! Please check documentation to fix error and then restart the program.\");\n\t\t}\n\t}", "public void getOldFile() throws FileNotFoundException, IOException, ClassNotFoundException{\r\n\t\tObjectInputStream ois = new ObjectInputStream(new FileInputStream(\"agenda.txt\"));\r\n\t\tArrayList<Artist> inputArtists = (ArrayList<Artist>) ois.readObject();\r\n\t\tArrayList<Stage> inputStages = (ArrayList<Stage>) ois.readObject();\r\n\t\tArrayList<Performance> inputPerformances = (ArrayList<Performance>) ois.readObject();\r\n\t\tartists.addAll(inputArtists);\r\n\t\tstages.addAll(inputStages);\r\n\t\tperformances.addAll(inputPerformances);\r\n\t}", "public static void main(String[] args) {\n\t\tint choice;\n\t\t\n\t\tScanner sc=new Scanner(System.in);\n\t\ttry\n\t\t{\n\t\t\t\n\t\t\n\t\tFileOutputStream fos=new FileOutputStream(\"F:\\\\Student.txt\");\n\t\tObjectOutputStream dos=new ObjectOutputStream(fos);\n\t FileInputStream fis=new FileInputStream(\"F:\\\\student.txt\");\t\n\t\tObjectInputStream ois=new ObjectInputStream(fis);\n\t //ArrayList<StudentDet> arl=new ArrayList<StudentDet>();\n\t \n\t\t\n\t\tSystem.out.println(\"1.Store data into file\");\n\t System.out.println(\"2.read whos age is > 18 and write into another file\");\n\t System.out.println(\"exit\");\n\t\tSystem.out.println(\"enter choice\");\n\t\tchoice=sc.nextInt();\n\t\t\n\t\tStudentOperation so=new StudentOperation();\n\t \n\t // sdt.accept();\n\t \n\t\t/*StudentDet sd=new StudentDet();\n\t\tStudentDet sd1=new StudentDet(1,10,220406,\"a\");\n\t\tStudentDet sd2=new StudentDet(4,15,220406,\"am\");\n\t\tStudentDet sd3=new StudentDet(3,33,220406,\"amber\");\n\t\tStudentDet sd4=new StudentDet(5,23,220406,\"er\");\n\t\tStudentDet sd5=new StudentDet(6,19,220406,\"amer\");\n\t\tStudentDet sd6=new StudentDet(2,20,220406,\"ambr\");\n\t\t*/\n\t\t\n\t\tswitch(choice)\n\t\t{\n\t\tcase 1:so.store(); \n\t\t\tbreak;\n\t\t\n\t\tcase 2:\tso.Readstore();\n\t\tbreak;\n\t\t\n\t\tdefault:System.out.println(\"invalid choice\");\n\t\tbreak;\t\n\t\t}\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t \n\t}", "static void initializeStudentSystem() {\r\n\r\n Course math = new Course(\"1000\", \"Mathematics\", \"College of Science\");\r\n Course computing = new Course(\"1001\", \"Computing\", \"College of Engineering\");\r\n Course english = new Course(\"1002\", \"English\", \"College of Liberal Arts\");\r\n Course history = new Course(\"1003\", \"History\", \"College of Liberal Arts\");\r\n Course biology = new Course(\"1004\", \"Biology\", \"College of Science\");\r\n courses.put(math.getCRN(), math);\r\n courses.put(computing.getCRN(), computing);\r\n courses.put(english.getCRN(), english);\r\n courses.put(history.getCRN(), history);\r\n courses.put(biology.getCRN(), biology);\r\n //\r\n User admin = new User();\r\n admin.setUsername(\"admin\");\r\n admin.setPassword(\"admin\");\r\n admin.setAccountType(4);\r\n accounts.put(admin.getUsername(), admin);\r\n //\r\n Student defaultStudent = new Student();\r\n defaultStudent.setName(\"Jose Cabrera\");\r\n defaultStudent.setUsername(\"John1\");\r\n defaultStudent.setPassword(\"123\");\r\n defaultStudent.setId(\"80539934\");\r\n defaultStudent.setMajor(\"CS\");\r\n defaultStudent.setAccountType(1);\r\n defaultStudent.setGraduationStatus(21);\r\n accounts.put(\"John1\", defaultStudent);\r\n //\r\n Student defaultStudent2 = new Student();\r\n defaultStudent2.setName(\"Raul Hinostroza\");\r\n defaultStudent2.setUsername(\"John2\");\r\n defaultStudent2.setPassword(\"123\");\r\n defaultStudent2.setId(\"805393\");\r\n defaultStudent2.setMajor(\"CS\");\r\n defaultStudent2.setAccountType(1);\r\n accounts.put(\"John2\", defaultStudent2);\r\n //\r\n Student defaultStudent3 = new Student();\r\n defaultStudent3.setName(\"Max Morales\");\r\n defaultStudent3.setUsername(\"John3\");\r\n defaultStudent3.setPassword(\"123\");\r\n defaultStudent3.setId(\"8053923\");\r\n defaultStudent3.setMajor(\"CS\");\r\n defaultStudent3.setAccountType(1);\r\n accounts.put(\"John3\", defaultStudent3);\r\n defaultStudent.addCourses(\"1000\");\r\n defaultStudent2.addCourses(\"1000\");\r\n defaultStudent3.addCourses(\"1000\");\r\n //\r\n Faculty defaultFaculty = new Faculty();\r\n defaultFaculty.setAccountType(2);\r\n defaultFaculty.setName(\"Smith\");\r\n defaultFaculty.setUsername(\"Smith1\");\r\n defaultFaculty.setPassword(\"123\");\r\n accounts.put(defaultFaculty.getUsername(), defaultFaculty);\r\n //\r\n Staff defaultStaff = new Staff();\r\n defaultStaff.setAccountType(3);\r\n defaultStaff.setName(\"Smith\");\r\n defaultStaff.setUsername(\"Smith2\");\r\n defaultStaff.setPassword(\"123\");\r\n accounts.put(defaultStaff.getUsername(), defaultStaff);\r\n }", "private FileManager()\n {\n bookFile.open(\"bookdata.txt\");\n hisFile.open(\"history.txt\");\n idFile.open(\"idpassword.txt\");\n createIDMap();\n createHisMap(Customer.getInstance());\n }", "private void importStudent(ClassPathResource studentFile) throws IOException {\n\t\t//System.out.println(studentFile.getFilename());\n\t\tFileInputStream fileInputStream = new FileInputStream(resourceStudent.getFile());\n\t\t@SuppressWarnings(\"resource\")\n\t\tWorkbook workbook = new XSSFWorkbook(fileInputStream);\n\t\tSheet sheet = workbook.getSheetAt(0);\n\t\tboolean validate = studentReader.validdateFile(sheet);\n\t\tMainClass mainClass = null;\n\t\tList<Student> students = null;\n\t\tif(!validate) {\n\t\t\tSystem.out.println(\"STUDENT SEEDING ERROR!\");\n\t\t\treturn;\n\t\t}\n\t\tmainClass = students.get(0).getMainClass();\n\t\tFaculty faculty = mainClass.getFaculty();\n\t\tLecturer lecturer = mainClass.getLecturer();\n\t\tif(!facultyService.findById(faculty.getFacultyId()).isPresent())\n\t\t\tfacultyService.save(faculty);\n\t\telse\n\t\t\tfaculty = facultyService.findById(faculty.getFacultyId()).get();\n\t\tmainClass.setFaculty(faculty);\n\t\tif(!lecturerService.existsById(lecturer.getId()))\n\t\t\tlecturerService.save(lecturer);\n\t\telse\n\t\t\tlecturer = lecturerService.findById(lecturer.getId()).get();\n\t\tmainClass.setLecturer(lecturer);\n\t\tmainClassService.save(mainClass);\n\t\tstudentService.saveAll(students);\n\t\texcelFileHandlerService.getStudents().clear();\n\t}", "@Override\n public void edit(){\n Integer Pointer=0;\n FileWriter editDetails = null;\n ArrayList<String> lineKeeper = saveText();\n\n /* Search into the list to find the Username, if it founds it, changes the\n * old information with the new information.\n * Search*/\n if(lineKeeper.contains(getUsername())){\n Pointer=lineKeeper.indexOf(getUsername());\n\n //Write the new information\n lineKeeper.set(Pointer+1, getPassword());\n lineKeeper.set(Pointer+2, getFirstname());\n lineKeeper.set(Pointer+3, getLastname());\n lineKeeper.set(Pointer+4, DMY.format(getDoB()));\n lineKeeper.set(Pointer+5, getContactNumber());\n lineKeeper.set(Pointer+6, getEmail());\n lineKeeper.set(Pointer+7, String.valueOf(getSalary()));\n lineKeeper.set(Pointer+8, getPositionStatus());\n Pointer=Pointer+9;\n homeAddress.edit(lineKeeper,Pointer);\n }//end if\n\n try{\n editDetails= new FileWriter(\"employees.txt\",false);\n for( int i=0;i<lineKeeper.size();i++){\n editDetails.append(lineKeeper.get(i));\n editDetails.append(System.getProperty(\"line.separator\"));\n }//end for\n editDetails.close();\n editDetails = null;\n }//end try\n catch (IOException ioe) {}//end catch\n }", "private void writeItems() {\n\n // open file\n File file = getFilesDir();\n File todoFile = new File(file, \"scores.txt\");\n\n // try to add items to file\n try {\n FileUtils.writeLines(todoFile, items);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public static void updateStudentList(String content) {\n String timestamp = String.format(\"List last updated %s\", new Date()); \n try {\n BufferedWriter writer = new BufferedWriter(new FileWriter(Constants.STUDENT_LIST)); \n writer.write(content);\n writer.newLine();\n writer.append(timestamp); \n writer.close();\n } catch (IOException exception) {\n System.out.println(exception);\n } \n }", "public static void main(String[] args) throws FileNotFoundException, IOException {Kollar ifall filen hittas\n //\n try {\n File studentfil = new File(\"studentfil\");\n File betygsfil = new File(\"betygsfil\");\n int antalVgUppgifter = 2;\n\n ArrayList<Student> studenter = lasStudentfil(studentfil, antalVgUppgifter);\n skrivBetygsfil(studenter, betygsfil);\n }catch(FileNotFoundException ex){\n System.out.println(\"Kunde inte hitta filen...\");\n }catch(IOException ex){\n System.out.println(\"Något gick fel...\");\n }\n }", "public static void save() {\n\t\t// Save each user \n\t\t// and list of directories \n\t\t// and files in each directory\n\t\tArrayList<String> usernames = getRegisteredUserNames();\n\t\tUtils.FileUtils.write(\n\t\t\t\tusernames, \n\t\t\t\tGlobal.Constants.LIST_OF_USERS\n\t\t\t\t);\t\n\t\tfor (User user:Global.Variables.registeredUsers) {\n\t\t\tUtils.FileUtils.write(\n\t\t\t\tuser.getDirectoryNames(), \n\t\t\t\tGlobal.Constants.DIRECTORY_LOCATION + user.getName()\n\t\t\t\t);\n\t\t\tsave(user);\n\t\t}\n\t}", "private void saveGenres(){\n\t\tFile genreList = new File(Paths.get(\"genres.txt\").toString());\n\t\ttry{\n\t\t\tBufferedWriter writer = new BufferedWriter(new FileWriter(genreList));\n\t\t\tfor (String s : genres){\n\t\t\t\twriter.write(s);\n\t\t\t\twriter.newLine();\n\t\t\t}\n\t\t\twriter.close();\n\t\t} catch(IOException ex){\n\t\t\t\n\t\t}\n\t}", "public void importStudents(String fileName) throws FileNotFoundException\n {\n Scanner inf = new Scanner(new File(fileName));\n while(inf.hasNextLine())\n {\n String first = inf.nextLine();\n String last = inf.nextLine();\n String password = inf.nextLine();\n String p1 = inf.nextLine();\n String p2 = inf.nextLine();\n String p3 = inf.nextLine();\n String p4 = inf.nextLine();\n String p5 = inf.nextLine();\n String p6 = inf.nextLine();\n String p7 = inf.nextLine();\n String p8 = inf.nextLine();\n \n students.add(new Student(first, last, password, p1, p2, p3, p4, p5, p6, p7, p8, this));\n }\n }", "public void readFileContent(String path) {\n\t\ttry (FileReader fr = new FileReader(path); BufferedReader br = new BufferedReader(fr);) {\n\t\t\tString line;\n\t\t\twhile ((line = br.readLine()) != null) {\n\t\t\t\tStudent student = this.convertStringToStudent(line);\n\t\t\t\tthis.addStudent(student);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tthrow new RuntimeException(\"File read failed.\", e);\n\t\t}\n\t}", "public void writeDocumentForA(String filename, String path) throws Exception\r\n\t{\n\t\tFile folder = new File(path);\r\n\t\tFile[] listOfFiles = folder.listFiles();\r\n\t \r\n\t \r\n\t \tFileWriter fwText;\r\n\t\tBufferedWriter bwText;\r\n\t\t\r\n\t\tfwText = new FileWriter(\"C:/Users/jipeng/Desktop/Qiang/updateSum/TAC2008/Parag/\"+ filename+\"/\" +\"A.txt\");\r\n\t\tbwText = new BufferedWriter(fwText);\r\n\t\t\r\n\t \tfor ( int i=0; i<listOfFiles.length; i++) {\r\n\t \t\t//String name = listOfFiles[i].getName();\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tString text = readText(listOfFiles[i].getAbsolutePath());\r\n\t\t\t\r\n\t\t\tFileWriter fwWI = new FileWriter(\"C:/pun.txt\");\r\n\t\t\tBufferedWriter bwWI = new BufferedWriter(fwWI);\r\n\t\t\t\r\n\t\t\tbwWI.write(text);\r\n\t\t\t\r\n\t\t\tbwWI.close();\r\n\t\t\tfwWI.close();\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tList<List<HasWord>> sentences = MaxentTagger.tokenizeText(new BufferedReader(new FileReader(\"C:/pun.txt\")));\r\n\t\t\t\r\n\t\t\t//System.out.println(text);\r\n\t\t\tArrayList<Integer> textList = new ArrayList<Integer>();\r\n\t\t\t\r\n\t\t\tfor (List<HasWord> sentence : sentences)\r\n\t\t\t {\r\n\t\t\t ArrayList<TaggedWord> tSentence = tagger.tagSentence(sentence);\r\n\t\t\t \r\n\t\t\t for(int j=0; j<tSentence.size(); j++)\r\n\t\t\t {\r\n\t\t\t \t \tString word = tSentence.get(j).value();\r\n\t\t\t \t \t\r\n\t\t\t \t \tString token = word.toLowerCase();\r\n\t\t\t \t \r\n\t\t\t \t \tif(token.length()>2 )\r\n\t\t\t\t \t{\r\n\t\t\t \t\t\t if (!m_EnStopwords.isStopword(token)) \r\n\t\t\t \t\t\t {\r\n\t\t\t \t\t\t\t\r\n\t\t\t\t\t\t\t\t if (word2IdHash.get(token)==null)\r\n\t\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t\t textList.add(id);\r\n\t\t\t\t\t\t\t\t\t // bwText.write(String.valueOf(id)+ \" \");\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t word2IdHash.put(token, id);\r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t allWordsArr.add(token);\r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t id++;\r\n\t\t\t\t\t\t\t\t } else\r\n\t\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t \tint wid=(Integer)word2IdHash.get(token);\r\n\t\t\t\t\t\t\t\t \tif(!textList.contains(wid))\r\n\t\t\t\t\t\t\t\t \t\ttextList.add(wid);\r\n\t\t\t\t\t\t\t\t \t//bwText.write(String.valueOf(wid)+ \" \");\r\n\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t \t}\r\n\t\t\t \t }\r\n\t\t\t }\r\n\t\t\tCollections.sort(textList);\r\n\t\t \r\n\t\t\tString text2 = valueFromList(textList);\r\n\t\t bwText.write(text2);\r\n\t\t //System.out.println(text2);\r\n\t\t bwText.newLine();\r\n\t\t textList.clear();\r\n\t\t \r\n\t \t}\r\n\t \tbwText.close();\r\n\t fwText.close();\r\n\t}", "@Test\n\tpublic void testWriteFacultyRecords() throws FileNotFoundException {\n\t\tLinkedList<Faculty> facultyDirectory = FacultyRecordIO\n\t\t\t\t.readFacultyRecords(\"test-files/expected_faculty_records.txt\");\n\t\ttry {\n\t\t\tFacultyRecordIO.writeFacultyRecords(\"test-files/actual_faculty_records.txt\", facultyDirectory);\n\t\t} catch (FileNotFoundException e) {\n\t\t\tthrow new FileNotFoundException();\n\t\t} catch (IOException e) {\n\t\t\tfail(\"Cannot write to faculty directory file\");\n\t\t}\n\n\t\tcheckFiles(\"test-files/expected_faculty_records.txt\", \"test-files/actual_faculty_records.txt\");\n\t}", "public void uploadDataFromFile()\n {\n String jobSeekerFile = (\"JobSeeker.txt\");\n String jobRecruiterFile = (\"JobRecruiter.txt\");\n String jobFile = (\"Job.txt\");\n String notificationFile = (\"Notification.txt\");\n \n String jobSeekerLines = readFile(jobSeekerFile);\n String jobRecruiterLines = readFile(jobRecruiterFile);\n String jobLines = readFile(jobFile);\n String notificationLines = readFile(notificationFile);\n \n storeJobSeekersToJobSeekerList(jobSeekerLines);\n storeJobRecruitersToJobRecruiterList(jobRecruiterLines);\n storeJobsToJobList(jobLines);\n storeNotificationsToNotificationList(notificationLines);\n \n }", "private void updateStudentProfileInfo() {\n\t\t\n\t\tstudent.setLastName(sLastNameTF.getText());\n\t\tstudent.setFirstName(sFirstNameTF.getText());\n\t\tstudent.setSchoolName(sSchoolNameTF.getText());\n\t\t\n\t\t//Update Student profile information in database\n\t\t\n\t}", "public void closeFile()\n {\n ArrayList<String> jobs = new ArrayList<String>();\n ArrayList<String> jobRecruiters = new ArrayList<String>();\n ArrayList<String> jobSeekers = new ArrayList<String>();\n ArrayList<String> notifications = new ArrayList<String>();\n for (Job job : jobList)\n {\n String jobinfo = job.getJobRecruiterUsername() + \"///\" + job.getTitle() + \"///\" + job.getDescription() + \"/// \" + job.getSalary();\n jobinfo = jobinfo + \"///\" + job.getLocation() + \"///\";\n for (String cate: job.getCategory())\n {\n jobinfo = jobinfo + cate + \",\";\n }\n jobinfo = jobinfo.substring(0,jobinfo.length()-1) + \"///\";\n for (String seek : job.getJobSeekerUsername())\n {\n jobinfo = jobinfo + seek + \",\";\n }\n jobinfo = jobinfo.substring(0,jobinfo.length()-1);\n jobs.add(jobinfo);\n }\n writeFile(\"Job.txt\", jobs);\n for (JobRecruiter recruiter : jobRecruiterList)\n {\n String recinfo = recruiter.getName() + \",\" + recruiter.getUserName() + \",\" + recruiter.getRole() + \",\" + recruiter.getGender() + \",\";\n recinfo = recinfo + recruiter.getEmail() + \",\" + recruiter.getPassword() + \",\" + recruiter.getCompanyName() + \",\" + recruiter.getLocation();\n jobRecruiters.add(recinfo);\n }\n writeFile(\"JobRecruiter.txt\", jobRecruiters);\n for (JobSeeker seeker : jobSeekerList)\n {\n String seekinfo = seeker.getName() + \",\" + seeker.getUserName() + \",\" + seeker.getRole() + \",\" + seeker.getGender() + \",\";\n seekinfo = seekinfo + seeker.getEmail() + \",\" + seeker.getPassword() + \",\";\n for(String skill : seeker.getSkillsets())\n {\n seekinfo = seekinfo + skill + \",\";\n }\n seekinfo = seekinfo.substring(0,seekinfo.length()-1);\n String notinfo = seeker.getUserName() + \"///\";\n for (String noti : seeker.getNotification())\n {\n notinfo = notinfo + noti + \",\";\n }\n notinfo = notinfo.substring(0,notinfo.length()-1);\n jobSeekers.add(seekinfo);\n notifications.add(notinfo);\n }\n writeFile(\"JobSeeker.txt\", jobSeekers);\n writeFile(\"Notification.txt\", notifications);\n }", "static void writeToFiles() throws IOException {\n\n writeToFilePriceHistory();\n writeToFileEmployees();\n writeToFileInventory();\n writeToSaleItems();\n writeToOrder();\n writeToFileInventory();\n writeToRevenueLog();\n }", "@Override\n protected void onCreate (Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n surname = (EditText) findViewById(R.id.surname);\n group = (EditText) findViewById(R.id.group);\n faculty = (EditText) findViewById(R.id.faculty);\n\n w_file = (EditText) findViewById(R.id.w_file);\n r_file = (EditText) findViewById(R.id.r_file);\n\n b_write = (Button) findViewById(R.id.b_write);\n b_read = (Button) findViewById(R.id.b_read);\n\n tv_text = (TextView) findViewById(R.id.tv_text);\n\n b_read.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n String fileName;\n fileName = r_file.getText().toString() + \".txt\";\n tv_text.setText(readFile(fileName));\n }\n });\n\n\n b_write.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n String record, fileName;\n record = surname.getText().toString() + \"\\n\" + group.getText().toString() + \"\\n\" + faculty.getText().toString();\n fileName = w_file.getText().toString() + \".txt\";\n saveFile (fileName,record);\n }\n });\n\n\n }", "public static void guardar()\n {\n File fileUsuario,fileDocente;\n ObjectOutputStream entradaUsuario,entradaDocente;\n \n fileDocente = new File(\"docentes\"); \n fileUsuario = new File(\"usuarios\");\n \n try \n {\n \n entradaDocente = new ObjectOutputStream(new FileOutputStream(fileDocente));\n entradaUsuario = new ObjectOutputStream(new FileOutputStream(fileUsuario));\n \n entradaDocente.writeObject(docentes);\n entradaUsuario.writeObject(usuarios);\n \n entradaDocente.close();\n entradaUsuario.close();\n } \n catch (Exception e) \n {\n e.printStackTrace();\n }\n }", "private void storeData() {\r\n final File tweetsFile = new File(tweetsStorePath);\r\n final File usersFile = new File(usersStorePath);\r\n final Set<TweetEntity> tweetEntities = new HashSet();\r\n final Set<UserEntity> userEntities = new HashSet();\r\n \r\n tweets.entrySet().stream().forEach(entry -> {\r\n entry.getValue().stream().forEach(\r\n status -> {\r\n try {\r\n tweetEntities.add(\r\n new TweetEntity(status,\r\n entry.getKey()));\r\n userEntities.add(\r\n new UserEntity(status.getUser()));\r\n } catch (UnsupportedEncodingException ex) {\r\n \r\n }\r\n });\r\n });\r\n\r\n try {\r\n try (PrintWriter tweetWriter = new PrintWriter(tweetsFile)) {\r\n tweetEntities.stream().forEach(entity -> {\r\n tweetWriter.println(entity.toString());\r\n });\r\n }\r\n try (PrintWriter userWriter = new PrintWriter(usersFile)) {\r\n userEntities.stream().forEach(entity -> {\r\n userWriter.println(entity.toString());\r\n });\r\n }\r\n } catch (IOException ex) {\r\n System.out.println(\"DBLIS - storeData() - error storing data\" + ex);\r\n }\r\n }", "public void allartongs() throws IOException{\r\n writefiles data=new writefiles(\"d:\\\\documents\\\\textfiles\\\\AllArtSongs.txt\",true);\r\n Map<String,String> ArrangerNamesLineMap=new HashMap<>();\r\n for(int songid:ArrangerLinesMap.keySet()){\r\n int arrangerid=ArrangerLinesMap.get(songid);\r\n ArrangersMap.get((songid));\r\n ArrangerNamesLineMap.put(test.getsongName(songid), ArrangersMap.get(arrangerid));\r\n }\r\n for(String songname:ArrangerNamesLineMap.keySet()){\r\n System.out.println(\"The artist is:\"+ArrangerNamesLineMap.get(songname)+\" The song is:\"+songname);\r\n data.writeToFile(\"The artist is:\"+ArrangerNamesLineMap.get(songname)+\" The song is:\"+songname);\r\n }\r\n System.out.println(ArrangerNamesLineMap.size());\r\n }", "public void saveBook() throws FileNotFoundException {\n\t\tString formated;\n\n\t\tFile saveFile = new File(FILEPATH); \n\t\tPrintWriter o = new PrintWriter(saveFile);\n\n\t\tfor (int i = 0; i < bookList.size(); i++) {\n\t\t\tint type = bookType(bookList.get(i).getIsbn());\n\t\t\tswitch (type) {\n\t\t\tcase 0: // ChildernsBook\n\t\t\t\tformated = String.format(\"%s;%s;%d;%d;%s;%s;%c\", bookList.get(i).getIsbn(),\n\t\t\t\t\t\tbookList.get(i).getCallNumber(), bookList.get(i).getAvailable(), bookList.get(i).getTotal(),\n\t\t\t\t\t\tbookList.get(i).getTitle(), ((ChildrensBook) bookList.get(i)).getAuthors(),\n\t\t\t\t\t\t((ChildrensBook) bookList.get(i)).getFormat());\n\t\t\t\tbreak;\n\t\t\tcase 1: // CookBook\n\t\t\t\tformated = String.format(\"%s;%s;%d;%d;%s;%s;%c\", bookList.get(i).getIsbn(),\n\t\t\t\t\t\tbookList.get(i).getCallNumber(), bookList.get(i).getAvailable(), bookList.get(i).getTotal(),\n\t\t\t\t\t\tbookList.get(i).getTitle(), ((CookBook) bookList.get(i)).getPublisher(),\n\t\t\t\t\t\t((CookBook) bookList.get(i)).getDiet());\n\t\t\t\tbreak;\n\t\t\tcase 2: // PaperBack\n\t\t\t\tformated = String.format(\"%s;%s;%s;%s;%s;%s;%s;%s\", bookList.get(i).getIsbn(),\n\t\t\t\t\t\tbookList.get(i).getCallNumber(), bookList.get(i).getAvailable(), bookList.get(i).getTotal(),\n\t\t\t\t\t\tbookList.get(i).getTitle(), ((PaperBack) bookList.get(i)).getAuthors(),\n\t\t\t\t\t\t((PaperBack) bookList.get(i)).getYear(), ((PaperBack) bookList.get(i)).getGenre());\n\t\t\t\tbreak;\n\t\t\tcase 3: // periodic\n\t\t\t\tformated = String.format(\"%s;%s;%s;%s;%s;%s;\", bookList.get(i).getIsbn(),\n\t\t\t\t\t\tbookList.get(i).getCallNumber(), bookList.get(i).getAvailable(), bookList.get(i).getTotal(),\n\t\t\t\t\t\tbookList.get(i).getTitle(), ((Periodic) bookList.get(i)).getFrequency());\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tformated = \"Null\";\n\t\t\t}\n\t\t\to.println(formated);\n\t\t}\n\n\t\to.close();\n\n\t}", "private static void loadFiles(String[] files) throws IOException {\n\t\tfor(String file : files){\n\n\t\t\t//Create reader for the file\n\t\t\tBufferedReader fileReader = new BufferedReader(new FileReader(file));\n\n\t\t\t//Create HashMap to store words and counts\n\t\t\tHashMap<String,WordCount> fileWordCounts = new HashMap<String,WordCount>();\n\t\t\tArrayList<String> sentences = new ArrayList<String>();\n\n\t\t\t//While the file still has more lines to be read from\n\t\t\twhile(fileReader.ready()){\n\n\t\t\t\t//Read a line from the file\n\t\t\t\tString fileLine = fileReader.readLine();\n\t\t\t\t//Add the line to file sentences\n\t\t\t\tsentences.add(fileLine);\n\t\t\t\t//Split the file and remove punctuation from words\n\t\t\t\tString[] fileWords = fileLine.replaceAll(\"[^a-zA-Z ]\", \"\").toLowerCase().split(\"\\\\s+\");\n\n\t\t\t\t//iterate through all words in each line\n\t\t\t\tfor (String word : fileWords)\n\t\t\t\t{\n\t\t\t\t\tWordCount count = fileWordCounts.get(word);\n\t\t\t\t\t//If word is not in file, add it \n\t\t\t\t\tif (count == null) {\n\t\t\t\t\t\tfileWordCounts.put(word,new WordCount(word));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcount.inc(); //If not, increment it\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t}\n\n\t\t\t//Add file to fileDatabase \n\t\t\tfileDatabase.map.put(file, new FileObject(file, fileWordCounts, sentences));\n\n\t\t\tfileReader.close(); // Close File\n\n\t\t}//End of For Loop reading from all files\n\t}", "@Test\n public void saveFile() {\n\n // create a new file system object\n FileSystem sampleFileSystem = new FileSystem();\n\n // add our previously created Person Objects to the created Address Book\n ericAddressBook.add(Eric);\n ericAddressBook.add(Daniel);\n\n File sampleFile = new File(\"Address Book\");\n\n\n\n }", "public static void main(String[] args) {\n Scanner scan = null;\n try {\n scan = new Scanner(new File(\"src/input.txt\"));\n } catch (FileNotFoundException e) {\n System.out.println(\"File not found.\");\n }\n\n /** Read the minimum degree of B+Tree first */\n\n int degree = scan.nextInt();\n\n BTree bTree = new BTree(degree);\n\n /** Reading the database student.csv into B+Tree Node*/\n List<Student> studentsDB = getStudents();\n\n for (Student s : studentsDB) {\n bTree.insert(s);\n }\n \n long size = (long) studentsDB.size();\n /** Start reading the operations now from input file*/\n try {\n while (scan.hasNextLine()) {\n Scanner s2 = new Scanner(scan.nextLine());\n\n while (s2.hasNext()) {\n\n String operation = s2.next();\n //System.out.println(operation);\n switch (operation) {\n case \"insert\": {\n\n long studentId = Long.parseLong(s2.next());\n String studentName = s2.next() + \" \" + s2.next();\n String major = s2.next();\n String level = s2.next();\n int age = Integer.parseInt(s2.next());\n /** TODO: Write a logic to generate recordID*/\n\n long recordID = ++size;\n\n Student s = new Student(studentId, age, studentName, major, level, recordID);\n bTree.insert(s);\n\n break;\n }\n case \"delete\": {\n long studentId = Long.parseLong(s2.next());\n boolean result = bTree.delete(studentId);\n if (result)\n System.out.println(\"Student deleted successfully.\");\n else\n System.out.println(\"Student deletion failed.\");\n\n break;\n }\n case \"search\": {\n long studentId = Long.parseLong(s2.next());\n long recordID = bTree.search(studentId);\n if (recordID != -1)\n System.out.println(\"Student exists in the database at \" + recordID);\n else\n System.out.println(\"Student does not exist.\");\n break;\n }\n case \"print\": {\n List<Long> listOfRecordID = new ArrayList<>();\n listOfRecordID = bTree.print();\n System.out.println(\"List of recordIDs in B+Tree \" + listOfRecordID.toString());\n break;\n }\n default:\n System.out.println(\"Wrong Operation\");\n break;\n }\n }\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public void writeStaffEntry(String firstName, String lastName, String userName)\r\n\t{\r\n\t\ttry \r\n\t\t{\r\n\t\t\tPrintWriter out = new PrintWriter(new FileWriter(\"StaffEntryRecords.txt\", true));\r\n\t\t\tout.println(\"First Name: \" +firstName);\r\n\t\t\tout.println(\"Last Name: \" +lastName);\r\n\t\t\tout.println(\"Username: \" +userName);\r\n\t\t\tout.println(\" \");\r\n\t\t\tout.close();\r\n\t\t}\r\n\t\tcatch(FileNotFoundException e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Error: Cannot open file for writing\");\r\n\t\t}\r\n\t\tcatch(IOException e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Error: Cannot write to file\");\r\n\t\t}\r\n\t}", "public static void editStudentInfo(){\n System.out.println(\"Enter the students ID\");\r\n System.out.println(\"=============================\");\r\n Scanner studentNameSearch = new Scanner(System.in);\r\n String idToSearch = studentNameSearch.nextLine();\r\n for (Student searchStudent : studentList){ //basic loop to search through the list of student by the ID\r\n if (searchStudent.getStudentID().equals(idToSearch)){\r\n searchStudent.printStudentInfo();\r\n System.out.println(\"What would you like to do?\");\r\n System.out.println(\"===========================\");\r\n System.out.println(\"1: Change a students name\");\r\n System.out.println(\"2: Add a course\");\r\n System.out.println(\"3: Remove a course\");\r\n System.out.println(\"4: Set course as completed\");\r\n System.out.println(\" \");\r\n Scanner editChoice = new Scanner(System.in);\r\n\r\n switch (editChoice.nextInt()){\r\n case 1 -> {\r\n //Edit first and last name\r\n Scanner newNameInput = new Scanner(System.in);\r\n System.out.println(\"Enter the students Last name\");\r\n String newName = newNameInput.nextLine();\r\n searchStudent.setLastName(newName);\r\n System.out.println(\"Enter the students First name\");\r\n String newName1 = newNameInput.nextLine();\r\n searchStudent.setFirstName(newName1);\r\n searchStudent.getFullName();\r\n mainMenu();\r\n }\r\n case 2 -> {\r\n //search for a course and add a course to the students schedule\r\n System.out.println(\"Enter the course ID\");\r\n Scanner courseToAdd = new Scanner(System.in);\r\n String courseIdToSearch = courseToAdd.nextLine();\r\n for (Course searchCourse : courseList){\r\n if (searchCourse.getCourseID().equals(courseIdToSearch)){\r\n searchStudent.addClasstoSchedule(searchCourse);\r\n }\r\n }\r\n mainMenu();\r\n }\r\n case 3 -> {\r\n //remove a course from the students schedule\r\n System.out.println(\"Enter the course ID\");\r\n Scanner courseToAdd = new Scanner(System.in);\r\n String courseIdToSearch = courseToAdd.nextLine();\r\n for (Course searchCourse : courseList){\r\n if (searchCourse.getCourseID().equals(courseIdToSearch)){\r\n searchStudent.removeClassFromSchedule(searchCourse);\r\n }\r\n }\r\n mainMenu();\r\n }\r\n case 4 ->{\r\n //Set a course as completed\r\n System.out.println(\"Enter the course ID\");\r\n Scanner courseToAdd = new Scanner(System.in);\r\n String courseIdToSearch = courseToAdd.nextLine();\r\n for (Course searchCourse : courseList){\r\n if (searchCourse.getCourseID().equals(courseIdToSearch)){\r\n searchStudent.setCourseComplete(courseIdToSearch);\r\n }\r\n }\r\n mainMenu();\r\n }\r\n default -> {\r\n //does nothing\r\n }\r\n\r\n }\r\n\r\n }\r\n else{\r\n System.err.println(\"Could not find student based on that ID\");\r\n mainMenu();\r\n }\r\n }\r\n }", "public void saveData(String leftPath, String rightPath) throws IOException {\r\n File leftSource = new File(\"././ressources/savedataleft.csv\");\r\n File rightSource = new File(\"././ressources/savedataright.csv\");\r\n File leftDest = new File(leftPath);\r\n File rightDest = new File(rightPath);\r\n Files.copy(leftSource.toPath(), leftDest.toPath(), StandardCopyOption.REPLACE_EXISTING);\r\n Files.copy(rightSource.toPath(), rightDest.toPath(), StandardCopyOption.REPLACE_EXISTING);\r\n }", "private void writeAll(){\n try (BufferedWriter ignored = new BufferedWriter(new FileWriter(this.fileName))) {\n Iterable<E> values=entities.values();\n values.forEach(this::writeToFile);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void createStudents(String fileContents) {\r\n\t\tplot = false;\r\n\t\tif (this.students != null) {\r\n\t\t\tstudents.clear();\r\n\t\t}\r\n\t\tdates.clear();\r\n\t\tattendancePos = 0;\r\n\t\tdataLoaded = 0;\r\n\t\tthis.students = new ArrayList<Student>();\r\n\t\tString[] studentString = fileContents.split(\"\\n\");\r\n\t\tfor (int i=0; i<studentString.length; i++) {\r\n\t\t\tString[] studentInfo = studentString[i].split(\",\");\r\n\t\t\tArrayList<Integer> attendance = new ArrayList<Integer>();\r\n\t\t\ttry {\r\n\t\t\t\tStudent toAdd = new Student(studentInfo[0], studentInfo[1], studentInfo[2], studentInfo[3], studentInfo[4], studentInfo[5], attendance);\r\n\t\t\t\tstudents.add(toAdd);\r\n\t\t\t} catch (ArrayIndexOutOfBoundsException e) {\r\n\t\t\t\tJOptionPane.showMessageDialog(null, \"File Format is incorrect\", \"Error\", 2);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\tsetChanged();\r\n\t\tnotifyObservers();\r\n\t}", "public void save(String fileName){\r\n \tint k = 0;\r\n \t\t\r\n try{\r\n \r\n File f = new File(fileName + \".txt\");\r\n \t//Next line checks if the file already exists.\r\n \t if(f.exists()){\r\n \t \t\r\n \t \t//If it does, we have to ask the user if they\r\n \t \t//want to overwrite it.\r\n \t \t System.out.println(\"A file by this name already exists.\");\r\n \t \t System.out.println(\"Do you want to overwrite it? (Y/N)\");\r\n \t \t Scanner ans = new Scanner(System.in);\r\n \t \t char answer = ans.next().toUpperCase().charAt(0);\r\n \t \t \r\n \t \t \t//If they are comfortable overwriting the already\r\n \t \t \t//existing file, we save the items to the file.\r\n \t \t if(answer == 'Y'){\r\n \t \t \t\t//If the file exists, we have to delete it then\r\n \t \t \t\t//save a new one with that name. This is because\r\n \t \t \t\t//if the file has 6 elements, but the arrayList\r\n \t \t \t\t//only has 4, then only the first 4 of the 6 in the\r\n \t \t \t\t//file are overwritten. So we delete it and create\r\n \t \t \t\t//a new file with the name. If we're over writing,\r\n \t \t \t\t//then we don't care to keep whats in the existing\r\n \t \t \t\t//file.\r\n \t \t \tboolean success = f.delete();\r\n \t \t \tif(success == false) {\r\n \t \t \t\tSystem.out.println(\"Cannot delete file \" + f.getName());\r\n \t \t \t\tSystem.out.println(\"Check if the file is opened by another program and try again...\");\r\n \t \t \t\treturn;\r\n \t \t \t}\r\n \t }else if(answer == 'N'){\r\n \t \tSystem.out.println(\"Try again and enter a different file name.\");\r\n \t \treturn;\r\n \t } else {\r\n \t \tSystem.out.println(\"The answer has to be 'Y' or 'N'. Try again...\");\r\n \t \treturn;\r\n \t }\r\n \t \r\n }\r\n \t//If there is no already existing file by that name,\r\n \t//then the items are saved to this new file.\r\n\t\tFileWriter writer = new FileWriter(fileName + \".txt\");\r\n \r\n\t \twhile(k < items.size()){\r\n \t\t writer.write(items.get(k) + \"\\r\\n\");\r\n \t \tk++;\r\n\t \t}\r\n\t \twriter.close();\r\n\t \tSystem.out.println(\"Saved to: \" + fileName + \".txt\");\r\n\r\n }catch(IOException e){\r\n System.out.println(\"Something went wrong with accessing the file.\");\r\n }\r\n }", "@Override\n public void seedBooks() throws IOException {\n if (this.bookRepository.count() > 0) {\n return;\n }\n\n String[] lines = this.readFileUtil.read(BOOKS_FILE_RELATIVE_PATH);\n for (int i = 0; i < lines.length; i++) {\n /* Get args */\n String[] args = lines[i].split(\"\\\\s+\");\n\n /* Get edition type */\n EditionType editionType = EditionType.values()[Integer.parseInt(args[0])];\n\n /* Get release date */\n LocalDate releaseDate = localDateUtil.parseByPattern(\"d/M/yyyy\", args[1]);\n\n /* Get copies */\n long copies = Long.parseLong(args[2]);\n\n /* Get price */\n BigDecimal price = new BigDecimal(args[3]);\n\n /* Get age restriction */\n AgeRestriction ageRestriction = AgeRestriction.values()[Integer.parseInt(args[4])];\n\n /* Get title */\n String title = Arrays.stream(args).skip(5).collect(Collectors.joining(\" \"));\n\n /* Get author */\n Author randomAuthor = this.randomAuthorUtil.getRandom();\n\n /* Get categories */\n Set<Category> randomCategories = this.randomCategoriesUtil.getRandom();\n\n /* Create book */\n Book book = new Book(ageRestriction, copies, editionType, price, releaseDate, title, randomAuthor);\n book.setCategories(randomCategories);\n\n /* Save the book */\n this.bookRepository.saveAndFlush(book);\n }\n }", "public void editStudentList(String lastName){\n for(int i = 0; i<studList.size();i++){\n \n if(lastName.equals(studList.get(i).getLastName())){\n \n System.out.println(\"Student Name: \" + studList.get(i).getFullName() + \", Student Number: \" + studList.get(i).getStuNumber() + \", Student GPA: \" + studList.get(i).getGPA());\n\n Scanner input = new Scanner(System.in);\n String newName = \"\";\n double newGPA;\n\n System.out.print(\"Student name: \");\n newName = input.nextLine();\n\n System.out.print(\"Student GPA: \");\n newGPA = input.nextDouble();\n\n Student temp = new Student(newName, studList.get(i).getStuNumber(), newGPA);\n studList.set(i, temp);\n }\n }\n }", "public static void readData(ArrayList<Student> students, ArrayList<Course> courses)\r\n {\r\n //emfanizie mnm ston xrhsth,dexetai apanthsh apo ton xrhsth\r\n //kai thn apanthsh thn epistrefei ws alfarithmitiko\r\n\r\n //String answer= JOptionPane.showInputDialog(\"Enter your name:\");\r\n\r\n boolean more= true;\r\n\r\n while(more)\r\n {\r\n\r\n String selection= JOptionPane.showInputDialog(\"1:Student 2:Graduate\");\r\n int choice =Integer.parseInt(selection);\r\n\r\n String name= JOptionPane.showInputDialog(\"Name: \");\r\n String id= JOptionPane.showInputDialog(\"Id: \");\r\n\r\n //to arxikopoiw ws null gia na mhn vgazei error\r\n //ayto symvanei dioti an mpei mesa sto if pernei mai timh an omws den mpei den tha parei timh kai tha vgazei error\r\n String supervisor=null;\r\n\r\n if(choice == 2)\r\n {\r\n supervisor= JOptionPane.showInputDialog(\"Supervisor: \");\r\n }\r\n\r\n Student student;\r\n if(choice==1)\r\n {\r\n student= new Student(name,id);\r\n }\r\n else\r\n {\r\n student= new Graduate(name,id,supervisor);\r\n }\r\n\r\n String coursename =JOptionPane.showInputDialog(\"Enter course name: \");\r\n\r\n //ftiaxnoume ena for wste na diatreksw ola ta mathimata poy exie mesa h lista\r\n //sthn synexeia tha sygkrinw to mathima me thn epilogh tou xrhsth\r\n for (Course course:courses)\r\n {\r\n if(course.getName().equals(coursename))\r\n {\r\n student.addCourses(course);\r\n }\r\n\r\n }\r\n\r\n //ton foithth ton topothetoume sthn lista poy yparxeis thn main kai thn pernei ws orisma h synarthsh\r\n students.add(student);\r\n\r\n String answer= JOptionPane.showInputDialog(\"More Students (Y/N)\");\r\n //gia string tha mporousa na kanw==\"n\"\r\n if(answer.equals(\"N\"))\r\n {\r\n more= false;\r\n }\r\n\r\n }\r\n\r\n\r\n }", "public void writeKeysToFile(){\n if(d == null){\n calculateKeypair();\n }\n FileHandler fh = new FileHandler();\n fh.writeFile(sbPrivate.toString(), \"sk.txt\");\n fh.writeFile(sbPublic.toString(), \"pk.txt\");\n }", "public static void load(){\n StringBuilder maleNamesString = new StringBuilder();\n try (Scanner maleNamesFile = new Scanner(mnames)){\n while (maleNamesFile.hasNext()) {\n maleNamesString.append(maleNamesFile.next());\n }\n }\n catch(FileNotFoundException e){\n e.printStackTrace();\n return;\n }\n\n //Create a string from the fnames.json file\n StringBuilder femaleNamesString = new StringBuilder();\n try (Scanner femaleNamesFile = new Scanner(fnames)){\n while (femaleNamesFile.hasNext()) {\n femaleNamesString.append(femaleNamesFile.next());\n }\n }\n catch(FileNotFoundException e){\n e.printStackTrace();\n return;\n }\n\n //Create a string from the snames.json file\n StringBuilder surNamesString = new StringBuilder();\n try (Scanner surNamesFile = new Scanner(snames)){\n while (surNamesFile.hasNext()) {\n surNamesString.append(surNamesFile.next());\n }\n\n }\n catch(FileNotFoundException e){\n e.printStackTrace();\n return;\n }\n\n //Create a string from the locations.json file\n StringBuilder locationsString = new StringBuilder();\n try (Scanner locationsFile = new Scanner(locationsJson)){\n while (locationsFile.hasNext()) {\n locationsString.append(locationsFile.next());\n }\n\n }\n catch(FileNotFoundException e){\n e.printStackTrace();\n return;\n }\n\n maleNames = (Names)convertJsonToObject(maleNamesString.toString(), new Names());\n\n femaleNames = (Names)convertJsonToObject(femaleNamesString.toString(), new Names());\n\n surNames = (Names)convertJsonToObject(surNamesString.toString(), new Names());\n\n locations = (Locations)convertJsonToObject(locationsString.toString(), new Locations());\n }", "public static void saveData() throws FileNotFoundException {\t\n\t\t\t\n\tScanner inputStream = new Scanner(new File(\"bookings.dat\"));\n\t\ttry {\n\t\t\t\n\t\t\tBookingList.surName = inputStream.nextLine();\n\t\t\tBookingList.tableNo = inputStream.nextLine();\n\t\t\tBookingList.sittingTime = inputStream.nextLine();\n\t\t\tBookingList.partyOf = inputStream.nextLine();\n\t\t\t\t\n\t\t\tBooking<?> bookingData = new Booking<Object>(null, surName, tableNo, sittingTime, partyOf);\n\t\t\tb1.insert(bookingData);\n\t\t\t\t\n\t\t}finally {\n\t\t\tinputStream.close();\n\t\t}\n\t\t\t\n\t}", "public void update() throws IOException{\r\n\t\tObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(\"agenda.txt\", false));\r\n\t\toos.writeObject(artists);\r\n\t\toos.writeObject(stages);\r\n\t\toos.writeObject(performances);\r\n\t\tartists.clear();\r\n\t\tstages.clear();\r\n\t\tperformances.clear();\r\n\t\toos.close();\r\n\t}", "void changeFile()\n {\n App app = new App();\n // Loop through the read File\n for (String s : readFile) {\n if (app.containsUtilize(s)) {\n // Changes the first use of utilize with use\n String newTemp = s.replaceFirst(\"utilize\", \"use\");\n // Writes to file\n this.writeFile.add(newTemp);\n } else {\n // not utilize\n this.writeFile.add(s);\n }\n }\n }", "public void writeFile() \r\n\t{\r\n\t\tStringBuilder builder = new StringBuilder();\r\n\t\tfor(String str : scorers)\r\n\t\t\tbuilder.append(str).append(\",\");\r\n\t\tbuilder.deleteCharAt(builder.length() - 1);\r\n\t\t\r\n\t\ttry(DataOutputStream output = new DataOutputStream(new FileOutputStream(HIGHSCORERS_FILE)))\r\n\t\t{\r\n\t\t\toutput.writeChars(builder.toString());\r\n\t\t} \r\n\t\tcatch (FileNotFoundException e) \r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.err.println(\"[ERROR]:[FileManager] File \" + HIGHSCORERS_FILE + \" was not found \" \r\n\t\t\t\t\t+ \"while writing.\");\r\n\t\t} \r\n\t\tcatch (IOException e) \r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.err.println(\"[ERROR]:[FileManager] Error while reading the file \" + HIGHSCORERS_FILE);\r\n\t\t}\r\n\t}", "void startFile() {\n writeToFile(defaultScore);\n for (int i = 0; i < 5; i++) {\n writeToFile(readFromFile() + defaultScore);\n }\n }", "private static void init() {\n\n students = new HashMap<String, Student>(); //redundant but there for my reference\n\n //new Student objects, from the Student class, that are in our new HashMap called students\n Student annette = new Student(\"Annette\");\n annette.addGrade(90); // addGrade method from the Student class\n annette.addGrade(85);\n annette.addGrade(40);\n\n annette.recordAttendance( \"2019-10-01\", \"A\");\n annette.recordAttendance( \"2019-10-02\", \"P\");\n annette.recordAttendance( \"2019-10-03\", \"A\");\n annette.recordAttendance( \"2019-10-04\", \"P\");\n\n\n Student bridget = new Student(\"Bridget\");\n bridget.addGrade(90);\n bridget.addGrade(70);\n bridget.addGrade(60);\n\n bridget.recordAttendance( \"2019-10-01\", \"A\");\n bridget.recordAttendance( \"2019-10-02\", \"P\");\n bridget.recordAttendance( \"2019-10-03\", \"A\");\n bridget.recordAttendance( \"2019-10-04\", \"P\");\n\n\n Student bev = new Student(\"Bev\");\n bev.addGrade(97);\n bev.addGrade(96);\n bev.addGrade(95);\n\n bev.recordAttendance( \"2019-10-01\", \"A\");\n bev.recordAttendance( \"2019-10-02\", \"P\");\n bev.recordAttendance( \"2019-10-03\", \"A\");\n bev.recordAttendance( \"2019-10-04\", \"P\");\n\n\n Student glo = new Student(\"Glo\");\n glo.addGrade(94);\n glo.addGrade(93);\n glo.addGrade(92);\n\n glo.recordAttendance( \"2019-10-01\", \"A\");\n glo.recordAttendance( \"2019-10-02\", \"P\");\n glo.recordAttendance( \"2019-10-03\", \"A\");\n glo.recordAttendance( \"2019-10-04\", \"P\");\n\n\n // sets the usernames as keys\n // and values that are student objects\n students.put(\"bmills\", bridget);\n students.put(\"annette1\", annette);\n students.put(\"bevvybev\", bev);\n students.put(\"thegloUp\", glo);\n\n }", "public void updateFile() {\n try {\n FileWriter fw = new FileWriter(path);\n for (Task t : taskList.getTasks()) {\n fw.write(t.toTxt());\n }\n fw.close();\n } catch (IOException e) {\n System.out.println(\"File cannot be found\");\n }\n }", "public void writeBuyingHistory(ArrayList<String> boughtBooks)throws IOException\n {\n String toWrite = new String();\n int i =0;\n if(hisMap.get(Customer.getInstance().getUsername())==null)\n {\n hisMap.put(Customer.getInstance().getUsername(),new ArrayList<String>());\n }\n else\n {\n i=0;\n while (i<boughtBooks.size())\n {\n hisMap.get(Customer.getInstance().getUsername()).add(boughtBooks.get(i));\n i++;\n }\n }\n\n\n i=0;\n\n toWrite+=Customer.getInstance().getUsername()+\",\";\n while (i<hisMap.get(Customer.getInstance().getUsername()).size()-boughtBooks.size())\n {\n toWrite+=hisMap.get(Customer.getInstance().getUsername()).get(i)+\"%\";\n i++;\n }\n ;\n i=0;\n while (i<boughtBooks.size())\n {\n toWrite+=boughtBooks.get(i);\n if(i!=boughtBooks.size()-1)\n toWrite+=\"%\";\n i++;\n }\n\n\n\n\n List<String> lines = Files.readAllLines(Paths.get(\"history.txt\"));\n if(specificLine>lines.size()-1)\n {\n lines.add(toWrite);\n }\n else {\n lines.set(specificLine, toWrite);\n }\n /*write part*/\n BufferedWriter bw = null;\n FileWriter fw = null;\n try {\n int j=0;\n String content = \"\";\n while (j<lines.size())\n {\n content+= lines.get(j)+\"\\n\";\n j++;\n }\n\n fw = new FileWriter(\"history.txt\");\n bw = new BufferedWriter(fw);\n bw.write(content);\n\n } catch (IOException e) {\n\n e.printStackTrace();\n\n } finally {\n\n try {\n\n if (bw != null)\n bw.close();\n\n if (fw != null)\n fw.close();\n\n } catch (IOException ex) {\n\n ex.printStackTrace();\n\n }\n\n }\n\n }", "public static void main(String[] args) {\n\t\tStudent ivan = new Student(\"Ivan Petrov\", \"Computer Science\");\n\t\tivan.grade=5.5;\n\t\tivan.yearInCollege=2;\n\t\tivan.money=500;\n\t\tivan.age=19;\n\t\t\n\t\tStudent teodor = new Student(\"Teodor Alexiev\", \"Computer Science\");\n\t\tteodor.grade=5.25;\n\t\tteodor.yearInCollege=3;\n\t\tteodor.money=300;\n\t\tteodor.age=20;\n\t\t\n\t\tStudent irina = new Student(\"Irina Paraskelova\", \"Computer Science\");\n\t\tirina.grade = 5.65;\n\t\tirina.money=400;\n\t\tirina.age=18;\n\t\t\n\t\tStudent vasilena = new Student (\"Vasilena Kremenlieva\", \"Computer Science\");\n\t\tvasilena.grade = 5.0;\n\t\tvasilena.money=1000;\n\t\tvasilena.age=18;\n\t\t\n\t\tStudent trifon = new Student(\"Trifon Stoimenov\", \"Computer Science\");\n\t\ttrifon.grade = 5.70;\n\t\ttrifon.yearInCollege=3;\n\t\ttrifon.money = 800;\n\t\ttrifon.age=21;\n\t\t\n\t\tStudent alexander = new Student (\"Alexander Dobrikov\", \"Finance\");\n\t\talexander.grade = 4.75;\n\t\talexander.yearInCollege = 2;\n\t\talexander.money = 600;\n\t\talexander.age = 20;\n\t\t\n\t\tStudent mirela = new Student (\"Mirela Kostadinova\", \"Finance\");\n\t\tmirela.grade = 5.5;\n\t\tmirela.yearInCollege=1;\n\t\tmirela.money=100;\n\t\tmirela.age=19;\n\t\t\n\t\tStudent velizar = new Student(\"Velizar Stoyanov\", \"Finance\");\n\t\tvelizar.grade = 6.0;\n\t\tvelizar.yearInCollege = 3;\n\t\tvelizar.money = 500;\n\t\tvelizar.age = 22;\n\t\t\n\t\tStudent antoaneta = new Student(\"Antoaneta Borisova\", \"Finance\");\n\t\tantoaneta.grade = 5.30;\n\t\tantoaneta.yearInCollege = 2;\n\t\tantoaneta.money = 750;\n\t\tantoaneta.age = 19;\n\t\t\n\t\tirina.upYear();\n\t\tSystem.out.println(\"Irina is in year \"+irina.yearInCollege+\" of college.\");\n\t\t\n\t\tvasilena.receiveScholarship(5.0, 350);\n\t\tSystem.out.println(vasilena.money);\n\t\t\n\t\tStudentGroup cs1 = new StudentGroup(\"Computer Science\");\n\t\tcs1.addStudent(ivan);\n\t\tcs1.addStudent(teodor);\n\t\tcs1.addStudent(irina);\n\t\tcs1.addStudent(vasilena);\n\t\tcs1.addStudent(trifon);\n\t\tteodor.upYear();\n\t\tSystem.out.println(teodor.isDegree);\n\t\t\n\t\tcs1.addStudent(velizar);\n\t\t\n\t\tcs1.printStudentsInGroup();\n\t\tSystem.out.println(cs1.theBestStudent());\n\t\t\n\t\tcs1.emptyGroup();\n\t\tcs1.printStudentsInGroup();\n\t\t\n\t\tStudentGroup fin1 = new StudentGroup(\"Finance\");\n\t\t\n\t\tfin1.addStudent(alexander);\n\t\tfin1.addStudent(mirela);\n\t\tfin1.addStudent(velizar);\n\t\tfin1.addStudent(antoaneta);\n\t\t\n\t\tfin1.printStudentsInGroup();\n\t\t\t\n\t\t\n\t}", "public void saveAll() {\n\n if (schedule != null) {\n\n readWrite.save(schedule, buddies);\n }\n if (finalsList != null) {\n\n readWrite.save(finalsList, finalsTerm);\n }\n }", "public static void files() throws IOException {\n\n\n try {\n BufferedReader reader = new BufferedReader(new FileReader(\"D:\\\\Text.txt\"));\n String line;\n while ((line = reader.readLine()) != null) {\n Palindroms.palindromeByReverse(line);\n BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(\"D:\\\\output.txt\")));\n writer.append(line);\n writer.close();\n }\n reader.close();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n System.out.println(\"Bye!\");\n }\n }", "public void update(){\n\t\tif ( crm.addedNewStudent()){\n\t\t\tList<Student> students = crm.getStudents();\n\t\t\tStudent newest = students.get(students.size()-1);\n\t\t\tint ID = newest.ID();\n\t\t\tString name = newest.name();\n\t\t\tint GradYear = newest.GradYear();\n\t\t\tsv.addStudent(ID, name, GradYear);\n\t\t}\n\t}", "public static void processFilesForValidation() {\r\n\t\t// Process each file one at a time.\r\n\t\tfor (int i = 0; i < inScanners.length; i++) {\r\n\t\t\tScanner sc = inScanners[i];\r\n\t\t\tint articleCount = 1;\r\n\t\t\t// Read the input file.\r\n\t\t\ttry {\r\n\t\t\t\twhile(sc.hasNextLine()) {\r\n\t\t\t\t\tString s = sc.nextLine();\r\n\t\t\t\t\t// If we come across an article, read its contents and add it to the file.\r\n\t\t\t\t\tif(s.startsWith(\"@ARTICLE{\")) {\r\n\t\t\t\t\t\tauthor = journal = title = year = volume = number = pages = doi = ISSN = month = \"\";\r\n\t\t\t\t\t\twhile (!s.equals(\"}\")) {\r\n\t\t\t\t\t\t\ts = sc.nextLine();\r\n\t\t\t\t\t\t\tparseValue(s);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// Throw an exception if a field is missing.\r\n\t\t\t\t\t\tif (author.isEmpty() || journal.isEmpty() || title.isEmpty() || year.isEmpty() || volume.isEmpty() \r\n\t\t\t\t\t\t\t\t|| number.isEmpty() || pages.isEmpty() || doi.isEmpty() || ISSN.isEmpty() || month.isEmpty()) {\r\n\t\t\t\t\t\t\tthrow new FileInvalidException(\"One or more fields are missing.\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// Add the article to the file if valid.\r\n\t\t\t\t\t\tString author1 = author.replaceAll(\" and\", \",\");\r\n\t\t\t\t\t\tint andIndex = author.indexOf(\"and\");\r\n\t\t\t\t\t\tString author2 = andIndex != -1 ? author.replaceAll(author.substring(andIndex,author.length()), \"et al\") : author;\r\n\t\t\t\t\t\tString author3 = author.replaceAll(\"and\", \"&\");\r\n\t\t\t\t\r\n\t\t\t\t\t\t// IEEE\r\n\t\t\t\t\t\toutWriters[i][0].println(author1+\". \\\"\"+title+\"\\\", \"+journal+\", vol. \"+volume+\", no. \"+number+\", p. \"+pages+\", \"+month+\" \"+year+\".\\r\\n\");\r\n\t\t\t\t\t\t// ACM\r\n\t\t\t\t\t\toutWriters[i][1].println(\"[\"+articleCount+\"]\\t\"+author2+\". \"+year+\". \"+title+\". \"+journal+\". \"+volume+\", \"+number+\" (\"+year+\"), \"+pages+\". DOI:https://doi.org/\"+doi+\".\\r\\n\");\r\n\t\t\t\t\t\t// NJ\r\n\t\t\t\t\t\toutWriters[i][2].println(author3+\". \"+title+\". \"+journal+\". \"+volume+\", \"+pages+\"(\"+year+\").\\r\\n\");\r\n\t\t\t\t\t\tarticleCount++;\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}\r\n\t\t\t\t// Close output writers once file has been read.\r\n\t\t\t\tfor (int j = 0; j < 3; j++) {\r\n\t\t\t\t\toutWriters[i][j].close();\r\n\t\t\t\t}\r\n\t\t\t\tnumValidFiles++;\r\n\t\t\t}\r\n\t\t\t// If file is invalid, close and delete the output files.\r\n\t\t\tcatch (FileInvalidException e) {\r\n\t\t\t\tSystem.out.println(\"Error: Detected Empty Field!\" \r\n\t\t\t\t\t\t + \"\\n============================\"\r\n\t\t\t + \"\\nProblem detected with input file: Latex\" + (i + 1) + \".bib\"\r\n\t\t\t\t\t\t + \"\\nFile is invalid: \" + e.getMessage() + \" Processing stopped at this point. \"\r\n\t\t\t\t\t\t + \"Other empty/missing fields may be present as well.\\n\");\r\n\t\t\t\tfor (int j = 0; j < 3; j++) {\r\n\t\t\t\t\toutWriters[i][j].close();\r\n\t\t\t\t\toutFiles[i][j].delete();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// Close input file after reading.\r\n\t\t\tsc.close();\r\n\t\t}\r\n\t}", "public void writeSparseVecsForSplit(String fileName, List<String> docNames,\n boolean includeTextAttribs,\n NodeVecs ndvecs, boolean withWords,\n WordVecs contextVecs, int startArmId) throws IOException {\n File file = new File(fileName);\n file.getParentFile().mkdirs();\n FileWriter fw = new FileWriter(file);\n BufferedWriter bw = new BufferedWriter(fw);\n\n WekaDataset dataset = new WekaDataset(trainInstances, testInstances);\n List<WekaDataset.AttributeHeader> headers = dataset.getHeaders();\n Map<String, WekaDataset.AttributeHeader> headerMap = new HashMap<>();\n for (WekaDataset.AttributeHeader header: headers) {\n headerMap.put(header.getAttribute().getId(), header);\n }\n \n for (String docName: docNames) {\n List<DataInstance> perDocList = DataInstance.getInstancesForDoc(attributeValueCollection, docName);\n int armId = 0;\n for (DataInstance dataInstance: perDocList) {\n armId++;\n String docArmId = constructDocArmId(docName, armId, startArmId); // unique for a doc-arm\n String line = withWords?\n getSparseVecWithWords(docArmId, headerMap, dataInstance, ndvecs, contextVecs):\n getSparseVec(headerMap, dataInstance, includeTextAttribs, ndvecs)\n ;\n if (line == null)\n continue;\n bw.write(line);\n // Write out the doc name as well for more info... Appending as the last token\n // so that existing code isn't affected...\n bw.write(\"\\t\" + docName); // \\t is the delimiter\n bw.newLine();\n }\n }\n bw.close();\n fw.close();\n }", "public void writeToFile() {\n try {\n // stworz plik\n File file = new File(\"../Alice.ids\");\n // stworz bufor zapisu do pliku\n FileWriter fileWriter = new FileWriter(file);\n for(int i = 0; i < identificationNumbers.length; i++) {\n for(int j = 0; j < identificationNumbers[i].length; j++)\n fileWriter.write(Integer.toString(identificationNumbers[i][j]));\n\t\t\t fileWriter.write(\"\\n\");\n }\n\t\t\tfileWriter.flush();\n\t\t\tfileWriter.close();\n } catch(Exception e) {\n e.printStackTrace();\n }\n }", "protected void fileSet() throws IOException {\n//\t\tfos = new FileOutputStream(outFile, false);\n//\t\tdos = new DataOutputStream(fos);\n\t\trealWriter = new BufferedWriter(new FileWriter(outFile.getAbsolutePath()));\n\t}", "public void updateScoreFile() {\n try {\n outputStream = new ObjectOutputStream(new FileOutputStream(HIGHSCORE_FILE));\n outputStream.writeObject(scores);\n } catch (FileNotFoundException e) {\n } catch (IOException e) {\n } finally {\n try {\n if (outputStream != null) {\n outputStream.flush();\n outputStream.close();\n }\n } catch (IOException e) {\n }\n }\n }", "public void saveUsers() {\n FileWriter fileWriter = null;\n PrintWriter printWriter = null;\n try {\n fileWriter = new FileWriter(pathData);\n printWriter = new PrintWriter(fileWriter);\n if (users != null) {\n \n for (Map.Entry m : users.entrySet()) {\n printWriter.println(m.getKey() + spChar + m.getValue() + \"\\n\");\n }\n }\n printWriter.close();\n } catch (IOException e) {\n }\n }" ]
[ "0.7342936", "0.7097447", "0.60952246", "0.59794694", "0.59427184", "0.59069306", "0.58947515", "0.58939487", "0.5870261", "0.5754904", "0.5737167", "0.5724098", "0.57090783", "0.5681208", "0.5671739", "0.5655282", "0.56461334", "0.5610286", "0.55808264", "0.553775", "0.5488704", "0.548121", "0.5468724", "0.5454064", "0.54530543", "0.5450394", "0.5441066", "0.5436912", "0.5412282", "0.540153", "0.5390131", "0.53829813", "0.53678703", "0.5358175", "0.53476065", "0.5315097", "0.5313966", "0.52897686", "0.52588445", "0.5253844", "0.5248153", "0.5247213", "0.5236811", "0.52199596", "0.5210864", "0.52093345", "0.5196304", "0.51944155", "0.51904535", "0.51772803", "0.51522034", "0.5147312", "0.51397324", "0.51350355", "0.5133043", "0.5124871", "0.5123687", "0.5098186", "0.50949824", "0.50912243", "0.5081542", "0.50714296", "0.50636744", "0.50628537", "0.50610983", "0.5060561", "0.5059229", "0.5057614", "0.50570714", "0.50553536", "0.50521487", "0.5048618", "0.5044698", "0.50390637", "0.50390077", "0.50384974", "0.5034153", "0.5033119", "0.50283474", "0.50212634", "0.50137883", "0.50105715", "0.501017", "0.5008655", "0.5003665", "0.50027114", "0.499869", "0.4989397", "0.49893385", "0.49884742", "0.49880806", "0.4986431", "0.4986418", "0.498181", "0.49814814", "0.49785092", "0.49771568", "0.497411", "0.49680635", "0.49651814" ]
0.70487577
2
/Overwrite students.txt file with the Parsed Form of each student in the ALL_STUDENTS ArrayList
private static void writeToStudentsFile() throws IOException{ FileWriter fw = new FileWriter(STUDENTS_FILE, false); //overwrites the students.txt file BufferedWriter bw = new BufferedWriter(fw); Iterator<StudentDetails> iter = ALL_STUDENTS.listIterator(1); //Get all StudentDetails objects from index 1 of ALL_STUDENTS. This is because the value at index 0 is just a dummy student while(iter.hasNext()){ StudentDetails student = iter.next(); bw.write(student.ParseForTextFile()); //writes the Parsed Form of the StudentDetails object to the students.txt file } bw.close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void saveStudentsList(List<Student> students, File file) throws IOException {\n saveStudentsList(students, new FileOutputStream(file));\n }", "private static void writeToBooksFile() throws IOException{\n\t\tFileWriter fw = new FileWriter(BOOKS_FILE, false); //overwrites the students.txt file\n\t\tBufferedWriter bw = new BufferedWriter(fw);\n\t\t\n\t\tSet<Integer> keys = ALL_BOOKS.keySet(); //returns list of all keys in ALL_BOOKS\n\t\tfor(int key : keys){\n\t\t\tbw.write(ALL_BOOKS.get(key).ParseForTextFile()); //writes the Parsed Form of the BookDetails object to the books.txt file\n\t\t}\n\t\tbw.close();\n\t}", "static void writeStudentsToFile(Student[] students, String filename) {\n\t\ttry (FileWriter out = new FileWriter(filename)) {\n\n\t\t\tfor (Student s : students)\n\t\t\t\tout.write(s.toString() + \"\\n\");\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void WriteStudentstoFile(String path) {\n\t\tPrintWriter writer = null;\n\t\ttry {\n\t\t\twriter = new PrintWriter(path, \"UTF-8\");\n\t\t\tArrayList<Student> data = GetAllStudentData();\n\t\t\tfor (int i = 0; i <= data.size() - 1; i++) {\n\t\t\t\tString f = data.get(i).regID + \",\" + data.get(i).name + \",\" + data.get(i).fatherName + \",\"\n\t\t\t\t\t\t+ data.get(i).section + \",\" + data.get(i).department;\n\t\t\t\twriter.println(f);\n\t\t\t}\n\t\t\twriter.close();\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(e);\n\t\t}\n\t}", "public List<Student> getAllStudents() throws IOException {\n\t\tstudentList = studentListGenerator.generateList(\"StudentList.txt\");\n\t\treturn studentList;\n\t}", "public void readFile(File inputFile) throws FileNotFoundException, IOException, ClassNotFoundException {\n\n ArrayList<Student> studentList = null;\n int noOfStudents = 1; int noOfProjects = 0;\n int count = 1;\n String title; String school; String supervisor; Project project = null; \n ArrayList<Project> projectList = new ArrayList<>();\n\n Scanner scan = new Scanner(new FileReader(inputFile));\n String line = null;\n\n while (scan.hasNextLine()) {\n studentList = new ArrayList<>();\n \n if (count == 1) {\n line = scan.nextLine();\n noOfProjects = Integer.parseInt(line);\n System.out.println(line);\n }\n\n line = scan.nextLine();\n String[] projectInfo = line.split(\",\", 5);\n noOfStudents = Integer.parseInt(projectInfo[3]);\n String[] studentInfo = projectInfo[4].split(\",\");\n\n Student student = null;\n \n for (int k = 0; k < studentInfo.length; k+=4) {\n //new Student(AdminNo, Name, Course, Gender)\n student = new Student(studentInfo[k], studentInfo[k+1], studentInfo[k+2], studentInfo[k+3]);\n studentList.add(student); //Add new Student to List\n }\n\n title = projectInfo[0];\n school = projectInfo[1];\n supervisor = projectInfo[2];\n project = new Project(title, school, supervisor, noOfStudents, studentList);\n \n System.out.println(line);\n count++;\n \n projectList.add(project);\n }\n\n for (Student stud: studentList) {\n System.out.println(stud.getAdminNo() + stud.getCourse() + stud.getGender() + stud.getName());\n }\n \n writeToFile(project);\n \n scan.close();\n }", "public void createStudents(String fileContents) {\r\n\t\tplot = false;\r\n\t\tif (this.students != null) {\r\n\t\t\tstudents.clear();\r\n\t\t}\r\n\t\tdates.clear();\r\n\t\tattendancePos = 0;\r\n\t\tdataLoaded = 0;\r\n\t\tthis.students = new ArrayList<Student>();\r\n\t\tString[] studentString = fileContents.split(\"\\n\");\r\n\t\tfor (int i=0; i<studentString.length; i++) {\r\n\t\t\tString[] studentInfo = studentString[i].split(\",\");\r\n\t\t\tArrayList<Integer> attendance = new ArrayList<Integer>();\r\n\t\t\ttry {\r\n\t\t\t\tStudent toAdd = new Student(studentInfo[0], studentInfo[1], studentInfo[2], studentInfo[3], studentInfo[4], studentInfo[5], attendance);\r\n\t\t\t\tstudents.add(toAdd);\r\n\t\t\t} catch (ArrayIndexOutOfBoundsException e) {\r\n\t\t\t\tJOptionPane.showMessageDialog(null, \"File Format is incorrect\", \"Error\", 2);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\tsetChanged();\r\n\t\tnotifyObservers();\r\n\t}", "public void importStudents(String fileName) throws FileNotFoundException\n {\n Scanner inf = new Scanner(new File(fileName));\n while(inf.hasNextLine())\n {\n String first = inf.nextLine();\n String last = inf.nextLine();\n String password = inf.nextLine();\n String p1 = inf.nextLine();\n String p2 = inf.nextLine();\n String p3 = inf.nextLine();\n String p4 = inf.nextLine();\n String p5 = inf.nextLine();\n String p6 = inf.nextLine();\n String p7 = inf.nextLine();\n String p8 = inf.nextLine();\n \n students.add(new Student(first, last, password, p1, p2, p3, p4, p5, p6, p7, p8, this));\n }\n }", "public void flushSudentsContentInFile(String path) {\n\t\ttry (Writer writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(path, false), \"UTF-8\"))) {\n\t\t\tfinal String[] res = new String[] { \"\" };\n\t\t\tthis.getStudents().forEach(student -> {\n\t\t\t\tString ress = student.toString();\n\t\t\t\tres[0] += ress + \"\\n\";\n\t\t\t});\n\t\t\twriter.write(res[0]);\n\t\t\twriter.flush();\n\t\t} catch (Exception e) {\n\t\t\tthrow new RuntimeException(\"File write failed.\", e);\n\t\t}\n\t}", "public void save() {\n\t\tFileOutputStream fos;\n\t\ttry {\n\t\t\tfos = new FileOutputStream(\"studentData.dat\");\n\n\t\t\tObjectOutputStream oos;\n\t\t\ttry {\n\t\t\t\toos = new ObjectOutputStream(fos);\n\n\t\t\t\toos.writeObject(studentList);\n\t\t\t\toos.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\tSystem.out.println(\"File is finished writing to the hard drive\");\n\t}", "public static void processInput () throws IllegalArgumentException {\n \n File inputDataFile = null;\n Scanner inputFile = null; \n String line = \"\";\n \n try {\n inputDataFile = new File (INPUT_FILE);\n inputFile = new Scanner(inputDataFile);\n }\n catch (FileNotFoundException e) {\n System.out.println(\"File not found.\");\n System.exit (0);\n }\n \n while (inputFile.hasNextLine()) {\n for (int i = 0; i >= 15; i++) {\n \n \n \n Student[] newStudent = line.split (\",\", 10);\n \n inputFile.close();\n \n \n \n \n\n \n\n}// End processInput\n\n//*****************************************************************************\n\npublic static void processStudentData (String[] info) throws IllegalArgumentException {\n\n \n\n}// End processStudentData \n\n//*****************************************************************************\n\npublic static void processGradeItemData (String[] info) throws \n IllegalArgumentException {\n\n}// End processGradeItemData\n\n//*****************************************************************************\n\npublic static void generateReport () {\n\n\n}// End generateReport\n\n\n} // End JedidiahPrallNicholasRyan_03", "private void Add() {\n\t\t\tString names2 = StudentNum.getText();\n\t\t\tString names1 = Studentname.getText();\n\t\t\tStudentname.setText(\"\");\n\t\t\tStudentNum.setText(\"\");\n\t\t\tif (!names2.equals(\"Student Number\")) {\n\t\t\t\tFile directory = new File(\"Schools\\\\\" + names2 + \".hi\");\n\t\t\t\tif (!directory.exists()) {\n\t\t\t\t\tif (directory.mkdir()) {\n\t\t\t\t\t\tworklabel.setText(\"Student has been added\");\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tPrintWriter out;\n\t\t\t\t\t\t\tPrintWriter out2;\n\t\t\t\t\t\t\tout = new PrintWriter(new FileWriter(\"Schools\\\\\"\n\t\t\t\t\t\t\t\t\t+ names2 + \".hi\" + \"\\\\\"\n\t\t\t\t\t\t\t\t\t+ \"Student Information.txt\", true));\n\t\t\t\t\t\t\tout.println(\"Student Name: \" + names1);\n\t\t\t\t\t\t\tout.println(\"Student Number: \" + names2);\n\t\t\t\t\t\t\tout.println(\"Address:\");\n\t\t\t\t\t\t\tout.println(\"Postal Code:\");\n\t\t\t\t\t\t\tout.println(\"Phone Number:\");\n\t\t\t\t\t\t\tout.println(\"Contact #1 Name:\");\n\t\t\t\t\t\t\tout.println(\"Contact #1 Number:\");\n\t\t\t\t\t\t\tout.println(\"Contact #1 Email:\");\n\t\t\t\t\t\t\tout.println(\"Contact #2 Name:\");\n\t\t\t\t\t\t\tout.println(\"Contact #2 Number:\");\n\t\t\t\t\t\t\tout.println(\"Contact #2 Email:\");\n\t\t\t\t\t\t\tout.println(\"Medical Alert #1:\");\n\t\t\t\t\t\t\tout.println(\"Medical Alert #2:\");\n\t\t\t\t\t\t\tout.println(\"Medical Alert #3:\");\n\t\t\t\t\t\t\tout.println(\"Medical Alert #4:\");\n\t\t\t\t\t\t\tout.println(\"Medical Alert #5:\");\n\t\t\t\t\t\t\tout.println(\"Accomodation #1:\");\n\t\t\t\t\t\t\tout.println(\"Accomodation #2:\");\n\t\t\t\t\t\t\tout.println(\"Accomodation #3:\");\n\t\t\t\t\t\t\tout.println(\"Accomodation #4:\");\n\t\t\t\t\t\t\tout.println(\"Accomodation #5:\");\n\t\t\t\t\t\t\tout.println(\"Volunteer Hours:\");\n\t\t\t\t\t\t\tout2 = new PrintWriter(new FileWriter(\"Schools\\\\\"+ names2+\".hi\" + \"\\\\\" + \"Transcript.txt\",true));\n\t\t\t\t\t\t\tout2.println(\"Course Code\t\tMark\tPassed\tAbsences\tLate\");\n\t\t\t\t\t\t\tout.close();\n\t\t\t\t\t\t\tout2.close();\n\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tworklabel.setText(\"Invalid\");\n\t\t\t\t}\n\t\t\t}\n\t\t}", "@Override\n\tpublic List<Personne> generateStudents(MultipartFile file) throws IllegalStateException, IOException{\n\t\tList<Personne> students=new ArrayList<Personne>();\n\t\tPersonne student=new Personne();\n\t\tString line = \"\";\n\t\tfile.transferTo(new File(\"D:\\\\files\\\\\" + file.getOriginalFilename()));\n\t\ttry {\n\t\t\tBufferedReader br;\n\t\t\tbr = new BufferedReader( new FileReader(\"D:\\\\files\\\\\" + file.getOriginalFilename()));\n\t\t\twhile((line = br.readLine())!=null)\n\t\t\t{\n\t\t\t\tString [] data =line.split(\",\");\n\t\t\t\tPersonne etudiant = new Personne();\n\t\t\t // etudient.setId((long) Integer.parseInt(data[0]));\n\t\t\t\tetudiant.setNom(data[0]);\n\t\t\t\tetudiant.setPrenom(data[1]);\n\t\t\t\tetudiant.setCin(data[2]);\n\t\t\t\tetudiant.setCin(data[2]);\n\t\t\t\tetudiant.setCin(data[2]);\n\t\t\t\tetudiant.setCin(data[2]);\n\t\t\t\tetudiant.setCin(data[2]);\n\t\t\t\t//etudiant.setNom(data[3]);\n\t\t\t\tstudent=persoRepo.save(etudiant);\n\t\t\t\tif(student !=null) {\n\t\t\t\t\tstudents.add(student);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tbr.close();\n\t\t\t\n\t\t}\n\t\tcatch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn students;\n\t\t\n\t}", "public static ArrayList<Student> loadListOfStudents(String fileName) {\n ArrayList<Student> students = new ArrayList<>();\r\n String str = TextReader.StringFromFile(fileName);//Uses the method that returns a complete string with newlines for each studentline.\r\n if (validateInput(str)) {//Uses the validation method to check that the input is valid.\r\n String[] lines = str.split(\"\\n\");\r\n String[] lineParameters;\r\n int countFor = 0;\r\n for (String line : lines) {\r\n if(countFor > 1){\r\n lineParameters = line.split(\",\");\r\n Vote vote = new Vote(new Subject(lineParameters[1]), new Subject(lineParameters[2]), new Subject(lineParameters[3]), new Subject(lineParameters[4]));\r\n Student newStudent = new Student(lineParameters[0], vote);\r\n students.add(newStudent);\r\n }\r\n countFor++;\r\n }\r\n }\r\n\r\n return students;\r\n }", "private static List<Student> getStudents() {\n \t\n List<Student> studentList = new ArrayList<>();\n Scanner readStudents=null;\n try {\n\t\t\treadStudents = new Scanner(new File(\"src/Student.csv\"));\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tSystem.out.println(\"Student file not found.\");\n\t\t}\n\t\twhile(readStudents.hasNextLine()) {\n\t\t\tString[] studentLine = readStudents.nextLine().split(\",\");\n\t\t\tlong studentId= Long.parseLong(studentLine[0]);\n\t\t\tint age = Integer.parseInt(studentLine[4]);\n\t\t\tlong recordId = Long.parseLong(studentLine[5]);\n \tStudent newStudent = new Student(studentId,age,studentLine[1],studentLine[2],studentLine[3],recordId);\n \tstudentList.add(newStudent);\n\t\t}\n \n readStudents.close();\n return studentList;\n }", "public void saveFile(String fileName)\n {\n try\n {\n Formatter file = new Formatter(fileName);\n for (Item item: myList)\n {\n file.format(item.getFirstName() +\"\\n\" + item.getLastName() +\"\\n\"+ item.getPhoneNumber()+\"\\n\"+ item.getEmail()+\"\\n\");\n }\n file.close();\n }\n\n catch (Exception ex)\n {\n System.out.println(\"Error saving...\");\n }\n\n System.out.println(\"\");\n }", "public static void updateStudentList(String content) {\n String timestamp = String.format(\"List last updated %s\", new Date()); \n try {\n BufferedWriter writer = new BufferedWriter(new FileWriter(Constants.STUDENT_LIST)); \n writer.write(content);\n writer.newLine();\n writer.append(timestamp); \n writer.close();\n } catch (IOException exception) {\n System.out.println(exception);\n } \n }", "public void editStudentList(String lastName){\n for(int i = 0; i<studList.size();i++){\n \n if(lastName.equals(studList.get(i).getLastName())){\n \n System.out.println(\"Student Name: \" + studList.get(i).getFullName() + \", Student Number: \" + studList.get(i).getStuNumber() + \", Student GPA: \" + studList.get(i).getGPA());\n\n Scanner input = new Scanner(System.in);\n String newName = \"\";\n double newGPA;\n\n System.out.print(\"Student name: \");\n newName = input.nextLine();\n\n System.out.print(\"Student GPA: \");\n newGPA = input.nextDouble();\n\n Student temp = new Student(newName, studList.get(i).getStuNumber(), newGPA);\n studList.set(i, temp);\n }\n }\n }", "public void saveToFile()\n\t{\t\n\t\tsetCourseToFileString(courseToFileString);\n\t\t\ttry \n\t {\n\t FileWriter fw = new FileWriter(fileName);\n\t fw.write (this.getCourseToFileString ( ));\n\t for(Student b : this.getStudents ( ))\t \t\n\t \tfw.write(b.toFileString ( ));\n\t \tfw.close ( );\n\t } \n\t catch (Exception ex) \n\t {\n\t ex.printStackTrace();\n\t }\n\t\t\tthis.saveNeed = false;\n\n\t}", "private static List<Student> loadStudentList(File file) throws IOException {\n return loadStudentList(new FileInputStream(file));\n }", "public void getList() {\n\n\t\tFile opFile = new File(\"/home/bridgeit/Desktop/newfile.txt\");\n\t\ttry {\n\t\t\topFile.createNewFile();\n\t\t\tFileWriter fwriter = new FileWriter(opFile);\n\n\t\t\tfor (int i = 0; i < slist.size(); i++) {\n\n\t\t\t\tfwriter.append(slist.returnItem(i) + \" \");\n\n\t\t\t}\n\t\t\tfwriter.close();\n\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public void saveStaffList(String fileName) {\n try {\n BufferedWriter out = new BufferedWriter(new FileWriter(fileName));\n out.write(maxStaff+\"\\r\\n\");\n \n out.write(numStaff+\"\\r\\n\");\n \n \n for (int i = 0; i < numStaff; i++) {\n if (staffList[i] instanceof Labourer) {\n out.write(staffList[i].toFile());\n } else if (staffList[i] instanceof Manager) {\n out.write(staffList[i].toFile());\n }\n }\n out.close();\n } catch (IOException iox) {\n System.out.println(\"Error saving to \" + fileName);\n }\n }", "private static boolean loadStudents() throws IOException{\n\t\tBufferedReader reader = new BufferedReader(new FileReader(STUDENTS_FILE));\n\t\tboolean error_loading = false; //stores whether there was an error loading a student\n\t\t\n\t\tString line = reader.readLine(); //read the properties of each student in the students.txt file\n\t\t/*read students.txt file, set the input for each studentDetails object and add each StudentDetails object to ALL_STUDENTS ArrayList*/\n\t\twhile(line != null){\n\t\t\tStudentDetails student = new StudentDetails();\n\t\t\tString[] details = line.split(\"\\t\"); //the properties of each StudentDetails object are separated by tab spaces in the students.txt file\n\t\t\tfor(int i = 0; i < details.length; i ++){\n\t\t\t\tif(!setStudentInput(i, details[i], student)){ //checks if there was an error in setting the StudentDetails object's properties with the values in the students.txt file\n\t\t\t\t\tSystem.out.println(\"ERROR Loading Students\");\n\t\t\t\t\terror_loading = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(error_loading) //if there was an error loading a book then stop the process of loading books\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tALL_STUDENTS.add(student);\n\t\t\t/*Add Students who have been fined (total fine > 0) to the FINED_STUDENTS Hashtable*/\n\t\t\taddFinedStudentsToTable(student);\n\t\t\tline = reader.readLine();\n\t\t}\n\t\treader.close();\n\t\t\n\t\tif(!error_loading){\n\t\t\tSystem.out.println(\"Loading Students - Complete!\");\n\t\t\treturn true;\n\t\t}\n\t\treturn false; //error encountered while loading books\n\t}", "public static void writeStudents(String outputFilePath, boolean append) throws IOException\r\n\t{\r\n\t\twriteToFile(\"html_templates/etudiants/header.html\", outputFilePath, true);\r\n\t\t\r\n\t\tPrintStream fileWriter = new PrintStream(new FileOutputStream(new File(outputFilePath), append), false, \"UTF-8\");\r\n\t\t\r\n\t\tStudent[] allStudents = CtrlStudent.getStudents(\"../test/etudiants2014_2015.csv\");\r\n\t\t\r\n\t\tfileWriter.println(\"<li data-role=\\\"list-divider\\\">\");\r\n\t\tfileWriter.println(\"Etudiant<span class=\\\"ui-li-count\\\" title=\\\"Groupe\\\" style=\\\"right: 40px !important;\\\">Groupe</span>\");\r\n\t\tfileWriter.println(\"</li>\");\r\n\t\t\r\n\t\tfor (int i = 0; i < allStudents.length; i++)\r\n\t\t{\r\n\t\t\tfileWriter.println(\"<li data-find=\\\"\" + allStudents[i].getFname() + \" \" + allStudents[i].getLname().toUpperCase() + \"\\\">\");\r\n\t\t\tfileWriter.print(\"<a href=\\\"#projets\\\">\" + allStudents[i].getLname().toUpperCase() + \" \" + allStudents[i].getFname() + \"<span class=\\\"ui-li-count\\\" title=\\\"Groupe\\\">Groupe \" + allStudents[i].getStudGroup().getLibelle() + \"</span>\\n\");\r\n\t\t\tfileWriter.println(\"</a>\");\r\n\t\t\tfileWriter.println(\"</li>\");\r\n\t\t}\r\n\t\t\r\n\t\twriteToFile(\"html_templates/etudiants/footer.html\", \"OPTIweb.html\", true);\r\n\t\t\r\n\t\tfileWriter.close();\r\n\t}", "public void processFiles(){\n\t\tfor(String fileName : files) {\n\t\t\ttry {\n\t\t\t\tloadDataFromFile(fileName);\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\tSystem.out.println(\"Can't open file: \" + fileName);\n\t\t\t\tSystem.out.println();\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tprintInOrder();\n\t\t\tstudents.clear();\n\t\t}\n\t}", "private void readFile() {\r\n\t\tScanner sc = null; \r\n\t\ttry {\r\n\t\t\tsc = new Scanner(inputFile);\t\r\n\t\t\twhile(sc.hasNextLine()){\r\n\t\t\t\tgrade.add(sc.nextLine());\r\n\t } \r\n\t\t}\r\n\t\tcatch (FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\tsc.close();\r\n\t\t}\t\t\r\n\t}", "public void fillFromFile()\n\t{\n\t\tJFileChooser fc = new JFileChooser();\t//creates a new fileChooser object\n\t\tint status = fc.showOpenDialog(null);\t//creates a var to catch the dialog output\n\t\tif(status == JFileChooser.APPROVE_OPTION)\t\n\t\t{\n\t\t\tFile selectedFile = fc.getSelectedFile ( );\n\t\t\tthis.fileName = selectedFile;\n\t\t\tScanner file = null; //scans the file looking for information to load\n\n\t\t\tif(selectedFile.exists())\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tfile = new Scanner(fileName); //scans the input file\n\t\t\t\t}\n\t\t\t\tcatch(Exception IOException)\n\t\t\t\t{\n\t\t\t\t\tJOptionPane.showConfirmDialog (null, \"Unable to import data from the list\");\n\t\t\t\t\tSystem.exit (-1);\n\t\t\t\t}//if there was an error it will pop up this message\n\t\t\t\t\n\t\t\t\tString str = file.nextLine ( ); //names the line\n\t\t\t\tString [] header = str.split (\"\\\\|\"); //splits the line at the |\n\t\t\t\tsetCourseNumber(header[1]);\n\t\t\t\tsetCourseName(header[0]);\n\t\t\t\tsetInstructor(header[2]);\n\t\t\t\t\n\t\t\t\twhile(file.hasNextLine ( ))\n\t\t\t\t{\n\t\t\t\t\tstr = file.nextLine ( ); //names the line\n\t\t\t\t\tString [] tokens = str.split (\"\\\\|\"); //splits the line at the |\n\t\t\t\t\tStudent p = new Student();\n\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tp.setStrNameLast (String.valueOf (tokens[0]));\n\t\t\t\t\t\tp.setStrNameFirst (String.valueOf (tokens[1]));\n\t\t\t\t\t\tp.setStrMajor (String.valueOf (tokens[2]));\n\t\t\t\t\t\tp.setClassification (tokens[3]);\n\t\t\t\t\t\tp.setiHoursCompleted (new Integer (tokens[4]).intValue ( ));\n\t\t\t\t\t\tp.setfGPA (new Float (tokens[5]).floatValue ( ));\n\t\t\t\t\t\tp.setStrStudentPhoto (String.valueOf (tokens[6]));\n\t\t\t\t\t//creates a person object and then populates it with an array of scanned input values\n\t\t\t\t\t\tclassRoll.add (p);\n\t\t\t\t\t\t}//creates a person object and then populates it with an array of scanned input values\n\t\t\t\t\t\tcatch(Exception IOException)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tIOException.printStackTrace ( );\n\t\t\t\t\t\t\tJOptionPane.showMessageDialog (null, \"Bad input record: '\" + str + \"'\" + IOException.getMessage());\n\t\t\t\t\t\t}//pops up a message if there were any errors reading from the file\n\t\t\t\t}//continues through the file until there are no more lines to scan\n\t\t\tfile.close ( ); //closes the file\n\n\t\t\t\tif(selectedFile.exists ( )==false)\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new Exception();\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Exception IOException)\n\t\t\t\t\t{\n\t\t\t\t\t\tJOptionPane.showMessageDialog (null, \"Bad input record: '\" + selectedFile + \"' \" + IOException.getMessage());\n\t\t\t\t\t}\n\t\t\t\t}//if the user picks a file that does not exist this error message will be caught.\n\t\t\t}\n\t\t}//if the input is good it will load the information from the selected file to and Array List\n\t\t\telse\n\t\t\t{\n\t\t\t\tSystem.exit (0);\n\t\t\t}\n\t\tthis.saveNeed = true;\n\n\t\t}", "public void loadStudents(File filePath){\r\n Index.resetIndex();\r\n List<Student> students = DataConvert.loadStudentsDataFromCSV(filePath);\r\n List<String> errorMessage = new ArrayList<>();\r\n students.forEach(student -> {\r\n try{\r\n addStudent(student);\r\n } catch (ValidationException ex){\r\n errorMessage.add(\"=========================================\\n\");\r\n errorMessage.add(student.toString() + \" - \" + ex.getMessage());\r\n errorMessage.add(\"=========================================\\n\");\r\n }\r\n });\r\n if(!errorMessage.isEmpty()){\r\n String error = errorMessage.stream().reduce(\"\", (s1, s2)-> s1 += s2);\r\n throw new ValidationException(error);\r\n }\r\n }", "public static void addRecords() {\n\t\t\n\t\ttry {\n\t\t\twhile(fileInput.hasNextLine()) {\n\t\t\t\t// get user input to add contact to list. \n\t\t\t\tSystem.out.print(\"\\n\\nEnter contact first name: \");\t\n\t\t\t\tString firstName = input.next();\n\t\t\t\tSystem.out.print(\"\\nEnter contact last name: \");\n\t\t\t\tString lastName = input.next();\n\t\t\t\tSystem.out.print(\"\\nEnter contact phone number: \"); \n\t\t\t\tString phoneNumber = input.next();\n\t\t\t\tSystem.out.print(\"\\nEnter contact email address: \");\n\t\t\t\tString email = input.next();\n\t\t\t\t\n\t\t\t\tString[] contactInfo = { firstName, lastName, phoneNumber, email };\n\t\t\t\t\n\t\t\t\tList<String> newInput = Arrays.asList(contactInfo);\n\t\t\t\tSystem.out.printf(\"Unsorted array elements: %s%n\", list);\n\t\t\t\t\n\t\t\t\tCollections.sort(list); // sort ArrayList\n\t\t\t\tSystem.out.printf(\"Sorted array elements: %s%n\", list);\n\t\t\t\t\n\t\t\t\t// output new record to file.\n\n\t\t}\n\t\tcatch (FormatterClosedException f) {\n\t\t\tSystem.err.println(\"Error writing to file. Terminating.\"); break;\n\t\t}\n\t\tcatch (NoSuchElementException e) {\n\t\t\tSystem.err.println(\"Invalid input. Please try again.\");\n\t\t\tinput.nextLine(); // discard input so user can try again. \n\t\t}\n\t\t\t\n\t\tSystem.out.println(\"Enter another contact? 0 for no, 1 for yes: \");\n\t\tswitch(input.nextInt()) {\n\t\t\tcase 0: moreInput = false; break;\n\t\t\tcase 1: moreInput = true; break;\n\t\t}\n\t\t\t\n\t\t\t\n\t\t} // end while. \n\n\t\tSystem.out.println();\n\t}", "public List<Student> importStudent(String filename) throws FileNotFoundException {\n List<Student> students = new ArrayList<>();\n FileReader fileReader = new FileReader(DATA_PATH + filename);\n Scanner scanner = new Scanner(fileReader);\n //skip first line\n String firstLine = scanner.nextLine();\n Log.i(\"first line: \" + firstLine);\n\n while (scanner.hasNextLine()) {\n String[] s = scanner.nextLine().split(\",\");\n String fullName = s[0];\n int yearLevel = Integer.parseInt(s[1]);\n Student student = new Student(fullName, yearLevel);\n students.add(student);\n }\n\n scanner.close();\n return students;\n }", "public static ArrayList<Student> get_student_users() throws IOException {\n\t\tArrayList<Student> studentList = new ArrayList<Student>();\n\t\tReadCSV readStudentlist = new ReadCSV(\"students.csv\");\n\t\ttry {\n\t\t\t// auto-generated primary key for authors table\n\t\t\t\n\t\t\twhile (true) {\n\t\t\t\tList<String> tuple = readStudentlist.next();\n\t\t\t\tif (tuple == null) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t//Reads each value in from our string list and inserts them into the appropriate attribute of our student object\n\t\t\t\tIterator<String> i = tuple.iterator();\n\t\t\t\tStudent students = new Student();\n\t\t\t\tstudents.setName(i.next());\n\t\t\t\tString password = MD5.getMd5(i.next());\n\t\t\t\tstudents.setPassword(password);\n\t\t\t\tstudents.setEmail(i.next());\n\t\t\t\tstudents.set_faculty_code(i.next());\n\t\t\t\tstudents.setType(Integer.parseInt(i.next()));\n\t\t\t\tstudentList.add(students);\n\t\t\t}\n\t\t\treturn studentList;\n\t\t} finally {\n\t\t\treadStudentlist.close();\n\t\t}\n\t}", "public void handleStudents() {\n students.forEach(System.out::println);\n producer.saveAttendance(students, course);\n }", "public void editStudentList(int stuNumber){\n for(int i = 0; i<studList.size();i++){\n if(stuNumber == studList.get(i).getStuNumber()){\n \n System.out.println(\"Student Name: \" + studList.get(i).getFullName() + \", Student Number: \" + \n studList.get(i).getStuNumber() + \", Student GPA: \" + studList.get(i).getGPA());\n\n Scanner input = new Scanner(System.in);\n String newName = \"\";\n double newGPA;\n\n System.out.print(\"Student name: \");\n newName = input.nextLine();\n\n System.out.print(\"Student GPA: \");\n newGPA = input.nextDouble();\n\n Student temp = new Student(newName, studList.get(i).getStuNumber(), newGPA);\n studList.set(i, temp);\n }\n }\n }", "public static void saveStudentCourses(ArrayList<StudentCourse> CourseToUpdate) throws IOException {\n\t\tArrayList <String> courseList = new ArrayList<String>() ;// to store Courses data\n\n for (int i = 0 ; i < CourseToUpdate.size() ; i++) {\n\t\t\t\tStudentCourse course = CourseToUpdate.get(i);\n\t\t\t\tStringBuilder stringBuild = new StringBuilder();\n\t\t\t\tstringBuild.append(course.getUserid().trim());\n\t\t\t\tstringBuild.append(SEPARATOR);\n\t\t\t\tstringBuild.append(course.getUsername().trim());\n\t\t\t\tstringBuild.append(SEPARATOR);\n\t\t\t\tstringBuild.append(course.getCourseID().trim());\n\t\t\t\tstringBuild.append(SEPARATOR);\n\t\t\t\tstringBuild.append(course.getIndexID());\n\t\t\t\tstringBuild.append(SEPARATOR);\n\t\t\t\tstringBuild.append(course.getRegisterStatus());\n\t\t\t\t\n\t\t\t\tcourseList.add(stringBuild.toString()) ;\n\t\t\t}\n\t\t\tIO.write(Main.studentcoursepath.toString(), courseList);\n\t}", "public WriteToFile(List<Person> peopleList){\r\n\r\n try {\r\n // write over existing file if exists or create new\r\n FileWriter myWriter = new FileWriter(\"sorted-names-list.txt\", false);\r\n for (Person person: peopleList){\r\n // Get person name in order to append to text file\r\n String wholeName = person.getFirstName() + \" \" + person.getLastName();\r\n System.out.println(wholeName);\r\n myWriter.write(wholeName);\r\n myWriter.write(\"\\n\");\r\n }\r\n myWriter.close();\r\n System.out.println(\"Successfully wrote to the file.\");\r\n } catch (IOException e) {\r\n System.out.println(\"An error occurred.\");\r\n e.printStackTrace();\r\n }\r\n\r\n\r\n }", "public String getStudentList()\n\t{\n\t\tString courseOutput = \"\";\n\t\tint studentNum = 1;\n\t\t\n\t\tfor(Student student: classRoll)\n\t\t{\n\t\t\tcourseOutput += studentNum + \". \" + student + \"\\n\";\t\n\t\t\t\t//adds a Student to the already created string one student at a time\n\t\t\tstudentNum++;\n\t\t}\n\t\t\n\t\tcourseOutput = getCourseName() + getCourseNumber() + getInstructor() + courseOutput;\n\t\treturn courseOutput;\n\t}", "private void writeFile(List<ClubPointsDTO> clubs) {\n\t\tFileWriter file = null;\n\t\ttry {\n\n\t\t\tfile = new FileWriter(\"clubs.txt\");\n\n\t\t\t// Escribimos linea a linea en el fichero\n\t\t\tfile.write(\"CLUB\\tPUNTOS\\r\\n\");\n\t\t\tfor(ClubPointsDTO c : clubs)\n\t\t\t\tfile.write(c.getName()+\"\\t\"+c.getPoints()+\"\\r\\n\");\n\n\t\t\tfile.close();\n\n\t\t} catch (Exception ex) {\n\t\t\tthrow new FileException();\n\t\t}\n\t}", "private void printAllStudentInDB(){\n ArrayList studentInformation = AdminManager.loadDBStudentInformation();\n System.out.println(\"--------------------------------------------------------------------------------------\");\n System.out.println(\"USERNAME STUDENT NAME MATRIC NUMBER GENDER NATIONALITY\");\n System.out.println(\"--------------------------------------------------------------------------------------\");\n\n for(int i=0; i<studentInformation.size();i++){\n String st = (String)studentInformation.get(i);\n StringTokenizer star = new StringTokenizer(st, \",\");\n System.out.print(String.format(\"%7s \",star.nextToken().trim()));\n String printPassword = star.nextToken().trim();\n System.out.println(String.format(\"%20s %9s %6s %s\",star.nextToken().trim(),star.nextToken().trim(),star.nextToken().trim(),star.nextToken().trim()));\n }\n System.out.println(\"--------------------------------------------------------------------------------------\\n\");\n }", "void create() {\n\t\ttry {\n\t\t\tFile file = new File(\"Student.txt\");\n\t\t\t//File named Student.txt is created\n\t\t\tboolean x = file.createNewFile();\n\t\t\tif (x) {\n\t\t\t\tSystem.out.println(\"File has been created successfully! \");\n\t\t\t//Message of successful creation after new file is created\n\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"File already present\");\n\t\t\t\t//message if file already exists\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Exception Occurred:\");\n\n\t\t}\t\t\t\t\n\t\t\n\t\t\t\t\n\t\ttry {\n\t\tPrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter(\"Student.txt\", true)));\n\t\tint x = 1;\n\t\t\n\t\tdo {\n\t\t\tScanner sc = new Scanner(System.in);\n\t\t\tint y;\n\t\t\t//take input from user for name,roll no and mobile no.\n\t\t\t\n\t\t\tSystem.out.print(\"\\nEnter Student Name: \");\n\t\t\tstudentname = br.readLine();\n\t\t\t\n\t\t\tSystem.out.print(\"Student Roll no: \");\n\t\t\trollno = Integer.parseInt(br.readLine());\t\t\n\t\t\t\n\t\t\tSystem.out.print(\"Mobile Number: \");\n\t\t\tmob_no = Integer.parseInt(br.readLine());\n\t\t\t\n\t\t\tSystem.out.print(\"Marks : \");\n\t\t\tmarks = Float.parseFloat(br.readLine());\n\t\t\t\n\t\t\t//display student data\n\n\t\t\tpw.println(studentname + \"\\t\" + rollno + \"\\t\" + marks + \"\\t\" + mob_no);\n\t\t\t\n\t\t\tSystem.out.println(\"Do you want to enter more records? \\n1) Yes\\n2) No\");\n\t\t\t\n\t\t\ty = sc.nextInt();\n\t\t\t\n\t\t\tif(y == 2) {\n\t\t\t\tx = 0;\n\t\t\t}\n\t\t}while(x==1); //loop to add more records\n\t\tpw.close();\n\t\t}catch(IOException e) {\n\t\t\tSystem.out.println(e);\n\t\t}\n\t\t\n\t}", "private void printStudListByCourse() throws Exception {\n String courseID = null;\n ArrayList<Student> studentList = new ArrayList<Student>();\n\n Scanner sc = new Scanner(System.in);\n\n System.out.println(\"\\nPlease enter course ID\");\n courseID = sc.nextLine();\n while(!courseID.matches(\"^[a-zA-Z]{2}[0-9]{4}$\")){\n System.out.println(\"Invalid input! Please enter a valid index number!\");\n courseID = sc.nextLine();\n }\n\n studentList= this.adminManager.getStudentByCourse(courseID);\n if(studentList == null){\n System.out.println(\"\\nThere is no such a course index\\n\\n\");\n System.exit(1);\n }\n if (studentList.isEmpty()){\n System.out.println(\"\\nThere is no student registered for this course ID\\n\\n\");\n return;\n }\n else{\n System.out.println(\"Hang on a moment while we load database.\\n\\n\");\n System.out.println(\"------------------------------------------------------\");\n System.out.println(\" STUDENT NAME GENDER NATIONALITY\");\n System.out.println(\"------------------------------------------------------\");\n //\n for(Student student:studentList){\n System.out.println(String.format(\"%20s %6s %s\",student.getName(),student.getGender(),student.getNationality()));\n }\n\n System.out.println(\"------------------------------------------------------\\n\");\n }\n }", "private static void writeToFileEmployees() throws IOException {\n FileWriter write = new FileWriter(path2, append);\n PrintWriter print_line = new PrintWriter(write);\n for (int i = 0; i < RegisteredEmployees.listOfEmployees.size(); i++) {\n ArrayList<Integer> list = RegisteredEmployees.getEmployeeList();\n Integer ID = list.get(i);\n textLine = String.valueOf(ID);\n print_line.printf(\"%s\" + \"%n\", textLine);\n }\n print_line.close();\n }", "static void writeFile(){\n try{\n Path contactsListPath = Paths.get(\"contacts\",\"contacts.txt\");\n Files.write(contactsListPath, contactList);\n } catch(IOException ioe){\n ioe.printStackTrace();\n }\n //refreshes list of Contact objs\n fileToContactObjs();\n }", "public static void getXMLUserList() {\n\t\t// Make some local arrays to use below\n\t\tArrayList<Student> activeList = new ArrayList<Student>();\n\t\tArrayList<Student> archiveList = new ArrayList<Student>();\n\t\ttry {\n\t\t\tFile xmlFile = new File(\"Users.xml\");\n\t\t\tDocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\n\t\t\tDocumentBuilder builder = factory.newDocumentBuilder();\n\t\t\tDocument users = builder.parse(xmlFile);\n\t\t\t\n\t\t NodeList studentNodes = users.getElementsByTagName(\"student\");\n\t\t for(int i = 0; i < studentNodes.getLength(); i++) { // Go through each student node\n\t\t \t\n\t\t Node studentNode = studentNodes.item(i);\n\t\t if(studentNode.getNodeType() == Node.ELEMENT_NODE) {\n\t\t Element studentEl = (Element) studentNode;\n\t\t // Get the student's info (and convert types when necessary)\n\t\t String fn = studentEl.getElementsByTagName(\"firstName\").item(0).getTextContent();\n\t\t String ln = studentEl.getElementsByTagName(\"lastName\").item(0).getTextContent();\n\t\t String id = studentEl.getElementsByTagName(\"ucid\").item(0).getTextContent();\n\t\t int ucid = Integer.parseInt(id);\n\t\t String cB = studentEl.getElementsByTagName(\"currentBorrowing\").item(0).getTextContent();\n\t\t int cb = Integer.parseInt(cB);\n\t\t String iA = studentEl.getElementsByTagName(\"isActive\").item(0).getTextContent();\n\t\t boolean ia = Boolean.parseBoolean(iA);\n\t\t String username = studentEl.getElementsByTagName(\"username\").item(0).getTextContent();\n\t\t String pW = studentEl.getElementsByTagName(\"password\").item(0).getTextContent();\n\t\t String iL = studentEl.getElementsByTagName(\"isLibrarian\").item(0).getTextContent();\n\t\t boolean isLib = Boolean.parseBoolean(iL);\n\t\t \n\t\t // And then create all a new instance of Student with the info\n\t\t\t Student newStudent = new Student(fn, ln, ucid, cb, ia, username, pW, isLib);\n\t\t\t // Put the newly created student in the right list\n\t\t\t if(ia) {\n\t\t\t \tactiveList.add(newStudent);\n\t\t\t } else {\n\t\t\t \tarchiveList.add(newStudent);\n\t\t\t }\n\t\t }\n\t\t }\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Something went wrong with the Users.xml parsing\");\n\t\t\tSystem.out.println(e);\n\t\t}\n\t\t// Store our arrays so they are accessible elsewhere\n\t\tManageUsers.setActiveList(activeList);\n\t\tManageUsers.setArchiveList(archiveList);\n\t}", "public static void readData(ArrayList<Student> students, ArrayList<Course> courses)\r\n {\r\n //emfanizie mnm ston xrhsth,dexetai apanthsh apo ton xrhsth\r\n //kai thn apanthsh thn epistrefei ws alfarithmitiko\r\n\r\n //String answer= JOptionPane.showInputDialog(\"Enter your name:\");\r\n\r\n boolean more= true;\r\n\r\n while(more)\r\n {\r\n\r\n String selection= JOptionPane.showInputDialog(\"1:Student 2:Graduate\");\r\n int choice =Integer.parseInt(selection);\r\n\r\n String name= JOptionPane.showInputDialog(\"Name: \");\r\n String id= JOptionPane.showInputDialog(\"Id: \");\r\n\r\n //to arxikopoiw ws null gia na mhn vgazei error\r\n //ayto symvanei dioti an mpei mesa sto if pernei mai timh an omws den mpei den tha parei timh kai tha vgazei error\r\n String supervisor=null;\r\n\r\n if(choice == 2)\r\n {\r\n supervisor= JOptionPane.showInputDialog(\"Supervisor: \");\r\n }\r\n\r\n Student student;\r\n if(choice==1)\r\n {\r\n student= new Student(name,id);\r\n }\r\n else\r\n {\r\n student= new Graduate(name,id,supervisor);\r\n }\r\n\r\n String coursename =JOptionPane.showInputDialog(\"Enter course name: \");\r\n\r\n //ftiaxnoume ena for wste na diatreksw ola ta mathimata poy exie mesa h lista\r\n //sthn synexeia tha sygkrinw to mathima me thn epilogh tou xrhsth\r\n for (Course course:courses)\r\n {\r\n if(course.getName().equals(coursename))\r\n {\r\n student.addCourses(course);\r\n }\r\n\r\n }\r\n\r\n //ton foithth ton topothetoume sthn lista poy yparxeis thn main kai thn pernei ws orisma h synarthsh\r\n students.add(student);\r\n\r\n String answer= JOptionPane.showInputDialog(\"More Students (Y/N)\");\r\n //gia string tha mporousa na kanw==\"n\"\r\n if(answer.equals(\"N\"))\r\n {\r\n more= false;\r\n }\r\n\r\n }\r\n\r\n\r\n }", "private void inflateFromFile() {\n\t\t\n\t\tFile file = null;\t\t\n\t\ttry {\n\t\t\tfile = new File(FILE_PATH);\n\t\t} catch (NullPointerException e) {\n\t\t\tSystem.exit(1);\n\t\t}\n\t\t\n\t\tFileReader reader = null;\t\t\n\t\ttry {\n\t\t\treader = new FileReader(file);\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"Can't find source (json file)\");\n\t\t\tSystem.err.println(e.getMessage());\n\t\t\tSystem.exit(1);\n\t\t\t\n\t\t}\n\t\t\n\t\tJSONObject jsonObject = new JSONObject(\n\t\t\t\tnew JSONTokener(reader)\n\t\t\t\t);\n\t\t\n\t\tJSONArray array = jsonObject.getJSONArray(\"students\");\n\t\t\n\t\tfor (int i = 0; i < array.length(); i++) {\t\t\t\n\t\t\tJSONObject student = array.getJSONObject(i);\t\t\t\n\t\t\tString name = student.getString(\"name\");\n\t\t\tString secondName = student.getString(\"secondName\");\n\t\t\tString surname = student.getString(\"surname\");\n\t\t\tString birthday = student.getString(\"birthday\");\n\t\t\tString facultet = student.getString(\"facultet\");\n\t\t\tint groupNumber = student.getInt(\"groupNumber\");\n\t\t\t\n\t\t\tDate dateBirthday = null; \n\t\t\t//делаем Date из строки\t\t\t\n\t\t\ttry {\n\t\t\t\tdateBirthday = new SimpleDateFormat(\"dd.MM.yyyy\").parse(birthday);\n\t\t\t} catch(ParseException e) {\n\t\t\t\tSystem.err.println(\"Can't understand the date format from source.\");\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\tstudents.add(\n\t\t\t\t\tStudent.get(name, secondName, surname, dateBirthday, facultet, groupNumber)\n\t\t\t\t\t);\t\t\t\n\t\t}\t\t\t\n\t}", "private static void saveChanges() throws IOException{\n\t\twriteToStudentsFile(); //copy all the StudentDetails objects in ALL_STUDENTS and write them to the students.txt file\n\t\twriteToBooksFile(); //copy all the BookDetails objects in ALL_BOOKS and write them to the books.txt file\n\t\tSystem.out.println(\"All Changes Successfully Saved!\");\n\t\tSystem.out.println(\"Thanks for using the Library Management System\");\n\t}", "@Override\n public void edit(){\n Integer Pointer=0;\n FileWriter editDetails = null;\n ArrayList<String> lineKeeper = saveText();\n\n /* Search into the list to find the Username, if it founds it, changes the\n * old information with the new information.\n * Search*/\n if(lineKeeper.contains(getUsername())){\n Pointer=lineKeeper.indexOf(getUsername());\n\n //Write the new information\n lineKeeper.set(Pointer+1, getPassword());\n lineKeeper.set(Pointer+2, getFirstname());\n lineKeeper.set(Pointer+3, getLastname());\n lineKeeper.set(Pointer+4, DMY.format(getDoB()));\n lineKeeper.set(Pointer+5, getContactNumber());\n lineKeeper.set(Pointer+6, getEmail());\n lineKeeper.set(Pointer+7, String.valueOf(getSalary()));\n lineKeeper.set(Pointer+8, getPositionStatus());\n Pointer=Pointer+9;\n homeAddress.edit(lineKeeper,Pointer);\n }//end if\n\n try{\n editDetails= new FileWriter(\"employees.txt\",false);\n for( int i=0;i<lineKeeper.size();i++){\n editDetails.append(lineKeeper.get(i));\n editDetails.append(System.getProperty(\"line.separator\"));\n }//end for\n editDetails.close();\n editDetails = null;\n }//end try\n catch (IOException ioe) {}//end catch\n }", "public void showstudents(){\n for (int i=0; i<slist.size(); i++){\n System.out.println(slist.get(i).getStudent());\n }\n }", "public void writeToEmployeeListFile()\r\n {\r\n\ttry(ObjectOutputStream toEmployeeListFile = \r\n new ObjectOutputStream(new FileOutputStream(\"listfiles/employeelist.dta\")))\r\n\t{\r\n toEmployeeListFile.writeObject(employeeList);\r\n employeeList.saveStaticEmpRunNr(toEmployeeListFile);\r\n\t}\r\n\tcatch(NotSerializableException nse)\r\n\t{\r\n JOptionPane.showMessageDialog(null, \"Ansatt objektene er ikke \"\r\n + \"serialiserbare.\\nIngen registrering på fil!\"\r\n + nse.getMessage(), \"Feilmelding\", \r\n JOptionPane.ERROR_MESSAGE);\r\n\t}\r\n\tcatch(IOException ioe)\r\n\t{\r\n JOptionPane.showMessageDialog(null, \"Det oppsto en feil ved skriving \"\r\n + \"til fil.\\n\" + ioe.getMessage());\r\n\t}\r\n }", "static void createAuthorsFile () throws IOException {\n\t\tBufferedReader dataFile = new BufferedReader(new FileReader(DATAFILE));\n\t\tString inputLine;\n\t\t\n\t\tPrintWriter isbnLabeledDataFile = new PrintWriter(new FileWriter(ISBNLABELLEDDATAFILE));\n\t\t\n\t\tSet<String> books = new HashSet<String>();\n\t\twhile ((inputLine = dataFile.readLine()) != null) {\n\t\t\tif (inputLine.indexOf('\\t') == -1) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tString[] fields = inputLine.split(\"\\t\");\n\t\t\tif (fields.length != 4) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tfinal String bookId = fields[1];\n\t\t\tif (books.contains(bookId)) {\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\tbooks.add(bookId);\n\t\t\t\tString authorString = getAuthorString(bookId);\n\t\t\t\tisbnLabeledDataFile.println(bookId + \"\\t\" + authorString);\n\t\t\t\tout.println(bookId + \"\\t\" + authorString);\n\t\t\t}\n\t\t}\n\t\tdataFile.close();\n\t\tisbnLabeledDataFile.close();\n\t}", "public void saveUsers() {\n\t\ttry {\n\t\t\t\n\t\t\tFile xmlFile = new File(\"Users.xml\");\n\t\t\tDocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\n\t\t\tDocumentBuilder builder = factory.newDocumentBuilder();\n\t\t\tDocument document = builder.parse(xmlFile);\n\t\t\tElement users = document.getDocumentElement();\n\t\t\t\n\t\t\tArrayList<Student> u = ManageUsers.getActiveList();\n\t\t\tfor (int i = 0; i < u.size(); i++) {\n\t\t\t\t// Grab the info for a specific student\n\t\t\t\tStudent s = u.get(i);\n\t\t\t\tString fName = s.getFirstName();\n\t\t\t\tString lName = s.getLastName();\n\t\t\t\tint ucid = s.getUcid();\n\t\t\t\tint currentBorrowing = s.getCurrentBorrowing();\n\t\t\t\tboolean isActive = true;\n\t\t\t String username = s.getUsername();\n\t\t\t String password = s.getPassword();\n\t\t\t boolean isLibrarian = s.getIsLibrarian();\n\t\t\t \n\t\t\t Element student = document.createElement(\"student\");\n\t\t\t \n\t\t\t // Make a new element <student>\n\t\t\t // Add the element to the xml as a child of <Users>\n\t\t\t // Add the above fields (fName, etc.) as child nodes to the new student node\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Something went wrong with writing to the xml\");\n\t\t\tSystem.out.println(e);\n\t\t}\n\t}", "public static void processStudentData(String[] splitString) throws \r\n\t\t\t\t\t\t\t\t\t\tIllegalArgumentException {\r\n\t\r\n\t\tStudent student;\r\n\t\t\r\n\t\tif (splitString[1].equals(\"ADD\")) {\r\n\t\t\t\r\n\t\t\t // Create a new student object\r\n\t\t\t student = new Student(splitString[2], splitString[3], splitString[4], splitString[5]);\r\n\t\t\r\n\t\t\tif (listOfStudents.contains(student)) {\r\n\t\t\t\tSystem.out.println(\"List already contains the Student data with student ID \" + splitString[2]);\r\n\t\t\t} // End if\r\n\t\t\telse { \r\n\t\t\t\t// Add method to add student to list\r\n\t\t\t\tlistOfStudents.add(student);\r\n\t\t\t\t\r\n\t\t\t} // End else\r\n\t\t\t\t\r\n\t\t} // End if\r\n\t\t\r\n\t\telse if(splitString[1].equals(\"DEL\")) {\r\n\t\t\t\r\n\t\t\t// Create a new student object\r\n\t\t\t student = new Student(splitString[2], splitString[3], splitString[4], splitString[5]);\r\n\t\t\t// Remove method to remove Student from list\r\n\t\t\tlistOfStudents.remove(student);\r\n\t\t\tSystem.err.println(\"Student was removed in the list with Student ID \" + splitString[2]);\r\n\t\t} // End if\r\n\t\telse if (!(splitString[1].equals(\"ADD\")) && \r\n\t\t\t\t!(splitString[1].equals(\"DEL\"))) {\r\n\t\t\tthrow new IllegalArgumentException(\"Line does not contain 'ADD' or 'DEL' \" + splitString[1]);\r\n\t\t\t\r\n\t\t} // End else if\r\n\t\t\r\n\t}", "static void createNewFile(String path) \n\t\t{\n\t\tLinkedList<String> defaultData = new LinkedList<String>();\n\t\tdefaultData.add(\"1,Frank,West,98,95,87,78,77,80\");\n\t\tdefaultData.add(\"2,Dianne,Greene,78,94,88,87,95,92\");\n\t\tdefaultData.add(\"3,Doug,Lei,78,94,88,87,95,92\");\n\t\tdefaultData.add(\"4,James,Hewlett,69,92,74,77,89,91\");\n\t\tdefaultData.add(\"5,Aroha,Wright,97,92,87,83,82,92\");\n\t\t\n\t\ttry \n\t\t{\n\t\t\tPrintWriter newFile = new PrintWriter(path, \"UTF-8\"); // Create .txt file in given path\n\t\t\t\n\t\t\tfor (String s : defaultData) \n\t\t\t{\n\t\t\t\tnewFile.println(s); // Write To file\n\t\t\t}\n\t\t\t\n\t\t\tnewFile.close(); // Close File\n\t\t\t\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (UnsupportedEncodingException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tSystem.out.println(\"studentData.txt Created Successfully!\");\n\t\t\n\t}", "private static void updateFile(City [] cities , boolean append) throws IOException{\n PrintWriter write = new PrintWriter(new FileOutputStream(\"rainfall.txt\",append)); //to append , use append = true || to reset the full file append = false\n for(City obj:cities){\n String out = \"\";\n out += String.format(\"%-20s %-20s\",obj.getCityName(), obj.getCountryName());\n write.print(out);\n for(double rainfall:obj.getAverageMonthlyRainfall())\n write.printf(\"%-10.1f\",rainfall);\n write.println();\n }\n System.out.print(\"\\nrainfall.txt file has been updated...\");\n write.close();\n }", "public static void writeFile ( LinkedList contactsList ) {\n\t\ttry {\n PrintWriter writer = new PrintWriter ( \"contacts.txt\" );\n for ( int row = 0; row < contactsList.size ( ); row++ ) {\n \t// this is basically a toString right here, adapted to the original contacts.txt\n \tString line = contactsList.get ( row ).getFirst ( ) + \",\" + contactsList.get ( row ).getLast ( ) + \",\" + contactsList.get ( row ).getPhone ( ) \n \t\t\t+ \",\" + contactsList.get ( row ).getAddress ( ) + \",\" + contactsList.get ( row ).getCity ( ) + \",\" + contactsList.get ( row ).getZip ( );\n writer.println ( line );\n }\n writer.close();\n } catch ( FileNotFoundException fnf ) {\n System.out.println(\"File was not found.\");\n }\n\t}", "public void readFile() throws IOException {\r\n File file = new File(\"employee_list.txt\"); //Declaration and initialization of file object\r\n Scanner textFile = new Scanner(file); //Creates Scanner object and parse in the file\r\n\r\n while(textFile.hasNextLine()){ //Stay in a loop until there is no written line in the text file\r\n String line = textFile.nextLine(); //Read line and store in a String variable 'line'\r\n String[] words = line.split(\",\"); //Split the whole line at commas and store those in a simple String array\r\n Employee employee = new Employee(words[0],words[1],words[2]); //Create Employee object\r\n this.listOfEmployees.add(employee); //Add created Employee object to listOfEmployees ArrayList\r\n if(!this.listOfDepartments.contains(words[1])){ //This just adds all the department names to an ArrayList\r\n this.listOfDepartments.add(words[1]);\r\n }\r\n }\r\n }", "public static void printStudents(ArrayList<Student> S, ArrayList<School> H,\n\t\t\tint numStudentsAdded, boolean rankingsSet) {\n\n\t\tString name = \"\";\n\t\tString editRankingsOption = \"\";\n\t\tboolean valid = false;\n\n\t\tif (numStudentsAdded <= 0) {\n\t\t\tSystem.out.println(\"\");\n\t\t\tSystem.out.println(\"ERROR: No students are loaded!\");\n\t\t\tSystem.out.println(\"\");\n\t\t\treturn;\n\n\t\t}\n\n\t\tSystem.out.println(\"\");\n\t\tSystem.out.println(\"STUDENTS:\");\n\t\tSystem.out.println(\"\");\n\n\t\tSystem.out\n\t\t\t\t.println(\" # Name GPA ES Assigned school Preferred school order\");\n\t\tSystem.out\n\t\t\t\t.println(\"---------------------------------------------------------------------------------------------------------------------------\");\n\n\t\tfor (int i = 0; i < numStudentsAdded; i++) {\n\t\t\tSystem.out.print(\" \" + (i + 1) + \". \");\n\t\t\t// rankingsSet = true; //Now rankings will always be set by the text\n\t\t\t// file\n\t\t\tS.get(i).print(H, rankingsSet);\n\n\t\t\t// [i].printRankings(H);\n\t\t}\n\n\t\tSystem.out\n\t\t\t\t.println(\"---------------------------------------------------------------------------------------------------------------------------\");\n\t\tSystem.out.println(\"\");\n\n\t}", "@Override\r\n public void update() {\n ArrayList<String>Lines=new ArrayList<>();\r\n File file =new File(\"/home/yara/Documents/4year/OODP/Task.txt\");\r\n BufferedReader br = null;\r\n try {\r\n br = new BufferedReader(new FileReader(\"/home/yara/Documents/4year/OODP/Task.txt\"));\r\n } catch (FileNotFoundException ex) {\r\n Logger.getLogger(Task.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n String str;\r\n String UID=id.getText();\r\n try {\r\n while((str=br.readLine()) !=null)\r\n {\r\n \r\n Lines.add(str);\r\n }\r\n String UpadetString = id.getText() +\" , \"+ name.getText()+\" , \"+ date_start.getText()+\" , \"+ date_finish.getText()+\" , \"+status.getText();\r\n for (int i=0 ;i<Lines.size();i++)\r\n {\r\n String line=Lines.get(i).trim();\r\n String[] datarow =line.split(\" , \");\r\n if(datarow[0].equals(UID))\r\n {\r\n Lines.set(i,UpadetString );\r\n } \r\n }\r\n PrintWriter Pwriter = new PrintWriter(file);\r\n Pwriter.print(\"\");\r\n Pwriter.close();\r\n \r\n File f=new File(\"/home/yara/Documents/4year/OODP/Task.txt\");\r\n FileWriter writer = new FileWriter(f.getAbsoluteFile(), true);\r\n BufferedWriter bw=new BufferedWriter(writer);\r\n for(String x:Lines)\r\n {\r\n bw.write(x);\r\n bw.newLine();\r\n }\r\n bw.close();\r\n \r\n } catch (IOException ex) {\r\n Logger.getLogger(Task.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n \r\n \r\n }", "private static List<StudentRecord> convert(List<String> lines) {\n\t\tObjects.requireNonNull(lines);\n\t\t\n\t\tArrayList<StudentRecord> result = new ArrayList<>(lines.size());\n\t\t\n\t\tfor(String data : lines) {\n\t\t\tif(data.length() == 0) continue; //preskoci prazne linije\n\t\t\tScanner sc = new Scanner(data);\n\t\t\tsc.useDelimiter(\"\\t\");\n\t\t\t\n\t\t\ttry {\n\t\t\t\tresult.add(new StudentRecord(sc.next(), sc.next(), sc.next(), sc.next(), sc.next(), sc.next(), sc.next()));\n\t\t\t}catch(NoSuchElementException e) {\n\t\t\t\tsc.close();\n\t\t\t\tthrow new NoSuchElementException(\"Data not formatted correctly.\");\n\t\t\t}\n\t\t\tsc.close();\n\t\t}\n\t\t\n\t\treturn result;\n\t}", "void clearRecords() {\n\t\ttry {\n\t\tPrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter(\"Student.txt\")));\n\t\tpw.close();\n\t\tSystem.out.println(\"\\nAll Records cleared successfully !\");\n\t\tfor (int i = 0; i < 999999999; i++);\n\t\t}catch (IOException e) {\n\t\t\tSystem.out.println(e);\n\t\t}\n\t}", "public static void setSemester() {\r\n\t\tarrays = ReadingAndWritingInFile.readObject(\"MarketingDepartment.txt\");\r\n\t\taverageandidofemployees = (ArrayList<ArrayList<Double>>) arrays[0];\r\n\t\tdegreespersemester = (ArrayList<ArrayList<Double>>) arrays[1];\r\n\t\tidperemployee = (ArrayList<Double>) arrays[2];\r\n\t\tObject[] arrays2 = ReadingAndWritingInFile.readObject(\"HRDepartment.txt\");\r\n\t\tArrayList<ArrayList<Double>> averageandidofemployees2 = (ArrayList<ArrayList<Double>>) arrays2[0];\r\n\t\tArrayList<ArrayList<Double>> degreespersemester2 = (ArrayList<ArrayList<Double>>) arrays2[1];\r\n\t\tArrayList<Double> idperemployee2 = (ArrayList<Double>) arrays2[2];\r\n\t\tObject[] arrays3 = ReadingAndWritingInFile.readObject(\"AccountingDepartment.txt\");\r\n\t\tArrayList<ArrayList<Double>> averageandidofemployees3 = (ArrayList<ArrayList<Double>>) arrays3[0];\r\n\t\tArrayList<ArrayList<Double>> degreespersemester3 = (ArrayList<ArrayList<Double>>) arrays3[1];\r\n\t\tArrayList<Double> idperemployee3 = (ArrayList<Double>) arrays3[2];\r\n\t\tObject[] arrays4 = ReadingAndWritingInFile.readObject(\"ITDepartment.txt\");\r\n\t\tArrayList<ArrayList<Double>> averageandidofemployees4 = (ArrayList<ArrayList<Double>>) arrays4[0];\r\n\t\tArrayList<ArrayList<Double>> degreespersemester4 = (ArrayList<ArrayList<Double>>) arrays4[1];\r\n\t\tArrayList<Double> idperemployee4 = (ArrayList<Double>) arrays4[2];\r\n\t\tint times = ReadingAndWritingInFile.readNumber(\"Times.txt\");\r\n\t\tif (times == 1) {\r\n\t\t\t++times;\r\n\t\t\ttry {\r\n\t\t\t\tnew FileWriter(\"Times.txt\").close();\r\n\t\t\t\tFileOutputStream wr = new FileOutputStream(\"Times.txt\");\r\n\t\t\t\twr.write(times);\r\n\t\t\t\twr.close();\r\n\t\t\t} catch (FileNotFoundException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i <= averageandidofemployees.size() - 1; i++) {\r\n\t\t\t\tidperemployee.add(i, averageandidofemployees.get(i).get(1));\r\n\t\t\t\tdegreespersemester.add(new ArrayList<Double>());\r\n\t\t\t\tdegreespersemester.get(i).add(0, averageandidofemployees.get(i).get(0));\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i <= averageandidofemployees2.size() - 1; i++) {\r\n\t\t\t\tidperemployee2.add(i, averageandidofemployees2.get(i).get(1));\r\n\t\t\t\tdegreespersemester2.add(new ArrayList<Double>());\r\n\t\t\t\tdegreespersemester2.get(i).add(0, averageandidofemployees2.get(i).get(0));\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i <= averageandidofemployees3.size() - 1; i++) {\r\n\t\t\t\tidperemployee3.add(i, averageandidofemployees3.get(i).get(1));\r\n\t\t\t\tdegreespersemester3.add(new ArrayList<Double>());\r\n\t\t\t\tdegreespersemester3.get(i).add(0, averageandidofemployees3.get(i).get(0));\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i <= averageandidofemployees4.size() - 1; i++) {\r\n\t\t\t\tidperemployee4.add(i, averageandidofemployees4.get(i).get(1));\r\n\t\t\t\tdegreespersemester4.add(new ArrayList<Double>());\r\n\t\t\t\tdegreespersemester4.get(i).add(0, averageandidofemployees4.get(i).get(0));\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tint count2;\r\n\t\t\tfor (int i = 0; i <= averageandidofemployees.size() - 1; i++) {\r\n\t\t\t\tcount2 = 1;\r\n\t\t\t\tfor (int j = 0; j <= idperemployee.size() - 1; j++) {\r\n\t\t\t\t\tif (String.valueOf(averageandidofemployees.get(i).get(1))\r\n\t\t\t\t\t\t\t.equals(String.valueOf(idperemployee.get(j)))) {\r\n\t\t\t\t\t\tdegreespersemester.get(j).add(degreespersemester.get(j).size(),\r\n\t\t\t\t\t\t\t\taverageandidofemployees.get(i).get(0));\r\n\t\t\t\t\t\tcount2 = 0;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (count2 == 1) {\r\n\t\t\t\t\tidperemployee.add(idperemployee.size(), averageandidofemployees.get(i).get(1));\r\n\t\t\t\t\tdegreespersemester.add(new ArrayList<Double>());\r\n\t\t\t\t\tdegreespersemester.get(degreespersemester.size() - 1).add(0, averageandidofemployees.get(i).get(0));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tfor (int i = 0; i <= averageandidofemployees2.size() - 1; i++) {\r\n\t\t\t\tcount2 = 1;\r\n\t\t\t\tfor (int j = 0; j <= idperemployee2.size() - 1; j++) {\r\n\t\t\t\t\tif (String.valueOf(averageandidofemployees2.get(i).get(1))\r\n\t\t\t\t\t\t\t.equals(String.valueOf(idperemployee2.get(j)))) {\r\n\t\t\t\t\t\tdegreespersemester2.get(j).add(degreespersemester2.get(j).size(),\r\n\t\t\t\t\t\t\t\taverageandidofemployees2.get(i).get(0));\r\n\t\t\t\t\t\tcount2 = 0;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (count2 == 1) {\r\n\t\t\t\t\tidperemployee2.add(idperemployee2.size(), averageandidofemployees2.get(i).get(1));\r\n\t\t\t\t\tdegreespersemester2.add(new ArrayList<Double>());\r\n\t\t\t\t\tdegreespersemester2.get(degreespersemester2.size() - 1).add(0,\r\n\t\t\t\t\t\t\taverageandidofemployees2.get(i).get(0));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i <= averageandidofemployees3.size() - 1; i++) {\r\n\t\t\t\tcount2 = 1;\r\n\t\t\t\tfor (int j = 0; j <= idperemployee3.size() - 1; j++) {\r\n\t\t\t\t\tif (String.valueOf(averageandidofemployees3.get(i).get(1))\r\n\t\t\t\t\t\t\t.equals(String.valueOf(idperemployee3.get(j)))) {\r\n\t\t\t\t\t\tdegreespersemester3.get(j).add(degreespersemester3.get(j).size(),\r\n\t\t\t\t\t\t\t\taverageandidofemployees3.get(i).get(0));\r\n\t\t\t\t\t\tcount2 = 0;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (count2 == 1) {\r\n\t\t\t\t\tidperemployee3.add(idperemployee3.size(), averageandidofemployees3.get(i).get(1));\r\n\t\t\t\t\tdegreespersemester3.add(new ArrayList<Double>());\r\n\t\t\t\t\tdegreespersemester3.get(degreespersemester3.size() - 1).add(0,\r\n\t\t\t\t\t\t\taverageandidofemployees3.get(i).get(0));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i <= averageandidofemployees4.size() - 1; i++) {\r\n\t\t\t\tcount2 = 1;\r\n\t\t\t\tfor (int j = 0; j <= idperemployee4.size() - 1; j++) {\r\n\t\t\t\t\tif (String.valueOf(averageandidofemployees4.get(i).get(1))\r\n\t\t\t\t\t\t\t.equals(String.valueOf(idperemployee4.get(j)))) {\r\n\t\t\t\t\t\tdegreespersemester4.get(j).add(degreespersemester4.get(j).size(),\r\n\t\t\t\t\t\t\t\taverageandidofemployees4.get(i).get(0));\r\n\t\t\t\t\t\tcount2 = 0;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (count2 == 1) {\r\n\t\t\t\t\tidperemployee4.add(idperemployee4.size(), averageandidofemployees4.get(i).get(1));\r\n\t\t\t\t\tdegreespersemester4.add(new ArrayList<Double>());\r\n\t\t\t\t\tdegreespersemester4.get(degreespersemester4.size() - 1).add(0,\r\n\t\t\t\t\t\t\taverageandidofemployees4.get(i).get(0));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\tfor (int i = averageandidofemployees.size() - 1; i >= 0; i--) {\r\n\t\t\taverageandidofemployees.remove(i);\r\n\t\t}\r\n\t\tfor (int i = averageandidofemployees2.size() - 1; i >= 0; i--) {\r\n\t\t\taverageandidofemployees2.remove(i);\r\n\t\t}\r\n\t\tfor (int i = averageandidofemployees3.size() - 1; i >= 0; i--) {\r\n\t\t\taverageandidofemployees3.remove(i);\r\n\t\t}\r\n\t\tfor (int i = averageandidofemployees4.size() - 1; i >= 0; i--) {\r\n\t\t\taverageandidofemployees4.remove(i);\r\n\t\t}\r\n\t\tReadingAndWritingInFile.writeObject(\"MarketingDepartment.txt\", averageandidofemployees, degreespersemester,\r\n\t\t\t\tidperemployee);\r\n\t\tReadingAndWritingInFile.writeObject(\"HRDepartment.txt\", averageandidofemployees2, degreespersemester2,\r\n\t\t\t\tidperemployee2);\r\n\t\tReadingAndWritingInFile.writeObject(\"AccountingDepartment.txt\", averageandidofemployees3, degreespersemester3,\r\n\t\t\t\tidperemployee3);\r\n\t\tReadingAndWritingInFile.writeObject(\"ITDepartment.txt\", averageandidofemployees4, degreespersemester4,\r\n\t\t\t\tidperemployee4);\r\n\t}", "@SuppressWarnings({ \"rawtypes\", \"unchecked\"})\n\tpublic static ArrayList<StudentCourse> initStudentCourses() throws IOException, ParseException {\n\t\t// read String from text file\n\t\tArrayList<String> stringArray = (ArrayList) IO.read(Main.studentcoursepath.toString());\n\t\t\t\n\t\tif (stringArray.size() == 0){\n\t\t\treturn new ArrayList<StudentCourse>();\n\t\t}\n for (int i = 0 ; i < stringArray.size() ; i++) {\n\t\t\t\tString field = (String) stringArray.get(i);\n\n\t\t\t\t// get individual 'fields' of the string separated by SEPARATOR\n\t\t\t\t// pass in the string to the string tokenizer using delimiter \",\"\n\t\t\t\tStringTokenizer tokenizer = new StringTokenizer(field, SEPARATOR);\n\n\t\t\t\t//first to fifth tokens\n\t\t\t\tString userID = tokenizer.nextToken().trim();\n\t\t\t\tString userName = tokenizer.nextToken().trim();\n\t\t\t\tString courseID = tokenizer.nextToken().trim();\n\t\t\t\tint indexID = Integer.parseInt(tokenizer.nextToken().trim());\n\t\t\t\tString registerStatus = tokenizer.nextToken().trim();\n\n\t\t\t\t// create Course object from file data\n\t\t\t\tStudentCourse course = new StudentCourse(userID, userName, courseID, indexID, registerStatus);\n\t\t\t\t// add to Courses list\n\t\t\t\tstudentCourseList.add(course) ;\n\t\t}\n\t\treturn studentCourseList ;\n\t}", "public void updateFile() {\n try {\n FileWriter fw = new FileWriter(path);\n for (Task t : taskList.getTasks()) {\n fw.write(t.toTxt());\n }\n fw.close();\n } catch (IOException e) {\n System.out.println(\"File cannot be found\");\n }\n }", "public void writeScores() throws IOException {\n if (this.list.isPresent() && this.toSave) {\n try (DataOutputStream out = new DataOutputStream(new FileOutputStream(this.file))) {\n for (final Pair<String, Integer> p : this.list.get()) {\n out.writeUTF(p.getX());\n out.writeInt(p.getY().intValue());\n }\n this.toSave = false;\n } catch (IOException e) {\n System.out.println(\"IOException on writing scores\");\n }\n }\n\n }", "@SuppressWarnings(\"unchecked\")\r\n\tpublic List<Student> retrieveAllStudentObjects() {\r\n\t\tList<Student> listOfStudents = new ArrayList<Student>();\r\n\r\n\t\ttry {\r\n\t\t\tlistOfStudents = readSerializedObject();\r\n\r\n\t\t\tif (listOfStudents == null) {\r\n\t\t\t\tSystem.out.println(\"Unable to read from file!\");\r\n\t\t\t\tthrow new Exception();\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn listOfStudents;\r\n\t}", "public void populateList(){\n\t\tfor (int i = 0; i < 10; i++){\n\t\t\tscoreList.add(-1);\t\t\t\n\t\t\tnameList.add(\"\");\n\t\t}\n\t\tint i=0; \n\t\ttry {\n\t\t\tScanner results = new Scanner(new File(\"results.txt\"));\n\t\t\twhile (results.hasNext()){\n\t\t\t\tnameList.set(i, results.next());\n\t\t\t\tscoreList.set(i, results.nextInt());\n\t\t\t\ti++;\n\t\t\t}\n\t\t} catch (FileNotFoundException e1){\n\t\t\te1.printStackTrace();\n\t\t}\n\t}", "public static void editStudentInfo(){\n System.out.println(\"Enter the students ID\");\r\n System.out.println(\"=============================\");\r\n Scanner studentNameSearch = new Scanner(System.in);\r\n String idToSearch = studentNameSearch.nextLine();\r\n for (Student searchStudent : studentList){ //basic loop to search through the list of student by the ID\r\n if (searchStudent.getStudentID().equals(idToSearch)){\r\n searchStudent.printStudentInfo();\r\n System.out.println(\"What would you like to do?\");\r\n System.out.println(\"===========================\");\r\n System.out.println(\"1: Change a students name\");\r\n System.out.println(\"2: Add a course\");\r\n System.out.println(\"3: Remove a course\");\r\n System.out.println(\"4: Set course as completed\");\r\n System.out.println(\" \");\r\n Scanner editChoice = new Scanner(System.in);\r\n\r\n switch (editChoice.nextInt()){\r\n case 1 -> {\r\n //Edit first and last name\r\n Scanner newNameInput = new Scanner(System.in);\r\n System.out.println(\"Enter the students Last name\");\r\n String newName = newNameInput.nextLine();\r\n searchStudent.setLastName(newName);\r\n System.out.println(\"Enter the students First name\");\r\n String newName1 = newNameInput.nextLine();\r\n searchStudent.setFirstName(newName1);\r\n searchStudent.getFullName();\r\n mainMenu();\r\n }\r\n case 2 -> {\r\n //search for a course and add a course to the students schedule\r\n System.out.println(\"Enter the course ID\");\r\n Scanner courseToAdd = new Scanner(System.in);\r\n String courseIdToSearch = courseToAdd.nextLine();\r\n for (Course searchCourse : courseList){\r\n if (searchCourse.getCourseID().equals(courseIdToSearch)){\r\n searchStudent.addClasstoSchedule(searchCourse);\r\n }\r\n }\r\n mainMenu();\r\n }\r\n case 3 -> {\r\n //remove a course from the students schedule\r\n System.out.println(\"Enter the course ID\");\r\n Scanner courseToAdd = new Scanner(System.in);\r\n String courseIdToSearch = courseToAdd.nextLine();\r\n for (Course searchCourse : courseList){\r\n if (searchCourse.getCourseID().equals(courseIdToSearch)){\r\n searchStudent.removeClassFromSchedule(searchCourse);\r\n }\r\n }\r\n mainMenu();\r\n }\r\n case 4 ->{\r\n //Set a course as completed\r\n System.out.println(\"Enter the course ID\");\r\n Scanner courseToAdd = new Scanner(System.in);\r\n String courseIdToSearch = courseToAdd.nextLine();\r\n for (Course searchCourse : courseList){\r\n if (searchCourse.getCourseID().equals(courseIdToSearch)){\r\n searchStudent.setCourseComplete(courseIdToSearch);\r\n }\r\n }\r\n mainMenu();\r\n }\r\n default -> {\r\n //does nothing\r\n }\r\n\r\n }\r\n\r\n }\r\n else{\r\n System.err.println(\"Could not find student based on that ID\");\r\n mainMenu();\r\n }\r\n }\r\n }", "public void addOn(ArrayList array) {\n try {\n PrintWriter writer;\n if (array.get(0) instanceof Integer)\n writer = new PrintWriter(\"points.txt\");\n else writer = new PrintWriter(\"names.txt\");\n\n for (int i=0; i<array.size(); i++)\n writer.println(array.get(i));\n writer.close();\n } catch (IOException e)\n {}\n }", "@Override\n public void storeParsedText() {\n parsedHtmlPages.parallelStream().forEach(parsedHtmlPage -> {\n FileUtility.writeToFile(parsedHtmlPage, FILE_DIRECTORY_NAME + FILE_SEPARATOR + parsedHtmlPage.getTitle());\n });\n }", "public static void main(String[] args) {\n ArrayList<arrayset> list = new ArrayList<>();\n String [] newarray= new String[97];\n File data = new File(\"records.txt\");\n try {\n Scanner input = new Scanner(data);\n while (input.hasNextLine()) {\n String line = input.nextLine();\n firstName = line.split(\",\")[0];\n\n lastName = line.split(\",\")[1];\n\n gender = line.split(\",\")[2];\n\n age = Integer.parseInt(line.split(\",\")[3]);\n\n phoneNo = line.split(\",\")[4];\n\n email = line.split(\",\")[5];\n\n firstName = Character.toUpperCase(firstName.charAt(0)) + firstName.substring(1, firstName.length());\n lastName = Character.toUpperCase(lastName.charAt(0)) + lastName.substring(1, lastName.length());\n\n if (gender.toLowerCase() == \"male\" || gender.toLowerCase() == \"female\") {\n gender = gender.toLowerCase();\n }\n if (age > 1 || age < 129) {\n age = age;\n }\n else if(age <1 || age > 129) {\n System.out.println(\"Error person not valid\");\n }\n if (phoneNo.length() == 13) {\n phoneNo = phoneNo;\n }\n else if(phoneNo.length()<13) {\n System.out.println(\"Error person not valid\");\n }\n if (email.matches(\"[A-Z][0-9].@\")) {\n email = email;\n }\n else if(email.matches(\"[A-Z][0-9].@\")) {\n System.out.println(\"Error person not valid\");\n }\n list.add(new arrayset(firstName, lastName, gender, age, phoneNo, email));\n }\n input.close();\n }\n catch (FileNotFoundException e) {\n System.out.println(\"Error Wrong File!\");\n }\n System.out.println(\"Error: Person 4 is not valid, since age = -89\\n\" +\n \"Error: Person 12 is not valid, since last name = Lara22\\n\" +\n \"Error: Person 21 is not valid, since age = 179\\n\" +\n \"Error: Person 32 is not valid, since last name = Mccullough\\n\" +\n \"Error: Person 52 is not valid, since email = MMaddenMadden.net\\n\" +\n \"Error: Person 96 is not valid, since age = 0\");\n System.out.format(\"%-20s%-15s%-15s%-10s%-20s%7s \", \"First Name\", \"Last Name\", \"Gender\", \"Age\", \"Number\", \"Email\");\n\n int i = 0;\n while (i < list.size()) {\n String printarray= String.format(\"%-20s%-15s%-15s%-10s%-20s%7s \", list.get(i).getFirstName(), list.get(i).getLastName(),\n list.get(i).getGender(), list.get(i).getAge(), list.get(i).getPhoneNo(), list.get(i).getEmail());\n newarray[i]=printarray;\n i++;\n\n }\n for(int j=0; j<newarray.length; j++) {\n System.out.println(newarray[j]);\n\n }\n}", "public void read() {\n\t\tFileInputStream fis;\n\t\ttry {\n\t\t\tfis = new FileInputStream(\"studentData.dat\");\n\n\t\t\tObjectInputStream ois;\n\t\t\ttry {\n\t\t\t\tois = new ObjectInputStream(fis);\n\t\t\t\ttry {\n\t\t\t\t\tstudentList = (ArrayList<Student>) ois.readObject();\n\t\t\t\t} catch (ClassNotFoundException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\tois.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void saveGenres(){\n\t\tFile genreList = new File(Paths.get(\"genres.txt\").toString());\n\t\ttry{\n\t\t\tBufferedWriter writer = new BufferedWriter(new FileWriter(genreList));\n\t\t\tfor (String s : genres){\n\t\t\t\twriter.write(s);\n\t\t\t\twriter.newLine();\n\t\t\t}\n\t\t\twriter.close();\n\t\t} catch(IOException ex){\n\t\t\t\n\t\t}\n\t}", "public static void finaliseEdit() throws IOException {\r\n //Creating scanner object and reading the file\r\n Scanner s = new Scanner(new File(\"output.txt\"));\r\n Scanner sc2 = new Scanner(System.in);\r\n //Empty string to append the lines of the file to\r\n String lines = \"\";\r\n //While loop to append lines of file to empty string\r\n while (s.hasNext()) {\r\n lines += s.nextLine();\r\n }\r\n //Creating array by splitting the string by \"#\" which will be written in when a project is added\r\n String[] lineArr = lines.split(\"#\");\r\n //Creating arraylist and appending lines from array with while loop\r\n List<String> inLines = Arrays.asList(lineArr);\r\n while (s.hasNextLine()) {\r\n inLines.add(s.nextLine());\r\n }\r\n s.close();\r\n //For loop to split array by \", \"\r\n for (int i = 0; i < lineArr.length; i++) {\r\n String[] projectInfo = lineArr[i].split(\", \");\r\n //Prompting the user to enter a number to select a project to finalise\r\n System.out.println(\"Enter index number of task to finalise: \\ne - Exit\");\r\n int proSelect = sc2.nextInt();\r\n //Opening the file and creating a bufferedwriter object\r\n FileWriter writer = new FileWriter(\"output.txt\",false);\r\n BufferedWriter buffer = new BufferedWriter(writer);\r\n //The project gets selected by the user entering a number to select. That number will be subtracted by 1 to get the correct index of the selected project\r\n String selectedProj = inLines.get(proSelect - 1);\r\n //Creating array by splitting the string\r\n String[] selectedProjarr = selectedProj.split(\", \");\r\n //Changing the value of the index\r\n selectedProjarr[21] = \"finalised\";\r\n //Creating a string from the edited array\r\n String projLinestr = Arrays.toString(selectedProjarr);\r\n //Replacing the selected project in the arraylist with the string of the edited project\r\n inLines.set(proSelect - 1 , projLinestr);\r\n //For loop to write the arraylist to file. I got this method from https://stackoverflow.com/questions/6548157/how-to-write-an-arraylist-of-strings-into-a-text-file/6548204\r\n for(String str:inLines) {\r\n buffer.write((str + \"#\\n\"));\r\n }\r\n buffer.close();\r\n //Reading integers from file to calculate amount to be paid\r\n String feeStr = selectedProjarr[5];\r\n int feeINT = Integer.valueOf(feeStr);\r\n String ptdStr = selectedProjarr[6];\r\n int ptdInt = Integer.valueOf(ptdStr);\r\n int tobePaid = feeINT - ptdInt;\r\n //If there still is money to be payed when a project gets finalised, an invoice will be created, if all fees are paid, no invoive will be made\r\n if (tobePaid != 0) {\r\n //Opening the file and creating buffered writer to write to the file\r\n FileWriter writer2 = new FileWriter(\"invoice.txt\");\r\n BufferedWriter buffer2 = new BufferedWriter(writer2);\r\n //Writing to the file\r\n buffer2.write(\"Customer name: \" + selectedProjarr[12] + \" \" + selectedProjarr[13] + \"\\n\");\r\n buffer2.write(\"Customer tel number: \" + selectedProjarr[14] + \"\\n\");\r\n buffer2.write(\"Customer email: \" + selectedProjarr[15] + \"\\n\");\r\n buffer2.write(\"Customer address: \" + selectedProjarr[16] + \"\\n\");\r\n buffer2.write(\"Amount to be paid: \" + \"R\" + tobePaid);\r\n buffer2.close();\r\n System.out.println(\"Project has been finalised and invoice was created.\");\r\n }\r\n else\r\n {\r\n System.out.println(\"Total amount has been paid, invoice was not created.\\nProject was finalised.\");\r\n }\r\n //Opening file and creating buffered writer object to write to the completed projects file\r\n FileWriter writer3 = new FileWriter(\"completedProject.txt\");\r\n BufferedWriter buffer3 = new BufferedWriter(writer3);\r\n //Writing the project info to the file\r\n buffer3.write(\"Project name: \" + selectedProjarr[0] + \"\\n\");\r\n buffer3.write(\"Project number: \" + selectedProjarr[1] + \"\\n\");\r\n buffer3.write(\"Building type: \" + selectedProjarr[2] + \"\\n\");\r\n buffer3.write(\"Address: \" + selectedProjarr[3] + \"\\n\");\r\n buffer3.write(\"ERF Number: \" + selectedProjarr[4] + \"\\n\");\r\n buffer3.write(\"Fee: \" + \"R\" + selectedProjarr[5] + \"\\n\");\r\n buffer3.write(\"Amount paid to date: \" + \"R\" + selectedProjarr[6] + \"\\n\");\r\n buffer3.write(\"Due date: \" + selectedProjarr[7] + \"\\n\");\r\n //Creating date format to get the current date\r\n DateTimeFormatter dtf = DateTimeFormatter.ofPattern(\"dd/MM/yyyy\");\r\n LocalDateTime now = LocalDateTime.now();\r\n buffer3.write(\"Date completed: \" + dtf.format(now) + \"\\n\");\r\n //Writing Contractor information\r\n buffer3.write(\"Contractor name: \" + selectedProjarr[8] + \"\\n\");\r\n buffer3.write(\"Contractor tel number: \" + selectedProjarr[9] + \"\\n\");\r\n buffer3.write(\"Contractor email: \" + selectedProjarr[10] + \"\\n\");\r\n buffer3.write(\"Contractor address: \" + selectedProjarr[11] + \"\\n\");\r\n //Writing Customer information\r\n buffer3.write(\"Customer name: \" + selectedProjarr[12] + \" \" + selectedProjarr[13] + \"\\n\");\r\n buffer3.write(\"Customer tel number: \" + selectedProjarr[14] + \"\\n\");\r\n buffer3.write(\"Customer email: \" + selectedProjarr[15] + \"\\n\");\r\n buffer3.write(\"Customer address: \" + selectedProjarr[16] + \"\\n\");\r\n //Writing Architect information\r\n buffer3.write(\"Architect name: \" + selectedProjarr[17] + \"\\n\");\r\n buffer3.write(\"Architect tel numbert: \" + selectedProjarr[18] + \"\\n\");\r\n buffer3.write(\"Architect email: \" + selectedProjarr[19] + \"\\n\");\r\n buffer3.write(\"Architect address: \" + selectedProjarr[20] + \"\\n\");\r\n buffer3.close();\r\n break;\r\n }\r\n }", "private void enterStudentPersonalities() throws IOException {\n boolean foundStudent = false, validPersonality = false;\n String studID;\n char studPersonality = 0;\n\n do {\n System.out.println(\"\\nEnter assigned student ID:\");\n studID = Global.scan.nextLine();\n\n for (Student stud: Student.allStudents) {\n if (stud.getId().compareTo(studID) == 0) {\n foundStudent = true;\n System.out.println(\"\\nPlease enter personality of \" + studID + \" :\");\n studPersonality = Global.scan.nextLine().toUpperCase().charAt(0);\n char[] validPersonalities = {'A', 'B', 'C', 'D', 'E', 'F'};\n for (int i = 0; i < 6; i++) {\n if (studPersonality == validPersonalities[i]) {\n validPersonality = true;\n stud.setStudentPersonality(studPersonality);\n System.out.println(stud.getStudentPersonality());\n }\n }\n if (!validPersonality) {\n System.out.println(\"Invalid personality type!\");\n }\n }\n }\n if (!foundStudent) {\n System.out.println(\"Student not found!\");\n }\n } while (foundStudent == false || studID.isEmpty() || studPersonality == '0');\n FileReadWrite.saveStudentDetails(Main.studentsFileName, Student.allStudents);\n }", "private void downloadStudentList(){\n\t\t// wrzucenie poprzedniej listy (newlist) do oldList \n\t\toldStudentList = newStudentList;\n\t\t\n\t\t// sprawdzenie czy adresy/sciezki sa podane \n\t\tif(urlAdress.equals(\"\") && filePath.equals(\"\")){\n\t\t\tthrow new CrawlerException(\"Nie podano adresu URL i �cie�ki do pliku!\");\n\t\t}\n\t\t// pobranie nowej listy studentow do newList\n\t\tif(!urlAdress.equals(\"\")){\n\t\t\tdownloadFromUrl();\n\t\t}else if(!filePath.equals(\"\")){\n\t\t\tdownloadFromFile();\n\t\t}\n\t}", "public void printStudentList()\n {\n for(int i = 0; i < students.size(); i++)\n System.out.println( (i + 1) + \". \" + students.get(i).getName());\n }", "public void getOldFile() throws FileNotFoundException, IOException, ClassNotFoundException{\r\n\t\tObjectInputStream ois = new ObjectInputStream(new FileInputStream(\"agenda.txt\"));\r\n\t\tArrayList<Artist> inputArtists = (ArrayList<Artist>) ois.readObject();\r\n\t\tArrayList<Stage> inputStages = (ArrayList<Stage>) ois.readObject();\r\n\t\tArrayList<Performance> inputPerformances = (ArrayList<Performance>) ois.readObject();\r\n\t\tartists.addAll(inputArtists);\r\n\t\tstages.addAll(inputStages);\r\n\t\tperformances.addAll(inputPerformances);\r\n\t}", "public static void processFilesForValidation() {\r\n\t\t// Process each file one at a time.\r\n\t\tfor (int i = 0; i < inScanners.length; i++) {\r\n\t\t\tScanner sc = inScanners[i];\r\n\t\t\tint articleCount = 1;\r\n\t\t\t// Read the input file.\r\n\t\t\ttry {\r\n\t\t\t\twhile(sc.hasNextLine()) {\r\n\t\t\t\t\tString s = sc.nextLine();\r\n\t\t\t\t\t// If we come across an article, read its contents and add it to the file.\r\n\t\t\t\t\tif(s.startsWith(\"@ARTICLE{\")) {\r\n\t\t\t\t\t\tauthor = journal = title = year = volume = number = pages = doi = ISSN = month = \"\";\r\n\t\t\t\t\t\twhile (!s.equals(\"}\")) {\r\n\t\t\t\t\t\t\ts = sc.nextLine();\r\n\t\t\t\t\t\t\tparseValue(s);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// Throw an exception if a field is missing.\r\n\t\t\t\t\t\tif (author.isEmpty() || journal.isEmpty() || title.isEmpty() || year.isEmpty() || volume.isEmpty() \r\n\t\t\t\t\t\t\t\t|| number.isEmpty() || pages.isEmpty() || doi.isEmpty() || ISSN.isEmpty() || month.isEmpty()) {\r\n\t\t\t\t\t\t\tthrow new FileInvalidException(\"One or more fields are missing.\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// Add the article to the file if valid.\r\n\t\t\t\t\t\tString author1 = author.replaceAll(\" and\", \",\");\r\n\t\t\t\t\t\tint andIndex = author.indexOf(\"and\");\r\n\t\t\t\t\t\tString author2 = andIndex != -1 ? author.replaceAll(author.substring(andIndex,author.length()), \"et al\") : author;\r\n\t\t\t\t\t\tString author3 = author.replaceAll(\"and\", \"&\");\r\n\t\t\t\t\r\n\t\t\t\t\t\t// IEEE\r\n\t\t\t\t\t\toutWriters[i][0].println(author1+\". \\\"\"+title+\"\\\", \"+journal+\", vol. \"+volume+\", no. \"+number+\", p. \"+pages+\", \"+month+\" \"+year+\".\\r\\n\");\r\n\t\t\t\t\t\t// ACM\r\n\t\t\t\t\t\toutWriters[i][1].println(\"[\"+articleCount+\"]\\t\"+author2+\". \"+year+\". \"+title+\". \"+journal+\". \"+volume+\", \"+number+\" (\"+year+\"), \"+pages+\". DOI:https://doi.org/\"+doi+\".\\r\\n\");\r\n\t\t\t\t\t\t// NJ\r\n\t\t\t\t\t\toutWriters[i][2].println(author3+\". \"+title+\". \"+journal+\". \"+volume+\", \"+pages+\"(\"+year+\").\\r\\n\");\r\n\t\t\t\t\t\tarticleCount++;\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}\r\n\t\t\t\t// Close output writers once file has been read.\r\n\t\t\t\tfor (int j = 0; j < 3; j++) {\r\n\t\t\t\t\toutWriters[i][j].close();\r\n\t\t\t\t}\r\n\t\t\t\tnumValidFiles++;\r\n\t\t\t}\r\n\t\t\t// If file is invalid, close and delete the output files.\r\n\t\t\tcatch (FileInvalidException e) {\r\n\t\t\t\tSystem.out.println(\"Error: Detected Empty Field!\" \r\n\t\t\t\t\t\t + \"\\n============================\"\r\n\t\t\t + \"\\nProblem detected with input file: Latex\" + (i + 1) + \".bib\"\r\n\t\t\t\t\t\t + \"\\nFile is invalid: \" + e.getMessage() + \" Processing stopped at this point. \"\r\n\t\t\t\t\t\t + \"Other empty/missing fields may be present as well.\\n\");\r\n\t\t\t\tfor (int j = 0; j < 3; j++) {\r\n\t\t\t\t\toutWriters[i][j].close();\r\n\t\t\t\t\toutFiles[i][j].delete();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// Close input file after reading.\r\n\t\t\tsc.close();\r\n\t\t}\r\n\t}", "private void writeToFile(File contactsFile) {\n\n try (BufferedWriter out = new BufferedWriter(new FileWriter(contactsFile))) {\n List<String> lines = new ArrayList<>();\n\n for (User user : contacts) {\n String line = user.getUserId() + \"|\" + user.getFirstName() + \"|\" + user.getLastName() + \"|\" + user.getEmail() + \"|\" +\n user.getAge() + \"|home_\" + user.getPhoneNumbers().get(\"home\").getCountryCode() + \"_\" +\n user.getPhoneNumbers().get(\"home\").getNumber() + \",mobile_\" +\n user.getPhoneNumbers().get(\"mobile\").getCountryCode() + \"_\" +\n user.getPhoneNumbers().get(\"mobile\").getNumber() + \",work_\" +\n user.getPhoneNumbers().get(\"work\").getCountryCode() + \"_\" +\n user.getPhoneNumbers().get(\"work\").getNumber() + \"|\" + user.getAddress().getStreetName() + \",\" +\n user.getAddress().getStreetNumber() + \",\" + user.getAddress().getApartmentNumber() + \",\" +\n user.getAddress().getFloor() + \",\" + user.getAddress().getZipCode() + \",\" +\n user.getAddress().getCity() + \",\" + user.getAddress().getCountry() + \"|\" +\n user.getJobTitle() + \"|\" + user.getCompany().getName() + \"_\" +\n user.getCompany().getAddress().getStreetName() + \",\" +\n user.getCompany().getAddress().getStreetNumber() + \",\" +\n user.getCompany().getAddress().getApartmentNumber() + \",\" +\n user.getCompany().getAddress().getFloor() + \",\" +\n user.getCompany().getAddress().getZipCode() + \",\" +\n user.getCompany().getAddress().getCity() + \",\" +\n user.getCompany().getAddress().getCountry() + \"|\" +\n user.isFavorite();\n\n lines.add(line);\n\n }\n\n for (String line : lines) {\n out.write(line);\n out.newLine();\n }\n\n } catch (FileNotFoundException ex) {\n System.out.println(\"File not found \" + contactsFile + \"\\n\" + ex);\n } catch (IOException ex) {\n System.out.println(\"Failed to write content to file \" + contactsFile + \"\\n\" + ex);\n }\n\n\n }", "public static void init() {\n\t\tList<Object> objects = FileManager.readObjectFromFile(\"student.dat\");\n\t\tfor (Object o : objects)\n\t\t\tStudentList.add((Student) o);\n\t}", "public static void writeUsers(ArrayList<User> userList, \r\n String filename) throws IOException {\r\n File file = new File(filename);\r\n PrintWriter out = new PrintWriter(\r\n new FileWriter(file, false));\r\n for (User user: userList) {\r\n out.println(user); \r\n }\r\n out.close();\r\n }", "private void addStudent() throws FileNotFoundException, ValidatorException {\n //Lesen wir die Daten\n Scanner sc = new Scanner(System.in);\n System.out.println(\"Read student information\");\n System.out.print(\"ID: \");\n long studentId = sc.nextLong();\n System.out.print(\"First name: \");\n String firstName = sc.next();\n System.out.print(\"Last Name: \");\n String lastName = sc.next();\n\n //Wir rufen die addStudent Funktion vom dem Controller mit den gelesenen Daten auf\n if (ctrl.addStudent(studentId, firstName, lastName)) {\n System.out.println(\"Please add the courses later from the Registration System menu!\");\n System.out.println(\"Student saved with success!\");\n } else\n System.out.println(\"Student with this ID already exists!\");\n }", "public void readFileContent(String path) {\n\t\ttry (FileReader fr = new FileReader(path); BufferedReader br = new BufferedReader(fr);) {\n\t\t\tString line;\n\t\t\twhile ((line = br.readLine()) != null) {\n\t\t\t\tStudent student = this.convertStringToStudent(line);\n\t\t\t\tthis.addStudent(student);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tthrow new RuntimeException(\"File read failed.\", e);\n\t\t}\n\t}", "public static void writeScoreToFile(ArrayList<String> sArrayList,int score, Context context,String userName){\n\n int[] temp = new int[sArrayList.size()];\n Scanner in = null;\n\n //get the score part from the txt file\n for(int i=0;i<sArrayList.size();i++){\n\n in = new Scanner(sArrayList.get(i)).useDelimiter(\"[^0-9]+\");\n int integer = in.nextInt();\n temp[i]=integer;\n Log.d(\"array temp[]\", \"writeScoreToFile: \"+temp[i]+\"\\n\");\n in.close();\n\n }\n\n int tempVal=0;\n String tempString=null;\n if(score>temp[4]) {\n\n temp[4]=score;\n sArrayList.set(4,String.format(\"%-10s%d\",userName,score));\n for(int j=0;j<sArrayList.size()-1;j++){\n for(int k=1;k<sArrayList.size()-j;k++){\n if(temp[k-1]<temp[k]){\n tempVal = temp[k-1];\n temp[k-1]=temp[k];\n temp[k]=tempVal;\n tempString = sArrayList.get(k-1);\n sArrayList.set(k-1,sArrayList.get(k));\n sArrayList.set(k,tempString);\n }\n }\n }\n\n\n //print arraylist\n for(int i=0;i<sArrayList.size();i++){\n Log.d(\"Arraylistcontent\", \"writeScoreToFile: \"+sArrayList.get(i));\n //Log.d(\"sizeArrayList\", \"writeScoreToFile: \"+sArrayList.size());\n }\n\n\n try {\n OutputStreamWriter outputStreamWriter = new OutputStreamWriter(context.openFileOutput(\"score.txt\", Context.MODE_PRIVATE));\n for(int i=0;i<sArrayList.size();i++){\n //use each line for one score\n outputStreamWriter.write(sArrayList.get(i)+\"\\n\");\n }\n outputStreamWriter.close();\n\n } catch (FileNotFoundException e) {\n Log.e(\"FileNotFoundException\", \"File write failed: \" + e.toString());\n } catch (IOException e) {\n Log.e(\"IOException\", \"File write failed: \" + e.toString());\n }\n Log.d(\"end of the log\", \"writeScoreToFile: \"+\".......\");\n }\n }", "public void saveNewRollManager()\n\t{\n\t JFileChooser chooser = new JFileChooser(); //allows the user to choose a file\n\t chooser.setCurrentDirectory(new File(\"/home/me/Documents\"));\t//sets the directory of where to find the file\n\t int retrival = chooser.showSaveDialog(null);\n\t if (retrival == JFileChooser.APPROVE_OPTION) {\n\t try \n\t {\n\t FileWriter fw = new FileWriter(chooser.getSelectedFile()+\".txt\");\n\t fw.write (getCourseToFileString ( ));\n\t for(Student b : getStudents ( ))\t \t\n\t \tfw.write(b.toFileString ( ));\n\t \tfw.close ( );\n\t \t;\n\t } \n\t catch (Exception ex) \n\t {\n\t ex.printStackTrace();\n\t }\n\t\t\tthis.saveNeed = false;\n\n\t }\n\t \n\t}", "public static void createRecord() throws IOException {\r\n\t\tstudRecs.add(new Student());\r\n\t\tint i = studRecs.size() - 1;\r\n\t\tStudent tempRecord = studRecs.get(i);\r\n\t\tSystem.out.println(\"Creating Student \" + i + \" (\" + tempRecord.getStudentID() + \")\");\r\n\t\ttempRecord.setFirstName(StudentInput.firstName());\r\n\t\ttempRecord.setLastName(StudentInput.lastName());\r\n\t\ttempRecord.setStreetAddress(StudentInput.streetAddress());\r\n\t\ttempRecord.setCity(StudentInput.city());\r\n\t\ttempRecord.setProvince(StudentInput.province());\r\n\t\ttempRecord.setPostalCode(StudentInput.postalCode());\r\n\t\ttempRecord.setPhoneNumber(StudentInput.phoneNumber());\r\n\t\ttempRecord.setBirthDate(StudentInput.birthDate());\r\n\t\tSystem.out.println(\"Student \" + i + \" (\" + tempRecord.getStudentID() + \")\" + \" Created!\");\r\n\t}", "public void closeFile()\n {\n ArrayList<String> jobs = new ArrayList<String>();\n ArrayList<String> jobRecruiters = new ArrayList<String>();\n ArrayList<String> jobSeekers = new ArrayList<String>();\n ArrayList<String> notifications = new ArrayList<String>();\n for (Job job : jobList)\n {\n String jobinfo = job.getJobRecruiterUsername() + \"///\" + job.getTitle() + \"///\" + job.getDescription() + \"/// \" + job.getSalary();\n jobinfo = jobinfo + \"///\" + job.getLocation() + \"///\";\n for (String cate: job.getCategory())\n {\n jobinfo = jobinfo + cate + \",\";\n }\n jobinfo = jobinfo.substring(0,jobinfo.length()-1) + \"///\";\n for (String seek : job.getJobSeekerUsername())\n {\n jobinfo = jobinfo + seek + \",\";\n }\n jobinfo = jobinfo.substring(0,jobinfo.length()-1);\n jobs.add(jobinfo);\n }\n writeFile(\"Job.txt\", jobs);\n for (JobRecruiter recruiter : jobRecruiterList)\n {\n String recinfo = recruiter.getName() + \",\" + recruiter.getUserName() + \",\" + recruiter.getRole() + \",\" + recruiter.getGender() + \",\";\n recinfo = recinfo + recruiter.getEmail() + \",\" + recruiter.getPassword() + \",\" + recruiter.getCompanyName() + \",\" + recruiter.getLocation();\n jobRecruiters.add(recinfo);\n }\n writeFile(\"JobRecruiter.txt\", jobRecruiters);\n for (JobSeeker seeker : jobSeekerList)\n {\n String seekinfo = seeker.getName() + \",\" + seeker.getUserName() + \",\" + seeker.getRole() + \",\" + seeker.getGender() + \",\";\n seekinfo = seekinfo + seeker.getEmail() + \",\" + seeker.getPassword() + \",\";\n for(String skill : seeker.getSkillsets())\n {\n seekinfo = seekinfo + skill + \",\";\n }\n seekinfo = seekinfo.substring(0,seekinfo.length()-1);\n String notinfo = seeker.getUserName() + \"///\";\n for (String noti : seeker.getNotification())\n {\n notinfo = notinfo + noti + \",\";\n }\n notinfo = notinfo.substring(0,notinfo.length()-1);\n jobSeekers.add(seekinfo);\n notifications.add(notinfo);\n }\n writeFile(\"JobSeeker.txt\", jobSeekers);\n writeFile(\"Notification.txt\", notifications);\n }", "private void viewAllInfo(){\r\n try{\r\n Scanner scanner = new Scanner(file);\r\n String info;\r\n\r\n while (scanner.hasNext()){\r\n String line = scanner.nextLine();\r\n String[] components = line.split(separator);\r\n info = \" Name: \" + components[0] + \"\\n\";\r\n info += \" Phone No.: \"+components[1]+\"\\n\";\r\n info += \" Email: \"+components[2]+\"\\n\";\r\n info += \" Address: \"+components[3]+\"\\n\";\r\n textAreaFromAllInfo.append(info+\"\\n\");\r\n }\r\n\r\n }catch (IOException e){\r\n fileError();\r\n }\r\n }", "private void writeItems() {\n\n // open file\n File file = getFilesDir();\n File todoFile = new File(file, \"scores.txt\");\n\n // try to add items to file\n try {\n FileUtils.writeLines(todoFile, items);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void saveScores(){\n try {\n File f = new File(filePath, highScores);\n FileWriter output = new FileWriter(f);\n BufferedWriter writer = new BufferedWriter(output);\n\n writer.write(topScores.get(0) + \"-\" + topScores.get(1) + \"-\" + topScores.get(2) + \"-\" + topScores.get(3) + \"-\" + topScores.get(4));\n writer.newLine();\n writer.write(topName.get(0) + \"-\" + topName.get(1) + \"-\" + topName.get(2) + \"-\" + topName.get(3) + \"-\" + topName.get(4));\n writer.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public void printModuleStudentInfo() {\t\r\n\tfor(int i =0; i<(StudentList.size()); i++) {\r\n\t\tStudent temp =StudentList.get(i);\r\n\t\tSystem.out.println(temp.getUserName());\r\n\t}\t\r\n}", "public void run()throws IOException\n {\n /*\n * Data is read from the file using the Scanner class\n * As data is read, the average of the grades is calculated\n * \n */\n\n // Declare the arrays and variables\n\n int count; // count of students\n double sum; // sum of the grades\n double ave; \n String [] IDs = new String [20];\n Double [] grades = new Double [20];\n\n Scanner inputFile = new Scanner (new File (\"marks.txt\"));\n // reading the data from the file and calculating the average\n int i = 0; \n count = 0;\n sum = 0;\n while(inputFile.hasNext()) {\n IDs [i] = inputFile.next();\n grades [i] = inputFile.nextDouble();\n\n \n i++;\n\n }\n\n while (count < i) {\n sum+= grades[count];\n count++;\n }\n ave = sum / count;\n int i2 = 0;\n while (i2 < i) {\n System.out.println (IDs[i2] + \"\\t\" + grades[i2]);\n if (grades[i2] < ave) {\n System.out.println(\"Below average\");\n }else{\n if (grades[i2] == ave) {\n System.out.println(\"average\");\n } else {\n System.out.println(\"Above average\");\n }\n }\n i2++;\n }\n System.out.println (\"The average grade of \" + count + \" students is \" + ave);\n inputFile.close(); // closes the file\n\n \n }", "public void printStudents()\n {\n for(Student s : students)\n System.out.println(s);\n }", "public static void main(String[] args) {\n Group aco21 = new Group();\n System.out.print(\"1. Create Student \\n 2. Show students \\n 3. Find by id\");\n Scanner sc = new Scanner(System.in);\n int choice1 = sc.nextInt();\n if (choice1 == 1)\n {\n\n System.out.print(\"input name, phone and birthyear on different lines \\n\");\n String n = sc.nextLine();\n String p = sc.nextLine();\n int y = sc.nextInt();\n Student k = new Student();\n k.init(n,p, y, aco21.listStud.size()+1);\n aco21.listStud.add(k);\n clearScreen();\n System.out.print(\"1. Create Student \\n 2. Show students \\n 3. Find by id\");\n choice1 = sc.nextInt();\n }\n if (choice1 == 2)\n {\n for (int i = 0; i<aco21.listStud.size(); i++)\n {\n String l = String.format(\"Name %s Number %s birthyear %d\", aco21.listStud.get(i).name, aco21.listStud.get(i).phone, aco21.listStud.get(i).birthYear);\n System.out.print(l);\n }\n clearScreen();\n System.out.print(\"1. Create Student \\n 2. Show students \\n 3. Find by id\");\n choice1 = sc.nextInt();\n }\n }", "public void saveFile() throws FileNotFoundException {\r\n try {\r\n PrintWriter out = new PrintWriter(FILE_NAME);\r\n //This puts back the labels that the loadFile removed\r\n out.println(\"date,cust_email,cust_location,product_id,product_quantity\");\r\n int i = 0;\r\n\r\n while (i < orderInfo.size()) {\r\n String saved = orderInfo.get(i).toString();\r\n out.println(saved);\r\n i++;\r\n }\r\n out.close();\r\n } catch (FileNotFoundException e) {\r\n }\r\n\r\n }", "public void writeFile(){\n try{\n FileWriter writer = new FileWriter(\"Highscores.txt\");\n for (int i = 0; i<10; i++){\n if (i >= this.highscores.size()){\n break;\n }\n writer.write(String.valueOf(this.highscores.get(i)) + \"\\n\");\n }\n writer.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public static void printStudentInfo() {\n\t\tfor (Student student : StudentList)\n\t\t\tSystem.out.println(\"Name: \" + student.getName() + \" Matric Number: \" + student.getMatricNo() + \" Degree:\"\n\t\t\t\t\t+ student.getDegree());\n\t}", "void saveStudents(ArrayList<Student> studentList) throws SQLException {\n clearTable(\"Students\");\n Connection conn = getConnection();\n String setStatement, studentName, prefRole;\n double attendance;\n int studentID, groupID;\n for (int i = 0; i < studentList.size(); i++) {\n Student currentStudent = studentList.get(i);\n studentName = currentStudent.getName();\n prefRole = currentStudent.getPrefRole();\n attendance = currentStudent.getAttendance();\n studentID = currentStudent.getStudentID();\n groupID = currentStudent.getGroupID();\n setStatement = \"INSERT INTO Students(studentID, studentName, prefRole, attendance, groupID) VALUES ('\"\n + studentID + \"', '\"\n + studentName + \"', '\"\n + prefRole + \"', '\"\n + attendance + \"', '\"\n + groupID + \"')\";\n Statement stm = conn.createStatement();\n stm.execute(setStatement);\n }\n }", "private void rewriteLocationList(List<Location> newLocationList) {\n Log.d(\"debugMode\", \"writing new contents\");\n for (Location location : newLocationList) {\n String line = \"\\n\" + location.returnFull();\n byte[] bytes = line.getBytes();\n\n FileOutputStream out;\n try {\n Log.d(\"debugMode\", location.returnFull());\n out = openFileOutput(\"Locations.txt\", MODE_APPEND);\n out.write(bytes);\n out.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }", "public static void main(String[] args) {\n Student s1 = new Student(\"Azat\");\n Student s2 = new Student(\"Saida\");\n Student s3 = new Student(\"Adil\");\n Student s4 = new Student(\"Sabira\");\n Student s5 = new Student(\"Saniya\");\n\n\n List<Student> cybertekStudents = new ArrayList<>(Arrays.asList(s1, s2, s3, s4, s5));\n\n School cybertek = new School(\"Cybertek\", cybertekStudents);\n\n cybertekStudents.add(new Student(\"Denis\"));\n cybertekStudents.add(new Student(\"Irina\"));\n\n System.out.println(cybertek);\n System.out.println(cybertek.schoolName);\n System.out.println(cybertek.allStudentsList);\n\n Student[] students = {new Student(\"Gulnaz\"),\n new Student(\"Sardar\")};\n cybertek.addNewStudent(students);\n System.out.println(cybertek.allStudentsList);\n\n for (Student each : cybertekStudents) {\n System.out.println(each.studentName);\n //347-785-9417 munavvar\n //donna fro Wic, how she is share info 718 616 4338\n\n\n }\n }" ]
[ "0.6714121", "0.63534945", "0.62948257", "0.62887704", "0.623541", "0.6131574", "0.612907", "0.6061617", "0.6018648", "0.5963214", "0.5881004", "0.587625", "0.58513844", "0.5795235", "0.5788479", "0.57798207", "0.5737842", "0.5735038", "0.5715266", "0.5703232", "0.5671638", "0.5651142", "0.56457335", "0.5615085", "0.5608202", "0.559894", "0.5558548", "0.5555262", "0.5554609", "0.55515635", "0.5550303", "0.55361915", "0.5508885", "0.5501411", "0.5494676", "0.5487796", "0.54821926", "0.54713553", "0.54547024", "0.5451594", "0.54456466", "0.5433183", "0.5431553", "0.54212666", "0.5406869", "0.5399218", "0.5386548", "0.5383947", "0.5383625", "0.5381021", "0.5334426", "0.53205544", "0.53182435", "0.5305862", "0.5284204", "0.52745086", "0.5267255", "0.52663624", "0.52653563", "0.5262567", "0.5259975", "0.52587295", "0.52563447", "0.5254458", "0.5249117", "0.523195", "0.52277195", "0.5216849", "0.5215464", "0.5209739", "0.52092606", "0.52070343", "0.5205722", "0.52021646", "0.52017355", "0.5196819", "0.51945156", "0.519403", "0.5190372", "0.51859117", "0.5180954", "0.51798314", "0.51777494", "0.5170446", "0.5152782", "0.51495224", "0.51478595", "0.5134496", "0.5133955", "0.51309377", "0.5129359", "0.5126311", "0.5123207", "0.5121621", "0.5117656", "0.51125604", "0.5109102", "0.5103808", "0.510052", "0.50999105" ]
0.8045237
0
/Overwrite books.txt file with the Parsed Form of each book in the ALL_BOOKS Hashtable
private static void writeToBooksFile() throws IOException{ FileWriter fw = new FileWriter(BOOKS_FILE, false); //overwrites the students.txt file BufferedWriter bw = new BufferedWriter(fw); Set<Integer> keys = ALL_BOOKS.keySet(); //returns list of all keys in ALL_BOOKS for(int key : keys){ bw.write(ALL_BOOKS.get(key).ParseForTextFile()); //writes the Parsed Form of the BookDetails object to the books.txt file } bw.close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void saveBooks(){\n\t\ttry{\t\n\t\t\tPrintWriter pw = new PrintWriter(new FileWriter(\"../bin/books.csv\"));\t\n\t\t\tIterator bookIterator = bookMap.keySet().iterator();\n\t\t\twhile(bookIterator.hasNext() != false){\n\t\t\t\tString current = bookIterator.next().toString();\n\t\t\t\tfor(int i=0;i<bookMap.get(current).size();i++){\t\n\t\t\t\t\tpw.write(bookMap.get(current).get(i).getTitle() \n\t\t\t\t\t\t+ \",\" + bookMap.get(current).get(i).getAuthor()\n\t\t\t\t\t\t+ \",\" + bookMap.get(current).get(i).getYear()\n\t\t\t\t\t\t+ \",\" + bookMap.get(current).get(i).getType()\n\t\t\t\t\t\t+ \",\" + bookMap.get(current).get(i).getId());\n\t\t\t\t\tpw.write(\"\\n\");\n\t\t\t\t}\n\t\t\t}\t\n\t\t\tpw.close();\n\t\t\tSystem.out.println(\"\\tDone!\");\n\t\t}catch(IOException e){\n\t\t\tSystem.out.println(e.toString());\n\t\t}\n\n\t}", "static void createAuthorsFile () throws IOException {\n\t\tBufferedReader dataFile = new BufferedReader(new FileReader(DATAFILE));\n\t\tString inputLine;\n\t\t\n\t\tPrintWriter isbnLabeledDataFile = new PrintWriter(new FileWriter(ISBNLABELLEDDATAFILE));\n\t\t\n\t\tSet<String> books = new HashSet<String>();\n\t\twhile ((inputLine = dataFile.readLine()) != null) {\n\t\t\tif (inputLine.indexOf('\\t') == -1) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tString[] fields = inputLine.split(\"\\t\");\n\t\t\tif (fields.length != 4) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tfinal String bookId = fields[1];\n\t\t\tif (books.contains(bookId)) {\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\tbooks.add(bookId);\n\t\t\t\tString authorString = getAuthorString(bookId);\n\t\t\t\tisbnLabeledDataFile.println(bookId + \"\\t\" + authorString);\n\t\t\t\tout.println(bookId + \"\\t\" + authorString);\n\t\t\t}\n\t\t}\n\t\tdataFile.close();\n\t\tisbnLabeledDataFile.close();\n\t}", "public void saveBook() throws FileNotFoundException {\n\t\tString formated;\n\n\t\tFile saveFile = new File(FILEPATH); \n\t\tPrintWriter o = new PrintWriter(saveFile);\n\n\t\tfor (int i = 0; i < bookList.size(); i++) {\n\t\t\tint type = bookType(bookList.get(i).getIsbn());\n\t\t\tswitch (type) {\n\t\t\tcase 0: // ChildernsBook\n\t\t\t\tformated = String.format(\"%s;%s;%d;%d;%s;%s;%c\", bookList.get(i).getIsbn(),\n\t\t\t\t\t\tbookList.get(i).getCallNumber(), bookList.get(i).getAvailable(), bookList.get(i).getTotal(),\n\t\t\t\t\t\tbookList.get(i).getTitle(), ((ChildrensBook) bookList.get(i)).getAuthors(),\n\t\t\t\t\t\t((ChildrensBook) bookList.get(i)).getFormat());\n\t\t\t\tbreak;\n\t\t\tcase 1: // CookBook\n\t\t\t\tformated = String.format(\"%s;%s;%d;%d;%s;%s;%c\", bookList.get(i).getIsbn(),\n\t\t\t\t\t\tbookList.get(i).getCallNumber(), bookList.get(i).getAvailable(), bookList.get(i).getTotal(),\n\t\t\t\t\t\tbookList.get(i).getTitle(), ((CookBook) bookList.get(i)).getPublisher(),\n\t\t\t\t\t\t((CookBook) bookList.get(i)).getDiet());\n\t\t\t\tbreak;\n\t\t\tcase 2: // PaperBack\n\t\t\t\tformated = String.format(\"%s;%s;%s;%s;%s;%s;%s;%s\", bookList.get(i).getIsbn(),\n\t\t\t\t\t\tbookList.get(i).getCallNumber(), bookList.get(i).getAvailable(), bookList.get(i).getTotal(),\n\t\t\t\t\t\tbookList.get(i).getTitle(), ((PaperBack) bookList.get(i)).getAuthors(),\n\t\t\t\t\t\t((PaperBack) bookList.get(i)).getYear(), ((PaperBack) bookList.get(i)).getGenre());\n\t\t\t\tbreak;\n\t\t\tcase 3: // periodic\n\t\t\t\tformated = String.format(\"%s;%s;%s;%s;%s;%s;\", bookList.get(i).getIsbn(),\n\t\t\t\t\t\tbookList.get(i).getCallNumber(), bookList.get(i).getAvailable(), bookList.get(i).getTotal(),\n\t\t\t\t\t\tbookList.get(i).getTitle(), ((Periodic) bookList.get(i)).getFrequency());\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tformated = \"Null\";\n\t\t\t}\n\t\t\to.println(formated);\n\t\t}\n\n\t\to.close();\n\n\t}", "private static void outputBook() {\n\t\toutput(\"\");\r\n\t\tfor (book book : library.outputBook()) { // method name changes BOOKS to outputBook()\r\n\t\t\toutput(book + \"\\n\");\r\n\t\t}\t\t\r\n\t}", "private void librarian()throws IOException\n {\n //File Handling starts here with reading into each of the different files to obtain set of books along with relevant data.\n FileReader fauthor = new FileReader(\"BookAuthorList.txt\"); \n BufferedReader bufferAuthor = new BufferedReader(fauthor);\n\n FileReader fgenre = new FileReader(\"BookGenreList.txt\"); \n BufferedReader bufferGenre = new BufferedReader(fgenre);\n\n FileReader fname = new FileReader(\"BookNameList.txt\"); \n BufferedReader bufferName = new BufferedReader(fname);\n\n FileReader fnumber = new FileReader(\"BookNumberList.txt\"); \n BufferedReader bufferNumber = new BufferedReader(fnumber);\n\n for(int i=0; i<linecount; i++) //instance variable linecount\n {\n book[i] = new Book(\"1000\", \"Book Name\", \"Author of Book\", \"Genre of Book\"); //instantiating array element to avoid NullPointerException\n book[i].code = bufferNumber.readLine();\n book[i].author = bufferAuthor.readLine();\n book[i].genre = bufferGenre.readLine();\n book[i].name = bufferName.readLine();\n }\n /*\n * The following for loop trims each of the lines obtained from the file, to remove spaces and help maintain equal number of characters.\n */\n for(int i=0; i<linecount; i++) //trimming\n {\n book[i].code = book[i].code.trim();\n book[i].author = book[i].author.trim();\n book[i].genre = book[i].genre.trim();\n book[i].name = book[i].name.trim();\n }\n\n for(int i=0; i<linecount; i++) //add set number of lines. this helps in making tabular forms\n {\n /*\n * Utilising concatenation from Library classes here. \n * Function spaces is called.\n */\n book[i].code = book[i].code.concat(Spacebar.spaces(5 - book[i].code.length()));\n book[i].author = book[i].author.concat(Spacebar.spaces(25 - book[i].author.length()));\n book[i].genre = book[i].genre.concat(Spacebar.spaces(15 - book[i].genre.length()));\n book[i].name = book[i].name.concat(Spacebar.spaces(70 - book[i].name.length()));\n }\n }", "void saveBookMark(){\n File dotFile = new File( bmFile);\n FileWriter fw;\n BufferedWriter bw;\n PrintWriter pw;\n String str;\n\n // open dotFile\n try{\n // if there is not dotFile, create new one\n fw = new FileWriter( dotFile );\n bw = new BufferedWriter( fw );\n pw = new PrintWriter( bw );\n //write\n for(int i=0;i<MAX_BOOKMARK;i++){\n str = miBookMark[i].getText();\n pw.println(str);\n }\n pw.close();\n bw.close();\n fw.close();\n }catch(IOException e){\n }\n }", "private void populateBooks() {\n\n PrintWriter out;\n try {\n out = new PrintWriter(\"books.txt\");\n String ISBN, title, publisher, publicationPlace, shelfNum;\n int cost, copyrightYear, subjectCounter = 0, shelfNumCounter = 0, floor = 1, aisle = 1, shelf = 1, isbnCounter = 0;\n\n for (int subject = 0; subject < 6; subject++) {\n for (int book = 0; book < 20; book++) {\n title = BOOKS[randomInt(0, BOOKS.length - 1)];\n copyrightYear = randomInt(1970, 2012);\n shelfNum = \"\";\n shelfNum += Integer.toString(floor);\n shelfNum += Integer.toString(aisle);\n shelfNum += Integer.toString(shelf);\n for (int edition = 1; edition < 4; edition++) {\n publisher = PUBLISHERS[randomInt(0,\n PUBLISHERS.length - 1)];\n publicationPlace = PUBLICATION_PLACES[randomInt(0,\n PUBLICATION_PLACES.length - 1)];\n cost = randomInt(10, 200);\n ISBN = \"\";\n ISBN += Integer.toString(subject) + \"-\";\n ISBN += String.format(\"%03d\", randomInt(0, 999)) + \"-\";\n ISBN += String.format(\"%05d\", isbnCounter++) + \"-\";\n ISBN += edition;\n out.println(\"INSERT INTO `4400`.`Book` (`isbn`, `title`, `cost`, `isReserved`, `edition`, `publisher`, `publicationPlace`, `copyrightYear`, `shelfNumber`, `subjectName`) VALUES \"\n + \"('\"\n + ISBN\n + \"', '\"\n + title\n + \"', '\"\n + cost\n + \"', '0', '\"\n + edition\n + \"', '\"\n + publisher\n + \"', '\"\n + publicationPlace\n + \"', '\"\n + copyrightYear\n + \"', '\"\n + shelfNum\n + \"', '\"\n + SUBJECTS[subject] + \"');\");\n copyrightYear++;\n }\n if (shelfNumCounter++ == 3) {\n shelfNumCounter = 0;\n if (shelf++ == 2) {\n shelf = 1;\n aisle++;\n\n }\n }\n }\n\n if (subjectCounter++ == 1) {\n subjectCounter = 0;\n floor++;\n aisle = 1;\n shelf = 1;\n }\n }\n System.out.println(\"RAN\");\n out.close();\n } catch (final FileNotFoundException e) {\n System.out.println(\"TEST\");\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }", "public void loadBooks() {\n\t\ttry {\n\t\t\tScanner load = new Scanner(new File(FILEPATH));\n\t\t\tSystem.out.println(\"Worked\");\n\n\t\t\twhile (load.hasNext()) {\n\t\t\t\tString[] entry = load.nextLine().split(\";\");\n\n\t\t\t\t// checks the type of book\n\t\t\t\tint type = bookType(entry[0]);\n\n\t\t\t\t// creates the appropriate book\n\t\t\t\tswitch (type) {\n\t\t\t\tcase 0:\n\t\t\t\t\tcreateChildrensBook(entry); // creates a Childrensbook and adds it to the array\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tcreateCookBook(entry);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tcreatePaperbackBook(entry);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tcreatePeriodical(entry);\n\t\t\t\t\tbreak;\n\t\t\t\tcase -1:\n\t\t\t\t\tSystem.out.println(\"No book created\");\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tSystem.out.println(\"Error\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tload.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"Did not read in file properly, restart the program, and check filepath of books.txt.\");\n\t\t}\n\t}", "public void loadBooks(){\n\t\tSystem.out.println(\"\\n\\tLoading books from CSV file\");\n\t\ttry{\n\t\t\tint iD=0, x;\n\t\t\tString current = null;\n\t\t\tRandom r = new Random();\n\t\t\tBufferedReader br = new BufferedReader(new FileReader(\"../bin/books.csv\"));\n\t\t\twhile((current = br.readLine()) != null){\n\t\t\t\tString[] data = current.split(\",\");\n\t\t\t\tx = r.nextInt(6) + 15;\n\t\t\t\tfor(int i =0;i<x;i++){\n\t\t\t\t\tBook b= new Book(Integer.toHexString(iD), data[0], data[1], data[2], data[3]);\n\t\t\t\t\tif(bookMap.containsKey(data[0]) != true){\n\t\t\t\t\t\tbookMap.put(data[0], new ArrayList<Book>());\n\t\t\t\t\t}\t\n\t\t\t\t\t\t\n\t\t\t\t\tbookMap.get(data[0]).add(b);\n\t\t\t\t\tiD += 1;\n\t\t\t\t}\t\n\t\t\t}\t\t\t\n\t\t\tbr.close();\n\t\t\tSystem.out.println(\"\\tBooks Added!\");\n\t\t}catch(FileNotFoundException e){\n\t\t\tSystem.out.println(\"\\tFile not found\");\n\t\t}catch(IOException e){\n System.out.println(e.toString());\n }\n\t}", "public void writeBuyingHistory(ArrayList<String> boughtBooks)throws IOException\n {\n String toWrite = new String();\n int i =0;\n if(hisMap.get(Customer.getInstance().getUsername())==null)\n {\n hisMap.put(Customer.getInstance().getUsername(),new ArrayList<String>());\n }\n else\n {\n i=0;\n while (i<boughtBooks.size())\n {\n hisMap.get(Customer.getInstance().getUsername()).add(boughtBooks.get(i));\n i++;\n }\n }\n\n\n i=0;\n\n toWrite+=Customer.getInstance().getUsername()+\",\";\n while (i<hisMap.get(Customer.getInstance().getUsername()).size()-boughtBooks.size())\n {\n toWrite+=hisMap.get(Customer.getInstance().getUsername()).get(i)+\"%\";\n i++;\n }\n ;\n i=0;\n while (i<boughtBooks.size())\n {\n toWrite+=boughtBooks.get(i);\n if(i!=boughtBooks.size()-1)\n toWrite+=\"%\";\n i++;\n }\n\n\n\n\n List<String> lines = Files.readAllLines(Paths.get(\"history.txt\"));\n if(specificLine>lines.size()-1)\n {\n lines.add(toWrite);\n }\n else {\n lines.set(specificLine, toWrite);\n }\n /*write part*/\n BufferedWriter bw = null;\n FileWriter fw = null;\n try {\n int j=0;\n String content = \"\";\n while (j<lines.size())\n {\n content+= lines.get(j)+\"\\n\";\n j++;\n }\n\n fw = new FileWriter(\"history.txt\");\n bw = new BufferedWriter(fw);\n bw.write(content);\n\n } catch (IOException e) {\n\n e.printStackTrace();\n\n } finally {\n\n try {\n\n if (bw != null)\n bw.close();\n\n if (fw != null)\n fw.close();\n\n } catch (IOException ex) {\n\n ex.printStackTrace();\n\n }\n\n }\n\n }", "public void initializeBookStore() throws IOException{\r\n //creates new file called \"Book.txt\". \r\n file = new File(\"Book.txt\");\r\n //adds/writes into the file created. \r\n in = new FileWriter(\"Book.txt\", true);\r\n write = new BufferedWriter(in);\r\n \r\n if(file.length() == 0){\r\n write.write(data);\r\n write.newLine();\r\n write.close();\r\n }\r\n }", "private static boolean loadBooks() throws IOException{\n\t\tBufferedReader reader = new BufferedReader(new FileReader(BOOKS_FILE));\n\t\tboolean error_loading = false; //stores whether there was an error loading a book\n\t\t\n\t\tString line = reader.readLine(); //read the properties of a book in the books.txt file\n\t\t/*read books.txt file, set the input for each BookDetails object and add each BookDetails object to the ALL_BOOKS Hashtable*/\n\t\twhile(line != null){\n\t\t\tBookDetails book = new BookDetails();\n\t\t\tString[] details = line.split(\"\\t\"); //the properties of each BookDetails object are separated by tab spaces in the books.txt file\n\t\t\tfor(int i = 0; i < details.length; i ++){\n\t\t\t\tif(!setBookInput(i, details[i], book)){ //checks if there was an error in setting the BookDetails object's properties with the values in the books.txt file\n\t\t\t\t\tSystem.out.println(\"ERROR Loading Books\");\n\t\t\t\t\terror_loading = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(error_loading) //if there was an error loading a book then stop the process of loading books\n\t\t\t\tbreak;\n\t\t\tALL_BOOKS.put(book.getBookId(), book); //add BookDetails object to ALL_BOOKS\n\t\t\taddToPublisherTable(book.getPublisher(), book.getBookTitle()); //add book's title to the ALL_PUBLISHERS Hashtable\n\t\t\taddToGenreTable(book, book.getBookTitle()); //add book's title to the ALL_GENRES ArrayList\n\t\t\taddToAuthorTable(book.getAuthor().toString(), book.getBookTitle()); //add book's title to the ALL_AUTHORS Hashtable\n\t\t\tline = reader.readLine(); \n\t\t}\n\t\treader.close();\n\t\t\n\t\tif(!error_loading){\n\t\t\tSystem.out.println(\"Loading Books - Complete!\");\n\t\t\treturn true;\n\t\t}\n\t\treturn false; //error encountered while loading books\n\t}", "public void Buy (String bookName) throws IOException{ \r\n \r\n //Reads the \"Book.txt\" file. \r\n out = new FileReader(\"Book.txt\");\r\n read = new BufferedReader(out);\r\n \r\n String thisLine;\r\n String data = \"\";\r\n String newLine;\r\n while((thisLine = read.readLine()) != null){\r\n data += thisLine + \"\\r\\n\";\r\n }\r\n read.close();\r\n newLine = data.replaceAll(bookName, \"DELETED\");\r\n in = new FileWriter(\"Book.txt\");\r\n in.write(newLine);\r\n in.close();\r\n }", "private static void writeToStudentsFile() throws IOException{\n\t\tFileWriter fw = new FileWriter(STUDENTS_FILE, false); //overwrites the students.txt file\n\t\tBufferedWriter bw = new BufferedWriter(fw);\n\t\t\n\t\tIterator<StudentDetails> iter = ALL_STUDENTS.listIterator(1); //Get all StudentDetails objects from index 1 of ALL_STUDENTS. This is because the value at index 0 is just a dummy student\n\t\twhile(iter.hasNext()){\n\t\t\tStudentDetails student = iter.next();\n\t\t\tbw.write(student.ParseForTextFile()); //writes the Parsed Form of the StudentDetails object to the students.txt file\n\t\t}\n\t\t\n\t\tbw.close();\n\t}", "private void enterAll() {\n\n String sku = \"Java1001\";\n Book book1 = new Book(\"Head First Java\", \"Kathy Sierra and Bert Bates\", \"Easy to read Java workbook\", 47.50, true);\n bookDB.put(sku, book1);\n\n sku = \"Java1002\";\n Book book2 = new Book(\"Thinking in Java\", \"Bruce Eckel\", \"Details about Java under the hood.\", 20.00, true);\n bookDB.put(sku, book2);\n\n sku = \"Orcl1003\";\n Book book3 = new Book(\"OCP: Oracle Certified Professional Jave SE\", \"Jeanne Boyarsky\", \"Everything you need to know in one place\", 45.00, true);\n bookDB.put(sku, book3);\n\n sku = \"Python1004\";\n Book book4 = new Book(\"Automate the Boring Stuff with Python\", \"Al Sweigart\", \"Fun with Python\", 10.50, true);\n bookDB.put(sku, book4);\n\n sku = \"Zombie1005\";\n Book book5 = new Book(\"The Maker's Guide to the Zombie Apocalypse\", \"Simon Monk\", \"Defend Your Base with Simple Circuits, Arduino and Raspberry Pi\", 16.50, false);\n bookDB.put(sku, book5);\n\n sku = \"Rasp1006\";\n Book book6 = new Book(\"Raspberry Pi Projects for the Evil Genius\", \"Donald Norris\", \"A dozen friendly fun projects for the Raspberry Pi!\", 14.75, true);\n bookDB.put(sku, book6);\n }", "private void writeToDictionary() throws IOException {\n\n File file = new File(filePathDictionaryAuto);\n\n if (file.delete()) {\n file.createNewFile();\n Enumeration e = dictionaryTerms.keys();\n while (e.hasMoreElements()) {\n String word = (String) e.nextElement();\n if (word.length() != 1) {\n writePrintStream(dictionaryTerms.get(word) + \" \" + word, filePathDictionaryAuto);\n }\n }\n } else {\n System.out.println(\"Error in dictionary file\");\n }\n System.out.println(\"Dictionary updated\");\n\n }", "public static Map<Long, Book> readToMap() throws ApplicationException {\r\n ArrayList<String> bookList = readFile();\r\n Map<Long, Book> books = new HashMap<>();\r\n\r\n for (int i = 0; i < bookList.size(); i++) {\r\n String[] rows = bookList.get(i).split(COMMA_DELIMITER, -1);\r\n Book book = readBookString(rows);\r\n books.put(book.getId(), book);\r\n LOG.debug(String.format(\"%s has been added to the Map\", book.getAuthor()));\r\n\r\n }\r\n\r\n return books;\r\n\r\n }", "public static void save(String indexFileName) throws FileNotFoundException, UnsupportedEncodingException{\n\t\tHashMap<String, String> sCurrentHashMap = globalHash.get(indexFileName);\n\t\t\n\t\tPrintWriter writer = new PrintWriter(indexFileName+\".txt\", \"UTF-8\");\n\n\t\tIterator it = sCurrentHashMap.entrySet().iterator();\n\t\twhile(it.hasNext()){\n\t\t\tHashMap.Entry<String, String> entry = (HashMap.Entry<String, String>) it.next();\n\t\t\t//if this term appear more than one doc\n\t\t\tif(entry.getValue().length()>1) {\n\t\t\t\tStringTokenizer stDocID = new StringTokenizer(entry.getValue(),\",\");\n\t\t\t\twriter.println(entry.getKey()+\",\"+stDocID.countTokens()+\":<\"+entry.getValue()+\">\");\n\t\t\t} else{\n\t\t\t\twriter.println(entry.getKey()+\",1:<\"+entry.getValue()+\">\");\n\t\t\t}\n\t\t}\n\t\twriter.close();\n\t}", "private void bookPrinter(String name, String book) throws IOException\n {\n try\n {\n PrintWriter p = new PrintWriter (new BufferedWriter (new FileWriter (\"LibraryCards\\\\\"+name+\".txt\", true)));\n p.println(book.trim());\n p.println(DoDate.display()); //Prints the date to the Library Card\n\n p.close();\n }\n catch (Exception e)\n {\n System.out.println(\"Sorry. There was an error in registering your book.\");\n }\n }", "private ArrayList<Book> readBookCollection() {\n File file = new File(\"books.txt\");\n ArrayList<Book> collection = new ArrayList<Book>();\n try {\n FileReader fileReader = new FileReader(file);\n BufferedReader reader = new BufferedReader(fileReader);\n while (true) {\n String line = reader.readLine();\n if (line == null) break;\n line = line.trim();\n if (line.equals(\"\")) continue; // ignore possible blank lines\n String[] bookInfo = line.split(\" :: \");\n collection.add(new Book(bookInfo[0], bookInfo[1]));\n }\n }\n catch (IOException e) {\n System.out.println(e.getMessage());\n }\n return collection;\n }", "void SaveBook(String fileName)\r\n\t\t{\r\n\t\t\tFile f = new File(fileName);\r\n\t\t\t\r\n\t\t\tFileWriter writer;\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\twriter = new FileWriter(f);\r\n\t\t\t\tfor(int i = 0; i < this.size(); i++)\r\n\t\t\t\t{\r\n\t\t\t\twriter.write(this.get(i).getContactName());\r\n\t\t\t\twriter.write(\",\");\r\n\t\t\t\twriter.write(Integer.toString(this.get(i).getContactNumber()));\r\n\t\t\t\twriter.write(\"\\n\");\r\n\t\t\t\t}\r\n\t\t\t\twriter.flush();\r\n\t\t\t\twriter.close();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}", "public static void main(String arg[]) {\n \tFile wordListFile = new File(\"WordList.txt\");\r\n \tFile definitionsFile = new File (\"DefinitionsAndSentences.txt\"); \t\r\n \tFile outputFile = new File (\"debug.txt\"); \r\n \t\r\n \tInputStream inputStreamOne;\r\n \tInputStreamReader readerOne;\r\n \tBufferedReader binOne;\r\n \t\r\n \tInputStream inputStreamTwo;\r\n \tInputStreamReader readerTwo;\r\n \tBufferedReader binTwo;\r\n \t\r\n \tOutputStream outputStream;\r\n \tOutputStreamWriter writerTwo;\r\n \tBufferedWriter binThree;\r\n \t \t\r\n \t\r\n \t// Lists to store data to write to database\r\n \tArrayList<TermItem>databaseTermList = new ArrayList<TermItem>();\r\n \tArrayList<DefinitionItem>databaseDefinitionList = new ArrayList<DefinitionItem>();\r\n \tArrayList<SentenceItem>databaseSampleSentenceList = new ArrayList<SentenceItem>();\r\n \t\r\n \t// Create instance to use in main()\r\n \tDictionaryParserThree myInstance = new DictionaryParserThree();\r\n \t\r\n \tint totalTermCounter = 1;\r\n \tint totalDefinitionCounter = 1;\r\n\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tmyInstance.createDatabase();\r\n\t\t\t// Open streams for reading data from both files\r\n\t\t\tinputStreamOne = new FileInputStream(wordListFile);\r\n\t \treaderOne= new InputStreamReader(inputStreamOne);\r\n\t \tbinOne= new BufferedReader(readerOne);\r\n\t \t\r\n\t \tinputStreamTwo = new FileInputStream(definitionsFile);\r\n\t \treaderTwo= new InputStreamReader(inputStreamTwo);\r\n\t \tbinTwo= new BufferedReader(readerTwo);\r\n\t \t\r\n\t \toutputStream = new FileOutputStream(outputFile);\r\n\t \twriterTwo= new OutputStreamWriter(outputStream);\r\n\t \tbinThree= new BufferedWriter(writerTwo);\r\n\r\n\t \tString inputLineTwo;\r\n\t \tString termArray[] = new String[NUM_SEARCH_TERMS];\r\n\t \t\r\n\t \t// Populate string array with all definitions.\r\n\t \tfor (int i = 0; (inputLineTwo = binTwo.readLine()) != null; i++) {\r\n\t\t \t termArray[i] = inputLineTwo; \r\n\t \t}\t \t\r\n\t \t\r\n\t \t// Read each line from the input file (contains top gutenberg words to be used)\r\n\t \tString inputLineOne;\r\n\t \tint gutenbergCounter = 0;\r\n\t \twhile ((inputLineOne = binOne.readLine()) != null) {\r\n\t \t\t\r\n\t \t\t\r\n\t \t\t// Each line contains three or four words. Grab each word inside double brackets.\r\n\t\t \tString[] splitString = (inputLineOne.split(\"\\\\[\\\\[\")); \t\t \t\r\n\t \t\tfor (String stringSegment : splitString) {\r\n\t \t\t\t\r\n\t \t\t\tif (stringSegment.matches((\".*\\\\]\\\\].*\")))\r\n\t \t\t\t{\r\n\t \t\t\t\t// Increment counter to track Gutenberg rating (already from lowest to highest)\r\n\t \t\t\t\tgutenbergCounter++;\r\n\t \t \t\t\r\n\t \t\t\t\tboolean isCurrentTermSearchComplete = false;\r\n\t \t\t \tint lowerIndex = 0;\r\n\t \t\t \tint upperIndex = NUM_SEARCH_TERMS - 1;\r\n\t \t\t \t\r\n\t \t\t \tString searchTermOne = stringSegment.substring(0, stringSegment.indexOf(\"]]\"));\r\n\t \t\t \tsearchTermOne = searchTermOne.substring(0, 1).toUpperCase() + searchTermOne.substring(1);\r\n\t \t\t \t\r\n\t \t\t\t\twhile (!isCurrentTermSearchComplete) {\r\n\t \t\t\t\t\t\r\n\t \t\t\t\t\t// Go to halfway point of lowerIndex and upperIndex.\r\n\t \t\t\t\t\tString temp = termArray[(lowerIndex + upperIndex)/2];\r\n\t \t\t\t\t\tString currentTerm = temp.substring(temp.indexOf(\"<h1>\") + 4, temp.indexOf(\"</h1>\"));\r\n\t \t\t\t\t\t\t \t\t\t\t\t\r\n\t \t \t \t\t\t\t\t\r\n\t \t\t\t\t\t// If definition term is lexicographically lower, need to increase lower Index\r\n\t \t\t\t\t\t// and search higher.\r\n\t \t\t\t\t\t// If definition term is lexicographically higher, need decrease upper index\r\n\t \t\t\t\t\t// and search higher.\r\n\t \t\t\t\t\t// If a match is found, need to find first definition, and record each definition\r\n\t \t\t\t\t\t// in case of duplicates.\r\n\t \t\t\t\t\t\r\n\t \t\t\t\t\tif (currentTerm.compareTo(searchTermOne) < 0) {\t \t\t\t\t\t\t\r\n\t \t\t\t\t\t\tlowerIndex = (lowerIndex + upperIndex)/2;\r\n\t \t\t\t\t\t}\r\n\t \t\t\t\t\telse if (currentTerm.compareTo(searchTermOne) > 0) {\r\n\t \t\t\t\t\t\tupperIndex = (lowerIndex + upperIndex)/2; \t\t\t\t\t\t\r\n\t \t\t\t\t\t} \t\t\t\t\t\r\n\t \t\t\t\t\t\r\n\t \t\t\t\t\telse {\t\r\n\t \t\t\t\t\t\t// Backtrack row-by-row until we reach the first term in the set. Once we reach the beginning,\r\n\t \t\t\t\t\t\t// cycle through each match in the set and obtain each definition until we reach the an unmatching term.\r\n\r\n\t \t\t\t\t\t\t//else {\r\n\t \t\t\t\t\t\t\tSystem.out.println(searchTermOne);\r\n\t\t \t\t\t\t\t\tint k = (lowerIndex + upperIndex)/2;\r\n\t\t \t\t\t\t\t\tboolean shouldIterateAgain = true;\r\n\t\t \t\t\t\t\t\twhile (shouldIterateAgain) {\r\n\t\t \t\t\t\t\t\t\t\r\n\t\t \t\t\t\t\t\t\tif (k <= 0 || k >= NUM_SEARCH_TERMS) {\r\n\t\t\t \t\t\t\t\t\t\tshouldIterateAgain = false;\r\n\t\t\t \t\t\t\t\t\t}\r\n\t\t \t\t\t\t\t\t\telse {\r\n\t\t\t\t \t\t\t\t\t\tString current = termArray[k].substring(termArray[k].indexOf(\"<h1>\") + 4, termArray[k].indexOf(\"</h1>\"));\r\n\t\t\t\t \t\t\t\t\t\tString previous = termArray[k - 1].substring(termArray[k - 1].indexOf(\"<h1>\") + 4, termArray[k - 1].indexOf(\"</h1>\"));\r\n\t\t\t\t\t \t\t\t\t\t\r\n\t\t\t\t \t\t\t\t\t\tif (current.compareTo(previous) == 0) {\t\t\t\r\n\t\t\t\t \t\t\t\t\t\t\tk--;\r\n\t\t\t\t \t\t\t\t\t\t}\r\n\t\t\t\t\t \t\t\t\t\telse {\r\n\t\t\t\t\t \t\t\t\t\t\tshouldIterateAgain = false;\r\n\t\t\t\t\t \t\t\t\t\t}\r\n\t\t \t\t\t\t\t\t\t}\r\n\t\t \t\t\t\t\t\t} \r\n\t\t \t\t\t\t\t\tshouldIterateAgain = true;\r\n\t\t \t\t\t\t\t\twhile (shouldIterateAgain) {\r\n\t\t \t\t\t\t\t\t\t\t\t \t\r\n\t\t \t\t\t\t\t\t\t// Used to store data to later pass to DB\r\n\t\t \t\t\t\t\t DictionaryParserThree.TermItem tempTermItem = myInstance.new TermItem();\r\n\r\n\t\t \t\t\t\t\t // Determine unique ID (which will be written to DB later)\r\n\t\t \t\t\t\t\t // Add current term and gutenberg rating.\r\n\t\t \t\t\t\t\t tempTermItem.ID = totalTermCounter;\t\t \t\t\t\t\t \t \t\t\t\t\t \r\n\t\t \t\t\t\t\t \ttempTermItem.theWord = searchTermOne; // same as termArray[k]'s term\r\n\t\t \t\t\t\t\t \r\n\t\t \t\t\t\t\t\t\ttempTermItem.gutenbergRating = gutenbergCounter;\r\n\t\t \t\t\t\t\t\t\tdatabaseTermList.add(tempTermItem);\r\n\t\t \t\t\t\t\t\t\tbinThree.write(\"Term ID \" + tempTermItem.ID + \" \" + tempTermItem.theWord + \" guten rank is \" + tempTermItem.gutenbergRating);\r\n\t\t \t\t\t\t\t\t\tbinThree.newLine();\t\t\t\t\t\t\t\r\n\t\t \t\t\t\t \t\tsplitString = termArray[k].split(\"<def>\");\r\n\t\t \t\t\t\t \t\t\r\n\t\t \t\t\t\t \t\tint m = 0;\r\n\t \t\t\t\t\t \t\tfor (String stringSegment2 : splitString) {\r\n\t \t\t\t\t\t \t\t\tif (stringSegment2.matches(\".*</def>.*\") && m > 0) {\r\n\t \t\t\t\t\t \t\t\t\t\r\n\t \t\t\t\t\t \t\t\t\t// Determine unique ID (which will be written to DB later)\r\n\t \t\t\t\t\t \t\t\t\t// Add definition, as well as term ID it is associated with.\r\n\t \t\t\t\t\t \t\t\t\tDictionaryParserThree.DefinitionItem tempDefinitionItem = myInstance.new DefinitionItem();\r\n\t \t\t\t\t\t \t\t\t\ttempDefinitionItem.ID = totalDefinitionCounter;\r\n\t \t\t\t\t\t \t\t\t\ttempDefinitionItem.theDefinition = stringSegment2.substring(0, stringSegment2.indexOf(\"</def>\"));\r\n\t \t\t\t\t\t\t \t\t\ttempDefinitionItem.termID = totalTermCounter;\r\n\t \t\t\t\t\t\t \t\t\tdatabaseDefinitionList.add(tempDefinitionItem);\r\n\r\n\t \t\t\t\t\t\t \t\t\tint n = 0;\r\n\t \t\t\t\t\t\t \t\t\tString[] splitString2 = (stringSegment2.split(\"<blockquote>\")); \r\n\t \t \t\t\t\t\t \t\tfor (String stringSegment3 : splitString2) {\r\n\t \t \t\t\t\t\t \t\t\tif (stringSegment3.matches(\".*</blockquote>.*\") && n > 0) {\r\n\t \t \t\t\t\t\t \t\t\t\t// Add data which will be added to DB later.\r\n\t \t \t\t\t\t\t \t\t\t\t// Add sample sentence as well as the definition ID it is associated with.\r\n\t \t \t\t\t\t\t \t\t\t\tDictionaryParserThree.SentenceItem tempSentenceItem = myInstance.new SentenceItem();\t\r\n\t \t \t\t\t\t\t \t\t\t\ttempSentenceItem.definitionID = totalDefinitionCounter;\r\n\t \t \t\t\t\t\t \t\t\t\ttempSentenceItem.theSampleSentence = stringSegment3.substring(0, stringSegment3.indexOf(\"</blockquote>\"));\r\n\t \t \t\t\t\t\t \t\t\t\tdatabaseSampleSentenceList.add(tempSentenceItem);\t \t \t\t\t\t\t \t\t\t\t\r\n\t \t \t \t\t\t\t\t \t\t\r\n\t \t \t\t\t\t\t \t\t\t\tbinThree.write(\"Definition is\" + tempDefinitionItem.theDefinition);\r\n\t \t \t\t\t\t\t \t\t\t\tbinThree.newLine();\r\n\t \t \t\t\t\t\t \t\t\t\tbinThree.write(\" and sample sentence is \" + tempSentenceItem.theSampleSentence);\r\n\t \t \t\t \t\t\t\t\t\t\tbinThree.newLine();\t\r\n\t \t \t\t\t\t\t \t\t\t}\r\n\t \t \t\t\t\t\t \t\t\t// Increment counter for split string (for this line's sample sentence)\r\n\t \t \t\t\t\t\t \t\t\tn++;\r\n\t \t \t\t\t\t\t \t\t}\r\n\t \t \t\t\t\t\t \t\ttotalDefinitionCounter++;\r\n\t \t\t\t\t\t \t\t\t}\r\n\t \t\t\t\t\t \t\t\t// Increment counter for split string (for this line's definition)\r\n\t \t\t\t\t \t\t\t\tm++;\r\n\t \t\t\t\t \t\t\t\t\r\n\t \t\t\t\t\t \t\t}\t \t \t\t\t\t\t \t\t\r\n\t \t\t\t\t\t \t\t\t \t\t\t\t\t\t\t\r\n\t\t \t\t\t\t\t\t\ttotalTermCounter++;\r\n\t\t \t\t\t\t\t\t\t\r\n\t\t \t\t\t\t\t\t\t// Compare next definition and see if duplicate exists.\r\n\t\t \t\t\t\t\t\t\t// If so, add to string array.\r\n\t \t\t\t\t\t \t\tif (k < 0 || k >= NUM_SEARCH_TERMS - 1) {\r\n\t\t\t \t\t\t\t\t\t\tshouldIterateAgain = false;\r\n\t\t\t \t\t\t\t\t\t}\r\n\t \t\t\t\t\t \t\telse { \t \t\t\t\t\t \t\t\r\n\t\t\t \t\t\t\t\t\t\tString current = termArray[k].substring(termArray[k].indexOf(\"<h1>\") + 4, termArray[k].indexOf(\"</h1>\"));\r\n\t\t\t\t \t\t\t\t\t\tString next = termArray[k + 1].substring(termArray[k + 1].indexOf(\"<h1>\") + 4, termArray[k + 1].indexOf(\"</h1>\"));\r\n\t\t\t\t\t \t\t\t\t\tif (current.compareTo(next) == 0) {\t\r\n\t\t\t\t \t\t\t\t\t\t\tk++;\r\n\t\t\t\t \t\t\t\t\t\t}\r\n\t\t\t\t \t\t\t\t\t\telse {\r\n\t\t\t\t \t\t\t\t\t\t\tshouldIterateAgain = false;\r\n\t\t\t\t \t\t\t\t\t\t}\r\n\t \t\t\t\t\t \t\t}\r\n\t\t\t \t\t\t\t\t\t//}\t \t\t\t\t\t\t\r\n\t\t \t\t\t\t\t\tisCurrentTermSearchComplete = true;\r\n\t\t \t\t\t\t\t\t\r\n\t \t\t\t\t\t\t}\r\n\t \t\t\t\t\t}\r\n\t \t\t\t\t\t\r\n\t \t\t\t\t\t// If the term does not exist in the database.\r\n\t \t\t\t\t\tif (Math.abs(upperIndex) - Math.abs(lowerIndex) <= 1)\r\n\t \t\t\t\t\t{\r\n \t\t\t\t\t\t\t isCurrentTermSearchComplete = true;\r\n\t \t\t\t\t\t}\r\n\t \t\t\t\t}\r\n\t \t\t\t}\r\n\t \t\t} \t \t\t\r\n\t \t}\r\n\t \t\r\n\t \t \t\r\n\t \tSystem.out.println(\"ended search.\");\t\r\n\t \tmyInstance.writeAllItemsToDatabase(databaseTermList, databaseDefinitionList, databaseSampleSentenceList);\t\r\n\t \tSystem.out.println(\"ended write.\");\r\n\t \t\r\n\t \tbinOne.close();\r\n\t \treaderOne.close();\r\n\t \tinputStreamOne.close();\t \t\r\n\t \t\r\n\t \tbinTwo.close();\r\n\t \treaderTwo.close();\r\n\t \tinputStreamTwo.close();\t \t\r\n\t \t\r\n\t \tbinThree.close(); \r\n\t \twriterTwo.close();\r\n\t \toutputStream.close();\r\n\t \tSystem.exit(0);\r\n\r\n\r\n\t \t\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} \t\r\n }", "public ArrayList load() {\n File savefile = new File(\"bookings.txt\");\r\n try {\r\n if (savefile.createNewFile()) {\r\n System.out.println(\"Save file doesnt exist, creating...\");\r\n\r\n try {\r\n FileWriter writer = new FileWriter(savefile);\r\n\r\n for (int x = 0; x <= 89; x = x + 1) {\r\n String stringbuild = (x + \",false,none\");\r\n writer.write(stringbuild + \"\\n\");\r\n }\r\n writer.flush();\r\n writer.close();\r\n } catch (IOException ex) {\r\n Logger.getLogger(ParseBookings.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n\r\n } else {\r\n System.out.println(\"Save file exists. Will load...\");\r\n }\r\n } catch (IOException ex) {\r\n Logger.getLogger(ParseBookings.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n\r\n System.out.println(\"Loading Started...\");\r\n\r\n ArrayList Seats = new ArrayList();\r\n ArrayList Seats_Bronze = new ArrayList();\r\n ArrayList Seats_Silver = new ArrayList();\r\n ArrayList Seats_Gold = new ArrayList();\r\n\r\n try {\r\n File file = new File(\"bookings.txt\");\r\n FileReader filereader = new FileReader(file);\r\n BufferedReader bufferedreader = new BufferedReader(filereader);\r\n\r\n String buffer;\r\n while ((buffer = bufferedreader.readLine()) != null) {\r\n String[] buffersplit = buffer.split(\",\", -1);\r\n int index = Integer.parseInt(buffersplit[0]);\r\n if (index < 30) {\r\n //System.out.println(\"Bronze @ \"+index);\r\n\r\n Seat_Bronze bseat_ = new Seat_Bronze();\r\n bseat_.setID(index);\r\n bseat_.setBooked(Boolean.parseBoolean(buffersplit[1]), buffersplit[2]);\r\n Seats_Bronze.add(bseat_);\r\n\r\n } else if (59 >= index && index > 29) {\r\n //System.out.println(\"Silver @ \"+index);\r\n\r\n Seat_Silver sseat_ = new Seat_Silver();\r\n sseat_.setID(index);\r\n sseat_.setBooked(Boolean.parseBoolean(buffersplit[1]), buffersplit[2]);\r\n Seats_Silver.add(sseat_);\r\n\r\n } else {\r\n //System.out.println(\"Gold @\"+index);\r\n\r\n Seat_Gold gseat_ = new Seat_Gold();\r\n gseat_.setID(index);\r\n gseat_.setBooked(Boolean.parseBoolean(buffersplit[1]), buffersplit[2]);\r\n Seats_Gold.add(gseat_);\r\n\r\n }\r\n\r\n }\r\n\r\n Seats.add(Seats_Bronze);\r\n Seats.add(Seats_Silver);\r\n Seats.add(Seats_Gold);\r\n System.out.println(\"Loading Complete.\");\r\n System.out.println(\"Loaded B/S/G: \" + Seats_Bronze.size() + \"/\" + Seats_Silver.size() + \"/\" + Seats_Gold.size());\r\n\r\n return Seats;\r\n\r\n } catch (FileNotFoundException ex) {\r\n Logger.getLogger(ParseBookings.class.getName()).log(Level.SEVERE, null, ex);\r\n } catch (IOException ex) {\r\n Logger.getLogger(ParseBookings.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n return null;\r\n }", "public void addMultipleBook() {\n Set set = new TreeSet();\n System.out.println(\" yours choice how many addressbook you want to create it:--\");\n int number = scanner.nextInt();\n\n for (int index = 1; index <= number; index++) {\n System.out.println(\"give name to your dictionary:--\");\n String name = scanner.next();\n set.add(name);\n }\n System.out.println(set);\n }", "public BookList(String filename) throws IOException {\r\n bookList = new ArrayList<Book>();\r\n //use Chapter 5 in the book to create a File object and then a Scanner object with the File object.\r\n //Check if the file exists, if not, post a message to the console output.\r\n //Loop through the lines in the file and use a StringTokenizer (chapter 8) to tokenize the string on the comma.\r\n //Create a Book object with the title and price as parameters and add that Book object to the bookList attribute\r\n //in this class\r\n File file = new File(filename);\r\n if (file.exists()){\r\n Scanner fileScan = new Scanner(file);\r\n while(fileScan.hasNext()){\r\n StringTokenizer strTok = new StringTokenizer(fileScan.nextLine(), \",\");\r\n Book book = new Book(strTok.nextToken().trim(), Double.parseDouble(strTok.nextToken().trim()));\r\n bookList.add(book);\r\n }\r\n }else{\r\n System.out.println(\"File not found: \" + filename);\r\n }\r\n\r\n\r\n }", "public static void writeMultipleBooks(JarOutputStream jarOutputStream, Collection collection, HashMap books) throws IOException\n\t{\n\t\t// Write the number of chapters and verses for each book\n\t\tfor (Enumeration e = collection.books.elements(); e.hasMoreElements(); )\n\t\t{\n\t\t\tBook collectionBook = (Book) e.nextElement();\n\t\t\t\n\t\t\t// Get the book from the XML file\n\t\t\tBook thmlBook = (Book) books.get(collectionBook.name);\n\t\t\t\n\t\t\tSystem.out.print(thmlBook.fileName + \", \");\n\t\t\t\n\t\t\t// Write out the book index\n\t\t\twriteMultipleBookIndex(jarOutputStream, collectionBook, thmlBook);\n\n\t\t\tDataOutputStream dataOutputStream = new DataOutputStream(jarOutputStream);\n\n\t\t\tint fileNumber = 0;\n\n\t\t\tStringBuffer buffer = new StringBuffer();\n\n\t\t\tfor (int chapterNumber = collectionBook.startChapter; chapterNumber <= collectionBook.endChapter; chapterNumber++)\n\t\t\t{\n\t\t\t\tChapter chapter = (Chapter) thmlBook.chapters.elementAt(chapterNumber - thmlBook.startChapter);\n\t\t\t\t\n\t\t\t\t// Write out the chapter\n\t\t\t\t\n\t\t\t\tif (COMBINED_CHAPTERS)\n\t\t\t\t{\n\t\t\t\t\t// If the file number has changed then write out the file\n\t\t\t\t\tif (chapter.fileNumber != fileNumber)\n\t\t\t\t\t{\n\t\t\t\t\t\t//byte[] byteArray = buffer.toString().getBytes(\"UTF-8\");\n\n\t\t\t\t\t\t//System.out.println(\"Writing \" + thmlBook.name + \" \" + fileNumber + \" - \" + byteArray.length + \" bytes\");\n\t\t\t\t\t\t\n\t\t\t\t\t\tjarOutputStream.putNextEntry(new JarEntry(\"Bible Data/\" + thmlBook.fileName + \"/\" + thmlBook.fileName + \" \" + fileNumber));\n\t\t\t\t\t\t//jarOutputStream.write(byteArray, 0, byteArray.length);\n\t\t\t\t\t\t//dataOutputStream.writeUTF(buffer.toString());\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Convert the StringBuffer to bytes\n\t\t\t\t\t\tbyte[] verseBytes = buffer.toString().getBytes(\"UTF-8\");\n\t\t\t\t\t\tdataOutputStream.writeInt(verseBytes.length);\n\t\t\t\t\t\tdataOutputStream.write(verseBytes, 0, verseBytes.length);\n\n\t\t\t\t\t\tfileNumber = chapter.fileNumber;\n\t\t\t\t\t\tbuffer = new StringBuffer();\n\t\t\t\t\t}\n\n\t\t\t\t\tbuffer.append(chapter.allVerses.toString());\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();\n\t\t\t\t\tDataOutputStream output = new DataOutputStream(byteArrayOutputStream);\n\t\t\t\t\t\n\t\t\t\t\tString allVerses = chapter.allVerses.toString();\n\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"Writing \" + thmlBook.name + \" \" + chapterNumber + \" - \" + allVerses.length() + \" bytes\");\n\t\t\t\t\t\n\t\t\t\t\toutput.writeUTF(allVerses);\n\n\t\t\t\t\toutput.close();\n\t\t\t\t\t\n\t\t\t\t\tbyte[] byteArray = byteArrayOutputStream.toByteArray();\n\t\t\t\t\t\n\t\t\t\t\tjarOutputStream.putNextEntry(new JarEntry(\"Bible Data/\" + thmlBook.fileName + \"/\" + thmlBook.fileName + \" \" + chapterNumber));\n\t\t\t\t\tjarOutputStream.write(byteArray, 0, byteArray.length);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (COMBINED_CHAPTERS)\n\t\t\t{\n\t\t\t\t// Write out the final file\n\t\t\t\t//byte[] byteArray = buffer.toString().getBytes(\"UTF-8\");\n\n\t\t\t\t//System.out.println(\"Writing \" + thmlBook.name + \" \" + fileNumber + \" - \" + byteArray.length + \" bytes\");\n\t\t\t\t\n\t\t\t\tjarOutputStream.putNextEntry(new JarEntry(\"Bible Data/\" + thmlBook.fileName + \"/\" + thmlBook.fileName + \" \" + fileNumber));\n\t\t\t\t//jarOutputStream.write(byteArray, 0, byteArray.length);\n\t\t\t\t//dataOutputStream.writeUTF(buffer.toString());\n\n\t\t\t\t// Convert the StringBuffer to bytes\n\t\t\t\tbyte[] verseBytes = buffer.toString().getBytes(\"UTF-8\");\n\t\t\t\tdataOutputStream.writeInt(verseBytes.length);\n\t\t\t\tdataOutputStream.write(verseBytes, 0, verseBytes.length);\n\t\t\t}\n\t\t}\t\n\t}", "public void writeFile() {\n\t\ttry {\n\t\t\tFile dir = Environment.getExternalStorageDirectory();\n\t\t\tFile myFile = new File(dir.toString() + File.separator + FILENAME);\n\t\t\tLog.i(\"MyMovies\", \"SeSus write : \" + myFile.toString());\n\t\t\tmyFile.createNewFile();\n\t\t\tFileOutputStream fOut = new FileOutputStream(myFile);\n\t\t\tOutputStreamWriter myOutWriter = \n\t\t\t\t\tnew OutputStreamWriter(fOut);\n\t\t\tfor (Map.Entry<String, ValueElement> me : hm.entrySet()) {\n\t\t\t\tString refs = (me.getValue().cRefMovies>0? \"MOVIE\" : \"\");\n\t\t\t\trefs += (me.getValue().cRefBooks>0? \"BOOK\" : \"\");\n\t\t\t\tString line = me.getKey() + DELIMITER + me.getValue().zweiteZeile \n\t\t\t\t\t\t //+ DELIMITER\n\t\t\t\t\t\t //+ me.getValue().count\n\t\t\t\t\t \t+ DELIMITER\n\t\t\t\t\t \t+ refs\n\t\t\t\t\t \t + System.getProperty(\"line.separator\");\n\t\t\t\t//Log.i(\"MyMovies\", \"SeSus extracted : \" + line);\n\t\t\t\tmyOutWriter.write(line);\n\t\t\t}\n\t\t\tmyOutWriter.close();\n\t\t\tfOut.close();\n\t\t} catch (IOException e) {\n\t\t\t//\n\t\t\tLog.i(\"MyMovies\", \"SeSus write Exception : \");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static ArrayList readEndnote(String filename){\n \tString ENDOFRECORD=\"__EOREOR__\";\n \tArrayList bibitems = new ArrayList();\n \tFile f = checkAndCreateFile( filename );// will return null if file is not readable\n \tif(f==null) return null;\n \tStringBuffer sb = new StringBuffer();\n \ttry{\n \t BufferedReader in = new BufferedReader(new FileReader( filename));\n \n \t String str;\n \t boolean first = true;\n \t while ((str = in.readLine()) != null) {\n \t\tstr = str.trim();\n \t\t// if(str.equals(\"\")) continue;\n \t\tif(str.indexOf(\"%0\")==0){\n \t\t if (first) {\n \t\t\tfirst = false;\n \t\t }\n \t\t else {\n \t\t\tsb.append(ENDOFRECORD);\n \t\t }\n \t\t sb.append(str);\n \t\t}else\n \t\t sb.append(str);\n \t\tsb.append(\"\\n\");\n \t }\n \t in.close();\n \t}\n \n \tcatch(IOException e){return null;}\n \n \tString [] entries=sb.toString().split(ENDOFRECORD);\n \tHashMap hm=new HashMap();\n \tString Author=\"\",Type=\"\",Editor=\"\";\n \tfor(int i=0; i<entries.length; i++){\n \t hm.clear();\n \t Author=\"\"; Type=\"\";Editor=\"\";\n \t String[] fields = entries[i].substring(1).split(\"\\n%\");\n //String lastPrefix = \"\";\n \t for(int j=0; j <fields.length; j++){\n \t\tif(fields[j].length() < 3)\n \t\t continue;\n \n \t\t/* Details of Refer format for Journal Article and Book:\n \n \t\t Generic Ref Journal Article Book\n \t\t Code\n \t\t Author %A Author Author\n \t\t Year %D Year Year\n \t\t Title %T Title Title\n \t\t Secondary Author %E Series Editor\n \t\t Secondary Title %B Journal Series Title\n \t\t Place Published %C City\n \t\t Publisher %I Publisher\n \t\t Volume %V Volume Volume\n \t\t Number of Volumes %6 Number of Volumes\n \t\t Number %N Issue\n \t\t Pages %P Pages Number of Pages\n \t\t Edition %7 Edition\n \t\t Subsidiary Author %? Translator\n \t\t Alternate Title %J Alternate Journal\n \t\t Label %F Label Label\n \t\t Keywords %K Keywords Keywords\n \t\t Abstract %X Abstract Abstract\n \t\t Notes %O Notes Notes\n \t\t*/\n \n \t\tString prefix=fields[j].substring(0,1);\n \t\tString val = fields[j].substring(2);\n \t\tif( prefix.equals(\"A\")){\n \t\t if( Author.equals(\"\"))\n \t\t\tAuthor=val;\n \t\t else\n \t\t\tAuthor += \" and \" + val;\n \t\t}\n \t\telse if(prefix.equals(\"Y\")){\n \t\t if( Editor.equals(\"\")) Editor=val;\n \t\t else Editor += \" and \" + val;\n \t\t}\n \t\telse if(prefix.equals(\"T\")) hm.put(\"title\", Globals.putBracesAroundCapitals(val));\n \t\telse if(prefix.equals(\"0\")){\n \t\t if(val.indexOf(\"Journal\")==0)\n \t\t\tType=\"article\";\n \t\t else if((val.indexOf(\"Book\")==0)\n \t\t\t || (val.indexOf(\"Edited Book\")==0))\n \t\t\tType=\"book\";\n \t\t else if( val.indexOf(\"Conference\")==0)// Proceedings\n \t\t\tType=\"inproceedings\";\n \t\t else if( val.indexOf(\"Report\")==0) // Techreport\n \t\t\tType=\"techreport\";\n \t\t else\n \t\t\tType = \"misc\"; //\n \t\t}\n \t\telse if(prefix.equals(\"7\")) hm.put(\"edition\",val);\n \t\telse if(prefix.equals(\"C\")) hm.put(\"address\",val);\n \t\telse if(prefix.equals(\"D\")) hm.put(\"year\",val);\n else if(prefix.equals(\"8\")) hm.put(\"date\",val);\n \t\telse if(prefix.equals(\"J\")) {\n \t\t // \"Alternate journal. Let's set it only if no journal\n \t\t // has been set with %B.\n \t\t if (hm.get(\"journal\") == null)\n \t\t\thm.put(\"journal\", val);\n \t\t}\n else if (prefix.equals(\"B\")) {\n \t\t // This prefix stands for \"journal\" in a journal entry, and\n \t\t // \"series\" in a book entry.\n \t\t if (Type.equals(\"article\")) hm.put(\"journal\", val);\n \t\t else if (Type.equals(\"book\") || Type.equals(\"inbook\"))\n \t\t\thm.put(\"series\", val);\n \t\t else /* if (Type.equals(\"inproceedings\"))*/\n \t\t\thm.put(\"booktitle\", val);\n }\n \t\telse if(prefix.equals(\"I\")) hm.put(\"publisher\",val);\n \t\telse if(prefix.equals(\"P\")) hm.put(\"pages\",val);\n \t\telse if(prefix.equals(\"V\")) hm.put(\"volume\",val);\n \t\telse if(prefix.equals(\"N\")) hm.put(\"number\",val);\n \t\telse if(prefix.equals(\"U\")) hm.put(\"url\",val);\n else if(prefix.equals(\"O\")) hm.put(\"note\",val);\n else if(prefix.equals(\"K\")) hm.put(\"keywords\", val);\n \t\telse if(prefix.equals(\"X\")) hm.put(\"abstract\",val);\n \t\telse if(prefix.equals(\"9\")) {\n \t\t //Util.pr(val);\n \t\t if (val.indexOf(\"Ph.D.\")==0)\n \t\t\tType = \"phdthesis\";\n \t\t}\n \t\telse if(prefix.equals(\"F\")) hm.put\n \t\t (Globals.KEY_FIELD,Util.checkLegalKey(val));\n \t }\n \t //fixauthorscomma\n if (!Author.equals(\"\"))\n hm.put(\"author\",fixAuthor_lastnameFirst(Author));\n \t if( !Editor.equals(\"\"))\n \t\thm.put(\"editor\",fixAuthor_lastnameFirst(Editor));\n \t BibtexEntry b=new BibtexEntry(Globals.DEFAULT_BIBTEXENTRY_ID,\n \t\t\t\t\t Globals.getEntryType(Type)); // id assumes an existing database so don't create one here\n \t b.setField( hm);\n //if (hm.isEmpty())\n if (b.getAllFields().length > 0)\n bibitems.add(b);\n \n \t}\n \treturn bibitems;\n }", "public static ArrayList readOvid( String filename){\n \tArrayList bibitems = new ArrayList();\n \tFile f=new File(filename);\n \tint rowNum=0;\n \tif(!f.exists() && !f.canRead() && !f.isFile()){\n \t System.err.println(\"Error: \" + filename + \" is not a valid file and|or is not readable.\");\n \t return null;\n \t}\n \ttry{\n \t BufferedReader in = new BufferedReader(new FileReader(filename));\n \t String line;\n \t StringBuffer sb=new StringBuffer();\n \t while((line=in.readLine()) != null){\n \t\tif(line.length()>0 && line.charAt(0) != ' ') {\n sb.append(\"__NEWFIELD__\");\n }\n \t\tsb.append(line);\n \t }\n \t in.close();\n \t String items[]=sb.toString().split(\"<[0-9]+>\");\n \n \t for(int i =1; i<items.length; i++){\n \t\tHashMap h=new HashMap();\n \t\tString[] fields=items[i].split(\"__NEWFIELD__\");\n \t\tfor(int j=0; j<fields.length; j++){\n \t\t fields[j]=fields[j].trim();\n \t\t if(fields[j].indexOf(\"Author\") == 0 && fields[j].indexOf(\"Author Keywords\") ==-1\n \t\t && fields[j].indexOf(\"Author e-mail\") ==-1){\n \t\t\tString author;\n \t\t\tboolean isComma=false;\n \t\t\tif( fields[j].indexOf(\";\") > 0){ //LN FN; [LN FN;]*\n \t\t\t author = fields[j].substring(7,fields[j].length()).replaceAll(\"[^\\\\.A-Za-z,;\\\\- ]\",\"\").replaceAll(\";\",\" and \");\n \t\t\t}\n \t\t\telse{// LN FN. [LN FN.]*\n \t\t\t isComma=true;\n \t\t\t author = fields[j].substring(7,fields[j].length()).replaceAll(\"\\\\.\",\" and\").replaceAll(\" and$\",\"\");\n \n \t\t\t}\n \t\t\tif(author.split(\" and \").length > 1){ // single author or no \";\"\n h.put(\"author\", fixAuthor_lastnameFirst( author) );\n \t\t\t /* if(isComma==false)\n \n \t\t\t else\n \t\t\t\th.put(\"author\", fixAuthor_nocomma( author) );*/\n \t\t\t}\n \t\t\telse\n \t\t\t h.put(\"author\",author);\n \t\t }\n \t\t else if(fields[j].indexOf(\"Title\") == 0)\n \t\t\th.put(\"title\", fields[j].substring(6,fields[j].length()).replaceAll(\"\\\\[.+\\\\]\",\"\") );\n \t\t else if(fields[j].indexOf(\"Source\") == 0){\n System.out.println(fields[j]);\n \t\t\tString s=fields[j];\n \t\t\tMatcher matcher = ovid_src_pat.matcher(s);\n \t\t\tboolean matchfound = matcher.find();\n \t\t\tif(matchfound){\n \t\t\t h.put(\"journal\", matcher.group(1));\n \t\t\t h.put(\"volume\", matcher.group(2));\n \t\t\t h.put(\"issue\", matcher.group(3));\n \t\t\t h.put(\"pages\", matcher.group(4));\n \t\t\t h.put(\"year\", matcher.group(5));\n \t\t\t}else{// may be missing the issue\n \t\t\t matcher = ovid_src_pat_no_issue.matcher(s);\n \t\t\t matchfound = matcher.find();\n \t\t\t if(matchfound){\n \t\t\t\th.put(\"journal\", matcher.group(1));\n \t\t\t\th.put(\"volume\", matcher.group(2));\n \t\t\t\th.put(\"pages\", matcher.group(3));\n \t\t\t\th.put(\"year\", matcher.group(4));\n \t\t\t }\n \t\t\t}\n \n \t\t }\n \t\t else if(fields[j].indexOf(\"Abstract\")==0)\n \t\t\th.put(\"abstract\",fields[j].substring(9,fields[j].length()));\n \t\t //else if(fields[j].indexOf(\"References\")==0)\n \t\t //\th.put(\"references\", fields[j].substring( 11,fields[j].length()));\n \t\t}\n \t\tBibtexEntry b=new BibtexEntry(Globals.DEFAULT_BIBTEXENTRY_ID,\n \t\t\t\t\t\t\t\t\t Globals.getEntryType(\"article\")); // id assumes an existing database so don't create one here\n \t\tb.setField( h);\n \n \t\tbibitems.add( b );\n \n \t }\n \n \t}\n \tcatch(IOException ex){\n \t return null;\n \n \t}\n \treturn bibitems;\n }", "public static void main(String[] args) {\n\t\tAuthor au1=new Author(\"Ma Ma\",\"ma@gmail.com\",'F');\r\n\t\tAuthor au2=new Author(\"Mg Mg\",\"mg@gmail.com\",'M');\r\n\t\tAuthor au3=new Author(\"Su Su\",\"su@gmail.com\",'F');\r\n\t\tBook b1=new Book(\"Software Engineering\",au1,7000);\r\n\t\tBook b2=new Book(\"Java\",au1,8000,2);\r\n\t\tSystem.out.println(\"BookInfo writing by Ma Ma:\");\r\n\t\tSystem.out.println(\"BookName:\"+b1.name+\"\\nAuthor:\"+au1.name+\"\\nPrice:\"+b1.price);\r\n\t\tSystem.out.println(\"BookName:\"+b2.name+\"\\nAuthor:\"+au1.name+\"\\nPrice:\"+b2.price+\"\\nQty:\"+b2.qty);\r\n\t\tSystem.out.println();\r\n\t\tBook b3=new Book(\"Digital\",au2,4000);\r\n\t\tBook b4=new Book(\"Management\",au2,6000,3);\r\n\t\tSystem.out.println(\"BookInfo writing by Mg Mg:\");\r\n\t\tSystem.out.println(\"BookName:\"+b3.name+\"\\nAuthor:\"+au2.name+\"\\nPrice:\"+b3.price);\r\n\t\tSystem.out.println(\"BookName:\"+b4.name+\"\\nAuthor:\"+au2.name+\"\\nPrice:\"+b4.price+\"\\nQty:\"+b4.qty);\r\n\t\tSystem.out.println();\r\n\t\tBook b5=new Book(\"Accounting\",au3,5000);\r\n\t\tBook b6=new Book(\"Javascript\",au3,9000,4);\r\n\t\tSystem.out.println(\"BookInfo writing by Su Su:\");\r\n\t\tSystem.out.println(\"BookName:\"+b5.name+\"\\nAuthor:\"+au3.name+\"\\nPrice:\"+b5.price);\r\n\t\tSystem.out.println(\"BookName:\"+b6.name+\"\\nAuthor:\"+au3.name+\"\\nPrice:\"+b6.price+\"\\nQty:\"+b6.qty);\r\n\t}", "private static void saveChanges() throws IOException{\n\t\twriteToStudentsFile(); //copy all the StudentDetails objects in ALL_STUDENTS and write them to the students.txt file\n\t\twriteToBooksFile(); //copy all the BookDetails objects in ALL_BOOKS and write them to the books.txt file\n\t\tSystem.out.println(\"All Changes Successfully Saved!\");\n\t\tSystem.out.println(\"Thanks for using the Library Management System\");\n\t}", "public static ArrayList readScifinder( String filename)\n {\n \t\tArrayList bibitems=new ArrayList();\n \t\tFile f = new File(filename);\n \n \t\tif(!f.exists() && !f.canRead() && !f.isFile()){\n \t\t\tSystem.err.println(\"Error \" + filename + \" is not a valid file and|or is not readable.\");\n \t\t\treturn null;\n \t\t}\n \t\tStringBuffer sb=new StringBuffer();\n \t\ttry{\n \t\t\tBufferedReader in = new BufferedReader(new FileReader( filename));\n \n \t\t\tString str;\n \t\t\twhile ((str = in.readLine()) != null) {\n \t\t\t\tsb.append(str);\n \t\t\t}\n \t\t\tin.close();\n \n \t\t}\n \t\tcatch(IOException e){return null;}\n \t\tString [] entries=sb.toString().split(\"START_RECORD\");\n \t\tHashMap hm=new HashMap();\n \t\tfor(int i=1; i<entries.length; i++){\n \t\t\tString[] fields = entries[i].split(\"FIELD \");\n \t\t\tString Type=\"\";\n \t\t\thm.clear(); // reset\n \t\t\tfor(int j=0; j<fields.length; j++) if (fields[j].indexOf(\":\") >= 0) {\n \t\t\t\tString tmp[]= new String[2];\n tmp[0] = fields[j].substring(0, fields[j].indexOf(\":\"));\n tmp[1] = fields[j].substring(fields[j].indexOf(\":\")+1);\n \t\t\t\tif(tmp.length > 1){//==2\n \t\t\t\t\tif(tmp[0].equals(\"Author\"))\n \t\t\t\t\t\thm.put( \"author\", tmp[1].replaceAll(\";\",\" and \") );\n \t\t\t\t\telse if(tmp[0].equals(\"Title\"))\n \t\t\t\t\t\thm.put(\"title\",tmp[1]);\n \n \t\t\t\t\telse if(tmp[0].equals(\"Journal Title\"))\n \t\t\t\t\t\thm.put(\"journal\",tmp[1]);\n \n \t\t\t\t\telse if(tmp[0].equals(\"Volume\"))\n \t\t\t\t\thm.put(\"volume\",tmp[1]);\n \t\t\t\telse if(tmp[0].equals(\"Page\"))\n \t\t\t\t\thm.put(\"pages\",tmp[1]);\n \t\t\t\telse if(tmp[0].equals(\"Publication Year\"))\n \t\t\t\t\thm.put(\"year\",tmp[1]);\n \t\t\t\telse if(tmp[0].equals(\"Abstract\"))\n \t\t\t\t\thm.put(\"abstract\",tmp[1]);\n \t\t\t\telse if(tmp[0].equals(\"Supplementary Terms\"))\n \t\t\t\t\thm.put(\"keywords\",tmp[1]);\n \t\t\t\telse if(tmp[0].equals(\"Document Type\"))\n \t\t\t\t\tType=tmp[1].replaceAll(\"Journal\",\"article\");\n \t\t\t}\n \t }\n \n \t BibtexEntry b=new BibtexEntry(Globals.DEFAULT_BIBTEXENTRY_ID,\n \t\t\t\t\t\t\t\t\t Globals.getEntryType(Type)); // id assumes an existing database so don't create one here\n \t b.setField( hm);\n \t bibitems.add( b );\n \n \t}\n \treturn bibitems;\n }", "public void saveFile() throws FileNotFoundException {\r\n try {\r\n PrintWriter out = new PrintWriter(FILE_NAME);\r\n //This puts back the labels that the loadFile removed\r\n out.println(\"date,cust_email,cust_location,product_id,product_quantity\");\r\n int i = 0;\r\n\r\n while (i < orderInfo.size()) {\r\n String saved = orderInfo.get(i).toString();\r\n out.println(saved);\r\n i++;\r\n }\r\n out.close();\r\n } catch (FileNotFoundException e) {\r\n }\r\n\r\n }", "private static void readBooksInfo() {\n List<eGenre> arrBook = new ArrayList<>();\n\n // 1 //\n arrBook.add(eGenre.FANTASY);\n arrBook.add(eGenre.ADVENTURE);\n book.add(new Book(1200, arrBook, \"Верн Жюль\", \"Таинственный остров\", 1875));\n arrBook.clear();\n // 2 //\n arrBook.add(eGenre.FANTASY);\n arrBook.add(eGenre.MYSTIC);\n book.add(new Book(425, arrBook, \"Григоренко Виталий\", \"Иван-душитель\", 1953));\n arrBook.clear();\n // 3 //\n arrBook.add(eGenre.DETECTIVE);\n arrBook.add(eGenre.MYSTIC);\n book.add(new Book(360, arrBook, \"Сейгер Райли\", \"Последние Девушки\", 1992));\n arrBook.clear();\n // 4 //\n arrBook.add(eGenre.DETECTIVE);\n book.add(new Book(385, arrBook, \"Ольга Володарская\", \"То ли ангел, то ли бес\", 1995));\n arrBook.clear();\n // 5 //\n arrBook.add(eGenre.NOVEL);\n arrBook.add(eGenre.ACTION);\n book.add(new Book(180, arrBook, \"Лихэйн Деннис\", \"Закон ночи\", 1944));\n arrBook.clear();\n // 6 //\n arrBook.add(eGenre.NOVEL);\n book.add(new Book(224, arrBook, \"Мураками Харуки\", \"Страна Чудес без тормозов и Конец Света\", 1985));\n arrBook.clear();\n // 7 //\n arrBook.add(eGenre.STORY);\n book.add(new Book(1200, arrBook, \"Джон Хейвуд\", \"Люди Севера: История викингов, 793–1241\", 2017));\n arrBook.clear();\n // 8 //\n arrBook.add(eGenre.ACTION);\n arrBook.add(eGenre.MYSTIC);\n arrBook.add(eGenre.DETECTIVE);\n book.add(new Book(415, arrBook, \"Линдквист Юн\", \"Впусти меня\", 2017));\n arrBook.clear();\n // 9 //\n arrBook.add(eGenre.ACTION);\n book.add(new Book(202, arrBook, \"Сухов Евгений\", \"Таежная месть\", 2016));\n arrBook.clear();\n // 10 //\n arrBook.add(eGenre.DETECTIVE);\n arrBook.add(eGenre.MYSTIC);\n book.add(new Book(231, arrBook, \"Винд Кристиан\", \"Призраки глубин\", 2019));\n arrBook.clear();\n }", "public Book readBookFile()\n {\n\n String name=\"\";\n String author ;\n ArrayList<String> genre = new ArrayList<String>();\n float price=0;\n String bookId;\n String fields2[];\n String line;\n\n line = bookFile.getNextLine();\n if(line==null)\n {\n return null;\n }\n String fields[] = line.split(\" by \");\n if(fields.length>2)\n {\n int i=0;\n while (i<fields.length-1)\n {\n name+=fields[i];\n if(i<fields.length-2)\n {\n name+= \" by \";\n }\n i++;\n }\n fields2 = fields[fields.length-1].split(\"%\");\n }\n else\n {\n name = fields[0];\n fields2 = fields[1].split(\"%\");\n }\n\n author = fields2[0];\n price=Float.parseFloat(fields2[1]);\n bookId=fields2[2];\n genre.add(fields2[3]);\n genre.add(fields2[4]);\n return new Book(name,genre,author,price,bookId);\n\n\n }", "public static void ExportToFile() throws IOException {\n BufferedWriter writer = new BufferedWriter(new FileWriter(\"Data/dictionary.txt\"));\r\n for (Word word : Dictionary.dictionaryList) {\r\n writer.write(String.format(\"%s\\t%s\\n\", word.getWord(), word.getWordMeaning()));\r\n }\r\n writer.close();\r\n }", "public static void putBook(Book book){\r\n try {\r\n jsonWriter(addObject(objectToArray(fileReader(\"libreria.json\")),book));\r\n } catch (Exception e) {\r\n System.out.println(\"Error, no fue posible sobreescribir el archivo\");\r\n }\r\n }", "public static void writeMultipleIndex(/*File directory,*/ JarOutputStream jarOutputStream, Collection collection, HashMap books) throws IOException\n\t{\n\t\t// Write out the main bible index\n\t\t\n//\t\tDataOutputStream output = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(new File(directory, \"Index\"))));\n\n\t\tByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();\n\t\tDataOutputStream output = new DataOutputStream(byteArrayOutputStream);\n\t\t\n\t\t// Write out the number of books\n\t\toutput.write(collection.books.size());\n\t\t\n\t\t// Write the number of chapters and verses for each book\n\t\tfor (Enumeration e = collection.books.elements(); e.hasMoreElements(); )\n\t\t{\n\t\t\tBook collectionBook = (Book) e.nextElement();\n\t\t\tBook thmlBook = (Book) books.get(collectionBook.name);\n\t\t\t// Write the book name\n\t\t\toutput.writeUTF(thmlBook.name);\n\t\t\t\n\t\t\t// Write the book's file name\n\t\t\toutput.writeUTF(thmlBook.fileName);\n\n\t\t\t// Write the start chapter and number of chapters\n\t\t\toutput.writeShort(collectionBook.startChapter);\n\t\t\toutput.writeShort(collectionBook.endChapter - collectionBook.startChapter + 1);\n\t\t\t\n\t\t\tint fileNumber = 0;\n\t\t\tint fileLength = 0;\n\t\t\t\n\t\t\tfor (int i = collectionBook.startChapter; i <= collectionBook.endChapter; i++ )\n\t\t\t{\n\t\t\t\tChapter chapter = (Chapter) thmlBook.chapters.elementAt(i - thmlBook.startChapter);\n\n\t\t\t\tif (COMBINED_CHAPTERS)\n\t\t\t\t{\n\t\t\t\t\t// If this isn't the first chapter for the file and the length of the\n\t\t\t\t\t// next chapter will be greater than the maximum allowed file length\n\t\t\t\t\t// then put this chapter into the next file\n\t\t\t\t\tif ((fileLength != 0) && ((fileLength + chapter.allVerses.length() - MAX_FILE_SIZE) > (MAX_FILE_SIZE - fileLength)))\n\t\t\t\t\t{\n\t\t\t\t\t\tfileNumber++;\n\t\t\t\t\t\tfileLength = 0;\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tfileLength += chapter.allVerses.length();\n\t\t\t\t\tchapter.fileNumber = fileNumber;\n\n\t\t\t\t\toutput.write(fileNumber);\n\t\t\t\t\toutput.writeInt(chapter.allVerses.length());\n\t\t\t\t}\n\t\t\t\t\n//\t\t\t\tSystem.err.printf(\"chapter %d num verses: %d length %d\\n\", i, chapter.verses.size(), chapter.allVerses.length());\n\t\t\t\toutput.write(chapter.verses.size());\n\t\t\t}\n\t\t}\n\t\t\n\t\toutput.close();\n\t\t\n\t\t// Get the bytes of the index so that they can be written to the JAR file\n\t\tbyte[] byteArray = byteArrayOutputStream.toByteArray();\n\t\t\n\t\tjarOutputStream.putNextEntry(new JarEntry(\"Bible Data/Index\"));\n\t\tjarOutputStream.write(byteArray, 0, byteArray.length);\n\t}", "public void viewLibraryBooks(){\n\t\tIterator booksIterator = bookMap.keySet().iterator();\n\t\tint number, i=1;\n\t\tSystem.out.println(\"\\n\\t\\t===Books in the Library===\\n\");\n\t\twhile(booksIterator.hasNext()){\t\n\t\t\tString current = booksIterator.next().toString();\n\t\t\tnumber = bookMap.get(current).size();\n\t\t\tSystem.out.println(\"\\t\\t[\" + i + \"] \" + \"Title: \" + current);\n\t\t\tSystem.out.println(\"\\t\\t Quantity: \" + number + \"\\n\");\t\t\t\n\t\t\ti += 1; \n\t\t}\n\t}", "public static ArrayList readBiblioscapeTagFile(String filename) {\n ArrayList bibitems = new ArrayList();\n File f = new File(filename);\n if (!f.exists() || !f.canRead() || !f.isFile()) {\n System.err.println(\"Error: \" + filename + \" is not a valid file and|or is not readable.\");\n return null;\n }\n \n try {\n BufferedReader in = new BufferedReader(new FileReader(filename));\n String line;\n HashMap hm = new HashMap();\n HashMap lines = new HashMap();\n StringBuffer previousLine = null;\n while ((line = in.readLine()) != null) {\n // entry delimiter -> item complete\n if (line.equals(\"------\")) {\n String[] type = new String[2];\n String[] pages = new String[2];\n String country = null;\n String address = null;\n Vector comments = new Vector();\n // add item\n Object[] l = lines.entrySet().toArray();\n for (int i = 0; i < l.length; ++i) {\n Map.Entry entry = (Map.Entry)l[i];\n if (entry.getKey().equals(\"AU\")) hm.put(\"author\",entry.getValue().toString());\n else if (entry.getKey().equals(\"TI\")) hm.put(\"title\",entry.getValue().toString());\n else if (entry.getKey().equals(\"ST\")) hm.put(\"booktitle\",entry.getValue().toString());\n else if (entry.getKey().equals(\"YP\")) hm.put(\"year\",entry.getValue().toString());\n else if (entry.getKey().equals(\"VL\")) hm.put(\"volume\",entry.getValue().toString());\n else if (entry.getKey().equals(\"NB\")) hm.put(\"number\",entry.getValue().toString());\n else if (entry.getKey().equals(\"PS\")) pages[0] = entry.getValue().toString();\n else if (entry.getKey().equals(\"PE\")) pages[1] = entry.getValue().toString();\n else if (entry.getKey().equals(\"KW\")) hm.put(\"keywords\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"RM\")) hm.put(\"\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"RU\")) hm.put(\"\",entry.getValue().toString());\n else if (entry.getKey().equals(\"RT\")) type[0] = entry.getValue().toString();\n else if (entry.getKey().equals(\"SB\")) comments.add(\"Subject: \" + entry.getValue().toString());\n else if (entry.getKey().equals(\"SA\")) comments.add(\"Secondary Authors: \" + entry.getValue().toString());\n else if (entry.getKey().equals(\"NT\")) hm.put(\"note\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"PP\")) hm.put(\"\",entry.getValue().toString());\n else if (entry.getKey().equals(\"PB\")) hm.put(\"publisher\",entry.getValue().toString());\n else if (entry.getKey().equals(\"TA\")) comments.add(\"Tertiary Authors: \" + entry.getValue().toString());\n else if (entry.getKey().equals(\"TT\")) comments.add(\"Tertiary Title: \" + entry.getValue().toString());\n else if (entry.getKey().equals(\"ED\")) hm.put(\"edition\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"DP\")) hm.put(\"\",entry.getValue().toString());\n else if (entry.getKey().equals(\"TW\")) type[1] = entry.getValue().toString();\n else if (entry.getKey().equals(\"QA\")) comments.add(\"Quaternary Authors: \" + entry.getValue().toString());\n else if (entry.getKey().equals(\"QT\")) comments.add(\"Quaternary Title: \" + entry.getValue().toString());\n else if (entry.getKey().equals(\"IS\")) hm.put(\"isbn\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"LA\")) hm.put(\"\",entry.getValue().toString());\n else if (entry.getKey().equals(\"AB\")) hm.put(\"abstract\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"DI\")) hm.put(\"\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"DM\")) hm.put(\"\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"AV\")) hm.put(\"\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"PR\")) hm.put(\"\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"LO\")) hm.put(\"\",entry.getValue().toString());\n else if (entry.getKey().equals(\"AD\")) address = entry.getValue().toString();\n else if (entry.getKey().equals(\"LG\")) hm.put(\"language\",entry.getValue().toString());\n else if (entry.getKey().equals(\"CO\")) country = entry.getValue().toString();\n else if (entry.getKey().equals(\"UR\") || entry.getKey().equals(\"AT\")) {\n String s = entry.getValue().toString().trim();\n hm.put(s.startsWith(\"http://\") || s.startsWith(\"ftp://\") ? \"url\" : \"pdf\",\n entry.getValue().toString());\n }\n else if (entry.getKey().equals(\"C1\")) comments.add(\"Custom1: \" + entry.getValue().toString());\n else if (entry.getKey().equals(\"C2\")) comments.add(\"Custom2: \" + entry.getValue().toString());\n else if (entry.getKey().equals(\"C3\")) comments.add(\"Custom3: \" + entry.getValue().toString());\n else if (entry.getKey().equals(\"C4\")) comments.add(\"Custom4: \" + entry.getValue().toString());\n //else if (entry.getKey().equals(\"RD\")) hm.put(\"\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"MB\")) hm.put(\"\",entry.getValue().toString());\n else if (entry.getKey().equals(\"C5\")) comments.add(\"Custom5: \" + entry.getValue().toString());\n else if (entry.getKey().equals(\"C6\")) comments.add(\"Custom6: \" + entry.getValue().toString());\n //else if (entry.getKey().equals(\"FA\")) hm.put(\"\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"CN\")) hm.put(\"\",entry.getValue().toString());\n else if (entry.getKey().equals(\"DE\")) hm.put(\"annote\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"RP\")) hm.put(\"\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"DF\")) hm.put(\"\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"RS\")) hm.put(\"\",entry.getValue().toString());\n else if (entry.getKey().equals(\"CA\")) comments.add(\"Categories: \" + entry.getValue().toString());\n //else if (entry.getKey().equals(\"WP\")) hm.put(\"\",entry.getValue().toString());\n else if (entry.getKey().equals(\"TH\")) comments.add(\"Short Title: \" + entry.getValue().toString());\n //else if (entry.getKey().equals(\"WR\")) hm.put(\"\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"EW\")) hm.put(\"\",entry.getValue().toString());\n else if (entry.getKey().equals(\"SE\")) hm.put(\"chapter\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"AC\")) hm.put(\"\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"LP\")) hm.put(\"\",entry.getValue().toString());\n }\n \n String bibtexType = \"misc\";\n if (type[1] != null) { // first check TW\n type[1] = type[1].toLowerCase();\n if (type[1].indexOf(\"article\") >= 0) bibtexType = \"article\";\n else if (type[1].indexOf(\"book\") >= 0) bibtexType = \"book\";\n else if (type[1].indexOf(\"conference\") >= 0) bibtexType = \"inproceedings\";\n else if (type[1].indexOf(\"proceedings\") >= 0) bibtexType = \"inproceedings\";\n else if (type[1].indexOf(\"report\") >= 0) bibtexType = \"techreport\";\n else if (type[1].indexOf(\"thesis\") >= 0\n && type[1].indexOf(\"master\") >= 0) bibtexType = \"mastersthesis\";\n else if (type[1].indexOf(\"thesis\") >= 0) bibtexType = \"phdthesis\";\n } else if (type[0] != null) { // check RT\n type[0] = type[0].toLowerCase();\n if (type[0].indexOf(\"article\") >= 0) bibtexType = \"article\";\n else if (type[0].indexOf(\"book\") >= 0) bibtexType = \"book\";\n else if (type[0].indexOf(\"conference\") >= 0) bibtexType = \"inproceedings\";\n else if (type[0].indexOf(\"proceedings\") >= 0) bibtexType = \"inproceedings\";\n else if (type[0].indexOf(\"report\") >= 0) bibtexType = \"techreport\";\n else if (type[0].indexOf(\"thesis\") >= 0\n && type[0].indexOf(\"master\") >= 0) bibtexType = \"mastersthesis\";\n else if (type[0].indexOf(\"thesis\") >= 0) bibtexType = \"phdthesis\";\n }\n \n // concatenate pages\n if (pages[0] != null || pages[1] != null)\n hm.put(\"pages\",(pages[0] != null ? pages[0] : \"\")\n + (pages[1] != null ? \"--\" + pages[1] : \"\"));\n \n // concatenate address and country\n if (address != null)\n hm.put(\"address\",address + (country != null ? \", \" + country : \"\"));\n \n if (comments.size() > 0) { // set comment if present\n StringBuffer s = new StringBuffer();\n for (int i = 0; i < comments.size(); ++i)\n s.append((i > 0 ? \"; \" : \"\")+ comments.elementAt(i).toString());\n hm.put(\"comment\",s.toString());\n }\n BibtexEntry b = new BibtexEntry(\n Globals.DEFAULT_BIBTEXENTRY_ID,\n Globals.getEntryType(bibtexType));\n b.setField(hm);\n bibitems.add(b);\n \n hm.clear();\n lines.clear();\n previousLine = null;\n \n continue;\n }\n // new key\n if (line.startsWith(\"--\") && line.length() >= 7 && line.substring(4,7).equals(\"-- \")) {\n lines.put(line.substring(2,4),previousLine = new StringBuffer(line.substring(7)));\n continue;\n }\n // continuation (folding) of previous line\n if (previousLine == null) // sanity check; should never happen\n return null;\n previousLine.append(line.trim());\n }\n } catch (IOException e) {\n return null;\n }\n \n return bibitems;\n }", "public void saveToFile(String path, AddressBook addressBook) {\n try {\n DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();\n DocumentBuilder docBuilder = docFactory.newDocumentBuilder();\n Document doc = docBuilder.newDocument();\n \n Element rootElement = doc.createElement(\"addressBook\");\n doc.appendChild(rootElement);\n \n Attr attr = doc.createAttribute(\"addressBookName\");\n attr.setValue(addressBook.getAddressBookName());\n rootElement.setAttributeNode(attr);\n \n for (AddressEntry entry : entrySet) {\n \n Element addressEntries = doc.createElement(\"addressEntry\");\n rootElement.appendChild(addressEntries);\n \n Element nameElement = doc.createElement(\"name\");\n nameElement.appendChild(doc.createTextNode(entry.getName()));\n addressEntries.appendChild(nameElement);\n \n Element postalAddressElement = doc.createElement(\"postalAddress\");\n postalAddressElement.appendChild(doc.createTextNode(entry.getPostalAddress()));\n addressEntries.appendChild(postalAddressElement);\n \n Element phoneNumberElement = doc.createElement(\"phoneNumber\");\n phoneNumberElement.appendChild(doc.createTextNode(entry.getPhoneNumber()));\n addressEntries.appendChild(phoneNumberElement);\n \n Element emailElement = doc.createElement(\"emailAddress\");\n emailElement.appendChild(doc.createTextNode(entry.getEmailAddress()));\n addressEntries.appendChild(emailElement);\n \n Element noteElement = doc.createElement(\"note\");\n noteElement.appendChild(doc.createTextNode(entry.getNote()));\n addressEntries.appendChild(noteElement);\n \n TransformerFactory transformerFactory = TransformerFactory.newInstance();\n Transformer transformer = transformerFactory.newTransformer();\n DOMSource source = new DOMSource(doc);\n StreamResult result = new StreamResult(new File(path));\n transformer.transform(source, result);\n }\n \n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public static void saveData() throws FileNotFoundException {\t\n\t\t\t\n\tScanner inputStream = new Scanner(new File(\"bookings.dat\"));\n\t\ttry {\n\t\t\t\n\t\t\tBookingList.surName = inputStream.nextLine();\n\t\t\tBookingList.tableNo = inputStream.nextLine();\n\t\t\tBookingList.sittingTime = inputStream.nextLine();\n\t\t\tBookingList.partyOf = inputStream.nextLine();\n\t\t\t\t\n\t\t\tBooking<?> bookingData = new Booking<Object>(null, surName, tableNo, sittingTime, partyOf);\n\t\t\tb1.insert(bookingData);\n\t\t\t\t\n\t\t}finally {\n\t\t\tinputStream.close();\n\t\t}\n\t\t\t\n\t}", "@Override\n\tpublic void readWriteAllBirds() {\n\t\tBirdDataParser bdp= new BirdDataParser();\n\t\tfor (Birds b: Birds.values()) {\n\t\t\ttry {\n\t\t\t\tbdp.readInput(b.getName(),b.getName()+\".txt\");\n\t\t\t\tbdp.generateOutput(b.getName()+\"_out.txt\");\n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.out.println(e.getMessage());\n\t\t\t}\n\t\t}\n\n\t}", "public static void takeBook(Book book){\r\n try {\r\n jsonWriter(removeObject(objectToArray(fileReader(\"libreria.json\")),book));\r\n } catch (Exception e) {\r\n System.out.println(\"Error, no fue posible sobreescribir el archivo\");\r\n }\r\n }", "private void saveInFile() {\n try {\n FileOutputStream fos = openFileOutput(FILENAME,\n Context.MODE_PRIVATE);//goes stream based on filename\n BufferedWriter out = new BufferedWriter(new OutputStreamWriter(fos)); //create buffer writer\n Gson gson = new Gson();\n gson.toJson(countbookList, out);//convert java object to json string & save in output\n out.flush();\n fos.close();\n } catch (FileNotFoundException e) {\n throw new RuntimeException();\n } catch (IOException e) {\n throw new RuntimeException();\n }\n }", "public static void main(String[] args) throws Exception \n\t{\n\t\tList<String> stopWords = new ArrayList<String>();\n\t\tstopWords = stopWordsCreation();\n\n\n\t\t\n\t\tHashMap<Integer, String> hmap = new HashMap<Integer, String>();\t//Used in tittle, all terms are unique, and any dups become \" \"\n\t\n\t\t\n\t\tList<String> uniqueTerms = new ArrayList<String>();\n\t\tList<String> allTerms = new ArrayList<String>();\n\t\t\t\t\n\t\t\n\t\tHashMap<Integer, String> hmap2 = new HashMap<Integer, String>();\n\t\tHashMap<Integer, String> allValues = new HashMap<Integer, String>();\n\t\tHashMap<Integer, Double> docNorms = new HashMap<Integer, Double>();\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tMap<Integer, List<String>> postingsFileListAllWords = new HashMap<>();\t\t\n\t\tMap<Integer, List<String>> postingsFileList = new HashMap<>();\n\t\t\n\t\tMap<Integer, List<StringBuilder>> docAndTitles = new HashMap<>();\n\t\tMap<Integer, List<StringBuilder>> docAndAbstract = new HashMap<>();\n\t\tMap<Integer, List<StringBuilder>> docAndAuthors = new HashMap<>();\n\t\t\n\t\t\n\t\tMap<Integer, List<Double>> termWeights = new HashMap<>();\n\t\t\n\t\tList<Integer> docTermCountList = new ArrayList<Integer>();\n\t\t\n\t\tBufferedReader br = null;\n\t\tFileReader fr = null;\n\t\tString sCurrentLine;\n\n\t\tint documentCount = 0;\n\t\tint documentFound = 0;\n\t\tint articleNew = 0;\n\t\tint docTermCount = 0;\n\t\t\n\t\t\n\t\tboolean abstractReached = false;\n\n\t\ttry {\n\t\t\tfr = new FileReader(FILENAME);\n\t\t\tbr = new BufferedReader(fr);\n\n\t\t\t// Continues to get 1 line from document until it reaches the end of EVERY doc\n\t\t\twhile ((sCurrentLine = br.readLine()) != null) \n\t\t\t{\n\t\t\t\t// sCurrentLine now contains the 1 line from the document\n\n\t\t\t\t// Take line and split each word and place them into array\n\t\t\t\tString[] arr = sCurrentLine.split(\" \");\n\n\n\t\t\t\t//Go through the entire array\n\t\t\t\tfor (String ss : arr) \n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t/*\n\t\t\t\t\t * This section takes the array and checks to see if it has reached a new\n\t\t\t\t\t * document or not. If the current line begins with an .I, then it knows that a\n\t\t\t\t\t * document has just started. If it incounters another .I, then it knows that a\n\t\t\t\t\t * new document has started.\n\t\t\t\t\t */\n\t\t\t\t\t//System.out.println(\"Before anything: \"+sCurrentLine);\n\t\t\t\t\tif (arr[0].equals(\".I\")) \n\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\tif (articleNew == 0) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tarticleNew = 1;\n\t\t\t\t\t\t\tdocumentFound = Integer.parseInt(arr[1]);\n\t\t\t\t\t\t} \n\t\t\t\t\t\telse if (articleNew == 1) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tarticleNew = 0;\n\t\t\t\t\t\t\tdocumentFound = Integer.parseInt(arr[1]);\n\t\t\t\t\t\t}\t\t\t\n\t\t\t\t\t\t//System.out.println(documentFound);\n\t\t\t\t\t\t//count++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t/* This section detects that after a document has entered,\n\t\t\t\t\t * it has to gather all the words contained in the title \n\t\t\t\t\t * section.\n\t\t\t\t\t */\n\t\t\t\t\tif (arr[0].equals(\".T\") ) \n\t\t\t\t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t// Go to line UNDER .T since that is where tittle is located\n\t\t\t\t\t\t//sCurrentLine = br.readLine();\n\t\t\t\t\t\tdocAndTitles.put(documentFound, new ArrayList<StringBuilder>());\n\t\t\t\t\t\t//System.out.println(\"docAndTitles.get(documentCount+1): \" +docAndTitles.get(documentFound));\n\t\t\t\t\t\t//System.out.println(\"Docs and titles: \"+docAndTitles);\n\t\t\t\t\t\tStringBuilder title = new StringBuilder();\n\t\t\t\t\t\t\n\t\t\t\t\t\twhile ( !(sCurrentLine = br.readLine()).matches(\".B|.A|.N|.X|.K|.C\") )\n\t\t\t\t\t\t{\t\t\t\t\n\t\t\t\t\t\t\t/* In this section, there are 2 lists being made. One list\n\t\t\t\t\t\t\t * is for all the unique words in every title in the document (hmap).\n\t\t\t\t\t\t\t * Hmap contains all unique words, and anytime a duplicate word is \n\t\t\t\t\t\t\t * found, it is replaced with an empty space in the map.\n\t\t\t\t\t\t\t * All Values \n\t\t\t\t\t\t\t * \n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//postingsFileList.put(documentFound - 1, new ArrayList<String>());\n\t\t\t\t\t\t\t//postingsFileList.get(documentFound - 1).add(term2);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//System.out.println(\"current line: \"+sCurrentLine);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tString[] tittle = sCurrentLine.split(\" \");\n\t\t\t\t\t\t\tif (tittle[0].equals(\".W\") )\n\t\t\t\t\t\t\t{\t\t\n\t\t\t\t\t\t\t\tabstractReached = true;\n\t\t\t\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\ttitle.append(sCurrentLine);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfor (String tittleWords : tittle)\n\t\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\ttittleWords = tittleWords.toLowerCase();\n\t\t\t\t\t\t\t\ttittleWords = tittleWords.replaceAll(\"[-&^%'{}*|$+\\\\/\\\\?!<>=.,;_:()\\\\[\\\\]\\\"\\\\d]\", \"\");\n\t\t\t\t\t\t\t\ttittleWords = tittleWords.replaceAll(\"[-&^%'*{}|$+\\\\/\\\\?!<>=.,;_:()\\\\[\\\\]\\\"\\\\d]\", \"\");\n\t\t\t\t\t\t\t\ttittleWords = tittleWords.replaceAll(\"[-&^%'{}*|$+\\\\/\\\\?!<>=.,;_:()\\\\[\\\\]\\\"\\\\d]\", \"\");\n\t\t\t\t\t\t\t\t//System.out.println(tittleWords);\n\t\t\t\t\t\t\t\tif (hmap.containsValue(tittleWords)) \n\t\t\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\thmap.put(documentCount, \" \");\n\t\t\t\t\t\t\t\t\tallValues.put(documentCount, tittleWords);\n\t\t\t\t\t\t\t\t\tallTerms.add(tittleWords);\n\t\t\t\t\t\t\t\t\tdocumentCount++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse \n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tallTerms.add(tittleWords);\n\t\t\t\t\t\t\t\t\tallValues.put(documentCount, tittleWords);\n\t\t\t\t\t\t\t\t\thmap.put(documentCount, tittleWords);\n\t\t\t\t\t\t\t\t\tif (!(uniqueTerms.contains(tittleWords)))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif ((stopWordsSetting && !(stopWords.contains(tittleWords))))\n\t\t\t\t\t\t\t\t\t\t\tuniqueTerms.add(tittleWords);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tdocumentCount++;\n\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//docAndTitles.get(documentCount).add(\" \");\n\t\t\t\t\t\t\ttitle.append(\"\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//System.out.println(\"Title: \"+title);\n\t\t\t\t\t\t//System.out.println(\"docAndTitles.get(documentCount+1): \" +docAndTitles.get(documentFound));\n\t\t\t\t\t\tdocAndTitles.get(documentFound).add(title);\n\t\t\t\t\t\t//System.out.println(\"Done!: \"+ docAndTitles);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif (arr[0].equals(\".A\") ) \n\t\t\t\t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t// Go to line UNDER .T since that is where tittle is located\n\t\t\t\t\t\t//sCurrentLine = br.readLine();\n\t\t\t\t\t\tdocAndAuthors.put(documentFound, new ArrayList<StringBuilder>());\n\t\t\t\t\t\t//System.out.println(\"docAndTitles.get(documentCount+1): \" +docAndTitles.get(documentFound));\n\t\t\t\t\t\t//System.out.println(\"Docs and titles: \"+docAndTitles);\n\t\t\t\t\t\tStringBuilder author = new StringBuilder();\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\twhile ( !(sCurrentLine = br.readLine()).matches(\".N|.X|.K|.C\") )\n\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* In this section, there are 2 lists being made. One list\n\t\t\t\t\t\t\t * is for all the unique words in every title in the document (hmap).\n\t\t\t\t\t\t\t * Hmap contains all unique words, and anytime a duplicate word is \n\t\t\t\t\t\t\t * found, it is replaced with an empty space in the map.\n\t\t\t\t\t\t\t * All Values \n\t\t\t\t\t\t\t * \n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//postingsFileList.put(documentFound - 1, new ArrayList<String>());\n\t\t\t\t\t\t\t//postingsFileList.get(documentFound - 1).add(term2);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//System.out.println(\"current line: \"+sCurrentLine);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tString[] tittle = sCurrentLine.split(\" \");\n\t\t\t\t\t\t\tif (tittle[0].equals(\".W\") )\n\t\t\t\t\t\t\t{\t\t\n\t\t\t\t\t\t\t\tabstractReached = true;\n\t\t\t\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tauthor.append(sCurrentLine);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//docAndTitles.get(documentCount).add(\" \");\n\t\t\t\t\t\t\tauthor.append(\"\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//System.out.println(\"Title: \"+title);\n\t\t\t\t\t\t//System.out.println(\"docAndTitles.get(documentCount+1): \" +docAndTitles.get(documentFound));\n\t\t\t\t\t\tdocAndAuthors.get(documentFound).add(author);\n\t\t\t\t\t\t//System.out.println(\"Done!: \"+ docAndTitles);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t/* Since there may or may not be an asbtract after\n\t\t\t\t\t * the title, we need to check what the next section\n\t\t\t\t\t * is. We know that every doc has a publication date,\n\t\t\t\t\t * so it can end there, but if there is no abstract,\n\t\t\t\t\t * then it will keep scanning until it reaches the publication\n\t\t\t\t\t * date. If abstract is empty (in tests), it will also finish instantly\n\t\t\t\t\t * since it's blank and goes straight to .B (the publishing date).\n\t\t\t\t\t * Works EXACTLY like Title \t\t \n\t\t\t\t\t */\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif (abstractReached) \n\t\t\t\t\t{\t\n\t\t\t\t\t\t//System.out.println(\"\\n\");\n\t\t\t\t\t\t//System.out.println(\"REACHED ABSTRACT and current line is: \" +sCurrentLine);\n\t\t\t\t\t\tdocAndAbstract.put(documentFound, new ArrayList<StringBuilder>());\n\t\t\t\t\t\tStringBuilder totalAbstract = new StringBuilder();\n\t\t\t\t\t\t\n\t\t\t\t\t\twhile ( !(sCurrentLine = br.readLine()).matches(\".T|.I|.A|.N|.X|.K|.C\") )\n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\tString[] abstaract = sCurrentLine.split(\" \");\n\t\t\t\t\t\t\tif (abstaract[0].equals(\".B\") )\n\t\t\t\t\t\t\t{\t\t\t\n\t\t\t\t\t\t\t\tabstractReached = false;\n\t\t\t\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttotalAbstract.append(sCurrentLine);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tString[] misc = sCurrentLine.split(\" \");\n\t\t\t\t\t\t\tfor (String miscWords : misc) \n\t\t\t\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tmiscWords = miscWords.toLowerCase(); \n\t\t\t\t\t\t\t\tmiscWords = miscWords.replaceAll(\"[-&^%'*$+|{}?!\\\\/<\\\\>=.,;_:()\\\\[\\\\]\\\"\\\\d]\", \"\");\n\t\t\t\t\t\t\t\tmiscWords = miscWords.replaceAll(\"[-&^%'*$+|?{}!\\\\/<\\\\>=.,;_:()\\\\[\\\\]\\\"\\\\d]\", \"\");\t\t\n\t\t\t\t\t\t\t\tmiscWords = miscWords.replaceAll(\"[-&^%'*$+|{}?!\\\\/<\\\\>=.,;_:()\\\\[\\\\]\\\"\\\\d]\", \"\");\t\t\n\t\t\t\t\t\t\t\t//System.out.println(miscWords);\n\t\t\t\t\t\t\t\tif (hmap.containsValue(miscWords)) \n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\thmap.put(documentCount, \" \");\n\t\t\t\t\t\t\t\t\tallValues.put(documentCount, miscWords);\n\t\t\t\t\t\t\t\t\tallTerms.add(miscWords);\n\t\t\t\t\t\t\t\t\tdocumentCount++;\n\t\n\t\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\t\telse \n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tallTerms.add(miscWords);\n\t\t\t\t\t\t\t\t\thmap.put(documentCount, miscWords);\n\t\t\t\t\t\t\t\t\tallValues.put(documentCount, miscWords);\n\t\t\t\t\t\t\t\t\tif (!(uniqueTerms.contains(miscWords)))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif ((stopWordsSetting && !(stopWords.contains(miscWords))))\n\t\t\t\t\t\t\t\t\t\t\tuniqueTerms.add(miscWords);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tdocumentCount++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\ttotalAbstract.append(\"\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdocAndAbstract.get(documentFound).add(totalAbstract);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\t\n\t\t\t\t\n\t\t\t\t//Once article is found, we enter all of of it's title and abstract terms \n\t\t\t\tif (articleNew == 0) \n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tdocumentFound = documentFound - 1;\n\t\t\t\t\t//System.out.println(\"Words found in Doc: \" + documentFound);\n\t\t\t\t\t//System.out.println(\"Map is\" +allValues);\n\t\t\t\t\tSet set = hmap.entrySet();\n\t\t\t\t\tIterator iterator = set.iterator();\n\n\t\t\t\t\tSet set2 = allValues.entrySet();\n\t\t\t\t\tIterator iterator2 = set2.iterator();\n\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tpostingsFileList.put(documentFound - 1, new ArrayList<String>());\n\t\t\t\t\tpostingsFileListAllWords.put(documentFound - 1, new ArrayList<String>());\n\t\t\t\t\twhile (iterator.hasNext()) {\n\t\t\t\t\t\tMap.Entry mentry = (Map.Entry) iterator.next();\n\t\t\t\t\t\t// (\"key is: \"+ mentry.getKey() + \" & Value is: \" + mentry.getValue());\n\t\t\t\t\t\t// (\"Value is: \" + mentry.getValue());\n\t\t\t\t\t\t// );\n\t\t\t\t\t\tString term = mentry.getValue().toString();\n\t\t\t\t\t\t// //\"This is going to be put in doc3: \"+ (documentFound-1));\n\t\t\t\t\t\tpostingsFileList.get(documentFound - 1).add(term);\n\t\t\t\t\t\t// if ( !((mentry.getValue()).equals(\" \")) )\n\t\t\t\t\t\tdocTermCount++;\n\t\t\t\t\t}\n\t\t\t\t\t// \"BEFORE its put in, this is what it looks like\" + hmap);\n\t\t\t\t\thmap2.putAll(hmap);\n\t\t\t\t\thmap.clear();\n\t\t\t\t\tarticleNew = 1;\n\n\t\t\t\t\tdocTermCountList.add(docTermCount);\n\t\t\t\t\tdocTermCount = 0;\n\n\t\t\t\t\twhile (iterator2.hasNext()) {\n\t\t\t\t\t\tMap.Entry mentry2 = (Map.Entry) iterator2.next();\n\t\t\t\t\t\t// (\"key is: \"+ mentry.getKey() + \" & Value is: \" + mentry.getValue());\n\t\t\t\t\t\t// (\"Value2 is: \" + mentry2.getValue());\n\t\t\t\t\t\t// );\n\t\t\t\t\t\tString term = mentry2.getValue().toString();\n\t\t\t\t\t\t// //\"This is going to be put in doc3: \"+ (documentFound-1));\n\t\t\t\t\t\tpostingsFileListAllWords.get(documentFound - 1).add(term);\n\t\t\t\t\t\t// if ( !((mentry.getValue()).equals(\" \")) )\n\t\t\t\t\t\t// docTermCount++;\n\t\t\t\t\t}\n\n\t\t\t\t\tallValues.clear();\t\t\t\t\t\n\t\t\t\t\tdocumentFound = Integer.parseInt(arr[1]);\n\n\t\t\t\t\t// \"MEANWHILE THESE ARE ALL VALUES\" + postingsFileListAllWords);\n\n\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//System.out.println(\"Looking at final doc!\");\n\t\t\t//Final loop for last sets\n\t\t\tSet set = hmap.entrySet();\n\t\t\tIterator iterator = set.iterator();\n\n\t\t\tSet setA = allValues.entrySet();\n\t\t\tIterator iteratorA = setA.iterator();\n\t\t\tpostingsFileList.put(documentFound - 1, new ArrayList<String>());\n\t\t\tpostingsFileListAllWords.put(documentFound - 1, new ArrayList<String>());\n\t\t\twhile (iterator.hasNext()) {\n\t\t\t\tMap.Entry mentry = (Map.Entry) iterator.next();\n\t\t\t\t// (\"key is: \"+ mentry.getKey() + \" & Value is: \" + mentry.getValue());\n\t\t\t\t// (\"Value is: \" + mentry.getValue());\n\t\t\t\t// //);\n\t\t\t\t// if ( !((mentry.getValue()).equals(\" \")) )\n\t\t\t\tString term2 = mentry.getValue().toString();\n\t\t\t\tpostingsFileList.get(documentFound - 1).add(term2);\n\n\t\t\t\tdocTermCount++;\n\t\t\t}\n\t\t\t//System.out.println(\"Done looking at final doc!\");\n\t\t\t\n\t\t\t\n\t\t\t//System.out.println(\"Sorting time!\");\n\t\t\twhile (iteratorA.hasNext()) {\n\t\t\t\tMap.Entry mentry2 = (Map.Entry) iteratorA.next();\n\t\t\t\t// (\"key is: \"+ mentry.getKey() + \" & Value is: \" + mentry.getValue());\n\t\t\t\t// (\"Value2 is: \" + mentry2.getValue());\n\t\t\t\t// //);\n\t\t\t\tString term = mentry2.getValue().toString();\n\t\t\t\t// //\"This is going to be put in doc3: \"+ (documentFound-1));\n\t\t\t\tpostingsFileListAllWords.get(documentFound - 1).add(term);\n\t\t\t\t// if ( !((mentry.getValue()).equals(\" \")) )\n\t\t\t\t// docTermCount++;\n\t\t\t}\n\n\t\t\thmap2.putAll(hmap);\n\t\t\thmap.clear();\n\t\t\tdocTermCountList.add(docTermCount);\n\t\t\tdocTermCount = 0;\n\n\n\t\t\t\n\t\t\n\t\t\t// END OF LOOKING AT ALL DOCS\n\t\t\t\n\t\t\t//System.out.println(\"Docs and titles: \"+docAndTitles);\n\t\t\t\n\t\t\t//System.out.println(\"All terms\" +allTerms);\n\t\t\tString[] sortedArray = allTerms.toArray(new String[0]);\n\t\t\tString[] sortedArrayUnique = uniqueTerms.toArray(new String[0]);\n\t\t\t//System.out.println(Arrays.toString(sortedArray));\n\t\t\t\n\t\t\tArrays.sort(sortedArray);\n\t\t\tArrays.sort(sortedArrayUnique);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//Sortings \n\t\t\tSet set3 = hmap2.entrySet();\n\t\t\tIterator iterator3 = set3.iterator();\n\n\t\t\t// Sorting the map\n\t\t\t//System.out.println(\"Before sorting \" +hmap2);\t\t\t\n\t\t\tMap<Integer, String> map = sortByValues(hmap2);\n\t\t\t//System.out.println(\"after sorting \" +map);\n\t\t\t// //\"After Sorting:\");\n\t\t\tSet set2 = map.entrySet();\n\t\t\tIterator iterator2 = set2.iterator();\n\t\t\tint docCount = 1;\n\t\t\twhile (iterator2.hasNext()) {\n\t\t\t\tMap.Entry me2 = (Map.Entry) iterator2.next();\n\t\t\t\t// (me2.getKey() + \": \");\n\t\t\t\t// //me2.getValue());\n\t\t\t}\n\t\t\t\n\t\t\t//System.out.println(\"Done sorting!\");\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//System.out.println(\"Posting starts \");\n\t\t\t//\"THIS IS START OF DICTIONARTY\" \n\t\t\tBufferedWriter bw = null;\n\t\t\tFileWriter fw = null;\n\t\t\t\n\t\t\t\n\t\t\t//System.out.println(\"Start making an array thats big as every doc total \");\n\t\t\tfor (int z = 1; z < documentFound+1; z++)\n\t\t\t{\n\t\t\t\ttermWeights.put(z, new ArrayList<Double>());\n\t\t\t}\n\t\t\t//System.out.println(\"Done making that large array Doc \");\n\t\t\t\n\t\t\t//System.out.println(\"Current Weights: \"+termWeights);\n\t\t\t\n\t\t\t//System.out.println(\"All terms\" +allTerms)\n\t\t\t//System.out.println(Arrays.toString(sortedArray));\n\t\t\t//System.out.println(Arrays.toString(sortedArrayUnique));\n\t\t\t//System.out.println(uniqueTerms);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//\tSystem.out.println(\"Posting starts \");\n\t\t\t// \tPOSTING FILE STARTS \n\t\t\ttry {\n\t\t\t\t// Posting File\n\t\t\t\t//System.out.println(\"postingsFileListAllWords: \"+postingsFileListAllWords); //Contains every word including Dups, seperated per doc\n\t\t\t\t//System.out.println(\"postingsFileList: \"+postingsFileList); \t\t //Contains unique words, dups are \" \", seperated per doc\n\t\t\t\t//System.out.println(\"postingsFileListAllWords.size(): \" +postingsFileListAllWords.size()); //Total # of docs \n\t\t\t\t//System.out.println(\"Array size: \"+sortedArrayUnique.length);\n\n\t\t\t\tfw = new FileWriter(POSTING);\n\t\t\t\tbw = new BufferedWriter(fw);\n\t\t\t\tString temp = \" \";\n\t\t\t\tDouble termFreq = 0.0;\n\t\t\t\t// //postingsFileListAllWords);\n\t\t\t\tList<String> finalTermList = new ArrayList<String>();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\t\t// //postingsFileList.get(i).size());\n\t\t\t\t\tfor (int j = 0; j < sortedArrayUnique.length; ++j)\t\t\t\t\t // go thru each word, CURRENT TERM\n\t\t\t\t\t{\n\t\t\t\t\t\t//System.out.println(\"Term is: \" + sortedArrayUnique[j]);\n\t\t\t\t\t\ttemp = sortedArrayUnique[j];\t\t\t\t\t\n\t\t\t\t\t\tif ((stopWordsSetting && stopWords.contains(temp))) \n\t\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (!(finalTermList.contains(temp))) \n\t\t\t\t\t\t{\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//PART TO FIND DOCUMENT FREQ\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tint docCountIDF = 0;\n\t\t\t\t\t\t\t//Start here for dictionary \n\t\t\t\t\t\t\tfor (int totalWords = 0; totalWords < sortedArray.length; totalWords++) \t\t\n\t\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (temp.compareTo(\" \") == 0 || (stopWordsSetting && stopWords.contains(temp))) \n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t//EITHER BLANK OR STOPWORD \n\t\t\t\t\t\t\t\t\t//System.out.println(\"fOUND STOP WORD\");\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tString temp2 = sortedArray[totalWords];\n\t\t\t\t\t\t\t\t\t//System.out.println(\"Compare: \"+temp+ \" with \" +temp2);\n\t\t\t\t\t\t\t\t\tif (temp.compareTo(temp2) == 0) {\n\t\t\t\t\t\t\t\t\t\t// (temp2+\" \");\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tdocCountIDF++;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//System.out.println(\"Total Number: \" +docCountIDF);\n\t\t\t\t\t\t\t//System.out.println(\"documentFound: \" +documentFound);\n\t\t\t\t\t\t\t//System.out.println(\"So its \" + documentFound + \" dividied by \" +docCountIDF);\n\t\t\t\t\t\t\t//docCountIDF = 1;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tdouble idf = (Math.log10(((double)documentFound/(double)docCountIDF)));\n\t\t\t\t\t\t\t//System.out.println(\"Calculated IDF: \"+idf);\n\t\t\t\t\t\t\tif (idf < 0.0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tidf = 0.0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//System.out.println(\"IDF is: \" +idf);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//System.out.println(\"Size of doc words: \" + postingsFileListAllWords.size());\n\t\t\t\t\t\t\tfor (int k = 0; k < postingsFileListAllWords.size(); k++) \t\t//Go thru each doc. Since only looking at 1 term, it does it once per doc\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//System.out.println(\"Current Doc: \" +(k+1));\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\ttermFreq = 1 + (Math.log10(Collections.frequency(postingsFileListAllWords.get(k), temp)));\t\t\t\n\t\t\t\t\t\t\t\t\t//System.out.println(\"Freq is: \" +Collections.frequency(postingsFileListAllWords.get(k), temp));\n\t\t\t\t\t\t\t\t\t//System.out.println(termFreq + \": \" + termFreq.isInfinite());\n\t\t\t\t\t\t\t\t\tif (termFreq.isInfinite() || termFreq <= 0)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\ttermFreq = 0.0;\n\t\t\t\t\t\t\t\t\t}\t\t\t\t\n\t\t\t\t\t\t\t\t\t//System.out.println(\"termFreq :\" +termFreq); \n\t\t\t\t\t\t\t\t\t//System.out.println(\"idf: \" +idf);\n\t\t\t\t\t\t\t\t\ttermWeights.get(k+1).add( (idf*termFreq) );\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//System.out.println(\"\");\n\t\t\t\t\t\t\tfinalTermList.add(temp);\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\t\n\t\t\t\t\t\t//System.out.println(\"Current Weights: \"+termWeights);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//FINALCOUNTER\n\t\t\t\t\t\t//System.out.println(\"Done looking at word: \" +j);\n\t\t\t\t\t\t//System.out.println(\"\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"Current Weights: \"+termWeights);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\twhile (true)\n\t\t\t\t {\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"Enter a query: \");\n\t\t\t\t\t\n\t \tScanner scanner = new Scanner(System.in);\n\t \tString enterQuery = scanner.nextLine();\n\t \t\n\t \t\n\t\t\t\t\tList<Double> queryWeights = new ArrayList<Double>();\n\t\t\t\t\t\n\t\t\t\t\t// Query turn\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tenterQuery = enterQuery.toLowerCase();\t\t\n\t\t\t\t\tenterQuery = enterQuery.replaceAll(\"[-&^%'*$+|{}?!\\\\/<\\\\>=.,;_:()\\\\[\\\\]\\\"]\", \"\");\n\t\t\t\t\t//System.out.println(\"Query is: \" + enterQuery);\n\t\t\t\t\t\n\t\t\t\t\tif (enterQuery.equals(\"exit\"))\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tString[] queryArray = enterQuery.split(\" \");\n\t\t\t\t\tArrays.sort(queryArray);\n\t\t\t\t\t\n\t\t\t\t\t//Find the query weights for each term in vocab\n\t\t\t\t\tfor (int j = 0; j < sortedArrayUnique.length; ++j)\t\t\t\t\t // go thru each word, CURRENT TERM\n\t\t\t\t\t{\n\t\t\t\t\t\t//System.out.println(\"Term is: \" + sortedArrayUnique[j]);\n\t\t\t\t\t\ttemp = sortedArrayUnique[j];\t\t\t\t\t\n\t\t\t\t\t\tif ((stopWordsSetting && stopWords.contains(temp))) \n\t\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\tint docCountDF = 0;\n\t\t\t\t\t\t//Start here for dictionary \n\t\t\t\t\t\tfor (int totalWords = 0; totalWords < queryArray.length; totalWords++) \t\t\n\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (temp.compareTo(\" \") == 0 || (stopWordsSetting && stopWords.contains(temp))) \n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//EITHER BLANK OR STOPWORD\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tString temp2 = queryArray[totalWords];\n\t\t\t\t\t\t\t\t//System.out.println(\"Compare: \"+temp+ \" with \" +temp2);\n\t\t\t\t\t\t\t\tif (temp.compareTo(temp2) == 0) {\n\t\t\t\t\t\t\t\t\t// (temp2+\" \");\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tdocCountDF++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tDouble queryWeight = 1 + (Math.log10(docCountDF));\n\t\t\t\t\t\tif (queryWeight.isInfinite())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tqueryWeight = 0.0;\n\t\t\t\t\t\t}\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tqueryWeights.add(queryWeight);\n\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"Query WEights is: \"+queryWeights);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t// Finding the norms for DOCS\t\t\t\t\t\n\t\t\t\t\tfor (int norms = 1; norms < documentFound+1; norms++)\n\t\t\t\t\t{\n\t\t\t\t\t\tdouble currentTotal = 0.0;\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor (int weightsPerDoc = 0; weightsPerDoc < termWeights.get(norms).size(); weightsPerDoc++)\n\t\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\t\tdouble square = Math.pow(termWeights.get(norms).get(weightsPerDoc), 2);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//System.out.println(\"Current square: \" + termWeights.get(norms).get(weightsPerDoc));\n\t\t\t\t\t\t\tcurrentTotal = currentTotal + square;\n\t\t\t\t\t\t\t//System.out.println(\"Current total: \" + currentTotal);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//System.out.println(\"About to square root this: \" +currentTotal);\n\t\t\t\t\t\tdouble root = Math.sqrt(currentTotal);\n\t\t\t\t\t\tdocNorms.put(norms, root);\n\t\t\t\t\t}\n\t\t\t\t\t//System.out.println(\"All of the docs norms: \"+docNorms);\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//Finding the norm for the query\n\t\t\t\t\tdouble currentTotal = 0.0;\t\t\t\t\t\n\t\t\t\t\tfor (int weightsPerDoc = 0; weightsPerDoc < queryWeights.size(); weightsPerDoc++)\n\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tdouble square = Math.pow(queryWeights.get(weightsPerDoc), 2);\n\t\t\t\t\t\tcurrentTotal = currentTotal + square;\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tdouble root = Math.sqrt(currentTotal);\n\t\t\t\t\tdouble queryNorm = root; \t\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"Query norm \" + queryNorm);\n\t\t\t\t\t\n\t\t\t\t\t//Finding the cosine sim\n\t\t\t\t\t//System.out.println(\"Term Weights \" + termWeights);\n\t\t\t\t\tHashMap<Integer, Double> cosineScore = new HashMap<Integer, Double>();\n\t\t\t\t\tfor (int cosineSim = 1; cosineSim < documentFound+1; cosineSim++)\n\t\t\t\t\t{\n\t\t\t\t\t\tdouble total = 0.0;\n\t\t\t\t\t\tfor (int docTerms = 0; docTerms < termWeights.get(cosineSim).size(); docTerms++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tdouble docTermWeight = termWeights.get(cosineSim).get(docTerms);\n\t\t\t\t\t\t\tdouble queryTermWeight = queryWeights.get(docTerms);\n\t\t\t\t\t\t\t//System.out.println(\"queryTermWeight \" + queryTermWeight);\n\t\t\t\t\t\t\t//System.out.println(\"docTermWeight \" + docTermWeight);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\ttotal = total + (docTermWeight*queryTermWeight);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdouble cosineSimScore = 0.0;\n\t\t\t\t\t\tif (!(total == 0.0 || (docNorms.get(cosineSim) * queryNorm) == 0))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcosineSimScore = total / (docNorms.get(cosineSim) * queryNorm);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcosineSimScore = 0.0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tcosineScore.put(cosineSim, cosineSimScore);\n\t\t\t\t\t}\n\t\t\t\t\tcosineScore = sortByValues2(cosineScore);\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"This is the cosineScores: \" +cosineScore);\n\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"docAndTitles: \"+ docAndTitles);\n\t\t\t\t\tint topK = 0;\n\t\t\t\t\tint noValue = 0;\n\t\t\t\t\tfor (Integer name: cosineScore.keySet())\n\t\t\t\t\t{\n\t\t\t\t\t\tif (topK < 50)\n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t\n\t\t\t\t String key =name.toString();\n\t\t\t\t //String value = cosineScore.get(name).toString(); \n\t\t\t\t if (!(cosineScore.get(name) <= 0))\n\t\t\t\t {\n\t\t\t\t \tSystem.out.println(\"Doc: \"+key);\t\t\t\t \t\t\t\t\t \t\t\t\t\t \t\n\t\t\t\t \t\n\t\t\t\t \tStringBuilder builder = new StringBuilder();\n\t\t\t\t \tfor (StringBuilder value : docAndTitles.get(name)) {\n\t\t\t\t \t builder.append(value);\n\t\t\t\t \t}\n\t\t\t\t \tString text = builder.toString();\t\t\t\t \t\n\t\t\t\t \t//System.out.println(\"Title:\\n\" +docAndTitles.get(name));\n\t\t\t\t \tSystem.out.println(\"Title: \" +text);\n\t\t\t\t \t\n\t\t\t\t \t\n\t\t\t\t \t\n\t\t\t\t \t\n\t\t\t\t \t\n\t\t\t\t \t//System.out.println(\"Authors:\\n\" +docAndAuthors.get(name));\n\t\t\t\t \t\n\t\t\t\t \tif (docAndAuthors.get(name) == null || docAndAuthors.get(name).toString().equals(\"\"))\n\t\t\t\t \t{\n\t\t\t\t \t\tSystem.out.println(\"Authors: N\\\\A\\n\");\n\t\t\t\t \t}\n\t\t\t\t \telse \n\t\t\t\t \t{\t\t\t\t \t\t\t\t\t\t \t\n\t\t\t\t\t \tStringBuilder builder2 = new StringBuilder();\n\t\t\t\t\t \tfor (StringBuilder value : docAndAuthors.get(name)) {\n\t\t\t\t\t \t builder2.append(value);\n\t\t\t\t\t \t}\n\t\t\t\t\t \tString text2 = builder2.toString();\t\t\t\t \t\n\t\t\t\t\t \t\n\t\t\t\t\t \tSystem.out.println(\"Authors found: \" +text2);\n\t\t\t\t \t}\t\n\t\t\t\t \t\n\t\t\t\t \t\n\t\t\t\t \t/* ABSTRACT \n\t\t\t\t \tif (docAndAbstract.get(name) == null)\n\t\t\t\t \t{\n\t\t\t\t \t\tSystem.out.println(\"Abstract: N\\\\A\\n\");\n\t\t\t\t \t}\n\t\t\t\t \telse \n\t\t\t\t \t{\t\t\t\t \t\t\t\t\t\t \t\n\t\t\t\t\t \tStringBuilder builder2 = new StringBuilder();\n\t\t\t\t\t \tfor (StringBuilder value : docAndAbstract.get(name)) {\n\t\t\t\t\t \t builder2.append(value);\n\t\t\t\t\t \t}\n\t\t\t\t\t \tString text2 = builder2.toString();\t\t\t\t \t\n\t\t\t\t\t \t\n\t\t\t\t\t \tSystem.out.println(\"Abstract: \" +text2);\n\t\t\t\t \t}\t\n\t\t\t\t \t*/\n\t\t\t\t \t\n\t\t\t\t \tSystem.out.println(\"\");\n\t\t\t\t }\n\t\t\t\t else {\n\t\t\t\t \tnoValue++;\n\t\t\t\t }\n\t\t\t\t topK++;\n\t\t\t\t \n\t\t\t\t\t\t}\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (noValue == documentFound)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tSystem.out.println(\"No documents contain query!\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} \n\t\t\t\t\ttopK=0;\n\t\t\t\t\tnoValue = 0;\n\t\t\t\t }\n\t\t\t\t\n\t\t\t} finally {\n\t\t\t\ttry {\n\t\t\t\t\tif (bw != null)\n\t\t\t\t\t\tbw.close();\n\n\t\t\t\t\tif (fw != null)\n\t\t\t\t\t\tfw.close();\n\n\t\t\t\t} catch (IOException ex) {\n\n\t\t\t\t\tex.printStackTrace();\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (br != null)\n\t\t\t\t\tbr.close();\n\n\t\t\t\tif (fr != null)\n\t\t\t\t\tfr.close();\n\n\t\t\t} catch (IOException ex) {\n\n\t\t\t\tex.printStackTrace();\n\n\t\t\t}\n\n\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\n\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\tint itemCount = uniqueTerms.size();\n\t\t\t//System.out.println(allValues);\n\t\t\tSystem.out.println(\"Total Terms BEFORE STEMING: \" +itemCount);\n\t\t\tSystem.out.println(\"Total Documents \" + documentFound);\n\t\t\t\t\t\t\n\t\t \n\t\t\t \n\t\t\t \n\t\t\t//END OF MAIN\n\t\t}", "public static HashMap parseUSFM(File collectionsFile, String baseSourceDirectory, String sourceTextPath, String sTitleTag) throws IOException\n\t{\n //iterate through the source file directory and get the filenames present\n //USFM uses a predefined file format of:\n // 01GENxxxx.ptx\n HashMap books = new HashMap();\n if (baseSourceDirectory == null)\n {\n baseSourceDirectory = \"\";\n }\n \n try\n {\n System.out.println(\"Base Dir: \" + baseSourceDirectory);\n System.out.println(\"Source Path: \" + sourceTextPath);\n \n //get the list of files in the directory\n File folder = new File(baseSourceDirectory, sourceTextPath);\n File[] listOfFiles = folder.listFiles();\n\n for (int i = 0; i < listOfFiles.length; i++) \n {\n if (listOfFiles[i].isFile()) \n {\n String sFileName = listOfFiles[i].getName();\n if (sFileName.toLowerCase().endsWith(\".\" + usfmSourceFileExtension))\n {\n System.out.println(\"File \" + listOfFiles[i].getName());\n String sFilename = folder.toString() + File.separator + listOfFiles[i].getName();\n // Add book to the lookup table\n try\n {\n\t\t\t\t// Create a new book\n\t\t\t\tBook book = new Book(collectionsFile, sFilename, STYLE_RED, fileCodepage, useRedLettering, sTitleTag);\n\t\t\t\tbook.fileName = listOfFiles[i].getName();\n\n\t\t\t\tbooks.put(book.name, book);\n\n // the \\id tag syntax:\n // \\id <CODE> (Text text text...)\n // where <CODE> \"is normally the standard 3 letter UBS/SIL scripture book abbreviation.\"\n // we allow books to be identified using the id tag if the first word matches.\n // Hence, we add a special exception here:\n // book is always added twice: once with the code, and once with\n // the full text match.\n \n if (sTitleTag.equals(\"\\\\id\") && book.name.indexOf(' ') > 0 ) {\n String bookKey = book.name;\n String bookCode = bookKey.substring(0, bookKey.indexOf(' '));\n books.put(bookCode, book);\n }\n \n\t\t\t\tbookNames.add(book.name);\n\t }\n catch (Exception e)\n {\n System.out.println(\"Error: \" + e.getMessage());\n e.printStackTrace();\n }\n }\n } \n }\n }\n catch (Exception e)\n {\n System.out.println(\"Error: \" + e.getMessage());\n e.printStackTrace();\n }\n return books;\n\t}", "public void writeToBookingListFile()\r\n {\r\n\ttry(ObjectOutputStream toBookingListFile = \r\n new ObjectOutputStream(new FileOutputStream(\"listfiles/bookinglist.dta\")))\r\n\t{\r\n toBookingListFile.writeObject(bookingList);\r\n bookingList.saveStaticBookingRunNr(toBookingListFile);\r\n\t}\r\n\tcatch(NotSerializableException nse)\r\n\t{\r\n JOptionPane.showMessageDialog(null, \"Booking objektene er ikke \"\r\n + \"serialiserbare.\\nIngen registrering på fil!\"\r\n + nse.getMessage(), \"Feilmelding\", \r\n JOptionPane.ERROR_MESSAGE);\r\n\t}\r\n\tcatch(IOException ioe)\r\n\t{\r\n JOptionPane.showMessageDialog(null, \"Det oppsto en feil ved skriving \"\r\n + \"til fil.\\n\" + ioe.getMessage());\r\n\t}\r\n }", "public void flush(String filename) throws IOException {\n // open the file\n // the false part means that the buffer won't be automatically flushed\n // we flush after every term\n PrintStream out = new PrintStream(new BufferedOutputStream(\n new FileOutputStream(filename)), false);\n\n // STORE THE INDEX\n\n // an iterator over all terms\n Iterator i = index.keySet().iterator();\n\n // temporary variables\n Iterator docs;\n HashMap docList;\n String doc;\n int[] t;\n\n // the first line is the number of terms\n out.println(index.size());\n String word;\n\n // loop through each term\n while (i.hasNext()) {\n word = (String) i.next();\n\n // print the term\n out.println(word);\n\n // get variables to loop through documents containing the term\n docList = (HashMap) index.get(word);\n docs = docList.keySet().iterator();\n\n // loop through documents containing the term\n while (docs.hasNext()) {\n // get the document and frequency\n doc = (String) docs.next();\n t = (int[]) docList.get(doc);\n\n // store the document and frequency\n out.println(doc);\n out.println(t[0]);\n }\n\n // put another newline on there and flush the buffer\n out.println();\n out.flush();\n }\n\n // close the file\n out.close();\n }", "private void upgradeDictionary() throws IOException {\n File fileAnnotation = new File(filePathAnnSource);\n FileReader fr = new FileReader(fileAnnotation);\n BufferedReader br = new BufferedReader(fr);\n String line;\n\n if (fileAnnotation.exists()) {\n while ((line = br.readLine()) != null) {\n String[] annotations = line.split(\"[ \\t]\");\n String word = line.substring(line.lastIndexOf(\"\\t\") + 1);\n\n if (!nonDictionaryTerms.contains(word.toLowerCase())) {\n if (dictionaryTerms.containsKey(word.toLowerCase())) {\n if (!dictionaryTerms.get(word.toLowerCase()).equalsIgnoreCase(annotations[1])) {\n System.out.println(\"Conflict: word:: \" + word + \" Dictionary Tag: \" + dictionaryTerms.get(word.toLowerCase()) + \" New Tag: \" + annotations[1]);\n nonDictionaryTerms.add(word.toLowerCase());\n// removeLineFile(dictionaryTerms.get(word.toLowerCase())+\" \"+word.toLowerCase(),filePathDictionaryAuto);\n dictionaryTerms.remove(word.toLowerCase());\n writePrintStream(word, filePathNonDictionaryAuto);\n }\n } else {\n System.out.println(\"Updating Dictionary:: Word: \" + word + \"\\tTag: \" + annotations[1]);\n dictionaryTerms.put(word.toLowerCase(), annotations[1]);\n writePrintStream(annotations[1] + \" \" + word.toLowerCase(), filePathDictionaryAuto);\n }\n }\n\n// if (dictionaryTerms.containsKey(word.toLowerCase())) {\n// if (!dictionaryTerms.get(word.toLowerCase()).equalsIgnoreCase(annotations[1])) {\n// System.out.println(\"Conflict: word: \" + word + \" Dictionary Tag: \" + dictionaryTerms.get(word.toLowerCase()) + \" New Tag: \" + annotations[1]);\n// nonDictionaryTerms.add(word.toLowerCase());\n//\n// }\n// } else {\n// dictionary.add(word.toLowerCase());\n// dictionaryTerms.put(word.toLowerCase(), annotations[1]);\n// System.out.println(\"Updating Dictionary: Word: \" + word + \"\\tTag: \" + annotations[1]);\n// }\n }\n }\n\n\n br.close();\n fr.close();\n }", "public void dictionaryExportToFile(String path) throws IOException {\n FileWriter fw = new FileWriter(path);\n TreeMap<String, ArrayList<String>> wordList = dictionary.getWordList();\n\n int count = 0;\n\n for (Map.Entry<String, ArrayList<String>> entry : wordList.entrySet()) {\n fw.write(++count + \") \" + entry.getKey() + \"\\n\");\n for (String str : entry.getValue()) {\n fw.write(\" \" + str + \"\\n\");\n }\n }\n\n fw.close();\n }", "public void parseJson() {\n\n try {\n JSONParser parser = new JSONParser();\n jsonReader = new BufferedReader(new InputStreamReader(getClass().getResourceAsStream(\"/resources/bangor-library.json\")));\n JSONObject jsonObj = (JSONObject) parser.parse(jsonReader);\n \n String name = (String) jsonObj.get(\"name\");\n libraryName = name;\n JSONArray extractedBooks = (JSONArray) jsonObj.get(\"books\");\n\n Iterator i = extractedBooks.iterator();\n while (i.hasNext()) {\n rec = new LibraryRecord();\n rec.setLib_name(libraryName);\n JSONObject innerObj = (JSONObject) i.next();\n rec.setBook_name(innerObj.get(\"name\").toString());\n rec.setAuth_name(innerObj.get(\"author\").toString());\n rec.setCat_name(innerObj.get(\"category\").toString());\n\n if (!LibraryAccess.bookShelves.isEmpty()) {\n for (LibraryRecord bookSaved : LibraryAccess.bookShelves) {\n if (this.rec.getHashOfContent() == bookSaved.getHashOfContent()) {\n duplicate = true;\n rec = null;\n }\n }\n if (!duplicate) {\n LibraryAccess.addRecord(rec);\n }\n duplicate = false;\n\n } else {\n System.out.println(\"Library empty : Adding records...\");\n LibraryAccess.addRecord(this.rec);\n }\n }\n\n } catch (FileNotFoundException ex) {\n Logger.getLogger(JsnParser.class.getName()).log(Level.SEVERE, null, ex);\n } catch (IOException ex) {\n Logger.getLogger(JsnParser.class.getName()).log(Level.SEVERE, null, ex);\n } catch (ParseException ex) {\n Logger.getLogger(JsnParser.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tHashMap<String,Book> hM = IOUtils.restoreBooks(\"BooksCollection\");\n\t\tboolean exitLoop = false;\n\t\t\n\t\twhile(!exitLoop) {\n\t\t\ttry {\n\t\t\t\tSystem.out.println(\"-----Books collection menu-----\");\n\t\t\t\tSystem.out.println(\"1. Add new book\\n2. Display books\\n10. Exit program\"\n\t\t\t\t\t\t+ \"\\n\\nEnter your choice\");\n\t\t\t\tint choice = sc.nextInt();\n\t\t\t\t\n\t\t\t\tswitch (choice) {\n\t\t\t\t case 1: \n\t\t\t\t\t//String title, Category cat, double price, String author, LocalDate dt, int quantity\n\t\t\t\t\t System.out.println(\"Enter book information(title,category,price\"\n\t\t\t\t\t \t\t+ \",author,publish date,quantity)\");\n\t\t\t\t\t sc.nextLine();\n\t\t\t\t\t String name = sc.nextLine();\n\t\t\t\t\t Category c = Category.valueOf(sc.nextLine().toUpperCase());\n\t\t\t\t\t double p = sc.nextDouble();\n\t\t\t\t\t sc.nextLine();\n\t\t\t\t\t String a = sc.nextLine();\n\t\t\t\t\t LocalDate d = parse(sc.nextLine());\n\t\t\t\t\t int q = sc.nextInt();\n\t\t\t\t\t \n\t\t\t\t\t Book newBook = new Book(name, c, p, a, d, q);\n\t\t\t\t\t \n\t\t\t\t\t if(hM.containsKey(newBook.getTitle())) {\n\t\t\t\t\t\t throw new InvalidBookException(\"Book already exists\");\n\t\t\t\t\t }\n\t\t\t\t\t \n\t\t\t\t\t hM.put(newBook.getTitle(), newBook);\n\t\t\t\t\t System.out.println(\"Book inserted : \" + newBook);\n\t\t\t\t\t break;\n\t\t\t\t\t\n\t\t\t\t case 2:\n\t\t\t\t \t\tfor(Book b : hM.values()) {\n\t\t\t\t \t\t\tSystem.out.println(b);\n\t\t\t\t \t\t}\n\t\t\t\t \t\tbreak;\n\t\t\t\t case 10:\t\n\t\t\t\t \t\texitLoop = true;\n\t\t\t\t \t\tbreak;\n\t\t\t\t default:\n\t\t\t\t \t\tSystem.out.println(\"Invalid input\");\n\t\t\t\t}\n\t\t\t} catch(Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tsc.nextLine();\n\t\t} \n\t\t\n\t\tIOUtils.storeBooks(hM, \"BooksCollection\");\n\t\tSystem.out.println(\"Book stored\");\n\t\tsc.close();\n\t}", "private void updateFile() {\n\t\tPrintWriter outfile;\n\t\ttry {\n\t\t\toutfile = new PrintWriter(new BufferedWriter(new FileWriter(\"stats.txt\")));\n\t\t\toutfile.println(\"15\"); // this is the number\n\t\t\tfor (Integer i : storeInfo) {\n\t\t\t\toutfile.println(i); // we overwrite the existing files\n\t\t\t}\n\t\t\tfor (String s : charBought) {\n\t\t\t\toutfile.println(s); // overwrite the character\n\t\t\t}\n\t\t\tfor (String s : miscBought) {\n\t\t\t\toutfile.println(s);\n\t\t\t}\n\t\t\toutfile.close();\n\t\t}\n\t\tcatch (IOException ex) {\n\t\t\tSystem.out.println(ex);\n\t\t}\n\t}", "static Vector<BookInfo> dumpBooks (Object lineItems) {\n\t\tVector<BookInfo> books = new Vector<>();\n\t\tfor (Object o : (JSONArray) lineItems) {\n\t\t\tJSONObject jsonLineItem = (JSONObject) o;\n\t\t\tString title = jsonLineItem.getString(\"title\");\n\t\t\tString author = jsonLineItem.getString(\"author\");\n\t\t\tString publisher = jsonLineItem.getString(\"publisher\");\n\t\t\tString isbn = jsonLineItem.getString(\"isbn\");\n\t\t\tString bookID = jsonLineItem.getString(\"bookID\");\n\n\t\t\tBookInfo tmp = new BookInfo(title, author, publisher, isbn, bookID);\n\t\t\ttmp.setValid(true);\n\t\t\tbooks.add(tmp);\n\t\t}\n\t\treturn books;\n\t}", "private static void jsonWriter(JSONObject bookList) throws Exception{\r\n FileWriter file = new FileWriter(\"libreria.json\");\r\n file.write(bookList.toJSONString());\r\n file.flush();\r\n }", "public ArrayList<Book> search(String part){ \n this.searchBooks = new ArrayList<Book>();\n this.numberedListOfSearch = new HashMap<Integer, Book>();\n if (part.length()>=4){\n //Adding all the searching books into an ArrayList<Book>\n //No duplicating for books having the same title\n boolean bookExist = false;\n for (Book book : this.libraryBooks){\n if ((book.getTitle().toLowerCase().contains(part.toLowerCase())) || (book.getAuthor().toLowerCase().contains(part.toLowerCase()))){\n //Check whether any books having the same title in the list\n for (Book bookSearch : this.searchBooks){\n if (bookSearch.getTitle().equals(book.getTitle())){\n bookExist = true;\n break;\n }\n }\n //If none!\n if(!bookExist){\n this.searchBooks.add(book);\n }\n }\n bookExist = false;\n }\n //To put into a numbered list for printing\n //No duplicating for books having the same title\n for (int i =0; i < (this.searchBooks.size());i++){\n // put the book in the HashMap for printing \n this.numberedListOfSearch.put(i+1, this.searchBooks.get(i));\n }\n\n //To print out\n this.println(\"The searching process has finished!\");\n String researchBooks=\"\";\n //check whether the numbered list is empty or not\n if(this.numberedListOfSearch.size() >0){\n researchBooks += \"{\";\n for (int i = 0; i < this.numberedListOfSearch.size();i++){\n researchBooks += (i+1);\n researchBooks += \": \";\n researchBooks += this.numberedListOfSearch.get(i+1).toString();\n researchBooks += \"; \";\n }\n researchBooks = researchBooks.substring(0, researchBooks.length()-2);\n researchBooks += \"}\"; \n }\n //if the numbered list is empty\n else if ( this.numberedListOfSearch.size() == 0){\n researchBooks += \"Nothing found!\";\n }\n this.println(researchBooks);\n }\n\n //If not enough input key words!\n else{\n this.println(\"Please enter more key words! At least four!!\");\n }\n return this.searchBooks;\n }", "public void open(String fileName){\r\n \tString inStr = \"\";\r\n \tString[] parts;\r\n \tString title = \"\";\r\n \tString author = \"\";\r\n \tString year = \"\";\r\n \tString availability = \"\";\r\n \tString type = \"\";\r\n \tString temp = \"\";\r\n \t\r\n \titems.clear();\r\n \t\r\n \ttry{\r\n \t BufferedReader ir = new BufferedReader(new FileReader(fileName + \".txt\"));\r\n \t while((inStr = ir.readLine()) != null){\r\n \t \t\t//First we have to split the string\r\n \t \t\t//at every comma, since the file \r\n \t \t\t//contains a comma seperated list.\r\n\t\tparts = inStr.split(\", \");\r\n\t\tif(parts.length == 1)\r\n\t\t\tcontinue;\r\n\r\n\t\t \r\n\t\tfor(int i = 0; i < parts.length; i++){\r\n\t\t\tString[] pts = parts[i].split(\": \");\r\n\t\t\t\r\n\t\t\t //A switch statement makes it a little\r\n\t\t\t //easier and cleaner when splitting up\r\n\t\t\t //the elements for the second time,\r\n\t\t\t //by the :\r\n\t\t\tswitch(i) {\r\n \t\t\t\tcase 0:\r\n \t\t\t\t\ttitle = pts[1];\r\n\t \t\t\tbreak;\r\n \t\t\t\tcase 1:\r\n \t\t\t\t\ttemp = pts[1];\r\n \t\t\t\tbreak;\r\n\t \t\t\tcase 2:\r\n \t\t\t\t\tavailability = pts[1];\r\n \t\t\t\tbreak;\r\n \t\t\t\tcase 3:\r\n \t\t\t\t\ttype = pts[1];\r\n\t \t\t\tbreak;\r\n \t\t\t}\r\n \t \t}\t\r\n \t \t\r\n \t \t\t//Type and Title are common to all items,\r\n \t \t\t//so we dont have to check the itemType\r\n \t \t\t//before printing this part.\r\n\t\tSystem.out.println(\"Type: \" + type);\t\r\n\t\tSystem.out.println(\"Title: \" + title);\r\n\t\t\r\n\t\t\t//Now we have to check if the type is a book\r\n\t\t\t//or a magazine, since the two will have\r\n\t\t\t//different information attached to them.\r\n \t\tif(type.equalsIgnoreCase(\"BOOK\")) {\r\n\t\t\tSystem.out.println(\"Author: \" + temp);\r\n\t\t\tBook b = new Book(title, temp);\r\n\t\t\tif(availability.equalsIgnoreCase(\"true\"))\r\n\t\t\t\tb.setAvailability(true);\r\n\t\t\telse\r\n\t\t\t\tb.setAvailability(false);\r\n\t\t\titems.add(b);\r\n \t\t} else {\r\n\t\t\tSystem.out.println(\"Year: \" + temp);\r\n\t\t\tMagazine b = new Magazine(title, Integer.parseInt(temp));\r\n\t\t\tSystem.out.println(\"Control: \" + availability);\r\n\t\t\tif(availability.equalsIgnoreCase(\"true\"))\r\n\t\t\t\tb.setAvailability(true);\r\n\t\t\telse\r\n\t\t\t\tb.setAvailability(false);\r\n\t\t\titems.add(b);\r\n \t\t}\r\n \t\t\r\n \t\t\t//Since Availability is also common to all items,\r\n \t\t\t//it can be printed here without testing the\r\n \t\t\t//itemType. \r\n\t\tSystem.out.println(\"Availability: \" + availability);\r\n\t\tSystem.out.println(\"\");\r\n\t }\r\n\r\n ir.close();\t//Close file when done.\r\n \t } catch (FileNotFoundException e) {\r\n System.out.println(\"ERROR: file not found\");\r\n } catch (IOException e) {\r\n System.out.println(\"ERROR: file I/O problem\");\r\n } catch (NullPointerException e){\r\n \tSystem.out.println(\"ERROR: Null Pointer.\");\r\n }\r\n }", "public static void WriteToACsv(AddressbookModel addressbook,String addressbookname){\n final String COMMA_DELIMITER = \",\";\n final String LINE_SEPARATOR = \"\\n\";\n String PATH=\"C:\\\\Users\\\\Srikar\\\\IdeaProjects\\\\Addressbook\\\\src\\\\com\\\\mphasis\\\\data\"+\"\\\\\"+addressbookname;\n final String HEADER = \"Firstname,LastName,Address,City,Pincode,Number\";\n List personList=addressbook.getAddressbook();\n FileWriter fileWriter=null;\n try{\n fileWriter=new FileWriter(PATH);\n fileWriter.append(HEADER);\n fileWriter.append(\"\\n\");\n Iterator it=personList.iterator();\n while (it.hasNext()){\n Person person=(Person) it.next();\n fileWriter.append(person.getFirstname());\n fileWriter.append(COMMA_DELIMITER);\n fileWriter.append(person.getLastname());\n fileWriter.append(COMMA_DELIMITER);\n fileWriter.append(person.getAddress());\n fileWriter.append(COMMA_DELIMITER);\n fileWriter.append(person.getCity());\n fileWriter.append(COMMA_DELIMITER);\n fileWriter.append(person.getZip());\n fileWriter.append(COMMA_DELIMITER);\n fileWriter.append(person.getPhone());\n fileWriter.append(LINE_SEPARATOR);\n }\n }\n catch(Exception ee)\n {\n ee.printStackTrace();\n }\n finally\n {\n try\n {\n fileWriter.close();\n }\n catch(IOException ie)\n {\n System.out.println(\"Error occured while closing the fileWriter\");\n ie.printStackTrace();\n }\n }\n }", "@Override\n public void seedBooks() throws IOException {\n if (this.bookRepository.count() > 0) {\n return;\n }\n\n String[] lines = this.readFileUtil.read(BOOKS_FILE_RELATIVE_PATH);\n for (int i = 0; i < lines.length; i++) {\n /* Get args */\n String[] args = lines[i].split(\"\\\\s+\");\n\n /* Get edition type */\n EditionType editionType = EditionType.values()[Integer.parseInt(args[0])];\n\n /* Get release date */\n LocalDate releaseDate = localDateUtil.parseByPattern(\"d/M/yyyy\", args[1]);\n\n /* Get copies */\n long copies = Long.parseLong(args[2]);\n\n /* Get price */\n BigDecimal price = new BigDecimal(args[3]);\n\n /* Get age restriction */\n AgeRestriction ageRestriction = AgeRestriction.values()[Integer.parseInt(args[4])];\n\n /* Get title */\n String title = Arrays.stream(args).skip(5).collect(Collectors.joining(\" \"));\n\n /* Get author */\n Author randomAuthor = this.randomAuthorUtil.getRandom();\n\n /* Get categories */\n Set<Category> randomCategories = this.randomCategoriesUtil.getRandom();\n\n /* Create book */\n Book book = new Book(ageRestriction, copies, editionType, price, releaseDate, title, randomAuthor);\n book.setCategories(randomCategories);\n\n /* Save the book */\n this.bookRepository.saveAndFlush(book);\n }\n }", "private static void addBook() {\n\t\t\r\n\t\tString author = input(\"Enter author: \"); // varaible change A to author\r\n\t\tString title = input(\"Enter title: \"); // variable changes T to title\r\n\t\tString callNumber = input(\"Enter call number: \"); // variable name change C to callNumber\r\n\t\tbook B = lib.addBook(author, title, callNumber); //variable LIB changes to library,A to author,T to title,C to callNumber , method changes Add_book to addBook()\r\n\t\toutput(\"\\n\" + B + \"\\n\");\r\n\t\t\r\n\t}", "public void populateDictionary() throws IOException {\n\t\tScanner scan = new Scanner(new File(\"dictionary.txt\"));\n\t\twhile(scan.hasNextLine()) {\n\t\t\tString curr = scan.nextLine().toLowerCase();\n\t\t\tthis.dictionary.add(curr);\n\t\t}\n\t}", "public void allartongs() throws IOException{\r\n writefiles data=new writefiles(\"d:\\\\documents\\\\textfiles\\\\AllArtSongs.txt\",true);\r\n Map<String,String> ArrangerNamesLineMap=new HashMap<>();\r\n for(int songid:ArrangerLinesMap.keySet()){\r\n int arrangerid=ArrangerLinesMap.get(songid);\r\n ArrangersMap.get((songid));\r\n ArrangerNamesLineMap.put(test.getsongName(songid), ArrangersMap.get(arrangerid));\r\n }\r\n for(String songname:ArrangerNamesLineMap.keySet()){\r\n System.out.println(\"The artist is:\"+ArrangerNamesLineMap.get(songname)+\" The song is:\"+songname);\r\n data.writeToFile(\"The artist is:\"+ArrangerNamesLineMap.get(songname)+\" The song is:\"+songname);\r\n }\r\n System.out.println(ArrangerNamesLineMap.size());\r\n }", "void saveRecents(){\n File dotFile = new File( rcFile);\n FileWriter fw;\n BufferedWriter bw;\n PrintWriter pw;\n String str;\n\n // open dotFile\n try{\n // if there is not dotFile, create new one\n fw = new FileWriter( dotFile );\n bw = new BufferedWriter( fw );\n pw = new PrintWriter( bw );\n //write\n for(int i=0;i<MAX_RECENT;i++){\n str = miRecent[i].getText();\n pw.println(str);\n }\n pw.close();\n bw.close();\n fw.close();\n }catch(IOException e){\n }\n\n\n }", "public void saveAddressBook(File file) {\r\n try {\r\n FileWriter fw = new FileWriter(file);\r\n PrintWriter pw = new PrintWriter(fw);\r\n // inserts all the contacts with each field on a line by line basis\r\n for (AddressEntry current : contacts) {\r\n pw.println(current.getName());\r\n pw.println(current.getPostalAddress());\r\n pw.println(current.getPhoneNumber());\r\n pw.println(current.getEmail());\r\n pw.println(current.getNote());\r\n }\r\n pw.close();\r\n } catch (IOException e) {\r\n System.out.println(e.getMessage());\r\n }\r\n }", "public static void DocumentFrequencies() throws FileNotFoundException {\n for (Entry<String, List<Integer>> entry : dictionary.entrySet()) {\n List<Integer> termfrequency = new ArrayList<>();\n\n termfrequency = entry.getValue();\t// getting each word's termfrequency list\n int i = 0;\n termfrequency.add(0); \t\t\t//maintaining documentfrequency at the 57th index\n Integer documentFrequency = termfrequency.get(totaldocument+1);\n while(i<56) { //iterate 0 to 55 all speeches term frequency\n if(termfrequency.get(i)>0) {\t\t//increment document frequency of that word if termfrequency is greater than 0.0\n documentFrequency++;\t\t\t//increment document frequency\n }\n i++;\t\t//increment index\n }\n termfrequency.set(57, documentFrequency);\t//re-set the documentfrequency and save the current maintained document frequency from 0 to calculated value\n dictionary.put(entry.getKey(), termfrequency);\t\t// place the incremented final value of that word back to the same list in dictionary hashmap\n }\n //save();\n }", "public static void mainx(String[] args) {\n\t\tPrintWriter outputFile = null;\r\n\t\t\r\nSystem.out.println(\"Test Teacher Dictionary write\");\r\n\t\t\r\n\t\ttry {\r\n\t\t\toutputFile = new PrintWriter(new FileOutputStream(\"teacherdictionary.txt\"));\r\n\t\t}catch (FileNotFoundException e){\r\n\t\t\tSystem.out.println(\"Unable to open file.\");\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\toutputFile.println(\"<ENTRYSTART>\");\r\n\t\toutputFile.println(\"<ID>ZAK_B\");\r\n\t\toutputFile.println(\"<NAME>Zakaria Baani\");\r\n\t\toutputFile.println(\"<EMAIL>zakb@debug.fakecentury.edu\");\r\n\t\toutputFile.println(\"<ENTRYEND>\");\r\n\t\toutputFile.println(\"<ENTRYSTART>\");\r\n\t\toutputFile.println(\"<ID>MAH_E\");\r\n\t\toutputFile.println(\"<NAME>Mahmoud Eid\");\r\n\t\toutputFile.println(\"<EMAIL>mahe@debug.fakecentury.edu\");\r\n\t\toutputFile.println(\"<ENTRYEND>\");\r\n\t\toutputFile.println(\"<ENTRYSTART>\");\r\n\t\toutputFile.println(\"<ID>BRI_J\");\r\n\t\toutputFile.println(\"<NAME>Brian Jenson\");\r\n\t\toutputFile.println(\"<EMAIL>brij@debug.fakecentury.edu\");\r\n\t\toutputFile.println(\"<ENTRYEND>\");\r\n\t\t\r\n\t\toutputFile.close();\r\n\t\t\r\n\t\tTeacherDictionary teachers = new TeacherDictionary();\r\n\t\tSystem.out.println(teachers);\r\n\t\t\r\n\t\r\n\t\ttry {\r\n\t\t\toutputFile = new PrintWriter(new FileOutputStream(\"classdictionary.txt\"));\r\n\t\t}catch (FileNotFoundException e){\r\n\t\t\tSystem.out.println(\"Unable to open file.\");\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\nSystem.out.println(\"Test Room Dictionary write\");\r\n\t\t\r\n\t\ttry {\r\n\t\t\toutputFile = new PrintWriter(new FileOutputStream(\"roomdictionary.txt\"));\r\n\t\t}catch (FileNotFoundException e){\r\n\t\t\tSystem.out.println(\"Unable to open file.\");\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\toutputFile.println(\"<ENTRYSTART>\");\r\n\t\toutputFile.println(\"<ID>W101\");\r\n\t\toutputFile.println(\"<NAME>West 101\");\r\n\t\toutputFile.println(\"<CAPACITY>25\");\r\n\t\toutputFile.println(\"<ENTRYEND>\");\r\n\t\toutputFile.println(\"<ENTRYSTART>\");\r\n\t\toutputFile.println(\"<ID>E2213\");\r\n\t\toutputFile.println(\"<NAME>East 2213\");\r\n\t\toutputFile.println(\"<CAPACITY>45\");\r\n\t\toutputFile.println(\"<ENTRYEND>\");\r\n\t\toutputFile.println(\"<ENTRYSTART>\");\r\n\t\toutputFile.println(\"<ID>E1001\");\r\n\t\toutputFile.println(\"<NAME>East 1001\");\r\n\t\toutputFile.println(\"<CAPACITY>60\");\r\n\t\toutputFile.println(\"<ENTRYEND>\");\r\n\t\t\r\n\t\toutputFile.close();\r\n\t\t\r\n\t\tRoomDictionary rooms = new RoomDictionary();\r\n\t\tSystem.out.println(rooms);\r\n\t\t\r\n\t\t\r\n\t\t/*\r\n\t\t * class\r\n\t\t * \r\n\t\t * <ENTRYSTART>\r\n\t\t * <TITLE>\r\n\t\t * <TEACHER>\r\n\t\t * <STUDENTCOUNT>\r\n\t\t * <STUDENTLIST>\r\n\t\t * <SCHEDULE>\r\n\t\t * <ENTRYEND>\r\n\t\t * \r\n\t\t */\r\n\t\t\r\n\t\tSystem.out.println(\"Test Class Dictionary write\");\r\n\t\t\r\n\t\ttry {\r\n\t\t\toutputFile = new PrintWriter(new FileOutputStream(\"classdictionary.txt\"));\r\n\t\t}catch (FileNotFoundException e){\r\n\t\t\tSystem.out.println(\"Unable to open file.\");\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\toutputFile.println(\"<ENTRYSTART>\");\r\n\t\toutputFile.println(\"<TITLE>MATH 2081_1\");\r\n\t\toutputFile.println(\"<TEACHER>BRIAN_J\");\r\n\t\toutputFile.println(\"<SCHEDULE>MATH 2081_1\");\r\n\t\t\t\toutputFile.println(\"<STUDENTCOUNT>15\");\r\n\t\toutputFile.println(\"<STUDENTLIST>CATHY4\");\r\n\t\toutputFile.println(\"<STUDENTLIST>DAN5\");\r\n\t\toutputFile.println(\"<STUDENTLIST>EVE6\");\r\n\t\t\t\toutputFile.println(\"<ENTRYEND>\");\r\n\t\toutputFile.println(\"<TITLE>PHYS 1082_1\");\r\n\t\toutputFile.println(\"<TEACHER>MAHMOOD_E\");\r\n\t\toutputFile.println(\"<SCHEDULE>PHYS 1082_1\");\r\n\t\t\t\toutputFile.println(\"<STUDENTCOUNT>20\");\r\n\t\toutputFile.println(\"<STUDENTLIST>FRANK7\");\r\n\t\toutputFile.println(\"<STUDENTLIST>GRACE8\");\r\n\t\toutputFile.println(\"<STUDENTLIST>HENRY9\");\r\n\t\t\t\toutputFile.println(\"<ENTRYEND>\");\r\n\t\t\t\toutputFile.println(\"<ENTRYSTART>\");\r\n\t\t\t\toutputFile.println(\"<TITLE>CSCI 1082_2\");\r\n\t\t\t\toutputFile.println(\"<TEACHER>ZACH_B\");\r\n\t\t\t\toutputFile.println(\"<SCHEDULE>CSCI 1082_2\");\r\n\t\t\t\t\t\toutputFile.println(\"<STUDENTCOUNT>15\");\r\n\t\t\t\toutputFile.println(\"<STUDENTLIST>AARON1\");\r\n\t\t\t\toutputFile.println(\"<STUDENTLIST>AMY2\");\r\n\t\t\t\toutputFile.println(\"<STUDENTLIST>BOB3\");\r\n\t\t\t\t\t\toutputFile.println(\"<ENTRYEND>\");\r\n\t\t\r\n\t\toutputFile.close();\r\n\t\t\r\n\t\t///\r\n\t\t//DictionaryFile testDictionary = new DictionaryFile(\"classdictionary.txt\",\"ClassDictionary\");\r\n\t\tClassDictionary testDictionary = new ClassDictionary();\r\n//\t\tSystem.out.println(testDictionary.getEntryCount());\r\n//\t\tSystem.out.println(testDictionary.getOpenStatus());\r\n//\t\tSystem.out.println(testDictionary.isValid());\r\n\t\tSystem.out.println(testDictionary);\r\n\t\t\r\n\t\tCalendar calendar = new GregorianCalendar();\r\n\t\tSimpleDateFormat df = new SimpleDateFormat(\"yyyyMMddHH\");\r\n\t\tSystem.out.println(df.format(calendar.getTime()));\r\n\r\n\t}", "private void saveGenres(){\n\t\tFile genreList = new File(Paths.get(\"genres.txt\").toString());\n\t\ttry{\n\t\t\tBufferedWriter writer = new BufferedWriter(new FileWriter(genreList));\n\t\t\tfor (String s : genres){\n\t\t\t\twriter.write(s);\n\t\t\t\twriter.newLine();\n\t\t\t}\n\t\t\twriter.close();\n\t\t} catch(IOException ex){\n\t\t\t\n\t\t}\n\t}", "public void makeReport() throws IOException{\n File report = new File(\"Report.txt\");\n BufferedWriter reportWriter = new BufferedWriter(new FileWriter(report));\n BufferedReader bookReader = new BufferedReader(new FileReader(\"E-Books.txt\"));\n String current;\n while((current = bookReader.readLine()) != null ){\n String[] tokens = current.split(\",\");\n reportWriter.write(tokens[0].trim()+\" for \"+tokens[1].trim()+\" with redemption Code \"+tokens[2].trim()+\n \" is assigned to \"+tokens[4].trim()+\" who is in \"+tokens[5].trim()+\" grade.\");\n reportWriter.write(System.lineSeparator());\n reportWriter.flush();\n }\n reportWriter.close();\n bookReader.close();\n new reportWindow();\n }", "public void writeFile() \r\n\t{\r\n\t\tStringBuilder builder = new StringBuilder();\r\n\t\tfor(String str : scorers)\r\n\t\t\tbuilder.append(str).append(\",\");\r\n\t\tbuilder.deleteCharAt(builder.length() - 1);\r\n\t\t\r\n\t\ttry(DataOutputStream output = new DataOutputStream(new FileOutputStream(HIGHSCORERS_FILE)))\r\n\t\t{\r\n\t\t\toutput.writeChars(builder.toString());\r\n\t\t} \r\n\t\tcatch (FileNotFoundException e) \r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.err.println(\"[ERROR]:[FileManager] File \" + HIGHSCORERS_FILE + \" was not found \" \r\n\t\t\t\t\t+ \"while writing.\");\r\n\t\t} \r\n\t\tcatch (IOException e) \r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.err.println(\"[ERROR]:[FileManager] Error while reading the file \" + HIGHSCORERS_FILE);\r\n\t\t}\r\n\t}", "public static void main(String[] args) throws IOException {\n\t\tScanner sc=new Scanner(System.in);\n\t\tMap<String,AddressBook> multipleAddressBook = new HashMap<String, AddressBook>(); //dictionary for mapping different address book with key \n\t\tAddressBook address_book=new AddressBook();\t\t\t\t\t//first address book object\n\t\t\n\t\tString n=\"\";\n\t\tString k=\"AddressBook1\";\n\t\tmultipleAddressBook.put(k, address_book);\t\t\t\t\t\t\t//put the first address book into dictionary\n\t\t\n\t\twhile(true)\n\t\t{\n\t\t\tSystem.out.println(\"Enter your choice\\n1.add contact\\n2.edit contact\\n3.Delete contact\\n4.Display contact\\n5.Display addressbook\\n6.Create another address book\\n7.Search for a city or state\\n8.View persons by city or state\\n9.Sort by Name, City, State or zip\\n10.Read addressbook from the file\\n11.write into the file\\n12.exit\"); //options for different actions\n\t\t\tint choice=sc.nextInt();\n\t\t\tsc.nextLine();\n\t\t\tif(choice==6) //to create a new address book\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Enter the name of the addressbook\");\n\t\t\t\tn=sc.next();\n\t\t\t\tAddressBook object1=new AddressBook(); // a new address book object is created \n\t\t\t\tmultipleAddressBook.put(n, object1);\n\t\t\t\t\t\n\t\t\t}\n\t\t\telse if(choice==7)\n\t\t\t{\n\t\t\t System.out.println(\"Enter the name of city or state\");\n\t\t\t String place=sc.next();\n\t\t\t for(Map.Entry<String, AddressBook> entry : multipleAddressBook.entrySet())\n\t\t\t {\n\t\t\t AddressBook tempObject=entry.getValue();\n\t\t\t tempObject.search(place);\n\t\t\t } \n\t\t\t}\n\t\t\telse if(choice==8)\n\t\t\t{\n\t\t\t System.out.println(\"Enter the number 1 or 2\\n\"\n\t\t\t \t\t+ \"1.city\\n\"\n\t\t\t \t\t+ \"2.state\");\n\t\t\t int ch=sc.nextInt();\n\t\t\t if(ch == 1) {\n\t\t\t \tfor(Map.Entry<String, AddressBook> mapEntry : multipleAddressBook.entrySet()) {\n\t\t\t \t\tAddressBook tempObject = mapEntry.getValue();\n\t\t\t \t\tSystem.out.println(\"AddressBook name: \"+mapEntry.getKey()+\"\\npersons by cities are:\");\n\t\t\t \t\ttempObject.viewByCity();\n\t\t\t \t}\n\t\t\t }\n\t\t\t else{\n\t\t\t \tfor(Map.Entry<String, AddressBook> mapEntry : multipleAddressBook.entrySet()) {\n\t\t\t \t\tAddressBook tempObject = mapEntry.getValue();\n\t\t\t \t\tSystem.out.println(\"AddressBook: \"+mapEntry.getKey()+\"\\npersons by states are:\");\n\t\t\t \t\ttempObject.viewByState();\n\t\t\t \t}\n\t\t\t }\n\t\t\t}\n\t\t\telse if(choice==9)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Enter the number to select the sort by option\\n\"\n\t\t\t \t\t+ \"1.Name\\n\"\n\t\t\t \t\t+ \"2.City\\n\"\n\t\t\t \t\t+ \"3.State\\n\"\n\t\t\t \t\t+ \"4.zip\");\n\t\t\t int ch=sc.nextInt();\n\t\t\t for(Map.Entry<String, AddressBook> entry : multipleAddressBook.entrySet())\n\t\t\t {\n\t\t\t AddressBook tempObject=entry.getValue();\n\t\t\t System.out.println(entry.getKey()+\" details:\");\n\t\t\t tempObject.sortByNameCityStateZip(ch);\n\t\t\t System.out.println(\"-----------------------------------------------------------------\");\n\t\t\t } \n\t\t\t}\n\t\t\telse if(choice==10) {\n\t\t\t\tSystem.out.println(\"Enter the addressbook name:\");\n\t\t\t\tString addressbookName= sc.nextLine();\n\t\t\t\tAddressBook addressbookReadFile = multipleAddressBook.get(addressbookName);\n\t\t\t\taddressbookReadFile.readFromFile(addressbookName);\n\t\t\t}\n\t\t\telse if(choice==11) {\n\t\t\t\tSystem.out.println(\"Enter the addressbook name:\");\n\t\t\t\tString addressbookName= sc.next();\n\t\t\t\tAddressBook addressbookWriteFile = multipleAddressBook.get(addressbookName);\n\t\t\t\taddressbookWriteFile.writeIntoFile(addressbookName);\n\t\t\t}\n\t\t\telse if(choice==12)\t\t\t\t//to exist from the program\n\t\t\t\tSystem.exit(0);\n\t\t\telse\n\t\t\t{\n\t\t\t\ttry{\n\t\t\t\t\tSystem.out.println(\"Enter the addressbook name!!\");\n\t\t\t\t\tn=sc.next();\n\t\t\t\t\tchoice(choice,multipleAddressBook.get(n)); //to perform required operation on desired address book\n\t\t\t\t}catch(Exception e) {\n\t\t\t\t\tSystem.out.println(\"AddressBook not found!!\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\t\t\n\t\t}\n\t}", "public void saveFile(String theFileLocation){\r\n try {\r\n File fileArchive = new File(theFileLocation);\r\n if (!fileArchive.exists()){ //if there is no file then it creates a new file\r\n fileArchive.createNewFile();\r\n }\r\n FileWriter fW = new FileWriter(theFileLocation);\r\n BufferedWriter bW = new BufferedWriter(fW);\r\n \r\n for (int p = 0; p < buckets.length; p++){\r\n for (int i = 0; i < buckets[p].size(); i++){\r\n EmployeeInfo theEmployee = buckets[p].get(i);\r\n \r\n if (theEmployee instanceof FTE){\r\n bW.write(\"FTE\");\r\n bW.write(\"*\");\r\n } else {\r\n if (theEmployee instanceof PTE){\r\n bW.write(\"PTE\");\r\n bW.write(\"*\");\r\n } \r\n }\r\n // general for both\r\n bW.write(Integer.toString(theEmployee.getEmpNum()));;\r\n bW.write(\"*\");\r\n bW.write(theEmployee.getFirstName());\r\n bW.write(\"*\");\r\n bW.write(theEmployee.getLastName());\r\n bW.write(\"*\");\r\n bW.write(Integer.toString(theEmployee.getGender()));\r\n bW.write(\"*\");\r\n bW.write(Integer.toString(theEmployee.getWorkLoc()));\r\n bW.write(\"*\");\r\n bW.write(Integer.toString(theEmployee.getEmpRole()));\r\n bW.write(\"*\");\r\n bW.write(Double.toString(theEmployee.getDeductRate()));\r\n bW.write(\"*\");\r\n \r\n if (theEmployee instanceof FTE){\r\n FTE theFTE = (FTE) theEmployee;\r\n bW.write(Double.toString(theFTE.yearlySalary));\r\n\r\n } else {\r\n if (theEmployee instanceof PTE){\r\n PTE thePTE = (PTE) theEmployee;\r\n bW.write(Double.toString(thePTE.hourlyWage));\r\n bW.write(\"*\");\r\n bW.write(Double.toString(thePTE.hoursPerWeek));\r\n bW.write(\"*\");\r\n bW.write(Double.toString(thePTE.weeksPerYear));\r\n } \r\n }\r\n \r\n bW.newLine(); \r\n \r\n }\r\n \r\n }\r\n bW.write(\"$$$$$$$\");\r\n bW.close();\r\n }\r\n \r\n catch (IOException IOE){\r\n IOE.printStackTrace();\r\n }\r\n }", "public void addBook(Book b){\n\t\tbookMap.get(b.getTitle()).add(b);\n\t}", "private void exportSongsByTag(Path savePath) {\n\t\tTreeMap<String, TreeSet<String>> libraryMap = this.tagMap;\n\t\ttry (PrintWriter writer = new PrintWriter(Files.newBufferedWriter(savePath, Charset.forName(\"UTF-8\")))) {\n\t\t\tfor(String key: libraryMap.navigableKeySet()) {\n\t\t\t\tString keyLine = key+\": \";\n\t\t\t\tfor(String tag: libraryMap.get(key)) {\n\t\t\t\t\tkeyLine += tag+\" \";\n\t\t\t\t}\n\t\t\t\twriter.println(keyLine);\t\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"Failed to write to file on path: \" + savePath.toString());\n\t\t}\n\t}", "private static void loadBooks() {\n\tbookmarks[2][0]=BookmarkManager.getInstance().createBook(4000,\"Walden\",\"\",1854,\"Wilder Publications\",new String[] {\"Henry David Thoreau\"},\"Philosophy\",4.3);\n\tbookmarks[2][1]=BookmarkManager.getInstance().createBook(4001,\"Self-Reliance and Other Essays\",\"\",1900,\"Dover Publications\",new String[] {\"Henry David Thoreau\"},\"Philosophy\",4.3);\n\tbookmarks[2][2]=BookmarkManager.getInstance().createBook(4002,\"Light From Many Lamps\",\"\",1960,\"Wilder Publications\",new String[] {\"Henry David Thoreau\"},\"Philosophy\",4.3);\n\tbookmarks[2][3]=BookmarkManager.getInstance().createBook(4003,\"Head First Design Patterns\",\"\",1944,\"Wilder Publications\",new String[] {\"Henry David Thoreau\"},\"Philosophy\",4.3);\n\tbookmarks[2][4]=BookmarkManager.getInstance().createBook(4004,\"Effective Java Programming Language Guide\",\"\",1990,\"Wilder Publications\",new String[] {\"Eric Freeman\",\"Bert Bates\",\"Kathy Sierra\",\"Elisabeth Robson\"},\"Philosophy\",4.3);\n}", "public static void processFilesForValidation() {\r\n\t\t// Process each file one at a time.\r\n\t\tfor (int i = 0; i < inScanners.length; i++) {\r\n\t\t\tScanner sc = inScanners[i];\r\n\t\t\tint articleCount = 1;\r\n\t\t\t// Read the input file.\r\n\t\t\ttry {\r\n\t\t\t\twhile(sc.hasNextLine()) {\r\n\t\t\t\t\tString s = sc.nextLine();\r\n\t\t\t\t\t// If we come across an article, read its contents and add it to the file.\r\n\t\t\t\t\tif(s.startsWith(\"@ARTICLE{\")) {\r\n\t\t\t\t\t\tauthor = journal = title = year = volume = number = pages = doi = ISSN = month = \"\";\r\n\t\t\t\t\t\twhile (!s.equals(\"}\")) {\r\n\t\t\t\t\t\t\ts = sc.nextLine();\r\n\t\t\t\t\t\t\tparseValue(s);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// Throw an exception if a field is missing.\r\n\t\t\t\t\t\tif (author.isEmpty() || journal.isEmpty() || title.isEmpty() || year.isEmpty() || volume.isEmpty() \r\n\t\t\t\t\t\t\t\t|| number.isEmpty() || pages.isEmpty() || doi.isEmpty() || ISSN.isEmpty() || month.isEmpty()) {\r\n\t\t\t\t\t\t\tthrow new FileInvalidException(\"One or more fields are missing.\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// Add the article to the file if valid.\r\n\t\t\t\t\t\tString author1 = author.replaceAll(\" and\", \",\");\r\n\t\t\t\t\t\tint andIndex = author.indexOf(\"and\");\r\n\t\t\t\t\t\tString author2 = andIndex != -1 ? author.replaceAll(author.substring(andIndex,author.length()), \"et al\") : author;\r\n\t\t\t\t\t\tString author3 = author.replaceAll(\"and\", \"&\");\r\n\t\t\t\t\r\n\t\t\t\t\t\t// IEEE\r\n\t\t\t\t\t\toutWriters[i][0].println(author1+\". \\\"\"+title+\"\\\", \"+journal+\", vol. \"+volume+\", no. \"+number+\", p. \"+pages+\", \"+month+\" \"+year+\".\\r\\n\");\r\n\t\t\t\t\t\t// ACM\r\n\t\t\t\t\t\toutWriters[i][1].println(\"[\"+articleCount+\"]\\t\"+author2+\". \"+year+\". \"+title+\". \"+journal+\". \"+volume+\", \"+number+\" (\"+year+\"), \"+pages+\". DOI:https://doi.org/\"+doi+\".\\r\\n\");\r\n\t\t\t\t\t\t// NJ\r\n\t\t\t\t\t\toutWriters[i][2].println(author3+\". \"+title+\". \"+journal+\". \"+volume+\", \"+pages+\"(\"+year+\").\\r\\n\");\r\n\t\t\t\t\t\tarticleCount++;\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}\r\n\t\t\t\t// Close output writers once file has been read.\r\n\t\t\t\tfor (int j = 0; j < 3; j++) {\r\n\t\t\t\t\toutWriters[i][j].close();\r\n\t\t\t\t}\r\n\t\t\t\tnumValidFiles++;\r\n\t\t\t}\r\n\t\t\t// If file is invalid, close and delete the output files.\r\n\t\t\tcatch (FileInvalidException e) {\r\n\t\t\t\tSystem.out.println(\"Error: Detected Empty Field!\" \r\n\t\t\t\t\t\t + \"\\n============================\"\r\n\t\t\t + \"\\nProblem detected with input file: Latex\" + (i + 1) + \".bib\"\r\n\t\t\t\t\t\t + \"\\nFile is invalid: \" + e.getMessage() + \" Processing stopped at this point. \"\r\n\t\t\t\t\t\t + \"Other empty/missing fields may be present as well.\\n\");\r\n\t\t\t\tfor (int j = 0; j < 3; j++) {\r\n\t\t\t\t\toutWriters[i][j].close();\r\n\t\t\t\t\toutFiles[i][j].delete();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// Close input file after reading.\r\n\t\t\tsc.close();\r\n\t\t}\r\n\t}", "public void printAll(String file) throws FileNotFoundException, IOException, ParseException {\n\t\tarrayList = pareseFile(file);\n\t\tSystem.out.println(file + \" Adress book\");\n\t\tSystem.out.println(arrayList.toString());\n\n\t}", "private void saveCarListings() {\r\n try {\r\n Writer writer = new Writer(new File(CARLISTINGS_FILE));\r\n writer.write(cars);\r\n writer.close();\r\n System.out.println(\"Car Listings saved to file \" + CARLISTINGS_FILE);\r\n } catch (FileNotFoundException e) {\r\n System.out.println(\"Unable to save Car Listings to \" + CARLISTINGS_FILE);\r\n } catch (UnsupportedEncodingException e) {\r\n e.printStackTrace();\r\n }\r\n }", "private static void saveToFile(ArrayList<Favourite> allFav) {\n\t\t\n\t\tBufferedWriter writer=null;\n\t\t\n\t\ttry {\n\t\t\twriter=new BufferedWriter(new FileWriter(Constants.KEY_FAV_FILE));\n\t\t\tString save=\"\";\n\t\t\tfor(Favourite f:allFav) {\n\t\t\t\tsave+=fileFormat(f);\n\t\t\t}\n\t\t\twriter.write(save);\n\t\t}catch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t\n\t\t}finally{\n\t\tif(writer!=null){\n\t\t\ttry{\n\t\t\t\twriter.close();\n\t\t\t}catch(IOException e){\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\n\t\n}\n\n\t\t\n\t}", "public void saveAll(){\n // Store postings\n for (Map.Entry<String, PostingsList> entry : this.index.entrySet()) {\n saveJSON(\"postings/t\"+hash(entry.getKey())+\".json\", entry.getValue());\n System.err.println(\"postings/t\"+hash(entry.getKey())+\".json\");\n count++;\n if (count%1000==0)\n System.err.println(\"storing \"+ count);\n }\n // Store mapping ID<->document names mapping\n this.saveJSON(\"postings/docIDs.json\", this.docIDs);\n this.saveJSON(\"postings/docLengths.json\", this.docLengths);\n }", "private void writeAll(){\n try (BufferedWriter ignored = new BufferedWriter(new FileWriter(this.fileName))) {\n Iterable<E> values=entities.values();\n values.forEach(this::writeToFile);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private static void addNewBook(){\n\t\tSystem.out.println(\"===Add New Book===\");\n\t\tBookDetails new_book = new BookDetails();\n\t\tScanner string_input = new Scanner(System.in); //takes string input from user\n\t\tScanner integer_input = new Scanner(System.in); //takes integer input from user\n\t\t\n\t\tSystem.out.println(\"Enter BookId: \");\n\t\tint bookId = getIntegerInput(); //ensures user input is an integer value\n\t\t/*if bookId entered already exists then continually ask user to enter bookId until a bookId that does not exist is entered. \n\t\t * Do the same if bookId is less than 1 because book's in the library will not have Id's less than 1.*/\n\t\twhile(ALL_BOOKS.containsKey(bookId) || bookId < 1){\n\t\t\tSystem.out.println(\"Book Id entered already exists! Enter BookId: \");\n\t\t\tbookId = integer_input.nextInt();\n\t\t}\n\t\tnew_book.setBookId(bookId);\n\t\t\n\t\tSystem.out.println(\"Enter Book Title: \");\n\t\tString bookTitle = string_input.nextLine();\n\t\tnew_book.setBookTitle(bookTitle);\n\t\t\n\t\tString author_firstname;\n\t\tdo{\n\t\t\tSystem.out.println(\"Enter Author's First Name: \");\n\t\t\tauthor_firstname = string_input.next();\n\t\t}while(!new_book.setAuthorFirstName(author_firstname)); //loop until name input is valid (contains only letters) \n\t\t\n\t\tString author_middlename;\n\t\tdo{\n\t\t\tSystem.out.println(\"Enter Author's Middle Name (Type 'null' if author has no middle name): \");\n\t\t\tauthor_middlename = string_input.next();\n\t\t}while(!new_book.setAuthorMiddleName(author_middlename)); //loop until name input is valid (contains only letters) \n\t\t\n\t\tString author_lastname;\n\t\tdo{\n\t\t\tSystem.out.println(\"Enter Author's Last Name: \");\n\t\t\tauthor_lastname = string_input.next();\n\t\t}while(!new_book.setAuthorLastName(author_lastname)); //loop until name input is valid (contains only letters) \n\t\t\n\t\tstring_input = new Scanner(System.in);\n\t\tSystem.out.println(\"Enter Book's Publisher: \");\n\t\tString publisher = string_input.nextLine();\n\t\tnew_book.setPublisher(publisher);\n\t\t\n\t\t\n\t\t/*Set book's genre. Valid values for a book's Genre are Biology, Mathematics, Chemistry, Physics,\n\t\t * Science_Fiction, Fantasy, Action, Drama, Romance, Horror, History, Autobiography, Biography.*/\n\t\tString genre;\n\t\tdo{\n\t\t\tSystem.out.println(\"Enter Book's Genre: \");\n\t\t\tgenre = string_input.next();\n\t\t}while(!new_book.setGenre(genre)); //loop until valid genre value is entered\n\t\t\n\t\t/*Set book's condition. Valid values for a book's Condition are New, Good, Worn, Damaged.*/\n\t\tString condition;\n\t\tdo{\n\t\t\tSystem.out.println(\"Enter Book's Condition: \");\n\t\t\tcondition = string_input.next();\n\t\t}while(!new_book.setCondition(condition)); //loop until valid value for condition is entered\n\t\t\n\t\tALL_BOOKS.put(new_book.getBookId(), new_book);\n\t\taddToPublisherTable(new_book.getPublisher(), new_book.getBookTitle()); //add book's title to the ALL_PUBLISHERS Hashtable\n\t\taddToGenreTable(new_book, new_book.getBookTitle()); //add book's title to the ALL_GENRES ArrayList\n\t\taddToAuthorTable(new_book.getAuthor().toString(), new_book.getBookTitle()); //add book's title to the ALL_AUTHORS Hashtable\n\t\tSystem.out.println(\"Book Successfully Added!\");\n\t}", "public static void create(File collectionsFile) throws IOException\n\t{\t\t\n\t\tHashMap books = null;\n\t\t\n\t\t// If updateOnly is true then we are only updating the existing\n\t\t// JAD/JAR files and won't be parsing the source text\n\t\tif (!updateOnly)\n\t\t{\n\t\t\t// Extract xml file from the collectionsFile property: Source-Text\n\t\t\tString sourceTextPath = extractSourceTextPath(collectionsFile);\n\n // Extract the source file type from the collectionsFile property: SourceFormat\n sourceFormatType = extractSourceFormatType(collectionsFile);\n if (sourceFormatType.equals(SourceFormatType.unknown))\n {\n //do extra testing on the file to see if the format can be determined\n //this is for backward compatibility for GBC 2.2.6 version and prior\n //which did not specify the Source-Format property\n sourceFormatType = SourceFormatTypeRetry(baseSourceDirectory, sourceTextPath);\n }\n\n\t\t\t// Base source directory can be overridden with the -d argument\n\t\t\tUpdateBaseSourceDirectory(collectionsFile);\n\t\t\t/*if (baseSourceDirectory == null)\n\t\t\t{\n\t\t\t\t// By default the sourceTextPath is relative to the collectionsFile\n\t\t\t\t//baseSourceDirectory = \"\" + collectionsFile.getParent();\n baseSourceDirectory = collectionsFile.getAbsolutePath();\n baseSourceDirectory = baseSourceDirectory.substring(0, baseSourceDirectory.length() - collectionsFile.getName().length());\n\t\t\t}*/\n\t\t\tif (sourceFormatType == SourceFormatType.osis\n || sourceFormatType == SourceFormatType.thml)\n {\n File xmlFile = new File(baseSourceDirectory, sourceTextPath);\n books = parseXml(xmlFile);\n }\n else if (sourceFormatType == SourceFormatType.usfm)\n {\n extractCommonFields(collectionsFile);\n //make sure that the file extension is retrieved\n extractUSFMfields(collectionsFile);\n books = parseUSFM(collectionsFile, baseSourceDirectory, sourceTextPath, sTitleTag);\n }\n else\n {\n //dump out message saying that it cannot determine the file format type\n System.out.println(\"Error: Could not determine Bible format type, \" + sourceFormatType + \". Please use the 'Source-Format'\");\n System.out.println(\"property in your collections file.\");\n return;\n }\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Allow the relative path in the collections file to work for updateing\n\t\t\t// the icon as well.\n\t\t\tUpdateBaseSourceDirectory(collectionsFile);\n\t\t}\n\t\t\n\t\tif (books != null || updateOnly)\n\t\t{\n\t\t\tparseUiProperties();\n\t\t\t\n\t\t\t// Parse the collections file\n\t\t\tVector collections = parseCollectionsFile(collectionsFile, books);\n\t\t\t\n\t\t\tif (customFontString != null)\n\t\t\t{\n\t\t\t\tgenerateCustomFont(customFontString, collectionsFile, books);\n\t\t\t}\n\t\t\t\n\t\t\t// Open GoBibleCore based on MIDP version \n\t\t\tString goBibleJarFileName = \"GoBibleCore/GoBibleCore2.jar\";\n\t\t\t\n\t\t\t// Set some fields based on the MIDP version\n\t\t\t// Version 2.4.0 has removed MIDP-1.0 as an option\n//\t\t\tif (midpVersion.equals(\"MIDP-1.0\"))\n//\t\t\t{\n//\t\t\t\tversionString = \"1.\" + SUB_VERSION;\n//\t\t\t\tgoBibleJarFileName = \"GoBibleCore/GoBibleCore1.jar\";\n//\t\t\t}\n\t\t\t\n\t\t\t// Work out the current directory of the GoBibleCreator.jar\n\t\t\tFile jarDirectory = getJarDirectory();\n\t\t\tFile jarFile = new File(jarDirectory, goBibleJarFileName);\n\t\t\t\n\t\t\tJarFile goBibleJar = new JarFile(jarFile);\n\t\t\t\n\t\t\t// Write out the Go Bible data files into the same directory as the collections file\n\t\t\twriteCollections(collectionsFile.getParentFile(), collections, books, goBibleJar);\n\t\t}\n\t}", "private void write(HashMap<String, List<String>> result, String filename) {\n\t\ttry {\n\t\t\tBufferedWriter bw = new BufferedWriter(new FileWriter(filename));\n\n\t\t\tfor (String word : result.keySet()) {\n\t\t\t\tbw.write(String.format(\"%s: %s\\n\", word, result.get(word)));\n\t\t\t}\n\n\t\t\tbw.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void writeVocabPost(FlIndexer fi) throws IOException{\n this.docNormPow = new HashMap<>();\n \n LinkedList<Integer> tf;\n LinkedList<String> files;\n String token;\n int position=0;\n File file = new File(\"CollectionIndex/VocabularyFile.txt\");\n File Postingfile = new File(\"CollectionIndex/PostingFile.txt\");\n \n\tFileWriter fw = new FileWriter(file.getAbsoluteFile());\n FileWriter fw_posting = new FileWriter(Postingfile.getAbsolutePath());\n try (BufferedWriter bw = new BufferedWriter(fw)) {\n try (BufferedWriter bw_posting = new BufferedWriter(fw_posting)){\n for (Map.Entry<String, TermNode> entry : fi.mapTerms.entrySet()){\n double idf = ((double)this.docMap.size())/entry.getValue().getDf();\n //idf=log2(idf, 2);\n bw.write(entry.getValue().getTerm()+\" \"+entry.getValue().getDf()+\" \"+idf+\" \"+position+\"\\n\");\n \n tf=entry.getValue().getTfList();\n files=entry.getValue().getFileList();\n int i=tf.size();\n for (int j=0; j<i; j++){\n double tfidf=idf*((double)tf.get(j)/fi.getMaxTF(files.get(j)));\n double tfidfpow=Math.pow(tfidf, 2);\n\n \n if(this.docNormPow.containsKey(files.get(j))){\n //this.docNorm.put(files.get(j), this.docNorm.get(files.get(j))+tfidf);\n this.docNormPow.put(files.get(j), this.docNormPow.get(files.get(j))+tfidfpow);\n }\n else{\n //this.docNorm.put(files.get(j), tfidf);\n this.docNormPow.put(files.get(j), tfidfpow);\n }\n \n token=this.docMap.get(files.get(j))+\" \"+tf.get(j)+\" \"\n +entry.getValue().multiMap.get(files.get(j))+\" \"+tfidf+\"\\n\";\n position= position + token.length();\n \n bw_posting.write(token);\n }\n }\n }\n }\n \n System.out.println(\"Done creating VocabularyFile.txt\");\n System.out.println(\"Done creating PostingFile.txt\");\n }", "public void dump(AbstractAppointmentBook appointmentBook) throws IOException\n {\n FileWriter fw = new FileWriter(file, false);\n fw.write(appointmentBook.getOwnerName());\n ArrayList<AbstractAppointment> list = (ArrayList<AbstractAppointment>) appointmentBook.getAppointments();\n for (AbstractAppointment appointment : list) {\n fw.write(\"\\n\");\n fw.write(appointment.getDescription()+\",,,,//\"+appointment.getBeginTimeString()+\",,,,//\"+appointment.getEndTimeString());\n }\n fw.flush();\n fw.close();\n }", "public static void update(String indexFileName, String listOfDoc) throws IOException{\n\t\tHashMap<String, String> sCurrentHashMap = null;\n\t\tboolean hasFile = true;\n\t\t\n\t\tif(globalHash.containsKey(indexFileName)){\n\t\t\t//ถ้ามีใน global แล้ว เอาออกมาแล้วเอามารวมกับที่เพิ่งอ่านไฟล์ได้เลย\n\t\t\tsCurrentHashMap = globalHash.get(indexFileName);\n\t\t\n\t\t}else{ \n\t\t\t//if no hashmap in globalHash, then check if there's this fileName.txt in directory\n\t\t\t\n\t\t\tif(!new File(indexFileName+\".txt\").isFile()){\n\t\t\t\t\tSystem.out.println(\"ERROR: The inverted file is not found.\");\n\t\t\t\t\thasFile = false;\n\t\t\t}else{\n\t \t sCurrentHashMap = genHashMapFromInvertedIndexFile(indexFileName);\n\t\t\t \n\t\t\t}\n\t\t}\n\t\t\n\t\tif(hasFile){\n\t\t\tArrayList<Term> newTermList = extractDoc(listOfDoc);\n\t\t\t//if the new term list has value (not doc not found)\n\t\t\tif(newTermList.size()>0){\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tsCurrentHashMap = addListToHashMap(sCurrentHashMap, newTermList);\n\t\t\t\t\n\t\t\t\t/*เพิ่มเงื่อนไขกรณี ลบคำออกจากไฟล์ \n\t\t\t\t * 1.ทำ list เป็น hashMap อีกอันไว้เซิชไวไว\n\t\t\t\t * loop amount of doc\n\t\t\t\t * 2.ไล่ iterative ของ hashMap ว่ามี value อันไหน contain ชื่อไฟล์บ้าง ถ้าcontain ให้เช็คกลับว่า key นั้น มีในแฮชอีกอันหรือเปล่า\n\t\t\t\t*/\n\t\t\t\t\n\t\t\t\t/* // Convert new word (from file) list to HashMap\n\t\t\t\tHashMap<String, String> newWordHashMap = new HashMap<String, String>();\n\t\t\t\tfor(Term i: newTermList){\n\t\t\t\t\tnewWordHashMap.put(i.getTerm(), i.getDocNumber()+\"\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tIterator it = sCurrentHashMap.entrySet().iterator();\n\t\t\t\twhile(it.hasNext()){\n\t\t\t\t\tHashMap.Entry<String, String> entry = (HashMap.Entry<String, String>) it.next();\n\t\t\t\t\t//if its value contains the doc number, then check if its key is in the newTermHash or note\n\t\t\t\t\t// if not --> this term was removed --> remove this key out from sCurrentHashMap\n\t\t\t\t\tif(entry.getValue().contains(s)) {\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t\t\n\t\t\t\tglobalHash.put(indexFileName, sCurrentHashMap);\n\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "private void saveButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_saveButtonMouseClicked\n \n FileDialog dialog = new FileDialog(this, \"Ssuvegarder le fichier dictionnaire\", FileDialog.SAVE);\n dialog.setFile(loadedDictionaryFilename);\n dialog.setVisible(true);\n \n String filename = dialog.getFile();\n if(filename != null) // if user selected a file\n {\n // add .txt extension if user didn't add it\n if(!filename.substring(filename.length() - 4).equals(\".txt\"))\n filename = filename + \".txt\";\n \n // add full path of the filename\n filename = dialog.getDirectory() + filename;\n \n // get all WordDefinition in an arraylist \n ArrayList<WordDefinition> allWordDefinitionList = new ArrayList<>();\n for(int i = 0 ; i < lexiNodeTrees.size() ; i++)\n {\n ArrayList<WordDefinition> allWordsInTree = lexiNodeTrees.get(i).getAllWordsFromTree();\n \n for(int j = 0 ; j < allWordsInTree.size() ; j++)\n {\n allWordDefinitionList.add(allWordsInTree.get(j));\n }\n }\n \n // sort the list of word definition in alphabetical order\n Collections.sort(allWordDefinitionList, new WordDefinitionComparator());\n \n // save to file\n if(DictioFileOperations.saveListToFile(filename, allWordDefinitionList))\n {\n loadedDictionaryFilename = filename; // save new name in case user wants to save again\n JOptionPane.showMessageDialog(this, \"La list des mots a été \"\n + \"sauvegardé dans le fichier\\n\" + filename + \".\\n\\n\", \"INFORMATION\", \n JOptionPane.INFORMATION_MESSAGE);\n }\n\n else // if there was a problem saving the file\n JOptionPane.showMessageDialog(this, \"ERREUR: Impossible de \"\n + \"sauvegarder dans le fichier.\\n\\n\", \"ERREUR\", \n JOptionPane.ERROR_MESSAGE);\n }\n }", "public void listBooks() {\n for (int g = 0; g < books.length; g++) {\n books[g].toString();\n }\n// List all books in Bookstore\n }", "public void saveDictionary() throws IOException {\r\n\t\tif (modified) {\r\n\t\t\tSystem.out.println(\"Saving...\");\r\n\t\t}\r\n\t\telse {\r\n\t\t\tSystem.out.println(\"Saving un-changed dictionary...\");\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tFileWriter fw = new FileWriter(\"dictionary.txt\", false);\r\n\t\t\tBufferedWriter bw = new BufferedWriter(fw);\r\n\t\t\tObject[] dictionaryArray = dictionary.toArray();\r\n\t\t\tfor (int i = 0; i < dictionary.size(); i++) {\r\n\t\t\t\tString word = (String)dictionaryArray[i];\r\n\t\t\t\tSystem.out.println(word);\r\n\t\t\t\tbw.write(word);\r\n\t\t\t\tbw.newLine();\r\n\t\t\t}\r\n\t\t\tbw.close();\r\n\t\t\tmodified = false;\r\n\t\t}\r\n\t\tcatch (IOException e) {\r\n\t\t\tSystem.out.println(\"An error occurred while attempting to save the dictionary.\");\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t}\r\n\t}", "public static void saveLotteryFiles() {\n\t\tFileUtility.deleteAllLines(TOTAL_TICKETS_FILE);\n\t\tFileUtility.deleteAllLines(LOTTERY_ENTRIES_FILE);\n\t\tFileUtility.addLineOnTxt(TOTAL_TICKETS_FILE, totalTicketsPurchased + \"\");\n\n\t\tArrayList<String> line = new ArrayList<String>();\n\t\tfor (int index = 0; index < LotteryDatabase.lotteryDatabase.size(); index++) {\n\t\t\tLotteryDatabase data = LotteryDatabase.lotteryDatabase.get(index);\n\t\t\tline.add(data.getPlayerName() + ServerConstants.TEXT_SEPERATOR + data.getTicketsPurchased());\n\t\t}\n\t\tFileUtility.saveArrayContentsSilent(LOTTERY_ENTRIES_FILE, line);\n\t}", "public void addBook(Book aBook) {\n\t\t\n\t\tNode<ArrayList<Book>> current = head;\n\t\t//System.out.print(current.letter);\n\t\twhile (current.letter != aBook.getAuthorLastName().charAt(0)) {\n\t\t\tcurrent = current.next;\n\t\t}\n\n\t\tcurrent.data.add(aBook);\n\t\t\n\t}", "private void createDicts(String inputFile){\n\t\tproductIds = new TreeMap<>();\n\t\ttokenDict = new TreeMap<>();\n\t\treviewIds = new TreeMap<>();\n\n\t\tDataParser dataParser = null;\n\t\ttry {\n\t\t\tdataParser = new DataParser(inputFile);\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Error occurred while reading the reviews input file.\");\n\t\t\tSystem.exit(1);\n\t\t}\n\n\t\tfor (int i = 0; i < dataParser.allReviews.size(); i++) {\n\t\t\taddProductId(dataParser.allReviews.get(i).get(\"productId\"), i + 1);\n\t\t\tint length = addReviewText(dataParser.allReviews.get(i).get(\"text\"), i + 1);\n\t\t\taddReviewId(dataParser.allReviews.get(i), i, length);\n\t\t}\n\t}", "public void saveAsCsv() {\n\n try(BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(\"saves/data.csv\"))){\n for(Publication book : library){\n StringBuilder stringBuilder = new StringBuilder();\n\n stringBuilder.append(\"\\\"\").append(book.getClass().getSimpleName()).append(\"\\\"\"); // type\n stringBuilder.append(\",\"); // delimiter\n stringBuilder.append(\"\\\"\").append(book.getTitle()).append(\"\\\"\"); // title\n stringBuilder.append(\",\");\n stringBuilder.append(\"\\\"\").append(book.getAuthor().toString()).append(\"\\\"\"); // author\n stringBuilder.append(\",\");\n stringBuilder.append(\"\\\"\").append(book.getPages()).append(\"\\\"\"); // pages\n stringBuilder.append(\",\");\n stringBuilder.append(\"\\\"\").append(book.getIsbn()).append(\"\\\"\"); // isbn\n stringBuilder.append(\",\");\n stringBuilder.append(\"\\\"\").append(book.getReleaseYear()).append(\"\\\"\"); // year\n stringBuilder.append(\"\\n\");\n\n bufferedWriter.write(stringBuilder.toString()); // creates a line of one publication information and puts it to file\n }\n } catch (IOException e){\n System.out.println(\"IOException occurred: \" + e.getMessage());\n }\n }", "public void getOldFile() throws FileNotFoundException, IOException, ClassNotFoundException{\r\n\t\tObjectInputStream ois = new ObjectInputStream(new FileInputStream(\"agenda.txt\"));\r\n\t\tArrayList<Artist> inputArtists = (ArrayList<Artist>) ois.readObject();\r\n\t\tArrayList<Stage> inputStages = (ArrayList<Stage>) ois.readObject();\r\n\t\tArrayList<Performance> inputPerformances = (ArrayList<Performance>) ois.readObject();\r\n\t\tartists.addAll(inputArtists);\r\n\t\tstages.addAll(inputStages);\r\n\t\tperformances.addAll(inputPerformances);\r\n\t}", "void addbook(String book){\n\t\tthis.books[no_of_books]=book;\n\t\tno_of_books++;\n\t\tSystem.out.println(book+\" ...add\");\n\n\t}", "public void writeFile()\n\t{\n\t\t//Printwriter object\n\t\tPrintWriter writer = FileUtils.openToWrite(\"TobaccoUse.txt\");\n\t\twriter.print(\"Year, State, Abbreviation, Percentage of Tobacco Use\\n\");\n\t\tfor(int i = 0; i < tobacco.size(); i++)\n\t\t{\n\t\t\tStateTobacco state = tobacco.get(i);\n\t\t\tString name = state.getState();\n\t\t\tString abbr = state.getAbbreviation();\n\t\t\tdouble percent = state.getPercentUse();\n\t\t\tint year = state.getYear();\n\t\t\twriter.print(\"\"+ year + \", \" + name + \", \" + abbr + \", \" + percent + \"\\n\");\n\t\t} \n\t\twriter.close(); //closes printwriter object\n\t}", "public void readFromFile(String path) {\n try {\n ArrayList<String> list = new ArrayList<>(Files.readAllLines(Paths.get(path)));\n\n for (String info: list) {\n AddressEntry entry = new AddressEntry();\n ArrayList<String> entryList = new ArrayList<>(Arrays.asList(info.split(\",\")));\n entry.setFirstName(entryList.get(0).trim());\n entry.setLastName(entryList.get(1).trim());\n entry.setStreet(entryList.get(2).trim());\n entry.setCity(entryList.get(3).trim());\n entry.setState(entryList.get(4).trim());\n entry.setZip(Integer.parseInt(entryList.get(5).trim()));\n entry.setPhone(entryList.get(6).trim());\n entry.setEmail(entryList.get(7).trim());\n add(entry);\n }\n\n System.out.println(\"Read in \" + list.size() + \" new Addresses. Successfully loaded\");\n System.out.println(\"There are currently \" + addressEntryList.size() + \" Addresses in the Address Book.\");\n }\n catch (IOException e) {\n System.out.println(e);\n }\n }", "private static void writeToOutput(String path, Apriori apriori){\n try{\n BufferedWriter output = new BufferedWriter(new FileWriter(path, false));\n for (String s : apriori.mItemSet){\n output.write(s);\n }\n output.close();\n } catch (IOException e){\n e.printStackTrace();\n }\n }", "public void writer(List<String> toStore) throws IOException{\n //creates writer and clears file\n PrintWriter writer = new PrintWriter(\"output.txt\", \"UTF-8\");\n //for each loop to store all the values in the file into the file named output.txt\n for(String s : toStore)\n //stores the strings for outputting\n writer.println(s);\n //closes the writer and outputs to the file\n writer.close();\n }" ]
[ "0.72118276", "0.6828261", "0.6693373", "0.62248856", "0.6217926", "0.61759716", "0.6143723", "0.6102294", "0.6032166", "0.60098255", "0.59563476", "0.5881427", "0.584571", "0.5732669", "0.5693187", "0.56524885", "0.56359756", "0.562789", "0.5595472", "0.5590951", "0.55797493", "0.55696934", "0.5560076", "0.55489343", "0.55412686", "0.55408627", "0.5539203", "0.55379677", "0.5518119", "0.5474511", "0.5472223", "0.5462527", "0.5452227", "0.54406506", "0.54319793", "0.5421812", "0.54171526", "0.5411658", "0.54044896", "0.5399349", "0.53925866", "0.53793347", "0.5349397", "0.534573", "0.534543", "0.5343518", "0.5327319", "0.53148925", "0.5303286", "0.52812016", "0.5278652", "0.52563554", "0.52459806", "0.52382183", "0.52266973", "0.5222823", "0.5214699", "0.5212758", "0.51932627", "0.51917195", "0.5176621", "0.51649654", "0.51649237", "0.5150968", "0.51492536", "0.5148144", "0.51453984", "0.5139071", "0.5134188", "0.5122725", "0.51117074", "0.50910515", "0.50870687", "0.5079518", "0.5073734", "0.5063177", "0.5060142", "0.50549316", "0.50398487", "0.5034767", "0.503225", "0.5031461", "0.5031034", "0.5030388", "0.5023958", "0.50231045", "0.5019662", "0.50155735", "0.5015284", "0.50146586", "0.50133985", "0.5006696", "0.4980436", "0.49704456", "0.49686807", "0.4966961", "0.49650016", "0.4956446", "0.49508798", "0.49469125" ]
0.8135358
0
/Prints out a list of all students who have been fined (students whose total fine is greater than 0).
private static void printFinedStudents(){ Set<Integer> keys = FINED_STUDENTS.keySet(); //returns list of all keys in FINED_STUDENTS int count = 0; System.out.println("Fined Students are: "); for(int k : keys){ count ++; System.out.println(count + ". " + FINED_STUDENTS.get(k)); } if(keys.size() == 0) System.out.println("Empty! No Students have been fined"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void showstudents(){\n for (int i=0; i<slist.size(); i++){\n System.out.println(slist.get(i).getStudent());\n }\n }", "public void printStudents()\n {\n for(Student s : students)\n System.out.println(s);\n }", "public static void runExercise2() {\n students.stream().filter(student -> student.getGender().equals(Gender.MALE)).forEach(y -> System.out.println(y.getFirstName()));\n }", "public ArrayList<Student> filterSearchStudentList(int stuNum){\n \n ArrayList<Student> filteredList = new ArrayList<Student>();\n \n int existance = 0;\n\n for(int i = 0; i<studList.size(); i++){\n \n if(studList.get(i).getStuNumber() <= stuNum){\n \n Student keyListOb = new Student(studList.get(i).getFullName(), studList.get(i).getStuNumber(), studList.get(i).getGPA());\n filteredList.add(keyListOb);\n }\n \n else{\n existance++;\n }\n }\n if(existance == studList.size()){\n System.out.println(\"\\nNo results\");\n }\n\n for(int i =0; i<filteredList.size();i++){\n System.out.println(\"Student Name: \" + filteredList.get(i).getFullName() + \", Student Number: \" + filteredList.get(i).getStuNumber() + \", Student GPA: \" + filteredList.get(i).getGPA());\n }\n\n return filteredList;\n }", "public String DisplayStudents()\n\t{\t\n\t\tString studentList= \"\";\n\t\tint i=1; //the leading number that is interated for each student\n\t\tfor(Student b : classRoll)\n\t\t{\n\t\t\tstudentList += i + \". \" + b.getStrNameFirst ( ) + \" \" + b.getStrNameLast () +\"\\n\";\n\t\t\ti++;\n\t\t}\n\t\treturn studentList= getCourseName() +\"\\n\" + getCourseNumber()+\"\\n\" + getInstructor()+ \"\\n\" + studentList;\n\t}", "public void printStudentList()\n {\n for(int i = 0; i < students.size(); i++)\n System.out.println( (i + 1) + \". \" + students.get(i).getName());\n }", "private void displayStudentByName(String name) {\n\n int falg = 0;\n\n for (Student student : studentDatabase) {\n\n if (student.getName().equals(name)) {\n\n stdOut.println(student.toString());\n\n falg = 1;\n\n break;\n }\n }\n\n if (falg == 0) {\n\n stdOut.println(\"cannot find student\\n\");\n }\n }", "public static void runExercise7() {\n students.stream().filter(student -> student.getAge()>20).map(student -> student.getLastName() + \" \" + student.getFirstName()).sorted().forEach(System.out::println);\n }", "private static void addFinedStudentsToTable(StudentDetails student) {\n\t\tif(student.getTotalFine() > 0)\n\t\t\tFINED_STUDENTS.put(student.getId(), student.toString());\n\t}", "private void printStudListByCourse() throws Exception {\n String courseID = null;\n ArrayList<Student> studentList = new ArrayList<Student>();\n\n Scanner sc = new Scanner(System.in);\n\n System.out.println(\"\\nPlease enter course ID\");\n courseID = sc.nextLine();\n while(!courseID.matches(\"^[a-zA-Z]{2}[0-9]{4}$\")){\n System.out.println(\"Invalid input! Please enter a valid index number!\");\n courseID = sc.nextLine();\n }\n\n studentList= this.adminManager.getStudentByCourse(courseID);\n if(studentList == null){\n System.out.println(\"\\nThere is no such a course index\\n\\n\");\n System.exit(1);\n }\n if (studentList.isEmpty()){\n System.out.println(\"\\nThere is no student registered for this course ID\\n\\n\");\n return;\n }\n else{\n System.out.println(\"Hang on a moment while we load database.\\n\\n\");\n System.out.println(\"------------------------------------------------------\");\n System.out.println(\" STUDENT NAME GENDER NATIONALITY\");\n System.out.println(\"------------------------------------------------------\");\n //\n for(Student student:studentList){\n System.out.println(String.format(\"%20s %6s %s\",student.getName(),student.getGender(),student.getNationality()));\n }\n\n System.out.println(\"------------------------------------------------------\\n\");\n }\n }", "public void printList() {\n System.out.println(\"Disciplina \" + horario);\n System.out.println(\"Professor: \" + professor + \" sala: \" + sala);\n System.out.println(\"Lista de Estudantes:\");\n Iterator i = estudantes.iterator();\n while(i.hasNext()) {\n Estudante student = (Estudante)i.next();\n student.print();\n }\n System.out.println(\"Número de estudantes: \" + numberOfStudents());\n }", "public String getStudentsInCourse() {\n String output = \"\"; \n for (Student student : students) { // enhanced for\n output += student.toString() + \"\\n\";\n } // end for\n return output;\n }", "public static void printStudentInfo() {\n\t\tfor (Student student : StudentList)\n\t\t\tSystem.out.println(\"Name: \" + student.getName() + \" Matric Number: \" + student.getMatricNo() + \" Degree:\"\n\t\t\t\t\t+ student.getDegree());\n\t}", "private void displayStudentByGrade() {\n\n studentDatabase.sortArrayList();\n\n for (Student student : studentDatabase) {\n\n stdOut.println(student.toStringsort() + \"\\n\");\n }\n }", "private void filterStudents() {\n Scanner sc = new Scanner(System.in);\n System.out.print(\"The string with which you want the student first name to start: \");\n String anAwesomeString = sc.next();\n\n System.out.println(\"Filtered students (the ones whose first name start with \" + anAwesomeString + \"):\");\n Set<Student> students = ctrl.filterStudentsByFirstName(anAwesomeString);\n if (students.isEmpty())\n System.out.println(\"There isnt't any student whose name starts with the given string!\");\n else\n students.forEach(System.out::println);\n }", "public static void displayStudentRecords() {\n\t\tSystem.out.println(\"Student records in the database are:\");\n\t\tSelectStudentRecords records = new SelectStudentRecords();\n\t\ttry {\n\t\t\tList<Student> studentList = records.selectStudentRecords();\n\t\t\tstudentList.forEach(System.out::println);\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t}", "public static List<Student> getAllStudents(){\r\n Student student1 = new Student(\"Dowlath\",2,3.6,\"male\", Arrays.asList(\"Swim\",\"BasketBall\",\"VolleyBall\"),11);\r\n Student student2 = new Student(\"Bhavya\",2,3.8,\"female\",Arrays.asList(\"Swim\",\"Gymnastics\",\"soccer\"),12);\r\n\r\n\r\n /* 3rd Grade Students */\r\n Student student3 = new Student(\"Priya\",3,4.0,\"female\", Arrays.asList(\"Swim\",\"BasketBall\",\"Aerobics\"),10);\r\n Student student4 = new Student(\"Arsh\",3,3.9,\"male\",Arrays.asList(\"Swim\",\"Gymnastics\",\"soccer\"),9);\r\n\r\n\r\n /* 4th Grade Students */\r\n Student student5 = new Student(\"Sowmiya\",4,3.5,\"female\", Arrays.asList(\"Swim\",\"Dancing\",\"FootBall\"),15);\r\n Student student6 = new Student(\"Ariz\",4,3.9,\"male\",Arrays.asList(\"Swim\",\"BasketBall\",\"BaseBall\",\"FootBall\"),14);\r\n\r\n List<Student> students = Arrays.asList(student1,student2,student3,student4,student5,student6);\r\n return students;\r\n }", "public String getUnfoundStudents() {\r\n\t\treturn this.unfoundStudents;\r\n\t}", "public void printNotfullcourses() {\n\t\tfor (int i = 0; i < CourseManager.courses.size(); i++) {\n\t\t\tif (CourseManager.courses.get(i).checkFull() == false) {\n\t\t\t\tSystem.out.println(i + 1 + \". \" + CourseManager.courses.get(i).getName());\n\t\t\t}\n\t\t}\n\t}", "public ArrayList<Student> getAllStudents()\n {\n Cursor cursor = sqlServices.getData(USER_TABLE, null, USER_IS_TEACHER + \" = ?\",\n new String[]{\"0\"});\n return getStudentFromCursor(cursor);\n }", "public int findTotalStudents() {\n\t\treturn students.size();\r\n\t}", "public static void printStudents(List<Student> students) {\n }", "private static void showStudentDB () {\n for (Student s : studentDB) {\n System.out.println(\"ID: \" + s.getID() + \"\\n\" + \"Student: \" + s.getName());\n }\n }", "public void viewStudents(List<Student> studentList) {\n\t\tfor (Student student : studentList) {\n\t\t\tSystem.out.format(\"%5d | \", student.getId());\n\t\t\tSystem.out.format(\"%20s | \", student.getName());\n\t\t\tSystem.out.format(\"%5d | \", student.getAge());\n\t\t\tSystem.out.format(\"%20s | \", student.getAddress());\n\t\t\tSystem.out.format(\"%10.1f%n\", student.getGpa());\n\t\t}\n\t}", "@Test\n public void testFindAllStudents() throws Exception {\n List<Students> list = cs.findAllStudents();\n for (Students stu :\n list) {\n System.out.println(stu);\n }\n }", "private void viewAllStudents() {\n Iterable<Student> students = ctrl.getStudentRepo().findAll();\n students.forEach(System.out::println);\n }", "public static void printListOfStudentsPerCourse() {\n Scanner input = new Scanner(System.in);\n System.out.println(\"~~~~~~~~~Please select a course to see the Students~~~~~~~~~\");\n boolean caseCheck = false;\n String flag = \"Y\";\n do {\n if (flag.equalsIgnoreCase(\"Y\")) {\n SchoolCourse chosenSchoolCourse = schoolCourseSelection();\n for (int i = 0; i < chosenSchoolCourse.getListOfStudentsPerCourse().size(); i++) {\n System.out.println((i + 1) + \") \" + chosenSchoolCourse.getListOfStudentsPerCourse().get(i));\n System.out.println(\"\");\n }\n } else if (flag.equalsIgnoreCase(\"N\")) {\n\n return;\n\n } else {\n\n System.err.println(\"Invalid Answer, type: Y or N\");\n\n }\n System.out.println(\"Do you want to check another Course? (Y / N)\");\n flag = input.nextLine();\n } while (caseCheck == false);\n }", "public static void runExercise5() {\n long count = students.stream().filter(student -> student.getAge() > 22).count();\n System.out.println(count);\n }", "public void printModuleStudentInfo() {\t\r\n\tfor(int i =0; i<(StudentList.size()); i++) {\r\n\t\tStudent temp =StudentList.get(i);\r\n\t\tSystem.out.println(temp.getUserName());\r\n\t}\t\r\n}", "public String getStudentList()\n\t{\n\t\tString courseOutput = \"\";\n\t\tint studentNum = 1;\n\t\t\n\t\tfor(Student student: classRoll)\n\t\t{\n\t\t\tcourseOutput += studentNum + \". \" + student + \"\\n\";\t\n\t\t\t\t//adds a Student to the already created string one student at a time\n\t\t\tstudentNum++;\n\t\t}\n\t\t\n\t\tcourseOutput = getCourseName() + getCourseNumber() + getInstructor() + courseOutput;\n\t\treturn courseOutput;\n\t}", "@Override\n\tpublic String toString() {\n\t\tStringBuilder stud = new StringBuilder();\n\t\tfor (Student s : students) {\n\t\t\tstud.append(\"; \" + s.getBrojIndeksa());\n\t\t}\n\t\t\n\t\tif (professor != null)\n\t\t\treturn code + \"; \" + name + \"; \" + semester + \"; \"\n\t\t\t\t\t+ yearOfStuding + \"; \" + professor.getIdNumber() + stud;\n\t\telse\n\t\t\treturn code + \"; \" + name + \"; \" + semester + \"; \"\n\t\t\t+ yearOfStuding + \"; \" + stud;\n\t}", "public static void runExercise3() {\n students.stream().filter(student -> student.getAge() > 22).limit(5).forEach(y -> System.out.println(y.getName() + \" \" + y.getAge()));\n }", "@Override\n\tpublic String toString() {\n\t\tint temp = totalFees-feesPayed;\n\t\treturn (\"Student: \" + name + \" Total Fees Payed: $\" + feesPayed + \" Total Fees Remaining: $\" + temp);\n\t}", "public List<Student> getAllStudents() throws IOException {\n\t\tstudentList = studentListGenerator.generateList(\"StudentList.txt\");\n\t\treturn studentList;\n\t}", "public static List<Student> filterExample(){\n\t\tList<Student> genderFilter = StudentDataBase.getAllStudents().stream()\n\t\t\t\t.filter(stu->stu.getGender().equals(\"female\")).collect(Collectors.toList());\n\t\treturn genderFilter;\n\t}", "public String getStudents(){\n\t\treturn this.students;\n\t}", "private static void printList(Student[] students)\r\n {\r\n for(int index = 0; index < students.length; index++)\r\n {\r\n System.out.println(students[index].toString());\r\n }\r\n }", "abstract public void showAllStudents();", "public static void show(Student[] student){\n for(int i=0;i<student.length;i++){\n System.out.printf(\"First Name: %s Last Name: %s Gender: %s Student ID: %d GPA: %,.2f Department: %s Midterm Grade: %d Final Grade: %d %n\",student[i].getFirstName(),student[i].getLastName(),student[i].getGender(),student[i].getStudentID(),student[i].getGPA(),student[i].getDepartment(),student[i].getExamGrade().getMidtermExamGrade(),student[i].getExamGrade().getFinalExamGrade());\n }\n }", "private void printAllStudentInDB(){\n ArrayList studentInformation = AdminManager.loadDBStudentInformation();\n System.out.println(\"--------------------------------------------------------------------------------------\");\n System.out.println(\"USERNAME STUDENT NAME MATRIC NUMBER GENDER NATIONALITY\");\n System.out.println(\"--------------------------------------------------------------------------------------\");\n\n for(int i=0; i<studentInformation.size();i++){\n String st = (String)studentInformation.get(i);\n StringTokenizer star = new StringTokenizer(st, \",\");\n System.out.print(String.format(\"%7s \",star.nextToken().trim()));\n String printPassword = star.nextToken().trim();\n System.out.println(String.format(\"%20s %9s %6s %s\",star.nextToken().trim(),star.nextToken().trim(),star.nextToken().trim(),star.nextToken().trim()));\n }\n System.out.println(\"--------------------------------------------------------------------------------------\\n\");\n }", "public static List<Student> studentGpa() {\n\t\t\nList<Student> stuGpa = StudentDataBase.getAllStudents().stream().filter(j->j.getGpa()>=3.9).collect(Collectors.toList());\n\t\treturn stuGpa;\n\t}", "public static void main(String[] args) {\n\t\tHashSetStud students = new HashSetStud();\n\t\tstudents.initial();\n\t\tstudents.print();\n\t\n\t\t//\n\t\t// li.them(1, 5);\n\t\t// System.out.print(\"\\nThem gia tri 5 vao vi tri 1- \");\n\t\t// li.xuat();\n\t\t//\n\t\t// li.sua(2, 6);\n\t\t// System.out.print(\"\\nSua phan tu 2 thanh 6 -\");\n\t\t// li.xuat();\n\t\t//\n\t\t// li.xoa(3);\n\t\t// System.out.print(\"\\nXoa phan tu 3 -\");\n\t\t// li.xuat();\n\t\t//\n\t\t// List<Integer> al1 = new ArrayList<Integer>();\n\t\t// al1.add(3);\n\t\t// al1.add(10);\n\t\t// al1.add(15);\n\t\t//\n\t\t// li.themSubList(al1);\n\t\t// System.out.print(\"\\nThem mot sub ArrayList -\");\n\t\t// li.xuat();\n\t\t//\n\t\t// System.out.print(\"\\nVi tri dau tien cua 3: \" + li.viTriDauTien(3));\n\t\t// System.out.print(\"\\nVi tri cuoi cung cua 5: \" + li.viTriCuoiCung(5));\n\t\t//\n\t\t// System.out.print(\"\\nTra ve sub ArrayList -\");\n\t\t// ListEx li1 = new ListEx();\n\t\t// li1.setAL(li.traVeSubList(1, 3));\n\t\t// li1.xuat();\n\t\t// MapEx hMap = new MapEx();\n\t\t// hMap.nhap();\n\t\t// System.out.print(\"\\n\");\n\t\t// hMap.xuat();\n\t\t\n//\t\tTreeSetEx tset = new TreeSetEx();\n//\t\ttset.nhapERR();\n//\t\tSystem.out.print(\"\\n\");\n//\t\ttset.xuat();\n\n\t}", "public String DisplayStudentsGPA()\n\t{\t\n\t\tString studentList= \"\";\n\t\tint i=1; //iterates the leading number for each student on the list\n\t\tfor(Student b : classRoll) //loops through classRoll adding students to the list\n\t\t{\n\t\t\tstudentList += i + \". \" + b.getStrNameFirst ( ) + \" \" + b.getStrNameLast ( ) + \" \" + b.getfGPA ( ) +\"\\n\";\n\t\t\ti++;\n\t\t}\n\t\treturn studentList= getCourseName() +\"\\n\" + getCourseNumber()+\"\\n\" + getInstructor()+ \"\\n\" + studentList;\n\t}", "public String printStudentCourses() {\r\n String s = \"Completed courses: \\n\";\r\n for (Registration r : completeCourses) {\r\n s += r.toString();\r\n }\r\n s += \"Current courses: \\n\";\r\n for (Registration r : studentRegList) {\r\n s += r.toString();\r\n }\r\n s += \"\\0\";\r\n return s;\r\n }", "public static void printN(List<Student> data){\n printN(data, data.size());\n }", "@Override\n\tpublic void printStudent() {\n\t\tSystem.out.print(\"학번\\t국어\\t영어\\t수학\\n\");\n\t\tSystem.out.println(\"=\".repeat(60));\n\t\tint nSize = scoreList.size();\n\t\tfor(int i = 0 ; i < nSize ; i++) {\n\t\t\tScoreVO vo = new ScoreVO();\n\t\t\tSystem.out.print(vo.getNum() + \"\\t\");\n\t\t\tSystem.out.print(vo.getKor() + \"\\t\");\n\t\t\tSystem.out.print(vo.getEng() + \"\\t\");\n\t\t\tSystem.out.print(vo.getMath() + \"\\n\");\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t\tList<Student> stds = Arrays.asList( \r\n\t\t\t\tnew Student (\"Jessy\", \"Java ME\", \"Chicago\"), \r\n\t\t\t\tnew Student (\"Helen\", \"Java EE\", \"Houston\"), \r\n\t\t\t\tnew Student (\"Mark\", \"Java ME\", \"Chicago\")); \r\n\t\t\r\n\t\tstds.stream()\r\n\t\t\t.collect(Collector.groupingBy(Student::getCourse))\r\n\t\t\t.forEach((src, res) -> System.out.println(scr));\r\n\r\n\t}", "@Override\n\tpublic List<Student> geStudents() {\n\t\treturn null;\n\t}", "public static void userDisplay() {\n\n String nameList = \" | \";\n for (String username : students.keySet()) {\n nameList += \" \" + username + \" | \";\n\n\n }\n System.out.println(nameList);\n// System.out.println(students.get(nameList).getGrades());\n\n }", "public static void main(String[] args) {\n\t\tstudentList obj1 = new studentList(101, \"James Henry\", \"1042 Northcut Way\");\r\n\t\tstudentList obj2 = new studentList(102, \"Frank Peterson\", \"942 James Cv\");\r\n\t\tstudentList obj3 = new studentList(103, \"Kyle Smith\", \"1502 Diana Dr\");\r\n\t\tstudentList obj4 = new studentList(104, \"Paco Suarez\", \"221 Risinger Pl\");\r\n\t\tstudentList obj5 = new studentList(105, \"Hillary Butler\", \"712 Rainbow Rd\");\r\n\t\tstudentList obj6 = new studentList(106, \"Susan Sanchez\", \"1245 Killaminjaro\");\r\n\t\tstudentList obj7 = new studentList(107, \"Peter Griffin\", \"999 Chowder St\");\r\n\t\tstudentList obj8 = new studentList(108, \"Nancy Hourglass\", \"758 Clanky Ave\");\r\n\t\tstudentList obj9 = new studentList(109, \"Luis Gonzales\", \"1236 Burnet Rd\");\r\n\t\tstudentList obj10 = new studentList(110, \"Bob Jacket\", \"494 St. Peters Blvd\");\r\n\t\t\r\n\t\t// Creating the ArrayList\r\n\t\tArrayList<studentList> list = new ArrayList<studentList>();\r\n\t\t\r\n\t\t// Add the objects to the ArrayList\r\n\t\tlist.add(obj1);\r\n\t\tlist.add(obj2);\r\n\t\tlist.add(obj3);\r\n\t\tlist.add(obj4);\r\n\t\tlist.add(obj5);\r\n\t\tlist.add(obj6);\r\n\t\tlist.add(obj7);\r\n\t\tlist.add(obj8);\r\n\t\tlist.add(obj9);\r\n\t\tlist.add(obj10);\r\n\t\t\r\n\t\t// Creating an additional line for cohesion\r\n\t\tSystem.out.println(\"---------------------------------\");\r\n\t\t\r\n\t\t// Creating the for loop to display all the information\r\n\t\tfor (studentList ob : list) {\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Student Number: \" + ob.rollNo);\r\n\t\t\tSystem.out.println(\"Student Name: \" + ob.name);\r\n\t\t\tSystem.out.println(\"Student Address: \" + ob.address);\r\n\t\t\tSystem.out.println(\"---------------------------------\");\r\n\t\t}\r\n\t\t\r\n\t}", "public void printGrades() {\r\n for(String course : courses.keySet()) {\r\n \t System.out.printf(\"Student with facN: %s has taken course %s with grade of %.2f\\n\\n\",\r\n \t\t\t this.facultyNumber, course, courses.get(course));\r\n }\r\n }", "public void printInOrder() {\n\t\tCollections.sort(students);\n\t\tSystem.out.println(\"Student Score List\");\n\t\tfor(Student student : students) {\n\t\t\tSystem.out.println(student);\n\t\t}\n\t\tSystem.out.println();\n\t}", "private void printDiscardedAnswers(){\n\t\tSystem.out.println(\"\\nDiscarded Answers\");\n\t\tfor(Student student: discardedResponses){\n\t\t\tSystem.out.println(\"Student: \"+student.toString());\n\t\t}\n\t}", "private void showStudentCourses()\r\n {\r\n \tString courseResponse = \"\";\r\n \tfor(Course course : this.getDBManager().getStudentCourses(this.studentId))\r\n \t{\r\n \t\tcourseResponse += \"Course Faculty: \" + course.getCourseName() + \", Course Number: \" + String.valueOf(course.getCourseNum()) + \"\\n\";\r\n \t}\r\n \tthis.getClientOut().printf(\"SUCCESS\\n%s\\n\", courseResponse);\r\n \tthis.getClientOut().flush();\r\n }", "public static void main(String[] args) {\n\t int[] array= {1, 2, 3, 5, 465, 2, 8, 6, 8};\n System.out.println(hasDuplicates(array));\n System.out.println(hasDuplicates2(array));\n System.out.println(hasDuplicates3(array));\n\n String s1 = \"Hello World\";\n StringBuilder sb= new StringBuilder(s1);\n String reversed = sb.reverse().toString();\n System.out.println(reversed);\n\n Student jhony = new Student(\"John\", LocalDate.of(2000, Month.MAY,17), 85);\n Student paul = new Student(\"Paul\", LocalDate.of(1999, Month.JULY,1), 90);\n Student kolya = new Student(\"Kolya\", LocalDate.of(2002, Month.APRIL,6), 70);\n Student sasha = new Student(\"Sasha\", LocalDate.of(2005, Month.NOVEMBER,24), 29);\n Student tom = new Student(\"Tom\", LocalDate.of(2001, Month.JANUARY,2), 10);\n\n List<Student> students= new ArrayList<>();\n students.add(jhony);\n students.add(paul);\n students.add(kolya);\n students.add(sasha);\n students.add(tom);\n// for (Student student:students) {\n// //if(student.getMarkJava()<50) System.out.println(student.getName());\n// if(student.getBirthday().getYear()>2000) System.out.println(student.getName());\n// }\n students.stream().filter(student -> student.getMarkJava()>50)\n .forEach(System.out::println);\n System.out.println(students.stream().filter(el -> el.getMarkJava() > 80).count());\n System.out.println(students.stream().max(Comparator.comparing(student -> student.getMarkJava())));\n System.out.println(students.stream().mapToInt(student -> student.getMarkJava()).max().getAsInt());\n System.out.println(students.stream().mapToInt(student -> student.getMarkJava()).min().getAsInt());\n System.out.println(students.stream().mapToInt(student -> student.getMarkJava()).sum());\n System.out.println(students.stream().mapToInt(student -> student.getMarkJava()).average().getAsDouble());\n System.out.println(students.stream().count());\n\n PartTimeEmployee ivan = new PartTimeEmployee(\"Ivan\",15,80);\n FullTimeEmployee vasya = new FullTimeEmployee(\"Vasya\",2,15,\"coder\");\n List<IAccounting> workers = new ArrayList<>();\n workers.add(ivan);\n workers.add(vasya);\n System.out.println(workers);\n\n }", "private static void print_Final(Gradebook gradebook, String[] flags){\n if (flags[3] != null && flags[3].equals(\"G\")){\n List<Student> studentsList = gradebook.getAllStudents();\n //Map<Student, Double>\n Map<Double, List<Student>> grades = new HashMap<Double, List<Student>>();\n Set<Double> gradeSet = new HashSet<Double>();\n\n for(Student s : studentsList){\n double grade = gradebook.getGradeStudent(s);\n List<Student> studs = grades.get(grade);\n\n if(studs == null){\n studs = new ArrayList<Student>();\n }\n\n studs.add(s);\n grades.put(grade, studs);\n gradeSet.add(grade);\n }\n\n List<Double> gradeList = new ArrayList<Double>(gradeSet);\n Collections.sort(gradeList, Collections.reverseOrder());\n\n DecimalFormat df = new DecimalFormat(\"#.####\"); //Round to 4 decimal places\n df.setRoundingMode(RoundingMode.HALF_UP);\n for(Double d : gradeList){\n\n List<Student> studs = grades.get(d);\n for(Student s : studs){\n\n System.out.println(\"(\" + s.getLast() + \", \" + s.getFirst() + \", \" + df.format(d) + \")\");\n }\n }\n } else if (flags[4] != null && flags[4].equals(\"A\")){\n //compare override class at bottom of file\n List<Student> studentsAlpha = gradebook.getAllStudents();\n Collections.sort(studentsAlpha, new Comparator<Student>() {\n @Override\n public int compare(Student o1, Student o2) {\n if ( o2.getLast().compareToIgnoreCase(o1.getLast()) == 0) {\n return o1.getFirst().compareToIgnoreCase(o2.getFirst());\n } else {\n return o1.getLast().compareToIgnoreCase(o2.getLast());\n }\n }\n });\n\n DecimalFormat df = new DecimalFormat(\"#.####\"); //Round to 4 decimal places\n df.setRoundingMode(RoundingMode.HALF_UP);\n for (Student stud: studentsAlpha) {\n System.out.println(\"(\" + stud.getLast() + \", \" + stud.getFirst() + \", \" + df.format(gradebook.getGradeStudent(stud)) + \")\");\n }\n\n }\n else{\n throw new IllegalArgumentException(\"Grade or Alphabetical flag missing.\");\n }\n return;\n }", "public static void main(String[] args) {\n\t\t\n\t\tHashSet<Student> hs = new HashSet<>();\n\t\t\n\t\ths.add(new Student(1,\"atish\",\"bsc\",2016,true));\n\t\ths.add(new Student(2,\"atul\",\"be\",2018,false));\n\t\ths.add(new Student(3,\"abhishek\",\"bca\",2019,true));\n\t\ths.add(new Student(4,\"aksahay\",\"bcs\",2020,false));\n\t\ths.add(new Student(5,\"ajay\",\"be\",2017,true));\n\t\ths.add(new Student(6,\"amit\",\"bca\",2019,false));\n\t\t\n\t\t\n\t\tArrayList<Student> placed = new ArrayList<>();\n\t\tArrayList<Student> unplaced = new ArrayList<>();\n\t\t\n\t\tIterator<Student> itr = hs.iterator();\n\t\t\n\t\twhile(itr.hasNext())\n\t\t{\n\t\t\tStudent s = itr.next();\n\t\t\tif(s.isPlaced())\n\t\t\t{\n\t\t\t\tplaced.add(s);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tunplaced.add(s);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(placed);\n\t\tSystem.out.println(unplaced);\n\n\t}", "public String toString() {\n String o = \"\";\n for (Student v : students) {\n boolean first = true;\n o += \"Student \";\n o += v.getName();\n o += \" has neighbors \";\n ArrayList<Student> ngbr = v.getNeighbors();\n for (Student n : ngbr) {\n o += first ? n.getName() : \", \" + n.getName();\n first = false;\n }\n first = true;\n o += \" with prices \";\n ArrayList<Integer> wght = v.getPrices();\n for (Integer i : wght) {\n o += first ? i : \", \" + i;\n first = false;\n }\n o += System.getProperty(\"line.separator\");\n\n }\n\n return o;\n }", "public static List<String> listOfStudentsWhoseScoreBelow(List<MyStudent> l, int score){\n\t List<String> names= l.stream().filter(e->e.getScore()<score).map(e->e.getFirstName()).collect(Collectors.toList());\n\t return names;\n\t }", "public static void main(String[] args) {\n\n ArrayList<String> students = new ArrayList<>();\n students.add(\"Sayeem\");\n students.add(\"Wagar\");\n students.add(\"Beslan\");\n students.add(\"Dawut\");\n students.add(\"Ramazan\");\n students.add(\"Mehary\");\n\n // Verify that the names: Ulku, Busra are contained in students list\n\n boolean r = students.containsAll(Arrays.asList(\"Ulku\", \"Busra\") );\n System.out.println(r);\n\n System.out.println(\"=======================================\");\n\n ArrayList<String> group1 = new ArrayList<>();\n\n // add all student names in your group\n group1.addAll( Arrays.asList(\"Muhtar\", \"Nadir\", \"Asiya\", \"Saim\"));\n\n // verify your mentor and one of your closest friend' names are contained in the list\n group1.containsAll( Arrays.asList(\"Mike\"));\n\n\n\n }", "public Student getStudents() {\n\t\treturn this.student;\n\t}", "public static void runExample() {\n students.stream().map(student -> student.getName()).forEach(System.out::println);\n }", "public static void main(String[] args) {\n\t\tFunction<Student, String> f = (s) -> {\n\t\t\tif (s.marks > 60)\n\t\t\t\treturn \"A\";\n\t\t\telse if (s.marks > 50)\n\t\t\t\treturn \"B\";\n\t\t\telse if (s.marks > 40)\n\t\t\t\treturn \"C\";\n\t\t\telse\n\t\t\t\treturn \"Fail\";\n\t\t};\n\t\t\n\t\t// Predicate is used for conditional checks and returns boolean\n\t\tPredicate<Integer> p = (i) -> i > 60;\n\t\t\n\t\t// Consumer takes an input and does not return anything\n\t\tConsumer<Student> c = (s1) -> {\n\t\t\tSystem.out.println(\"Student name : \" + s1.name);\n\t\t\tSystem.out.println(\"Student makrs : \" + s1.marks);\n\t\t\tSystem.out.println(\"Student grade : \" + f.apply(s1) + \"\\n\");\n\t\t};\n\n\t\tStudent[] st = { new Student(\"Steffy\", 78), new Student(\"George\", 44), new Student(\"Rohan\", 32),\n\t\t\t\tnew Student(\"Maria\", 54), new Student(\"Peter\", 87) };\n\t\t\n\t\tfor (Student student : st) {\n\t\t\t\n\t\t\tif(p.test(student.marks))\n\t\t\tc.accept(student);\n\t\t}\n\t}", "public void outputGrades(){\n System.out.println(\"The grades are: \\n\");\n \n //gera a saida da nota de cada aluno\n for (int student = 0; student < grades.length; student++) {\n System.out.printf(\"Student %2d: %3d\\n\", student + 1, grades[ student ]);\n }\n }", "public static void printList(ArrayList<Student> x){\n\t\tSystem.out.println(\"FIRST NAME\"+\"\\t\"+\"LAST NAME\"+\" \"+\"\\t\"+\"ID\"+\"\\t\"+\"\\t\"+\"QUIZ1\"+\"\\t\"+\"QUIZ2\"+\"\\t\"+\"PROJECT\"+\"\\t\"+\"MIDTERM\"+\"\\t\"+\"FINAL\"+\"\\t\"+\"AVERAGE\"+\"\\t\"+\"LETTER GRADE\");\n\t\tSystem.out.println(\"-------------------------------------------------------------------------------------------------------------\");\n\t\tfor(Student y:x){\n\t\t\tSystem.out.println(y);\n\t\t\tSystem.out.println();\n\t\t}\n\t\tint q1=0,q2=0,p=0,m=0,f=0,counter=0;\n\t\tdouble avg=1;\n\t\tString letter;\n\t\tfor(Student y:x){\n\t\t\tq1=q1+y.getQ1();\n\t\t\tq2=q2+y.getQ2();\n\t\t\tp=p+y.getP();\n\t\t\tm=m+y.getM();\n\t\t\tf=f+y.getF();\n\t\t\tcounter++;\n\t\t}\n\t\tif(counter!=0) {\n\t\t\tq1=q1/counter;q2=q2/counter;p=p/counter;m=m/counter;f=f/counter;\n\t\t\tavg=(q1+q2+p+m+f)/5;\n\t\t\tletter=Student.letterCalc(avg);\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println(\"\\t\"+\"\\t\"+\"\\t\"+\"\\t\"+\"AVERAGE:\"+\"\\t\"+q1+\"\\t\"+q2+\"\\t\"+p+\"\\t\"+m+\"\\t\"+f+\"\\t\"+avg+\"\\t\"+letter);\n\t\t}\n\n\t\tSystem.out.println(\"-------------------------------------------------------------------------------------------------------------\");\n\t}", "@Override\n public void onSuccess(List<Student> students) {\n for (int i = 0; i < students.size(); i++) {\n // continue == lewati\n // berarti lewati student dengan status alumni\n\n if (students.get(i).getStatus().equals(\"alumni\")) continue;\n //hanya berisi student dengan status selain alumni\n System.out.println(\"NIM : \" + students.get(i).getNim());\n System.out.println(\"Name : \" + students.get(i).getName());\n System.out.println(\"Class : \" + students.get(i).getKlas());\n System.out.println(\"Status : \" + students.get(i).getStatus());\n System.out.println();\n }\n }", "public void printStudentInfo(){\r\n System.out.println(\"Name: \" + getName());\r\n System.out.println(\"Student Id: \" + getId());\r\n printMarks();\r\n System.out.println(\"\\nAverage \" + getAverage() + \"%\");\r\n printNumberOfCoursesInEachLetterGradeCategory();\r\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tArrayList<Student2> studs = new ArrayList<>();\r\n\t\tstuds.add(new Student2(6,\"neena\"));\r\n\t\tstuds.add(new Student2(1,\"nimmy\"));\r\n\t\tstuds.add(new Student2(4,\"cookie\"));\r\n\t\t\r\n\t\tCollections.sort(studs);\r\n\t\t\r\n\t\tfor(Student2 s : studs) {\r\n\t\t\tSystem.out.println(s);\r\n\t\t}\r\n\r\n\t}", "public static List<Student> filterMaleValues(){\n\n\t\tList<Student> filterMaleExe = StudentDataBase.getAllStudents().stream()\n\t\t\t\t.filter(k->k.getGradeLevel()>=3.9)\n\t\t\t\t.filter(j->j.getGender().equals(\"male\")).collect(Collectors.toList());\n\t\treturn filterMaleExe;\n\t}", "public void printFieldInformation() {\n \t\tint isnull = 0;\n \t\tint studentsA = 0;\n \t\tint empty = 0;\n \t\tfor (int a = 0; a < 5; a++) {\n \t\t\tfor (int b = 0; b < 7; b++) {\n \t\t\t\tif (students[a][b] == null) {\n \t\t\t\t\tisnull++;\n \t\t\t\t\tSystem.out.println(a + \" / \" + b);\n \t\t\t\t} else if (students[a][b] instanceof EmptyPlace)\n \t\t\t\t\tempty++;\n \t\t\t\telse if (students[a][b] instanceof Student)\n \t\t\t\t\tstudentsA++;\n \t\t\t}\n \t\t}\n \t\tSystem.out.println(\"null: \" + isnull);\n \t\tSystem.out.println(\"empty: \" + empty);\n \t\tSystem.out.println(\"studentsA: \" + studentsA);\n \t}", "public static void main(String[] args) {\n\t\tStudent s = new Student(\"Bora\", \"Boric\", 1989, 39998, 3, 7.59);\r\n\t\tStudent s1 = new Student(\"Mika\", \"Mikic\", 1998, 39322, 1, 8.59);\r\n\t\tStudent s2 = new Student(\"Kasa\", \"Kasic\", 1991, 39299, 2, 8.94);\r\n\t\tProfesor p = new Profesor(\"Stanko\", \"Stanic\", 1980, \"Predavac\");\r\n\t\tProfesor p1 = new Profesor(\"Sasa\", \"Sasic\", 1984, \"Asistent\");\r\n\t\tp.dodajPredmet(\"Statistika\");\r\n\t\tp.dodajPredmet(\"Matematika\");\r\n\t\tp1.dodajPredmet(\"Teorija cena\");\r\n\t\tp1.dodajPredmet(\"Makroekonomija\");\r\n\t\tSystem.out.println(s.ispis());\r\n\t\tSystem.out.println(s1.ispis());\r\n\t\tSystem.out.println(s2.ispis());\r\n\t\tSystem.out.println(p.ispisi());\r\n\t\tSystem.out.println(p1.ispisi());\r\n\r\n\t}", "public static void main(String[] args) {\n\t\tStudent ivan = new Student(\"Ivan Petrov\", \"Computer Science\");\n\t\tivan.grade=5.5;\n\t\tivan.yearInCollege=2;\n\t\tivan.money=500;\n\t\tivan.age=19;\n\t\t\n\t\tStudent teodor = new Student(\"Teodor Alexiev\", \"Computer Science\");\n\t\tteodor.grade=5.25;\n\t\tteodor.yearInCollege=3;\n\t\tteodor.money=300;\n\t\tteodor.age=20;\n\t\t\n\t\tStudent irina = new Student(\"Irina Paraskelova\", \"Computer Science\");\n\t\tirina.grade = 5.65;\n\t\tirina.money=400;\n\t\tirina.age=18;\n\t\t\n\t\tStudent vasilena = new Student (\"Vasilena Kremenlieva\", \"Computer Science\");\n\t\tvasilena.grade = 5.0;\n\t\tvasilena.money=1000;\n\t\tvasilena.age=18;\n\t\t\n\t\tStudent trifon = new Student(\"Trifon Stoimenov\", \"Computer Science\");\n\t\ttrifon.grade = 5.70;\n\t\ttrifon.yearInCollege=3;\n\t\ttrifon.money = 800;\n\t\ttrifon.age=21;\n\t\t\n\t\tStudent alexander = new Student (\"Alexander Dobrikov\", \"Finance\");\n\t\talexander.grade = 4.75;\n\t\talexander.yearInCollege = 2;\n\t\talexander.money = 600;\n\t\talexander.age = 20;\n\t\t\n\t\tStudent mirela = new Student (\"Mirela Kostadinova\", \"Finance\");\n\t\tmirela.grade = 5.5;\n\t\tmirela.yearInCollege=1;\n\t\tmirela.money=100;\n\t\tmirela.age=19;\n\t\t\n\t\tStudent velizar = new Student(\"Velizar Stoyanov\", \"Finance\");\n\t\tvelizar.grade = 6.0;\n\t\tvelizar.yearInCollege = 3;\n\t\tvelizar.money = 500;\n\t\tvelizar.age = 22;\n\t\t\n\t\tStudent antoaneta = new Student(\"Antoaneta Borisova\", \"Finance\");\n\t\tantoaneta.grade = 5.30;\n\t\tantoaneta.yearInCollege = 2;\n\t\tantoaneta.money = 750;\n\t\tantoaneta.age = 19;\n\t\t\n\t\tirina.upYear();\n\t\tSystem.out.println(\"Irina is in year \"+irina.yearInCollege+\" of college.\");\n\t\t\n\t\tvasilena.receiveScholarship(5.0, 350);\n\t\tSystem.out.println(vasilena.money);\n\t\t\n\t\tStudentGroup cs1 = new StudentGroup(\"Computer Science\");\n\t\tcs1.addStudent(ivan);\n\t\tcs1.addStudent(teodor);\n\t\tcs1.addStudent(irina);\n\t\tcs1.addStudent(vasilena);\n\t\tcs1.addStudent(trifon);\n\t\tteodor.upYear();\n\t\tSystem.out.println(teodor.isDegree);\n\t\t\n\t\tcs1.addStudent(velizar);\n\t\t\n\t\tcs1.printStudentsInGroup();\n\t\tSystem.out.println(cs1.theBestStudent());\n\t\t\n\t\tcs1.emptyGroup();\n\t\tcs1.printStudentsInGroup();\n\t\t\n\t\tStudentGroup fin1 = new StudentGroup(\"Finance\");\n\t\t\n\t\tfin1.addStudent(alexander);\n\t\tfin1.addStudent(mirela);\n\t\tfin1.addStudent(velizar);\n\t\tfin1.addStudent(antoaneta);\n\t\t\n\t\tfin1.printStudentsInGroup();\n\t\t\t\n\t\t\n\t}", "private String getListofStudents() {\n List<String> ListCopy= new ArrayList<>();\n for (Map.Entry<String, User> entry : RegisteredStudents.entrySet()){\n String key = entry.getKey();\n ListCopy.add(key);\n }\n ListCopy.sort(String::compareTo);\n return (Arrays.toString(ListCopy.toArray()).replaceAll(\", \",\",\"));\n }", "void rollcall(List<Student> list) {\n List<Student> present = new ArrayList<>();\n List<Student> absent = new ArrayList<>();\n for (Student student : list) {\n if (student.isPresent())\n present.add(student);\n else\n absent.add(student);\n }\n System.out.println(\"Present: \" + present.size() + \" students\" + \"\\n\" + present);\n System.out.println(\"Absent: \" + absent.size() + \" students\" + \"\\n\" + absent);\n\n }", "public String toString(){\n\t\treturn \"The student \"+Student.getFirstName()+\" \"+Student.getFamilyName()+\" has average of \"+averageGrade();\r\n\t}", "private static long vratiBrojOdlikasa(List<StudentRecord> records) {\n\t\treturn records.stream()\n\t\t\t\t\t\t.filter(s -> s.getGrade() == 5)\n\t\t\t\t\t\t.count();\n\t}", "public List<Student> selectStudentAll() {\n\t\treturn this.studentMaper.selectStudentAll();\r\n\t}", "public String getStudentnames() {\r\n return studentnames;\r\n }", "public static List<Student> getStudents() {\n\t\tList<Student> students = new ArrayList<>();\n\t\t\n\t\t// add sample data\n\t\tstudents.add(new Student(\"James\", \"Richt\", \"jr22@email.com\"));\n\t\tstudents.add(new Student(\"Kelly\", \"Lou\", \"kl86@email.com\"));\n\t\tstudents.add(new Student(\"Lin\", \"Howe\", \"lh77@email.com\"));\n\t\t\n\t\t// return the list\n\t\treturn students;\n\t}", "public void print() {\n\t\tfor(String subj : subjects) {\n\t\t\tSystem.out.println(subj);\n\t\t}\n\t\tSystem.out.println(\"==========\");\n\t\t\n\t\tfor(StudentMarks ssm : studMarks) {\n\t\t\tSystem.out.println(ssm.student);\n\t\t\tfor(Byte m : ssm.marks) {\n\t\t\t\tSystem.out.print(m + \" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn \"StudentForList [marks=\" + Arrays.toString(marks) + \", names=\" + names + \"]\";\n\t}", "public static void main()\n {\n float m= 0;\n Scanner sc= new Scanner(System.in);\n System.out.println(\"Enter name of the student\");\n String name= sc.nextLine();\n System.out.println(\"Enter the student's roll no.\");\n int roll= sc.nextInt();\n System.out.println(\"Enter the marks of 5 subjects(Press enter after each)\");\n for(int i=1;i<=5; i++)\n {\n float m1= sc.nextFloat();\n m= m+m1;\n }\n m= (m/5);\n System.out.println(\"Student's name: \"+ name);\n System.out.println(\"Roll no.: \"+ roll);\n String stream= \"\";\n if(m>=90)\n {\n stream= \"Science with Computers\";\n }\n else if(m>=80 && m<=89)\n {\n stream= \"Science without Computers\";\n }\n else if(m>=70 && m<=79)\n {\n stream= \"Commerce with Maths\";\n }\n else if(m>=60 && m<=69)\n {\n stream= \"Commerce without Maths\";\n }\n else\n {\n stream= \"Invalid Values\";\n }\n System.out.println(stream);\n System.out.println();\n }", "public String[] getStudents() {\n\t\treturn students;\n\t}", "public String print() {\r\n\t\t\r\n\t\tString printString = new String();\r\n\t\t\r\n\t\tif(numStudents == 0) {\r\n\t\t\tSystem.out.println(\"List is empty\");\r\n\t\t\tprintString = printString + \"List is empty\";\r\n\t\t\treturn printString;\r\n\t\t}\r\n \r\n\t\tSystem.out.println(\"\\nWe have the following Students:\\n\");\r\n\t\tprintString = printString + \"\\nWe have the following Students:\\n\";\r\n\r\n\t\tfor(int i = 0; i < numStudents; i++) {\r\n\t\t\t \r\n\t\t\tString student = ((Student)list[i]).toString();\r\n\t\t\tint tuitionDue = ((Student)list[i]).tuitionDue(); \r\n\t\t\t \r\n\t\t\t System.out.println(student + \" \" + \"tuition due: \" + tuitionDue);\r\n\t\t\t printString = printString + student + \" \" + \"tuition due: \" + tuitionDue + \"\\n\";\r\n\t\t }\r\n\t\t\r\n\t\tSystem.out.println(\"--End of List--\"); \r\n\t\tprintString = printString + \"--End of List--\";\r\n\t\t\r\n\t\treturn printString;\r\n\t}", "public static void main(String[] args) {\n \n \n System.out.println(\"show firstname\");\n System.out.println(FACADE.getStudentByName(\"Anders\"));\n System.out.println(\"------------------------------------------\");\n System.out.println(\"find all students\");\n System.out.println(FACADE.getAllStudent());\n System.out.println(\"----------------------------------------\");\n System.out.println(\"assign semester\");\n System.out.println(FACADE.assignSemester(7, 1));\n System.out.println(\"-----------------------------------------\");\n System.out.println(\"show total amount of students\");\n System.out.println(FACADE.getTotalAmount());\n System.out.println(\"------------------------------------------\");\n System.out.println(\"Show student by last name\");\n System.out.println(FACADE.getLastNameByAnd(\"And\"));\n System.out.println(\"------------------------------------------\");\n System.out.println(FACADE.getNumSemStudent(\"CLcos-v14e\"));\n }", "public static void main(String[] args){\n\t\tPersonalData data1= new PersonalData(1982,01,11,234567890);\n\t\tPersonalData data2= new PersonalData(1992,10,19,876543210);\n\t\tPersonalData data3= new PersonalData(1989,04,27,928374650);\n\t\tPersonalData data4= new PersonalData(1993,07,05,819463750);\n\t\tPersonalData data5= new PersonalData(1990,11,03,321678950);\n\t\tPersonalData data6= new PersonalData(1991,11,11,463728190);\n\t\tStudent student1=new Student(\"Ali Cantolu\",5005,50,data1);\n\t\tStudent student2=new Student(\"Merve Alaca\",1234,60,data2);\n\t\tStudent student3=new Student(\"Gizem Kanca\",5678,70,data3);\n\t\tStudent student4=new Student(\"Emel Bozdere\",8902,70,data4);\n\t\tStudent student5=new Student(\"Merter Kazan\",3458,80,data5);\n\n\t\t//A course (let us call it CSE141) with a capacity of 3 is created\n\t\tCourse CSE141=new Course(\"CSE141\",3);\n\n\t\t//Any 4 of the students is added to CSE141.\n\t\tif (!CSE141.addStudent(student1)) System.out.println(student1.toString()+ \" is not added\");\n\t\tif (!CSE141.addStudent(student2)) System.out.println(student2.toString()+ \" is not added\");\n\t\tif (!CSE141.addStudent(student3)) System.out.println(student3.toString()+ \" is not added\");\n\t\tif (!CSE141.addStudent(student4)) System.out.println(student4.toString()+ \" is not added\");\n\n\n\t\t//All students of CSE141 are printed on the screen.\n System.out.println(\"\\nAll students of \"+CSE141.getCourseName()+\": \");\n CSE141.list();\n\n //The capacity of CSE141 is increased.\n CSE141.increaseCapacity();\n\n //Remaining 2 students are added to CSE141.\n\t \tCSE141.addStudent(student4);\n\t \tCSE141.addStudent(student5);\n\n\t \t//All students of CSE141 are printed on the screen.\n\t \tSystem.out.println(\"\\nAll students of \"+CSE141.getCourseName()+\": \");\n\t \tCSE141.list();\n\n\t \t//Student with ID 5005 is dropped from CSE141.\n\t \tCSE141.dropStudent(student1);\n\n\t \t//All students of CSE141 are printed on the screen.\n\t \tSystem.out.println(\"\\nAll students of \"+CSE141.getCourseName()+\": \");\n\t \tCSE141.list();\n\n\t \t//Number of students enrolled to CSE141 is printed.\n\t \tSystem.out.println(\"\\nNumber of students enrolled to \"+CSE141.getCourseName()+\": \" + CSE141.getNumberOfStudents());\n\n\t \t//Birth year of best student of CSE141 is printed on the screen. (You should use getYear() method of java.util.Date class.)\n\t \tSystem.out.println(\"\\nBirth year of best student of CSE141 is \"+CSE141.getBestStudent().getPersonalData().getBirthDate().getYear());\n\n\t \t//A new course (let us call it CSE142) is created.\n\t \tCourse CSE142=new Course(\"CSE142\");\n\n\t \t//All students currently enrolled in CSE141 are added to CSE142. (You should use getStudents() method).\n\t \tStudent[] students = CSE141.getStudents();\n\t \tfor(int i=0;i<CSE141.getNumberOfStudents();i++)\n\t \t\tCSE142.addStudent(students[i]);\n\n\t \t//All students of CSE141 are removed from the course.\n\t \tCSE141.clear();\n\n\t \t//Student with ID 5005 is dropped from CSE141 and result of the operation is printed on the screen.\n\t \tSystem.out.println(\"\\nThe result of the operation 'Student with ID 5005 is dropped from \"+CSE141.getCourseName()+\"' is: \"+CSE141.dropStudent(student1));\n\n\t \t//All students of CSE142 are printed on the screen.\n\t \tSystem.out.println(\"\\nAll students of \"+CSE142.getCourseName()+\": \");\n\t \tCSE142.list();\n\n\t \t//Best student of CSE142 is dropped from CSE142.\n\t \tCSE142.dropStudent(CSE142.getBestStudent());\n\n\t \t//All students of CSE142 are printed on the screen.\n\t \tSystem.out.println(\"\\nAll students of \"+CSE142.getCourseName()+\": \");\n\t \tCSE142.list();\n\n\t \t//GPA of youngest student of CSE142 is printed on the screen.\n\t\tSystem.out.println(\"\\nThe Youngest Student's (\"+CSE142.getYoungestStudent()+\") GPA is \"+CSE142.getYoungestStudent().GPA());\n\n\t \t//Courses CSE141 and CSE142 are printed on the screen.\n\t \tSystem.out.println(\"\\nCourse Information for \"+CSE141.getCourseName()+\":\\n\" + CSE141.toString());\n\t \tSystem.out.println(\"\\nCourse Information for \"+CSE142.getCourseName()+\":\\n\" + CSE142.toString());\n\t }", "public String toString(){\n return \"The marks for student \" + registrationNumber + \"\" + \" are \" + Arrays.toString(getMarks()) + \"\" + \"their grade is \" + totalMark() + \".\" + \" This student passed: \" + passed() + \".\";\n }", "public void printReport(){\n\t\tSystem.out.println(\"This is \" + name + \", UPENN \" + graduationYear);\n\t\tSystem.out.println(\"Their GPA is \" + GPA);\n\t\tString numCoursesString = \"\";\n\t\tif (numCoursesCompleted == 1){\n\t\t\tnumCoursesString=\"course\";\t//if the student has only taken one course, just print course\n\t\t}\n\t\telse{\n\t\t\tnumCoursesString=\"courses\"; //if the student has taken more than one course, print courses when called\n\t\t}\n\t\tSystem.out.println(\"They have taken \" + numCoursesCompleted + \" \" + numCoursesString); \n\t}", "public static void runExercise1() {\n students.stream().map(student -> student.getLastName().toUpperCase()).forEach(System.out::println);\n }", "public static void printAllRecords() {\r\n\t\tfor (int i = 0; i<studRecs.size(); i++) {\r\n\t\t\tprintRecord(i);\r\n\t\t}\r\n\t}", "public static void partitionStudentsByGpaPredicate() {\n\t\tMap<Boolean, Set<Student>> mapOfStudents = StudentDb.getAllStudents().stream()\n\t\t\t\t.collect(partitioningBy(gpaPredicate, toSet()));\n\t\t\n\t\tSystem.out.println(\"Does the Student have First Class Degree? \" + mapOfStudents);\n\t}", "public void removeStudents(ArrayList<String> toRemove) {\n\t\tfor (int i=0; i<toRemove.size(); i++) {\r\n\t\t\tif (students.indexOf(toRemove.get(i)) != -1) {\r\n\t\t\t\tSystem.out.println(\"Removing \" + toRemove.get(i) + \" from \" + day + \" \" + time);\r\n\t\t\t\tstudents.remove(toRemove.get(i));\r\n\t\t\t}\r\n\t\t}\r\n\t\t//System.out.println(\"students left: \" + students + \"\\n\");\r\n\t}", "public static int showCuisines(){\r\n int check=0;\r\n for(int i=0;i<cuisines.size();i++){\r\n System.out.println(i+\".-\"+cuisines.get(i).getName());\r\n check=1;\r\n }\r\n if(check==0)\r\n System.out.println(\"There are not food in this category\");\r\n return check;\r\n }", "public static void printListOfAssignmentsPerStudentPerCourse() {\n Scanner input = new Scanner(System.in);\n System.out.println(\"~~~~~~~~~Select the student to see the Assignments~~~~~~~~~\");\n boolean caseCheck = false;\n String flag = \"Y\";\n do {\n if (flag.equalsIgnoreCase(\"Y\")) {\n Student chosenStudent = studentSelection();\n for (int i = 0; i < chosenStudent.getListOfAssignmentsPerStudentPerCourse().size(); i++) {\n System.out.println((i + 1) + \") \" + chosenStudent.getListOfAssignmentsPerStudentPerCourse().get(i));\n System.out.println(\"\");\n }\n } else if (flag.equalsIgnoreCase(\"N\")) {\n return;\n } else {\n\n System.err.println(\"Invalid Answer, type: Y or N\");\n\n }\n System.out.println(\"Do you want to check another Student? (Y / N)\");\n flag = input.nextLine();\n } while (caseCheck == false);\n }", "public void getStudentNameStudentAsc()\n\t{\n\t\tDatabaseHandler db = new DatabaseHandler(getApplicationContext());\n\n\t\tstudent_name_studname_asc = db.getStudentNameAllEnquiryStudentAsc();\n\t\tIterator itr = student_name_studname_asc.iterator();\n\t\twhile(itr.hasNext())\n\t\t{\n\t\t\tSystem.out.println(itr.next());\n\t\t}\n\t}", "void viewStudents(Professor professor);", "public void printRegisteredClasses(String user) {\n\t\tfor (int i = 0; i < CourseManager.students.size(); i++) {\n\t\t\tif (CourseManager.students.get(i).getUsername().equals(user)) {\n\t\t\t\tfor (int j = 0; j < CourseManager.courses.size(); j++) {\n\t\t\t\t\tfor (int k = 0; k < CourseManager.courses.get(j).getStudlist().size(); k++) {\n\t\t\t\t\t\tif (CourseManager.courses.get(j).getStudlist().get(k).getUsername().equals(user)) {\n\t\t\t\t\t\t\tSystem.out.println(CourseManager.courses.get(j).getName());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static boolean displayResult() {\r\n Counseling counseling = new Counseling();\r\n List<Student> studentList = counseling.getStudentList();\r\n\r\n try {\r\n \t//If everything goes correct then a new file is created at this location with the result of counseling in it\r\n PrintWriter writer = new PrintWriter\r\n (\"C:/Users/Aakanksha/workspace/DS2/src/counseling/Result.txt\", \"UTF-8\");\r\n for(Student student: studentList) {\r\n writer.println(student.getId() + \"\\t\" +\r\n student.getName() + \"\\t\" +\r\n student.getProgramAllocated());\r\n }\r\n writer.close();\r\n return true;\r\n }\r\n catch (IOException e) {\r\n e.printStackTrace();\r\n return false;\r\n } \r\n }", "public static List<Integer> gradingStudents(List<Integer> grades) {\n\t\t int test=0;\n\t\t int p=0;\n\t\t \n\t\t for(int grade: grades) {\n\t\t\t\n\t\t\t if(((grade/5)+1)*5-grade<3 && grade>=38 ) {\n\t\t\t test = (grade/5+1)*5;\n\t\t\t\t \n\t\t\t }else {\n\t\t\t\t test=grade;\n\t\t\t }\n\t\t\t \n\t\t }\n\t\t \n\t\t System.out.println(\"test \"+test );\n\t\t \treturn new ArrayList();\n\t\t }", "public ArrayList<Student> getStudents() {\r\n\t\treturn this.students;\r\n\t}" ]
[ "0.6634284", "0.63780415", "0.6303573", "0.62274414", "0.6191456", "0.61869484", "0.6167874", "0.61558384", "0.6110793", "0.58744395", "0.58570385", "0.58530486", "0.5852727", "0.5831802", "0.5817458", "0.5813761", "0.58006346", "0.5783726", "0.577687", "0.5740923", "0.57360244", "0.57081395", "0.56970197", "0.56896037", "0.56738394", "0.5673423", "0.567051", "0.5664902", "0.5649071", "0.56457824", "0.56437856", "0.56231815", "0.5591848", "0.55892587", "0.5588571", "0.5563959", "0.5555962", "0.5550698", "0.5521378", "0.55043274", "0.5493341", "0.54516846", "0.5439254", "0.5435648", "0.54301", "0.54114264", "0.541102", "0.54004115", "0.53954965", "0.53909385", "0.53597736", "0.53469723", "0.53451496", "0.5343737", "0.53437126", "0.534227", "0.53233767", "0.5311406", "0.53025466", "0.52990127", "0.52940243", "0.52925456", "0.529253", "0.5279736", "0.5276238", "0.5269995", "0.52688885", "0.5265541", "0.52616715", "0.5261117", "0.5257384", "0.5253002", "0.5250728", "0.52448887", "0.5244149", "0.524196", "0.5239453", "0.5226598", "0.5221005", "0.5220461", "0.5218829", "0.52139676", "0.51996577", "0.51993346", "0.5194893", "0.51918674", "0.51861006", "0.51859474", "0.51844364", "0.51801085", "0.5179309", "0.51782095", "0.5164133", "0.51631325", "0.5154897", "0.5151242", "0.5150074", "0.5147283", "0.51396245", "0.5138735" ]
0.7606906
0
/Displays a menu that asks the user to choose whether to query books by Author, Genre, or Publisher
private static void queryBook(){ System.out.println("===Book Queries Menu==="); /*Display menu options*/ System.out.println("1--> Query Books by Author"); System.out.println("2--> Query Books by Genre"); System.out.println("3--> Query Books by Publisher"); System.out.println("Any other number --> Exit To Main Menu"); System.out.println("Enter menu option: "); int menu_option = getIntegerInput(); //ensures user input is an integer value switch(menu_option){ case 1: System.out.println(); queryBooksByAuthor(); break; case 2: System.out.println(); queryBooksByGenre(); break; case 3: System.out.println(); queryBooksByPublisher(); break; default: break; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void queryBooksByGenre(){\n\t\tSystem.out.println(\"===Query Books By Genre===\");\n\t\tScanner string_input = new Scanner(System.in);\n\t\t\n\t\tSystem.out.println(\"Enter Genre to Query Books by: \");\n\t\tString genre = string_input.next();\n\t\tint genre_index = getGenreIndex(genre); //returns the index of the genre entered, in ALL_GENRES\n\t\t\n\t\tif(genre_index > -1){//valid genre was entered\n\t\t\tIterator<String> iter = ALL_GENRES.get(genre_index).iterator();\n\t\t\tSystem.out.println(\"All \" + genre + \" books are: \");\n\t\t\tprintAllElements(iter);\n\t\t}\n\t}", "private static void queryBooksByPublisher(){\n\t\tSystem.out.println(\"===Query Books By Publisher===\");\n\t\tScanner string_input = new Scanner(System.in);\n\t\t\n\t\tSystem.out.println(\"Enter Publisher to Query Books by: \");\n\t\tString publisher = string_input.nextLine();\n\t\t\n\t\tif(ALL_PUBLISHERS.containsKey(publisher)){\n\t\t\tIterator<String> iter = ALL_PUBLISHERS.get(publisher).iterator();\n\t\t\tSystem.out.println(\"All books published by \" + publisher + \" are:\"); \n\t\t\tprintAllElements(iter);\n\t\t}\n\t\t\n\t\telse\n\t\t\tSystem.out.println(\"Sorry! There are no such publishers in our records!\");\n\t}", "private void displayByAuthor() {\n\t\tString authorHolder; // declares authorHolder\n\t\t\n\t\tSystem.out.println(\"Please enter author of the book you would like displayed:\");\n\t\tauthorHolder = scan.next();\n\t\tscan.nextLine();\n\t\tSystem.out.println(inventoryObject.displayByAuthor(authorHolder));\n\t\tgetUserInfo();\n\t}", "public void menu()\n {\n System.out.println(\"\\n\\t\\t============================================\");\n System.out.println(\"\\t\\t|| Welcome to the Movie Database ||\");\n System.out.println(\"\\t\\t============================================\");\n System.out.println(\"\\t\\t|| (1) Search Movie ||\");\n System.out.println(\"\\t\\t|| (2) Add Movie ||\");\n System.out.println(\"\\t\\t|| (3) Delete Movie ||\");\n System.out.println(\"\\t\\t|| (4) Display Favourite Movies ||\");\n System.out.println(\"\\t\\t|| (5) Display All Movies ||\");\n System.out.println(\"\\t\\t|| (6) Edit movies' detail ||\");\n System.out.println(\"\\t\\t|| (7) Exit System ||\");\n System.out.println(\"\\t\\t=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\");\n System.out.print( \"\\t\\tPlease insert your option: \");\n }", "private static void queryBooksByAuthor(){\n\t\tSystem.out.println(\"===Query Books By Author===\");\n\t\tScanner string_input = new Scanner(System.in);\n\t\t\n\t\tSystem.out.println(\"Enter First Name of Author to Query Books by: \");\n\t\tString author_firstname = string_input.next();\n\t\t\n\t\tSystem.out.println(\"Enter Middle Name of Author to Query Books by (Type 'null' if Author has no middlename): \");\n\t\tString author_middlename = string_input.next();\n\t\tif(author_middlename.equalsIgnoreCase(\"null\"))\n\t\t\tauthor_middlename = \"\";\n\t\t\n\t\tSystem.out.println(\"Enter Last Name of Author to Query Books by: \");\n\t\tString author_lastname = string_input.next();\n\t\t\n\t\tString author_fullname = author_firstname + \" \" + author_middlename + \" \" + author_lastname;\n\t\t\n\t\tif(ALL_AUTHORS.containsKey(author_fullname)){//if author_full_name exists in the Hashtable then print out all of the author's book titles\n\t\t\tSystem.out.println(\"Author found!\");\n\t\t\tSystem.out.println(author_fullname + \"'s list of book titles are: \"); \n\t\t\tIterator<String> iter = ALL_AUTHORS.get(author_fullname).iterator();\n\t\t\tprintAllElements(iter);\n\t\t}\n\t\telse\n\t\t\tSystem.out.println(\"Sorry Author name entered does not exist in our records\");\n\t}", "private static void menu() {\n\t\tboolean finished = false;\n\t\tdo {\n\t\t\tSystem.out.println(\n\t\t\t\t\t\"If you would like to view a current the movies on the movie list, please type \\\"all\\\" \\nIf you would like to see a list of the initial possible categories, please type \\\"categories\\\" \\n\\nTo search for films by category, please type the category, now\\nTo exit the program, just type \\\"no\\\"\");\n\t\t\tString menAns = read.nextLine();\n\t\t\tif (menAns.equalsIgnoreCase(\"all\")) {\n\t\t\t\tlistFormat();\n\t\t\t} else if (menAns.equalsIgnoreCase(\"categories\") || menAns.equalsIgnoreCase(\"cats\")) {\n\t\t\t\tcatList();\n\t\t\t} else if (menAns.equalsIgnoreCase(\"no\")) {\n\t\t\t\tfinished = true;\n\t\t\t} else {\n\t\t\t\tseachCats(menAns);\n\t\t\t}\n\t\t} while (!finished);\n\n\t}", "public void displayMenu() throws FileNotFoundException {\n\t\tfinal String BOOK_KEY = \"1234\";\n\t\tString option;\n\t\tString isbnSelection;\n\t\tString bookTitle;\n\t\tString displayBookOfType;\n\t\tint typeOfBook;\n\t\tint numOfRandomBooks;\n\t\tchar freqSelected;\n\n\t\tScanner in = new Scanner(System.in);\n\n\t\tSystem.out.printf(\"Welcome to the ABC Book Company: How may we assist you?%n\" + \"1. Checkout Book%n\"\n\t\t\t\t+ \"2. Find Books by Title%n\" + \"3. Display Books by Type%n\" + \"4. Produce Random Book List%n\"\n\t\t\t\t+ \"5. Save & Exit%n%n\");\n\n\t\tSystem.out.printf(\"Enter option: \");\n\t\toption = in.nextLine();\n\n\t\twhile (!option.equals(\"5\")) {\n\t\t\tswitch (option) {\n\t\t\tcase \"1\":\n\t\t\t\tSystem.out.printf(\"Enter the ISBN of book: \");\n\t\t\t\tisbnSelection = in.nextLine();\n\t\t\t\tcheckOutBook(isbnSelection);\n\t\t\t\tbreak;\n\t\t\tcase \"2\":\n\t\t\t\tSystem.out.printf(\"Enter the title to search for: \");\n\t\t\t\tbookTitle = in.nextLine();\n\t\t\t\tfindBookTitle(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase \"3\":\n\t\t\t\tSystem.out.printf(\"# Type%n\" + \"1. Children's Books%n\" + \"2. CookBooks%n\" + \"3. Paperbacks%n\"\n\t\t\t\t\t\t+ \"4. Periodicals%n%n\");\n\t\t\t\tSystem.out.printf(\"Enter type of book: \");\n\n\t\t\t\tdisplayBookOfType = in.nextLine();\n\t\t\t\t\n\t\t\t\tif (BOOK_KEY.contains(displayBookOfType)&&displayBookOfType.length()==1) {\n\t\t\t\t\ttypeOfBook = Integer.parseInt(displayBookOfType);\n\t\t\t\t\tif (typeOfBook == 4) {\n\t\t\t\t\t\tSystem.out.printf(\"%nEnter a frequency (D for Daily, W for Weekly, \"\n\t\t\t\t\t\t\t\t+ \"M for Monthly, B for Biweekly, or Q for Quarterly): \");\n\t\t\t\t\t\tfreqSelected = in.nextLine().charAt(0);\n\t\t\t\t\t\tshowBookType(typeOfBook, freqSelected); // displayFrequency method needed!\n\t\t\t\t\t} else {\n\t\t\t\t\t\tshowBookType(typeOfBook);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"Enter a valid book type (1-4):\\n\");\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\tcase \"4\":\n\t\t\t\tSystem.out.printf(\"Enter number of books: \");\n\t\t\t\ttry {\n\t\t\t\t\tnumOfRandomBooks = Integer.parseInt(in.nextLine());\n\t\t\t\t\tif (numOfRandomBooks <= 50 && numOfRandomBooks >= 0) {\n\t\t\t\t\t\tproduceRandomBookList(numOfRandomBooks);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.println(\"Wrong user Input. Please use an appropriate number from 1-50.\");\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tSystem.out.println(\"Wrong user Input. Please use an appropriate number from 1-50.\");\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tSystem.out.println(\"Please enter an appropriate choice (1-4):\\n\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tSystem.out.printf(\"Welcome to the ABC Book Company: How may we assist you?%n\" + \"1. Checkout Book%n\"\n\t\t\t\t\t+ \"2. Find Books by Title%n\" + \"3. Display Books by Type%n\" + \"4. Produce Random Book List%n\"\n\t\t\t\t\t+ \"5. Save & Exit%n%n\");\n\n\t\t\tSystem.out.printf(\"Enter option: \");\n\n\t\t\toption = in.nextLine();\n\t\t}\n\t\tsaveBook();\n\t\tin.close();\n\t}", "@Override\n\tpublic void showmenu() {\n\t\t\n\t\tint choice;\n \n System.out.println(\"请选择1.查询 2.退出\");\n choice=console.nextInt();\n \n switch (choice){\n \n case 1:\n Menu.searchMenu();\n break;\n default:\n \tSystem.out.println(\"感谢您使用本系统 欢迎下次使用!\");\n System.exit(0);\n }\n \n \n\t}", "public void printTheCatalog() {\n System.out.println(\"choose an option:\\n1)print all sorting by title\");\n System.out.println(\"2)print all sorting by author\\n3)print all sorting by Subject\");\n int option1 = input.nextInt();\n if (option1 == 1) {\n Collections.sort(cards, Card.OrderByTitle);\n System.out.println(\"books ordered by title: \" + cards);\n } else if (option1 == 2) {\n Collections.sort(cards, Card.OrderByAuthor);\n System.out.println(\"books ordered by Author: \" + cards);\n } else if (option1 == 3) {\n Collections.sort(cards, Card.OrderBySubject);\n System.out.println(\"books ordered by Subject: \" + cards);\n }\n }", "public static void printMenu(){\n System.out.print(\"1. List all writing groups\\n\" +\n \"2. List all the data for one writing group\\n\"+\n \"3. List all publishers\\n\"+\n \"4. List all the data for one publisher\\n\"+\n \"5. List all books\\n\"+\n \"6. List all the data for one book\\n\"+\n \"7. Insert new book\\n\"+\n \"8. Insert new publisher\\n\"+\n \"9. Remove a book\\n\"+\n \"10. Quit\\n\\n\");\n }", "public String advancedSearchBooks() {\r\n List<Books> books = new ArrayList<Books>();\r\n keywords = keywords.trim();\r\n \r\n switch (searchBy) {\r\n case \"all\":\r\n return searchBooks();\r\n case \"title\":\r\n books = findBooksByTitle(keywords);\r\n break;\r\n case \"identifier\":\r\n books = findBooksByIdentifier(keywords);\r\n break;\r\n case \"contributor\":\r\n books = findBooksByContributor(keywords);\r\n break;\r\n case \"publisher\":\r\n books = findBooksByPublisher(keywords);\r\n break;\r\n case \"year\":\r\n books = findBooksByYear(keywords);\r\n break;\r\n case \"genre\":\r\n books = findBooksByGenre(keywords);\r\n break;\r\n case \"format\":\r\n books = findBooksByFormat(keywords);\r\n break;\r\n }\r\n clearFields();\r\n\r\n if (books == null || books.isEmpty()) {\r\n books = new ArrayList<Books>();\r\n }\r\n\r\n return displayBooks(books);\r\n }", "void viewBooks();", "public void promptMenu()\n {\n Object[] options = {\"Display by Albums-First\", \"Display by Artists-First\",\n \"Search by Album Title\", \"Search by Artist Name\",\n \"Add Album to Catalog\"};\n \n String action = (String) JOptionPane.showInputDialog(null, \n \"Select an option:\", \"Music Library Menu\",\n JOptionPane.INFORMATION_MESSAGE,null,options,options[0]);\n try {\n switch(action)\n {\n case \"Display by Albums-First\" : displayByAlbums();\n break;\n case \"Display by Artists-First\" : displayByArtists();\n break;\n case \"Search by Album Title\" : searchByAlbum();\n break;\n case \"Search by Artist Name\" : searchByArtist();\n break;\n case \"Add Album to Catalog\" : addAlbum(fileName);\n break;\n default : //do nothing\n break;\n }\n }\n catch(NullPointerException e) { //NPE is thrown if user Cancels or X's.\n int quit = JOptionPane.showConfirmDialog(null, \"Do you want to quit?\",\n \"Quit Menu\",JOptionPane.YES_NO_OPTION);\n if(quit == 0)\n {\n JOptionPane.showMessageDialog(null, \"Thanks for using the library!\"); \n System.exit(0);\n }\n else\n promptMenu();\n }\n catch (FileNotFoundException e) { //for the case of addAlbum(fileName);\n System.err.println(\"Sorry, no file under the name '\" + fileName + \"' exists!\");\n System.exit(2);\n }\n promptMenu();\n }", "public void displayBook()\n\t{\n\t\tb.display();\n\t\tSystem.out.println(\"Available Books=\"+availableBooks+\"\\n\");\n\t}", "static void displayMenu(){\n\t\tSystem.out.println(\"\");\n\t\tSystem.out.println(\"Select operation:\");\n\t\tSystem.out.println(\"1-List movies\");\n\t\tSystem.out.println(\"2-Show movie details\");\n\t\tSystem.out.println(\"3-Add a movie\");\n\t\tSystem.out.println(\"4-Add an example set of 5 movies\");\n\t\tSystem.out.println(\"5-Exit\");\n\t}", "public String searchByFilter() {\n if (selectedFilter.size() != 0) {\n for (Genre filterOption : selectedFilter) {\n searchTerm = searchResultTerm;\n searchBook();\n\n System.out.println(\"CURRENT NUMBER OF BOOKS: \" + books.size());\n\n BookCollection temp = this.db.getCollectionByGenre(filterOption);\n System.out.println(\"GETTING COLLECTION FOR FILTERING: \" + temp.getCollectionName() + \" NUM OF BOOKS: \"\n + temp.getCollectionBooks().size());\n filterBookList(temp.getCollectionBooks());\n System.out.println(\"UPDATED NUMBER OF BOOKS: \" + books.size());\n }\n } else {\n searchTerm = searchResultTerm;\n searchBook();\n }\n\n return \"list.xhtml?faces-redirect=true\";\n }", "public static void main(String[] args) {\n // for testing, add books and find book using it's name\n /* Library.books.add(book1);\n Library.books.add(book2);\n Library.books.add(book3);\n System.out.println(\"Enter namer for Book:\");\n String bookName = sc.nextLine();\n \n for (int i = 0; i <3 ; i++) {\n\n if (Library.books.get(i).getName().equalsIgnoreCase(bookName)) {\n \n System.out.println(books.get(i).getName());\n System.out.println(i);\n }\n }*/\n \n do{\n choicesInMenu(menu());\n } while (goOn);\n //Library.addBook();\n //Library.showAllBooks();\n\n }", "private void executeQuery()\n {\n ResultSet rs = null;\n try\n { \n String author = (String) authors.getSelectedItem();\n String publisher = (String) publishers.getSelectedItem();\n if (!author.equals(\"Any\") && !publisher.equals(\"Any\"))\n { \n if (authorPublisherQueryStmt == null)\n authorPublisherQueryStmt = conn.prepareStatement(authorPublisherQuery);\n authorPublisherQueryStmt.setString(1, author);\n authorPublisherQueryStmt.setString(2, publisher);\n rs = authorPublisherQueryStmt.executeQuery();\n }\n else if (!author.equals(\"Any\") && publisher.equals(\"Any\"))\n { \n if (authorQueryStmt == null)\n authorQueryStmt = conn.prepareStatement(authorQuery);\n authorQueryStmt.setString(1, author);\n rs = authorQueryStmt.executeQuery();\n }\n else if (author.equals(\"Any\") && !publisher.equals(\"Any\"))\n { \n if (publisherQueryStmt == null)\n publisherQueryStmt = conn.prepareStatement(publisherQuery);\n publisherQueryStmt.setString(1, publisher);\n rs = publisherQueryStmt.executeQuery();\n }\n else\n { \n if (allQueryStmt == null)\n allQueryStmt = conn.prepareStatement(allQuery);\n rs = allQueryStmt.executeQuery();\n }\n\n result.setText(\"\");\n while (rs.next())\n {\n result.append(rs.getString(1));\n result.append(\", \");\n result.append(rs.getString(2));\n result.append(\"\\n\");\n }\n rs.close();\n }\n catch (SQLException e)\n {\n result.setText(\"\");\n while (e != null)\n {\n result.append(\"\" + e);\n e = e.getNextException();\n }\n }\n }", "private static void MainMenuRec(){\n System.out.println(\"Choose one of the following:\");\n System.out.println(\"-----------------------------\");\n System.out.println(\"1. Book room\");\n System.out.println(\"2. Check-out\");\n System.out.println(\"3. See room list\");\n System.out.println(\"4. Create a new available room\");\n System.out.println(\"5. Delete a room\");\n System.out.println(\"6. Make a room unavailable\");\n System.out.println(\"7. Make a (unavailable) room available\");\n System.out.println(\"8. Back to main menu\");\n System.out.println(\"-----------------------------\");\n }", "private void displayByTitle() {\n\t\tString titleHolder; // declares titleHolder\n\t\t\n\t\tSystem.out.println(\"Please enter title of the book you would like displayed:\");\n\t\ttitleHolder = scan.next();\n\t\tscan.nextLine();\n\t\tSystem.out.println(inventoryObject.displayByTitle(titleHolder));\n\t\tgetUserInfo();\n\t}", "private void searchDisplay()\r\n {\r\n System.out.println();\r\n System.out.println(\"------------ Search Menu ----------------\");\r\n System.out.println(\"(1) By Registration Number\");\r\n System.out.println(\"(2) By Car Make and Car Model\");\r\n System.out.println(\"(3) By Age\");\r\n System.out.println(\"(4) By Price (range)\");\r\n System.out.println(\"(5) Back to Main Menu\");\r\n }", "@SuppressWarnings(\"unchecked\")\r\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\r\n private void initComponents() {\r\n\r\n jScrollPane1 = new javax.swing.JScrollPane();\r\n jTable1 = new javax.swing.JTable();\r\n jLabel1 = new javax.swing.JLabel();\r\n btnAddBook = new javax.swing.JButton();\r\n btnEditBook = new javax.swing.JButton();\r\n btnDeleteBook = new javax.swing.JButton();\r\n btnSearchBook = new javax.swing.JButton();\r\n btnMainExit = new javax.swing.JButton();\r\n jMenuBar1 = new javax.swing.JMenuBar();\r\n booksMenu = new javax.swing.JMenu();\r\n AddBooks = new javax.swing.JMenuItem();\r\n RemoveBook = new javax.swing.JMenuItem();\r\n UpdateBook = new javax.swing.JMenuItem();\r\n SearchBook = new javax.swing.JMenuItem();\r\n BorrowBook = new javax.swing.JMenuItem();\r\n ReturnBook = new javax.swing.JMenuItem();\r\n viewsMenu = new javax.swing.JMenu();\r\n viewAllBooks = new javax.swing.JMenuItem();\r\n viewBorrwedBooks = new javax.swing.JMenuItem();\r\n viewAvailableBooks = new javax.swing.JMenuItem();\r\n searchMenu = new javax.swing.JMenu();\r\n author = new javax.swing.JMenuItem();\r\n title = new javax.swing.JMenuItem();\r\n publisher = new javax.swing.JMenuItem();\r\n\r\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\r\n setTitle(\"Available Books\");\r\n\r\n jTable1.setModel(abm);\r\n jTable1.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_ALL_COLUMNS);\r\n jScrollPane1.setViewportView(jTable1);\r\n\r\n jLabel1.setText(\"ALL BOOKS AVAILABLE\");\r\n\r\n btnAddBook.setText(\"Add\");\r\n btnAddBook.addActionListener(new java.awt.event.ActionListener() {\r\n public void actionPerformed(java.awt.event.ActionEvent evt) {\r\n btnAddBookActionPerformed(evt);\r\n }\r\n });\r\n\r\n btnEditBook.setText(\"Edit\");\r\n\r\n btnDeleteBook.setText(\"Remove\");\r\n\r\n btnSearchBook.setText(\"Search\");\r\n\r\n btnMainExit.setText(\"Exit\");\r\n\r\n booksMenu.setMnemonic('B');\r\n booksMenu.setText(\"Books\");\r\n\r\n AddBooks.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, java.awt.event.InputEvent.CTRL_MASK));\r\n AddBooks.setMnemonic('A');\r\n AddBooks.setText(\"Add Books\");\r\n booksMenu.add(AddBooks);\r\n\r\n RemoveBook.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_R, java.awt.event.InputEvent.CTRL_MASK));\r\n RemoveBook.setMnemonic('R');\r\n RemoveBook.setText(\"Remove Books\");\r\n booksMenu.add(RemoveBook);\r\n\r\n UpdateBook.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_U, java.awt.event.InputEvent.CTRL_MASK));\r\n UpdateBook.setMnemonic('U');\r\n UpdateBook.setText(\"Update Book\");\r\n booksMenu.add(UpdateBook);\r\n\r\n SearchBook.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_MASK));\r\n SearchBook.setMnemonic('c');\r\n SearchBook.setText(\"Search\");\r\n booksMenu.add(SearchBook);\r\n\r\n BorrowBook.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_B, java.awt.event.InputEvent.CTRL_MASK));\r\n BorrowBook.setMnemonic('o');\r\n BorrowBook.setText(\"Borrow Books\");\r\n booksMenu.add(BorrowBook);\r\n\r\n ReturnBook.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_R, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK));\r\n ReturnBook.setMnemonic('t');\r\n ReturnBook.setText(\"Return Book\");\r\n booksMenu.add(ReturnBook);\r\n\r\n jMenuBar1.add(booksMenu);\r\n\r\n viewsMenu.setMnemonic('V');\r\n viewsMenu.setText(\"Views\");\r\n\r\n viewAllBooks.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK));\r\n viewAllBooks.setMnemonic('l');\r\n viewAllBooks.setText(\"All Books\");\r\n viewsMenu.add(viewAllBooks);\r\n\r\n viewBorrwedBooks.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_B, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK));\r\n viewBorrwedBooks.setMnemonic('r');\r\n viewBorrwedBooks.setText(\"Borrow Books\");\r\n viewsMenu.add(viewBorrwedBooks);\r\n\r\n viewAvailableBooks.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_L, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK));\r\n viewAvailableBooks.setMnemonic('v');\r\n viewAvailableBooks.setText(\"Available Books\");\r\n viewsMenu.add(viewAvailableBooks);\r\n\r\n jMenuBar1.add(viewsMenu);\r\n\r\n searchMenu.setMnemonic('S');\r\n searchMenu.setText(\"Search\");\r\n\r\n author.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.CTRL_MASK));\r\n author.setMnemonic('u');\r\n author.setText(\"Author\");\r\n searchMenu.add(author);\r\n\r\n title.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_T, java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.CTRL_MASK));\r\n title.setMnemonic('T');\r\n title.setText(\"Title\");\r\n searchMenu.add(title);\r\n\r\n publisher.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_P, java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.CTRL_MASK));\r\n publisher.setMnemonic('P');\r\n publisher.setText(\"Publisher\");\r\n searchMenu.add(publisher);\r\n\r\n jMenuBar1.add(searchMenu);\r\n\r\n setJMenuBar(jMenuBar1);\r\n\r\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\r\n getContentPane().setLayout(layout);\r\n layout.setHorizontalGroup(\r\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\r\n .addGroup(layout.createSequentialGroup()\r\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 1281, Short.MAX_VALUE)\r\n .addContainerGap())\r\n .addGroup(layout.createSequentialGroup()\r\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\r\n .addComponent(btnAddBook, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE)\r\n .addGap(48, 48, 48)\r\n .addComponent(btnEditBook, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)\r\n .addGap(34, 34, 34)\r\n .addComponent(btnDeleteBook)\r\n .addGap(42, 42, 42)\r\n .addComponent(btnSearchBook)\r\n .addGap(35, 35, 35)\r\n .addComponent(btnMainExit)\r\n .addGap(277, 277, 277))\r\n .addGroup(layout.createSequentialGroup()\r\n .addGap(457, 457, 457)\r\n .addComponent(jLabel1)\r\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\r\n );\r\n layout.setVerticalGroup(\r\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\r\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\r\n .addContainerGap()\r\n .addComponent(jLabel1)\r\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 9, Short.MAX_VALUE)\r\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 231, javax.swing.GroupLayout.PREFERRED_SIZE)\r\n .addGap(12, 12, 12)\r\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\r\n .addComponent(btnAddBook)\r\n .addComponent(btnEditBook)\r\n .addComponent(btnDeleteBook)\r\n .addComponent(btnSearchBook)\r\n .addComponent(btnMainExit))\r\n .addGap(6, 6, 6))\r\n );\r\n\r\n pack();\r\n }", "private int displayAppMenu() {\n\t\tint inputOption = -1;\n\t\tboolean isContinue = true;\n\t\tSystem.out.printf(\"Enter a selection from the following menu:\\r\\n\"\n\t\t\t\t+ \"1. Enter a new book\\r\\n\"\n\t\t\t\t+ \"2. Modify the book details. Enter the book isbn number\\r\\n\" \n\t\t\t\t+ \"3. Find a book by isbn number\\r\\n\"\n\t\t\t\t+ \"4. Display list of all books\\r\\n\\n\" \n\t\t\t\t+ \"5. Add a new user\\r\\n\" \n\t\t\t\t+ \"6. Modify user details\\r\\n\"\n\t\t\t\t+ \"7. Find a user by name\\r\\n\" \n\t\t\t\t+ \"8. Display all users\\r\\n\\n\"\n\t\t\t\t+ \"9. Add a loan. Link a user name to a book by isbn number\\r\\n\"\n\t\t\t\t+ \"10. Modify a loan. Loan is identified by isbn number\\r\\n\"\n\t\t\t\t+ \"11. Find a loan. Loan is identified by isbn number\\r\\n\" \n\t\t\t\t+ \"12. Display all loans\\r\\n\\n\"\n\t\t\t\t+ \"13. Delete a book\\r\\n\"\n\t\t\t\t+ \"14. Delete a user\\r\\n\" \n\t\t\t\t+ \"15. Delete a loan\\r\\n\\n\"\n\t\t\t\t+ \"0. Exit program\");\n\n\t\twhile (isContinue) {\n\t\t\tif (input.hasNextInt()) {\n\t\t\t\tinputOption = input.nextInt();\n\t\t\t\tisContinue = false;\n\n\t\t\t} else if (!input.hasNextInt()) {\n\n\t\t\t\tSystem.out.println(\"Please input a Integer\");\n\t\t\t\tinput.nextLine();\n\t\t\t}\n\t\t}\n\t\tinput.nextLine(); // clean up the input stream\n\t\treturn inputOption;\n\t}", "private void displayMenu()\r\n {\r\n System.out.println();\r\n System.out.println(\"--------- Main Menu -------------\");\r\n System.out.println(\"(1) Search Cars\");\r\n System.out.println(\"(2) Add Car\");\r\n System.out.println(\"(3) Delete Car\");\r\n System.out.println(\"(4) Exit System\");\r\n System.out.println(\"(5) Edit Cars\");\r\n }", "private void displayMenu() {\n\t\tSystem.out.println(\"********Loan Approval System***********\");\n\t\tSystem.out.println(\"\\n\");\n\t\tSystem.out.println(\n\t\t\t\t\"Choose the following options:\\n(l)Load Applicaitons\\n(s)Set the Budget\\n(m)Make a decision\\n(p)Print\\n(u)Update the application\");\n\n\t}", "public Books getBooks(String title,String authors,String isbn,String publisher);", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.search_gen_menu, menu);\r\n\t\tFile savedSelectedCourses = new File(getFilesDir(),\r\n\t\t\t\t\"savedSelectedCourses.txt\");\r\n\t\tMenuItem item = menu.findItem(R.id.UserTableSearch);\r\n\t\tif (savedSelectedCourses.length() > 0) {\r\n\t\t\titem.setTitle(\"Your timetable\");\r\n\t\t} else {\r\n\t\t\titem.setTitle(\"Create Timetable\");\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public void viewLibraryBooks(){\n\t\tIterator booksIterator = bookMap.keySet().iterator();\n\t\tint number, i=1;\n\t\tSystem.out.println(\"\\n\\t\\t===Books in the Library===\\n\");\n\t\twhile(booksIterator.hasNext()){\t\n\t\t\tString current = booksIterator.next().toString();\n\t\t\tnumber = bookMap.get(current).size();\n\t\t\tSystem.out.println(\"\\t\\t[\" + i + \"] \" + \"Title: \" + current);\n\t\t\tSystem.out.println(\"\\t\\t Quantity: \" + number + \"\\n\");\t\t\t\n\t\t\ti += 1; \n\t\t}\n\t}", "private void displayMenu() {\r\n System.out.println(\"\\nSelect an option from below:\");\r\n System.out.println(\"\\t1. View current listings\");\r\n System.out.println(\"\\t2. List your vehicle\");\r\n System.out.println(\"\\t3. Remove your listing\");\r\n System.out.println(\"\\t4. Check if you won bid\");\r\n System.out.println(\"\\t5. Save listings file\");\r\n System.out.println(\"\\t6. Exit application\");\r\n\r\n }", "private void printMovieMenu(){\n\t\tprint(\"Please choose from the options below\"+System.lineSeparator(), \"1.Search by Actor\", \"2.Search by Title\", \"3.Search by Genre\",\"4.Back to Login Menu\");\n\t}", "public String searchBooks() {\r\n if (keywords.isEmpty()) {\r\n return \"advanced-search\";\r\n }\r\n\r\n keywords = keywords.trim();\r\n \r\n //Get list of all the queries\r\n List<List<Books>> listOfLists = new ArrayList<List<Books>>();\r\n listOfLists.add(findBooksByGenre(keywords));\r\n listOfLists.add(findBooksByIdentifier(keywords));\r\n listOfLists.add(findBooksByContributor(keywords));\r\n listOfLists.add(findBooksByFormat(keywords));\r\n listOfLists.add(findBooksByPublisher(keywords));\r\n listOfLists.add(findBooksByTitle(keywords));\r\n listOfLists.add(findBooksByYear(keywords));\r\n\r\n clearFields();\r\n\r\n List<Books> books = new ArrayList<Books>();\r\n\r\n //Filter out useless data\r\n List<Books> tempBookList;\r\n for (int cntr = 0; cntr < listOfLists.size(); cntr++) {\r\n tempBookList = listOfLists.get(cntr);\r\n\r\n if (tempBookList == null) {\r\n continue;\r\n }\r\n\r\n if (tempBookList.isEmpty()) {\r\n continue;\r\n }\r\n\r\n books.addAll(tempBookList);\r\n }\r\n\r\n //Remove duplicates\r\n Set<Books> bookSet = new HashSet<Books>();\r\n bookSet.addAll(books);\r\n books.clear();\r\n books.addAll(bookSet);\r\n\r\n return displayBooks(books);\r\n }", "private void displayBookChoice(int n) throws IOException\n {\n System.out.println(\"Your choice is \"+genre[n]);\n System.out.println(\"Press Enter to see our \"+genre[n]+\" collection!\");\n br.readLine();\n System.out.println(\"Your choice of books includes:\");\n System.out.println();\n System.out.println(\"Code \\t\"+\"Book Name\"+Spacebar.spaces(70-9)+\"\\tAuthor\"+Spacebar.spaces(25-6)+\"\\tGenre\"+Spacebar.spaces(15-5));\n System.out.println();\n for (int i=0; i<linecount; i++)\n {\n if(book[i].genre.trim().equalsIgnoreCase(genre[n].trim()))\n System.out.println(book[i].code +\"\\t\"+book[i].name+\"\\t\"+book[i].author+\"\\t\"+book[i].genre);\n }\n }", "private void printMenu() {\n\t\tSystem.out.printf(\"\\n********** MiRide System Menu **********\\n\\n\");\n\n\t\tSystem.out.printf(\"%-30s %s\\n\", \"Create Car\", \"CC\");\n\t\tSystem.out.printf(\"%-30s %s\\n\", \"Book Car\", \"BC\");\n\t\tSystem.out.printf(\"%-30s %s\\n\", \"Complete Booking\", \"CB\");\n\t\tSystem.out.printf(\"%-30s %s\\n\", \"Display ALL Cars\", \"DA\");\n\t\tSystem.out.printf(\"%-30s %s\\n\", \"Search Specific Car\", \"SS\");\n\t\tSystem.out.printf(\"%-30s %s\\n\", \"Search Available Cars\", \"SA\");\n\t\tSystem.out.printf(\"%-30s %s\\n\", \"Seed Data\", \"SD\");\n\t\tSystem.out.printf(\"%-30s %s\\n\", \"Load Cars\", \"LC\");\n\t\tSystem.out.printf(\"%-30s %s\\n\", \"Exit Program\", \"EX\");\n\t\tSystem.out.println(\"\\nEnter your selection: \");\n\t\tSystem.out.println(\"(Hit enter to cancel any operation)\");\n\t}", "public void showMenu() {\n\t\tSystem.out.println(\"Please, choose one option!\");\n\t\tSystem.out.println(\"[ 1 ] - Highest Company Capital\");\n\t\tSystem.out.println(\"[ 2 ] - Lowest Company Capital\");\n\t\tSystem.out.println(\"[ 3 ] - Best Investor of the Day\");\n\t\tSystem.out.println(\"[ 4 ] - Worst Investor of the Day\");\n\t\tSystem.out.println(\"[ 0 ] - Exit\");\n\t}", "public static void main(String[] args) {\n\t\tint choice;\n\t\tScanner s=new Scanner(System.in);\n\t\tdatabase db=new database();\n\t\tchar c;\n\t\t\n\t\tdo {\n\t\t\n\t\tSystem.out.println(\"press 1 to view all books\");\n\t\tSystem.out.println(\"press 2 to search book by title\");\n\t\tSystem.out.println(\"press 3 to insert a book\");\n\t\tSystem.out.println(\"press 4 to delete book\");\n\t\tSystem.out.println(\"press 5 to update the book\");\n\t\tSystem.out.println(\"press 6 to exit\");\n\t\t\n\t\tchoice=s.nextInt();\n\t\tswitch(choice)\n\t\t{\n\t\tcase 1:\n\t\t\t\n\t\t\tdb.showDetails();\n\t\t\t break;\n\t\tcase 2:\n\t\t\tSystem.out.println(\"enter the title of book\");\n\t\t\tString name=s.next();\n\t\t\tdb.viewByname(name);\n\t\t\tbreak;\n\t\t\t\n\t\tcase 3:\n\t\t System.out.println(\"enter the book id\");\n\t\t int id1=s.nextInt();\n\t\t System.out.println(\"enter the book name\");\n\t\t String name1=s.next();\n\t\t System.out.println(\"enter the author name\");\n\t\t String author=s.next();\n\t\t System.out.println(\"enter the book price\");\n\t\t double price=s.nextDouble();\n\t\t Book ib=new Book(id1,name1,author,price);\n\t\t db.insert(ib);\n\t\t \n\t\t break;\n\t\t \n\t\tcase 4:\n\t\t\tSystem.out.println(\"enter the id of the book you want to delete\");\n\t\t\tint id9=s.nextInt();\n\t\t\tdb.delete(id9);\n\t\t\t\n\t\t\tbreak;\n\t\t\t\n\t\t\t\n\t\t\t\n\t\tcase 5:\tSystem.out.println(\"enter the id of the book you want to update\");\n\t\t int id5=s.nextInt();\n\t\t System.out.println(\"enter the new price\");\n\t\t double price1=s.nextDouble();\n\t\t \n\t\t db.update(id5,price1);\n\t\t System.out.println(\"updated successfully\");\n\t\t\t\n\t\tcase 6:\n\t\t\tdefault:\n\t\t\t \n\t\t\tbreak;\n\t\t\t\n\t\t\t\n\t\t}\n\t\tSystem.out.println(\"press y for menu:\");\n\t\tc=s.next().charAt(0);\n\t\t\n\t\t\n\t\t\n\n\t}while(c=='Y' || c=='y');\n\n}", "private int mainMenu(){\n System.out.println(\" \");\n System.out.println(\"Select an option:\");\n System.out.println(\"1 - See all transactions\");\n System.out.println(\"2 - See all transactions for a particular company\");\n System.out.println(\"3 - Detailed information about a company\");\n System.out.println(\"0 - Exit.\");\n\n return getUserOption();\n }", "public String displayBooks(List<Books> bookList) {\r\n if (bookList.size() == 1) {\r\n productBB.setBook(bookList.get(0));\r\n return \"product-page\";\r\n } else {\r\n resultBB.setBookList(bookList);\r\n return \"results\";\r\n }\r\n }", "public void displayMenu() {\n\t\tSystem.out.println(\"\\n1 to see vehicles in a date interval\");\n\t\tSystem.out.println(\"2 to see a specific reservation\");\n\t\tSystem.out.println(\"3 to see all reservations\");\n\t\tSystem.out.println(\"9 to exit\\n\");\n\t\ttry {\n\t\t\tString in = reader.readLine();\n\t\t\tswitch (in) {\n\t\t\tcase \"1\":\n\t\t\t\tdisplayCarsInInterval();\n\t\t\t\tbreak;\n\t\t\tcase \"2\":\n\t\t\t\tdisplaySpecificBooking();\n\t\t\t\tbreak;\n\t\t\tcase \"3\":\n\t\t\t\tdisplayBookings();\n\t\t\t\tbreak;\n\t\t\tcase \"9\":\n\t\t\t\tSystem.out.println(\"Client application terminated\");\n\t\t\t\tSystem.exit(0);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tSystem.out.println(\"Please insert a valid number\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Unexpected problem with reading your input, please try again.\");\n\t\t}\n\t\tdisplayMenu();\n\t}", "public static void main(String[] args) {\n\t\ttry{\r\n\t\t\t//establish connection to server\r\n\t\t\t\r\n\t\t\tConnection myConn = DriverManager.getConnection(\"jdbc:mysql://127.0.0.1:3306/library\", \"root\", \"Notgoaway00\");\r\n\t\t\t//get variables I'll need to run menu\r\n\t\t\t\r\n\t\t\tString input;\r\n\t\t\tScanner sc = new Scanner(System.in);\r\n\t\t\t\r\n\t\t\t//menu loop\r\n\t\t\t\r\n\t\t\twhile(true){\r\n\t\t\t\t//display menu\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.println(\"Please choose an option from the menu:\");\r\n\t\t\t\tSystem.out.println(\"A. Create a table\");\r\n\t\t\t\tSystem.out.println(\"B. Add an entry/entries\");\r\n\t\t\t\tSystem.out.println(\"C. Delete an entry/entries\");\r\n\t\t\t\tSystem.out.println(\"D. List a table\");\r\n\t\t\t\tSystem.out.println(\"1. Add a new book to the library\");\r\n\t\t\t\tSystem.out.println(\"2. Add a new user\");\r\n\t\t\t\tSystem.out.println(\"3. List library users with books they checked out\");\r\n\t\t\t\tSystem.out.println(\"4. Check out a book\");\r\n\t\t\t\tSystem.out.println(\"5. Return a book\");\r\n\t\t\t\tSystem.out.println(\"6. Exit\");\r\n\t\t\t\t\r\n\t\t\t\t//get and process choice\r\n\t\t\t\t\r\n\t\t\t\tinput = sc.nextLine();\r\n\t\t\t\t\r\n\t\t\t\tswitch(input){\r\n\t\t\t\tcase \"A\": createTable(myConn); break;\r\n\t\t\t\tcase \"B\": insert(myConn); break; \r\n\t\t\t\tcase \"C\": delete(myConn); break;\r\n\t\t\t\tcase \"D\": listTable(myConn); break;\r\n\t\t\t\tcase \"1\": addBook(myConn); break;\r\n\t\t\t\tcase \"2\": addUser(myConn); break;\r\n\t\t\t\tcase \"3\": listCheckedOut(myConn); break;\r\n\t\t\t\tcase \"4\": checkOut(myConn); break;\r\n\t\t\t\tcase \"5\": returnBook(myConn); break;\r\n\t\t\t\tcase \"6\": myConn.close(); sc.close(); exit(); break;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "private static void printDocumentMenuLogic() {\n\n\t\t// Check users exist\n\t\tif(users.size() == 0) {\n\t\t\tSystem.out.println(\"No users created! Please create one before using this menu.\");\n\t\t\tmenuHandler.waitOnKey(keyMsg);\n\t\t\treturn;\n\t\t}\n\n\t\tmenuHandler.prettyPrintUsers(users, numColumns);\n\t\tint userChoice = menuHandler.intRangeInput(\"Please input a number in range [0, \" + (users.size() - 1) + \"]\", 0, users.size() - 1);\n\n\t\tVDMSet documentSet = users.get(\"User\" + userChoice).getDocumentList();\n\n\t\t// Check documents exist\n\t\tif(documentSet.size() == 0) {\n\t\t\tSystem.out.println(\"No documents available to print! Please add documents to the user before printing.\");\n\t\t\tmenuHandler.waitOnKey(keyMsg);\n\t\t\treturn;\n\t\t} \n\n\t\t// Find documents that are in the selected user's documents\n\t\tTreeMap<String, Document> userDocuments = new TreeMap<String, Document>();\n\t\tfor(Map.Entry<String, Document> entry : documents.entrySet()) {\n\n\t\t\tif(users.get(\"User\" + userChoice).getDocumentList().contains(entry.getValue())) userDocuments.put(entry.getKey(), entry.getValue());\n\t\t}\n\n\t\tmenuHandler.prettyPrintDocuments(userDocuments, numColumns);\n\n\t\t// Await valid document input\n\t\tint docChoice;\n\t\tdo {\n\t\t\tdocChoice = menuHandler.intInput(\"Please input a number seen above.\");\n\t\t} while(!userDocuments.containsKey(\"Doc\" + docChoice));\n\n\t\tDocument toPrint = documents.get(\"Doc\" + docChoice);\n\n\t\t// Check printers available for the chosen document\n\t\tTreeMap<String, Printer> availablePrinters = checkPrinterAvailability(toPrint);\n\t\t\n\t\t// No printer can print the chosen document\n\t\tif(availablePrinters.size() == 0) {\n\t\t\tmenuHandler.waitOnKey(keyMsg);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// List available printers and await user input\n\t\twhile(true) {\n\t\t\tmenuHandler.prettyPrintPrinters(availablePrinters, 1);\n\n\t\t\t// Await valid printer input\n\t\t\tint printerChoice;\n\t\t\tdo {\n\t\t\t\tprinterChoice = menuHandler.intInput(\"Please input a number seen above.\");\n\t\t\t} while(!availablePrinters.containsKey(\"Printer\" + printerChoice));\n\n\t\t\t// Check user balance\n\t\t\tdouble totalCost = checkUserBalance(users.get(\"User\" + userChoice), toPrint, printers.get(\"Printer\" + printerChoice));\n\t\t\tif(totalCost != 0) {\n\t\t\t\tSystem.out.println(\"Not enough balance to print, needed: \" + totalCost);\n\t\t\t\tmenuHandler.waitOnKey(keyMsg);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Confirm pages to print to user\n\t\t\tint numPages = printers.get(\"Printer\" + printerChoice).numPagesToPrint(toPrint).intValue();\n\t\t\tboolean userConfirmation = menuHandler.inputYesNo(\"Can print \" + numPages + \"/\" + toPrint.getPagesLeft() + \". Confirm?\");\n\n\t\t\tif(userConfirmation) {\n\t\t\t\tprinters.get(\"Printer\" + printerChoice).print(toPrint, users.get(\"User\" + userChoice));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "private void displayBook() {\n NumberFormat formatter = NumberFormat.getCurrencyInstance();\n\n System.out.println(\"Book title: \" + getTitle());\n System.out.println(\"Book author: \" + getAuthor());\n System.out.println(\"Book description: \" + getDescription());\n System.out.println((\"The price is: \" + formatter.format(getPrice())));\n if (isInStock()) {\n System.out.println(\"Currently the book is in stock.\");\n }\n else {\n System.out.println(\"Currently the book is not in stock.\");\n }\n System.out.println();\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.each_book, menu);\n\t\treturn true;\n\t}", "public void searchOptions()\n {\n System.out.println(\"\\n\\t\\t:::::::::::::::::::::::::::::::::\");\n System.out.println(\"\\t\\t| Select Options Below : |\");\n System.out.println(\"\\t\\t:::::::::::::::::::::::::::::::::\");\n System.out.println(\"\\t\\t| [1] Search by - Title |\");\n System.out.println(\"\\t\\t| [2] Search by - Directors |\");\n System.out.println(\"\\t\\t| [3] Back To Menu |\");\n System.out.println(\"\\t\\t=================================\");\n System.out.print(\"\\t\\t Input the option number : \"); \n }", "private void printAvailableBooks() {\n\t\t\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.user_book, menu);\n return true;\n }", "private void displayMenu() {\n System.out.println(\"\\nSelect from:\");\n System.out.println(\"\\t1 -> add item to to-do list\");\n System.out.println(\"\\t2 -> remove item from to-do list\");\n System.out.println(\"\\t3 -> view to-do list\");\n System.out.println(\"\\t4 -> save work room to file\");\n System.out.println(\"\\t5 -> load work room from file\");\n System.out.println(\"\\t6 -> quit\");\n }", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tHashMap<String,Book> hM = IOUtils.restoreBooks(\"BooksCollection\");\n\t\tboolean exitLoop = false;\n\t\t\n\t\twhile(!exitLoop) {\n\t\t\ttry {\n\t\t\t\tSystem.out.println(\"-----Books collection menu-----\");\n\t\t\t\tSystem.out.println(\"1. Add new book\\n2. Display books\\n10. Exit program\"\n\t\t\t\t\t\t+ \"\\n\\nEnter your choice\");\n\t\t\t\tint choice = sc.nextInt();\n\t\t\t\t\n\t\t\t\tswitch (choice) {\n\t\t\t\t case 1: \n\t\t\t\t\t//String title, Category cat, double price, String author, LocalDate dt, int quantity\n\t\t\t\t\t System.out.println(\"Enter book information(title,category,price\"\n\t\t\t\t\t \t\t+ \",author,publish date,quantity)\");\n\t\t\t\t\t sc.nextLine();\n\t\t\t\t\t String name = sc.nextLine();\n\t\t\t\t\t Category c = Category.valueOf(sc.nextLine().toUpperCase());\n\t\t\t\t\t double p = sc.nextDouble();\n\t\t\t\t\t sc.nextLine();\n\t\t\t\t\t String a = sc.nextLine();\n\t\t\t\t\t LocalDate d = parse(sc.nextLine());\n\t\t\t\t\t int q = sc.nextInt();\n\t\t\t\t\t \n\t\t\t\t\t Book newBook = new Book(name, c, p, a, d, q);\n\t\t\t\t\t \n\t\t\t\t\t if(hM.containsKey(newBook.getTitle())) {\n\t\t\t\t\t\t throw new InvalidBookException(\"Book already exists\");\n\t\t\t\t\t }\n\t\t\t\t\t \n\t\t\t\t\t hM.put(newBook.getTitle(), newBook);\n\t\t\t\t\t System.out.println(\"Book inserted : \" + newBook);\n\t\t\t\t\t break;\n\t\t\t\t\t\n\t\t\t\t case 2:\n\t\t\t\t \t\tfor(Book b : hM.values()) {\n\t\t\t\t \t\t\tSystem.out.println(b);\n\t\t\t\t \t\t}\n\t\t\t\t \t\tbreak;\n\t\t\t\t case 10:\t\n\t\t\t\t \t\texitLoop = true;\n\t\t\t\t \t\tbreak;\n\t\t\t\t default:\n\t\t\t\t \t\tSystem.out.println(\"Invalid input\");\n\t\t\t\t}\n\t\t\t} catch(Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tsc.nextLine();\n\t\t} \n\t\t\n\t\tIOUtils.storeBooks(hM, \"BooksCollection\");\n\t\tSystem.out.println(\"Book stored\");\n\t\tsc.close();\n\t}", "private void showAuthorDetails()\n {\n String message = \"Author: Kyle Russell\\nUniversity: Auckland University of Technology\\nContact: specialk.jn@gmail.com\";\n JOptionPane.showMessageDialog(null, message, \"Author information\", JOptionPane.INFORMATION_MESSAGE);\n }", "private static void menu()\r\n\t{\r\n\t\tSystem.out.println(\"0. ** FOR INSTRUCTOR **\");\r\n\t\tSystem.out.println(\" Seed 5 URLs, set 3 keywords, creates 1000 Producers and 10 Consumers\");\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"1. Add seed url\");\r\n\t\tSystem.out.println(\"2. Add consumer (Parser)\");\r\n\t\tSystem.out.println(\"3. Add producer (Fetcher)\");\r\n\t\tSystem.out.println(\"4. Add keyword search\");\r\n\t\tSystem.out.println(\"5. Print stats\");\r\n\t}", "void availableBooks(){\n\t\tSystem.out.println(\")))))Available books((((((\");\n\t\tfor(int i=0;i<books.length;i++){\n\t\t\tString book=books[i];\n\t\t\tif(book==null){\n\t\t\tcontinue;\n\t\t}\n\t\t\tSystem.out.println(\"*\"+books[i]);\n\t\t}\n\t\t\n\t}", "public void mainMenu() {\n\n System.out.println(\"\\n HOTEL RESERVATION SYSTEM\");\n System.out.println(\"+------------------------------------------------------------------------------+\");\n System.out.println(\" COMMANDS:\");\n System.out.println(\" - View Tables\\t\\t(1)\");\n System.out.println(\" - Add Records\\t\\t(2)\");\n System.out.println(\" - Update Records\\t(3)\");\n System.out.println(\" - Delete Records\\t(4)\");\n System.out.println(\" - Search Records\\t(5)\");\n System.out.println(\"+------------------------------------------------------------------------------+\");\n System.out.print(\" > \");\n }", "@FXML\n\t private void loadbookinfo(ActionEvent event) {\n\t \tclearbookcache();\n\t \t\n\t \tString id = bookidinput.getText();\n\t \tString qu = \"SELECT * FROM BOOK_LMS WHERE id = '\" + id + \"'\";\n\t ResultSet rs = dbhandler.execQuery(qu);\n\t Boolean flag = false;\n\t \n\t try {\n while (rs.next()) {\n String bName = rs.getString(\"title\");\n String bAuthor = rs.getString(\"author\");\n Boolean bStatus = rs.getBoolean(\"isAvail\");\n\n Bookname.setText(bName);\n Bookauthor.setText(bAuthor);\n String status = (bStatus) ? \"Available\" : \"Not Available\";\n bookstatus.setText(status);\n\n flag = true;\n }\n\n if (!flag) {\n Bookname.setText(\"No Such Book Available\");\n }\n\n } catch (SQLException ex) {\n Logger.getLogger(MainController.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public static void displayMenu() {\r\n System.out.print(\"\\nName Saver Server Menu\\n\\n\"\r\n +\"1. Add a name\\n2. Remove a name\\n3. List all names\\n\"\r\n +\"4. Check if name recorded\\n5. Exit\\n\\n\"\r\n +\"Enter selection [1-5]:\");\r\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu_book_detail, menu);\n return true;\n }", "private static void displayRepoMenu() {\n\t\tSystem.out.println(\"\\t Repo Menu Help \\n\" \n\t\t\t\t+ \"====================================\\n\"\n\t\t\t\t+ \"su <username> : To subcribe users to repo \\n\"\n\t\t\t\t+ \"ci: To check in changes \\n\"\n\t\t\t\t+ \"co: To check out changes \\n\"\n\t\t\t\t+ \"rc: To review change \\n\"\n\t\t\t\t+ \"vh: To get revision history \\n\"\n\t\t\t\t+ \"re: To revert to previous version \\n\"\n\t\t\t\t+ \"ld : To list documents \\n\"\n\t\t\t\t+ \"ed <docname>: To edit doc \\n\"\n\t\t\t\t+ \"ad <docname>: To add doc \\n\"\n\t\t\t\t+ \"dd <docname>: To delete doc \\n\"\n\t\t\t\t+ \"vd <docname>: To view doc \\n\"\n\t\t\t\t+ \"qu : To quit \\n\" \n\t\t\t\t+ \"====================================\\n\");\n\t}", "private String printMainMenu() {\n System.out.println(\"Please make a selection:\");\n System.out.println(\"1: List all tools\");\n System.out.println(\"2: Search for tool by toolName\");\n System.out.println(\"3: Search for tool by toolID\");\n System.out.println(\"4: Check item quantity\");\n System.out.println(\"5: Decrease item quantity\");\n System.out.println(\"6: Make New Order/Append Today's Order\");\n System.out.println(\"7: View Current Orders\");\n System.out.println(\"8: View Supplier List\");\n System.out.println(\"9: Quit\");\n String selection = this.userInput.nextLine();\n return selection;\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabel1 = new javax.swing.JLabel();\n id = new javax.swing.JButton();\n title = new javax.swing.JButton();\n publisher_name = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setTitle(\"Search Book\");\n\n jLabel1.setText(\"Search Book\");\n\n id.setText(\"Id\");\n id.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n idActionPerformed(evt);\n }\n });\n\n title.setText(\"Title\");\n title.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n titleActionPerformed(evt);\n }\n });\n\n publisher_name.setText(\"Publisher name\");\n publisher_name.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n publisher_nameActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(164, 164, 164)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(publisher_name)\n .addComponent(title)\n .addComponent(id)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel1)\n .addGap(25, 25, 25)))\n .addContainerGap(131, Short.MAX_VALUE))\n );\n\n layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {id, publisher_name, title});\n\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(44, 44, 44)\n .addComponent(jLabel1)\n .addGap(36, 36, 36)\n .addComponent(id)\n .addGap(22, 22, 22)\n .addComponent(title)\n .addGap(18, 18, 18)\n .addComponent(publisher_name)\n .addContainerGap(97, Short.MAX_VALUE))\n );\n\n pack();\n }", "static void listerMenu() {\n System.out.println(\n \"-------------------------------------\\n\" +\n \"Saisir une option :\\n\" +\n \"1 : Liste des hôtes\\n\" +\n \"2 : Liste des logements\\n\" +\n \"3 : Liste des voyageurs\\n\" +\n \"4 : Liste des réservations\\n\" +\n \"5 : Fermer le programme\"\n );\n switch (Menu.choix(5)) {\n case 1:\n GestionHotes.listerHotes();\n break;\n case 2:\n GestionLogements.listerLogements();\n break;\n case 3:\n GestionVoyageurs.listerVoyageurs();\n break;\n case 4:\n GestionReservations.listerReservations();\n break;\n case 5:\n System.exit(0);\n break;\n }\n }", "public static void options(){\n System.out.println(\"Choose from the following options \");\n System.out.println(\"0 Print the options again\");\n System.out.println(\"1 Create Student Records\");\n System.out.println(\"2 Create Teacher Records\");\n System.out.println(\"3 Edit the Records\");\n System.out.println(\"4 Get the Record Count\");\n System.out.println(\"5 Exit\");\n }", "private void displayMenu() {\r\n\t\tif (this.user instanceof Administrator) {\r\n\t\t\tnew AdminMenu(this.database, (Administrator) this.user);\r\n\t\t} else {\r\n\t\t\tnew BorrowerMenu(this.database);\r\n\t\t}\r\n\t}", "private void displayMenu() {\n\t\tint option = MenuView.getMenuOption(\n\t\t\t\"Welcome \" + movieGoer.getName() + \"!\",\n\t\t\t\"View movie showtimes\",\n\t\t\t\"Book a ticket\",\n\t\t\t\"View movie details\",\n\t\t\t\"List top 5 movies\",\n\t\t\t\"View booking history\",\n\t\t\t\"Exit\"\n\t\t);\n\t\t\n\t\tswitch (option) {\n\t\t\tcase 1:\n\t\t\t\tNavigationController.load(new ShowTimeController());\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 2:\n\t\t\t\tNavigationController.load(new BookingController(movieGoer));\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 3:\n\t\t\t\tNavigationController.load(new MovieController(movieGoer));\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t\n\t\t\tcase 4:\n\t\t\t\tNavigationController.load(new TopMoviesController());\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 5:\n\t\t\t\tNavigationController.load(new BookingHistoryController(movieGoer));\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 6:\n\t\t\t\tNavigationController.goBack();\n\t\t\t\tbreak;\n\t\t}\n\t}", "private void ShowMenu() {\n\t\tSystem.out.println(\"Please enter a number between 0 and 6 to perform the below actions:\\n\" + \n\t\t\t\t\"0: Exit the program\\n\" + \n\t\t\t\t\"1: Show total population for all zip codes available\\n\" + \n\t\t\t\t\"2: Show the total parking fines per capita for each zip code available\\n\" + \n\t\t\t\t\"3: Show the average market value for residences in a specified zip code\\n\" + \n\t\t\t\t\"4: Show the average total livable area for residences in a specified zip code\\n\" + \n\t\t\t\t\"5: Show the total residential market value per capita for a specified zip code\\n\" +\n\t\t\t\t\"6: Show a sorted list of zip codes and their most common fine in that zip code. Values sorted by total livable area per capita\");\n\t}", "public static int books(int choice) {\r\n\r\n\t\tswitch (choice) {\r\n\t\tcase 1: // Mech dept books\r\n\t\t\tSystem.out.println(\"1 :SOLID MECHANICS\");\r\n\r\n\t\t\tSystem.out.println(\"2 :FLUID MECHANICS\");\r\n\r\n\t\t\treturn 1;\r\n\r\n\t\tcase 2: // civil debt books\r\n\t\t\tSystem.out.println(\"3 :BRICKS\");\r\n\r\n\t\t\tSystem.out.println(\"4 :SURVEY\");\r\n\r\n\t\t\treturn 1;\r\n\r\n\t\tcase 3: // cse debt books\r\n\t\t\tSystem.out.println(\"5 :DBMS\");\r\n\r\n\t\t\tSystem.out.println(\"6 :JAVA\");\r\n\r\n\t\t\treturn 1;\r\n\t\tdefault:\r\n\t\t\tSystem.out.println(\"ENTER THE DETAILS CORRECTLY\");\r\n\t\t}\r\n\t\treturn 0;\r\n\r\n\t}", "public static void openBooksSection() {\n click(BOOKS_TAB_UPPER_MENU);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n if (item.getItemId() == R.id.option_get_place) {\n showCurrentPlace();\n }\n else if (item.getItemId() == R.id.option_author) {\n showAuthorDialog();\n }\n return true;\n }", "public static void menu() {\n\t\tSystem.out.println(\"Menu:\");\n\t\tSystem.out.println(\"1: Create\");\n\t\tSystem.out.println(\"2: Merge\");\n\t\tSystem.out.println(\"3: Collection\");\n\t\tSystem.out.println(\"4: Upgrades\");\n\t\tSystem.out.println(\"5: Sell\");\n\t\tSystem.out.println(\"6: Identify Crystal\");\n\t\tSystem.out.println(\"\");\n\t}", "public static void architectUpMenu(){\n\n //Displaying the menu options by using the system out method\n System.out.println(\"1 - Would you like to view all of the architects\");\n System.out.println(\"2 - Would you like to search for a architect's information\");\n System.out.println(\"3 - Adding a new architect's details\\n\");\n\n System.out.println(\"0 - Back to main menu\\n\");\n }", "public void listBooks() {\n String sql = \"SELECT ISBN, BookName, AuthorName, Price FROM books\";\n\n try (Connection conn = this.connect();\n Statement stmt = conn.createStatement();\n ResultSet rs = stmt.executeQuery(sql)) {\n\n // Print results\n while(rs.next()) {\n System.out.println(rs.getInt(\"ISBN\") + \"\\t\" +\n rs.getString(\"BookName\") + \"\\t\" +\n rs.getString(\"AuthorName\") + \"\\t\" +\n rs.getInt(\"Price\"));\n }\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }", "private void queryAllMenu()\n\t{\n\t\tclearPanel(getPanel1());\n\t\t\n\t\t//get value from combo boxes into Values\n\t\tsetValue1(getTopics1().getSelectedItem().toString());\t\n\t\tsetValue2(getTopics2().getSelectedItem().toString());\n\t\t\n\t\t//load user values into query1 by calling CrimeQuery and passing the values\n\t\tsetQuery1(new CrimeQuery(getValue1(),getValue2()));\n\t\t\n\t\t//get the table from QueryAll from CrimeQuery class\n\t\tJTable table=getQuery1().QueryAll();\n\t\t\n\t\t//add table with new options\n\t\tJScrollPane scrolltable = new JScrollPane(table);\n\t\tscrolltable.setBounds(500,10,500,500);\n\t\n\t\tgetPanel1().add(scrolltable);\n\t\t\n\t\tgetPanel1().add(getButton2());\n\t\tgetPanel1().add(getButton5());\n\t\tgetPanel1().add(getButton3());\n\t\tgetPanel1().add(getButton6());\n\t\tgetButton3().setBounds(100,10,230,60);\n\t\tgetButton6().setBounds(100,215,230,60);\n\t\tgetButton5().setBounds(100,315,230,60);\n\t\tgetButton2().setBounds(100,410,230,60);\n\t\t\n\t\t\n\t\t\n\t}", "private void searchMenu(){\n\t\t\n\t}", "void showBookResult(Book book);", "public void searchFor(View view) {\n // Get a handle for the editable text view holding the user's search text\n EditText userInput = findViewById(R.id.user_input_edit_text);\n // Get the characters from the {@link EditText} view and convert it to string value\n String input = userInput.getText().toString();\n\n // Search filter for search text matching book titles\n RadioButton mTitleChecked = findViewById(R.id.title_radio);\n // Search filter for search text matching authors\n RadioButton mAuthorChecked = findViewById(R.id.author_radio);\n // Search filter for search text matching ISBN numbers\n RadioButton mIsbnChecked = findViewById(R.id.isbn_radio);\n\n if (!input.isEmpty()) {\n // On click display list of books matching search criteria\n // Build intent to go to the {@link QueryResultsActivity} activity\n Intent results = new Intent(MainActivity.this, QueryListOfBookActivity.class);\n\n // Get the user search text to {@link QueryResultsActivity}\n // to be used while creating the url\n results.putExtra(\"topic\", mUserSearch.getText().toString().toLowerCase());\n\n // Pass search filter, if any\n if (mTitleChecked.isChecked()) {\n // User is searching for book titles that match the search text\n results.putExtra(\"title\", \"intitle=\");\n } else if (mAuthorChecked.isChecked()) {\n // User is searching for authors that match the search text\n results.putExtra(\"author\", \"inauthor=\");\n } else if (mIsbnChecked.isChecked()) {\n // User is specifically looking for the book with the provided isbn number\n results.putExtra(\"isbn\", \"isbn=\");\n }\n\n // Pass on the control to the new activity and start the activity\n startActivity(results);\n\n } else {\n // User has not entered any search text\n // Notify user to enter text via toast\n\n Toast.makeText(\n MainActivity.this,\n getString(R.string.enter_text),\n Toast.LENGTH_SHORT)\n .show();\n }\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.book_menu, menu);\n return true;\n }", "public void listBooksByAuthor(String name) {\n String sql = \"SELECT ISBN, BookName, AuthorName, Price \" +\n \"FROM books \" +\n \"WHERE AuthorName = ?\";\n\n try (Connection conn = this.connect();\n PreparedStatement pstmt = conn.prepareStatement(sql)) {\n\n // Set values\n pstmt.setString(1, name);\n\n ResultSet rs = pstmt.executeQuery();\n\n // Print results\n while(rs.next()) {\n System.out.println(rs.getInt(\"ISBN\") + \"\\t\" +\n rs.getString(\"BookName\") + \"\\t\" +\n rs.getString(\"AuthorName\") + \"\\t\" +\n rs.getInt(\"Price\"));\n }\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }", "public void displayAll() {\r\n \t Item currentItem;\r\n \t \r\n \t System.out.println(\"-----BOOKS-----\");\r\n \t for(int i=0; i<items.size(); i++) {\r\n \t currentItem = items.get(i);\r\n \t \t //This next line checks if the current item is a book.\r\n \t if(currentItem.getItemType() == Item.ItemTypes.BOOK) \r\n \t System.out.println(currentItem.toString());\r\n \t }\r\n \t \t\r\n \t System.out.println(\"-----MAGAZINES-----\");\r\n \t for(int i=0; i<items.size(); i++) {\r\n \t currentItem = items.get(i);\r\n \t \t //This next line checks if the current item is a magazine.\r\n \t if(currentItem.getItemType() == Item.ItemTypes.MAGAZINE)\r\n \t System.out.println(currentItem.toString());\r\n \t }\r\n\r\n }", "private static void displayUserMenu() {\n\t\tSystem.out.println(\"\\t User Menu Help \\n\" \n\t\t\t\t+ \"====================================\\n\"\n\t\t\t\t+ \"ar <reponame> : To add a new repo \\n\"\n\t\t\t\t+ \"dr <reponame> : To delete a repo \\n\"\n\t\t\t\t+ \"or <reponame> : To open repo \\n\"\n\t\t\t\t+ \"lr : To list repo \\n\"\n\t\t\t\t+ \"lo : To logout \\n\"\n\t\t\t\t+ \"====================================\\n\");\n\t}", "public void displayMenu() {\r\n\t\tSystem.out.println(\"Enter a number between 0 and 8 as explained below: \\n\");\r\n\t\tSystem.out.println(\"[\" + ADD_CUSTOMER + \"] Add a customer.\");\r\n\t\tSystem.out.println(\"[\" + ADD_MODEL + \"] Add a model.\");\r\n\t\tSystem.out.println(\"[\" + ADD_TO_INVENTORY + \"] Add a washer to inventory.\");\r\n\t\tSystem.out.println(\"[\" + PURCHASE + \"] Purchase a washer.\");\r\n\t\tSystem.out.println(\"[\" + LIST_CUSTOMERS + \"] Display all customers.\");\r\n\t\tSystem.out.println(\"[\" + LIST_WASHERS + \"] Display all washers.\");\r\n\t\tSystem.out.println(\"[\" + DISPLAY_TOTAL + \"] Display total sales.\");\r\n\t\tSystem.out.println(\"[\" + SAVE + \"] Save data.\");\r\n\t\tSystem.out.println(\"[\" + EXIT + \"] to Exit\");\r\n\t}", "@FXML\n public void showAllBooks() {\n LibrarySystem.setScene(new AllBookListInReaderPage(\n reader, readerlist, booklist, booklist));\n }", "private void menuSetup()\n {\n menuChoices = new String []\n {\n \"Add a new product\",\n \"Remove a product\",\n \"Rename a product\",\n \"Print all products\",\n \"Deliver a product\",\n \"Sell a product\",\n \"Search for a product\",\n \"Find low-stock products\",\n \"Restock low-stock products\",\n \"Quit the program\" \n };\n }", "public static int dispAndGetMenu ( int menu ) {\n\t\tif ( menu == 0 ) { // if menu to display is main menu\n\t\t\tSystem.out.println ( \" Contacts Menu\" );\n\t\t\tSystem.out.println ( \"1. Add Contact\" );\n\t\t\tSystem.out.println ( \"2. Remove Contact\" );\n\t\t\tSystem.out.println ( \"3. Search for Contact\" );\n\t\t\tSystem.out.println ( \"4. Update Contact\" );\n\t\t\tSystem.out.println ( \"5. Show Contacts\" );\n\t\t\tSystem.out.println ( \"6. Quit\" );\n\t\t\tSystem.out.print ( \"Enter menu choice: \" );\n\t\t\treturn CheckInput.getIntRange ( 1, 6 ); // choose 1-6\n\t\t} else if ( menu == 2 ) { // submenu 2 for removing contacts\n\t\t\tSystem.out.print ( \"\\n\" );\n\t\t\tSystem.out.println ( \" Contact Removal Menu\" );\n\t\t\tSystem.out.println ( \"1. First and Last Name\" );\n\t\t\tSystem.out.println ( \"2. Index\" );\n\t\t\tSystem.out.print ( \"Remove by: \" );\n\t\t\treturn CheckInput.getIntRange ( 1, 2 ); // choose 1 or 2\n\t\t} else if ( menu == 3 ) { // submenu 3 for searching for a contact\n\t\t\tSystem.out.print ( \"\\n\" );\n\t\t\tSystem.out.println ( \" Contact Searching Menu\" );\n\t\t\tSystem.out.println ( \"1. Last Name\" );\n\t\t\tSystem.out.println ( \"2. Zip Code\" );\n\t\t\tSystem.out.print ( \"Search by: \" );\n\t\t\treturn CheckInput.getIntRange ( 1, 2 );\n\t\t} else { // submenu 4 for updating contacts\n\t\t\tSystem.out.print ( \"\\n\" );\n\t\t\tSystem.out.println ( \" Contact Updating Menu\" );\n\t\t\tSystem.out.println ( \"1. First Name\" );\n\t\t\tSystem.out.println ( \"2. Last Name\" );\n\t\t\tSystem.out.println ( \"3. Phone Number\" );\n\t\t\tSystem.out.println ( \"4. Address\" );\n\t\t\tSystem.out.println ( \"5. City \" );\n\t\t\tSystem.out.println ( \"6. Zip Code\" );\n\t\t\tSystem.out.print ( \"Update category: \" );\n\t\t\treturn CheckInput.getIntRange ( 1, 6 ); // choose 1-6\n\t\t}\n\t}", "public String promptMenu() {\n String selection;\n promptMenu: do {\n selection = promptString(\n \"\\n======== FLOORING PROGRAM MAIN MENU ========\\n\" + \n \"DISPLAY - Display Orders\\n\" + \n \"ADD - Add an Order\\n\" + \n \"EDIT - Edit an Order\\n\" + \n \"REMOVE - Remove an Order\\n\" + \n \"EXPORT - Export all data to file\\n\" + \n \"EXIT - Exit\\n\" +\n \"What would you like to do?\"\n );\n \n switch(selection.toLowerCase()) {\n case \"display\":\n case \"add\":\n case \"edit\":\n case \"remove\":\n case \"export\":\n case \"exit\":\n break promptMenu;\n default:\n continue;\n }\n } while(true);\n \n return selection;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu_main, menu);\n this.menu = menu;\n publicMenuItem = menu.findItem(R.id.action_public_invites);\n privateMenuItem = menu.findItem(R.id.action_private_invites);\n if(savedDbQuery){\n publicMenuItem.setVisible(true);\n privateMenuItem.setVisible(false);\n }else{\n publicMenuItem.setVisible(false);\n privateMenuItem.setVisible(true);\n }\n publicMenuItem = menu.findItem(R.id.action_public_invites);\n privateMenuItem = menu.findItem(R.id.action_private_invites);\n return true;\n }", "public void showNumberOfBooksInYear() {\n\tSystem.out.println(\"You have choose option 2\");\n\tSystem.out.println(\"Choose your year:\");\n\ttry {\n\t int choosenYear = sc.nextInt();\n\t int numOfBooks = logicTier.findNumberOfBooksInYear(choosenYear);\n\t System.out.println(\"The number of Book published in \"+choosenYear+\" is \"+numOfBooks);\n\t} catch (Exception e) {\n\t e.printStackTrace();\n\t}\n }", "private void displayMenu()\r\n {\r\n System.out.println(\"\\nWelcome to Car Park System\");\r\n System.out.println(\"=============================\");\r\n System.out.println(\"(1)Add a Slot \");\r\n System.out.println(\"(2)Delete a Slot\");\r\n System.out.println(\"(3)List all Slots\");\r\n System.out.println(\"(4)Park a Car\");\r\n System.out.println(\"(5)Find a Car \");\r\n System.out.println(\"(6)Remove a Car\");\r\n System.out.println(\"(7)Exit \");\r\n System.out.println(\"\\nSelect an Option: \");\r\n }", "public void getAnAuthor() {\n System.out.println(\"Give author name: \");\n String key = input.next();\n for (Card s: cards) {\n if (s.autherOfBook.equals(key)) {\n System.out.println(s.titleOfBook + \" \" + s.autherOfBook + \" \" + s.subjectOfBook);\n } \n }\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu_book_list, menu);\n return true;\n }", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main_alumno, menu);\r\n\t\t\r\n\t\tMenuItem searchItem = menu.findItem(R.id.buscarItem);\r\n\t SearchView searchView = (SearchView) MenuItemCompat.getActionView(searchItem);\r\n\t // Configure the search info and add any event listeners\r\n\t //searchView.setQueryHint(\"Buscar curso...\");\r\n\t\treturn true;\r\n\t}", "public static void menu(Connection connection) throws SQLException {\r\n\r\n //scanner to get menu number from the user\r\n Scanner scan = new Scanner(System.in);\r\n System.out.println(\"TOY STORE DATABASE MENU:\\n1) Enter new toy\\n2) Update toy information\\n3) Delete item from stock\\n4) Search Database\\n5) Print Inventory\\n0) Exit\");\r\n String opt = scan.nextLine();\r\n\r\n\r\n //switch and cases for the menu 0 is exit, the others are sent to other methods (add/update/delete/search/print)\r\n switch (opt) {\r\n case \"0\":\r\n //the program remains running until user escapes from main menu\r\n System.exit(0);\r\n break;\r\n case \"1\":\r\n add(connection);\r\n break;\r\n case \"2\":\r\n update(connection);\r\n break;\r\n case \"3\":\r\n delete(connection);\r\n break;\r\n case \"4\":\r\n search(connection);\r\n break;\r\n case \"5\":\r\n Statement statement = connection.createStatement();\r\n printAllFromTable(statement, connection);\r\n break;\r\n // if the user enters an invalid menu number then the error message is displayed and the menu is repeated\r\n default:\r\n System.out.println(\"Error!!!!! Please enter a valid option from the menu (0-5)\\n\\n\");\r\n menu(connection);\r\n break;\r\n\r\n }\r\n scan.close();\r\n }", "private void displayByID() { \n\t\tint sic_idHolder; // declares sic_idHolder\n\t\t\n\t\tSystem.out.println(\"Please enter the SIC-ID of the book you would like displayed:\");\n\t\tsic_idHolder = scan.nextInt();\n\t\tscan.nextLine();\n\t\tSystem.out.println(inventoryObject.displayBySICID(sic_idHolder));\n\t\tgetUserInfo();\n\t}", "private ClubSearch() \r\n {\r\n in = new Scanner(System.in);\r\n db = DatabaseManager.getInstance();\r\n \r\n openPrompt = \"Would you like to search for a club, \" +\r\n \t \"filter by type of club, list clubs, or exit? (s/f/l/e)\";\r\n cDatabase = \"ClubDatabase\";\r\n cName = \"ClubName\";\r\n }", "public void main_menu()\n\t{\n\t\tSystem.out.println(\"===========================================================\");\n\t\tSystem.out.println(\"Please Select an option\");\n\t\tSystem.out.println(\"===========================================================\");\n\t\tSystem.out.print(\"1.Add 2.Update 3.Delete 4.Exit\\n\");\n\t\tSystem.out.println(\"===========================================================\");\n\t\tchoice=me.nextInt();\n\t\tthis.check_choice(choice);\n\t}", "public void displaymenu()\r\n\t{\r\n\t\tSystem.out.println(\"Welcome to the COMP2396 Authentication system!\");\r\n\t\tSystem.out.println(\"1. Authenticate user\");\r\n\t\tSystem.out.println(\"2. Add user record\");\r\n\t\tSystem.out.println(\"3. Edit user record\");\r\n\t\tSystem.out.println(\"4. Reset user password\");\r\n\t\tSystem.out.println(\"What would you like to perform?\");\r\n\t}", "public static void menu() {\n\t\tSystem.out.println(\"\\nPlease select which type of argument to generate by entering the associated number.\\n\");\n\t\tfor(int i = 0; i < type.length; i++) {\n\t\t\tSystem.out.println((i+1)+\". \"+type[i]);\n\t\t}\n\t\tSystem.out.println(\"8. Quit\");\n\t}", "public void readBook()\n\t{\n\t\tb.input();\n\t\tSystem.out.print(\"Enter number of available books:\");\n\t\tavailableBooks=sc.nextInt();\n\t}", "@Override\n public void onCreateOptionsMenu(@NonNull @NotNull Menu menu, @NonNull @NotNull MenuInflater inflater) {\n inflater.inflate(R.menu.main_menu, menu);\n MenuItem menuItem = menu.findItem(R.id.search_icon);\n SearchView searchView = (SearchView) menuItem.getActionView();\n searchView.setQueryHint(getString(R.string.explore_music));\n\n //listens to the query on the searchview\n searchView.setOnQueryTextListener(new OnQueryTextListener() {\n @Override\n public boolean onQueryTextSubmit(String query) {\n //query itunes api\n queryMusic(query, \"all\");\n return false;\n }\n\n @Override\n public boolean onQueryTextChange(String newText) {\n if (!TextUtils.isEmpty(newText)) {\n //hidden due to the limit of 20 request per minute\n// queryMusic(newText, \"all\");\n }\n return false;\n }\n });\n super.onCreateOptionsMenu(menu, inflater);\n }", "public void stringPresentation () {\n System.out.println ( \"****** String Data Module ******\" );\n ArrayList<Book> bookArrayList = new ArrayList<Book>();\n bookArrayList = new Request().postRequestBook();\n for (Book book: bookArrayList) {\n System.out.println(book.toString());\n }\n ClientEntry.showMenu ( );\n\n }", "private void setUpSearchButton()\n {\n searchButton.setCaption(\"Go\");\n searchButton.addClickListener(new Button.ClickListener() {\n public void buttonClick(Button.ClickEvent event)\n {\n //Grab the data from the database base on the search text\n //Assume all search is author name for now\n String searchValue = searchText.getValue();\n \n //Remove all values in the table\n bookTable.removeAllItems();\n \n //Grab Data from database\n List<Book> books = collectDataFromDatabase(searchValue);\n \n //Put the data into the table\n allBooksBean.addAll(books);\n //putDataIntoTable(books);\n }\n });\n }", "@FXML\n public void returnOrBorrowBook() {\n LibrarySystem.setScene(\n new SearchBook(reader, null, readerlist, booklist));\n }", "public static void mainMenu() \n\t{\n\t\t// display menu\n\t\tSystem.out.print(\"\\nWhat would you like to do?\" +\n\t\t\t\t\"\\n1. Enter a new pizza order (password required)\" +\n\t\t\t\t\"\\n2. Change information of a specific order (password required)\" +\n\t\t\t\t\"\\n3. Display details for all pizzas of a specific size (s/m/l)\" +\n\t\t\t\t\"\\n4. Statistics of today's pizzas\" +\n\t\t\t\t\"\\n5. Quit\" +\n\t\t\t\t\"\\nPlease enter your choice: \");\t\n\t}", "@FXML\n public void showBorrowedBooks() {\n LibrarySystem.setScene(new BorroweddBookList(\n (reader.getBorrowedBooks(booklist)), reader, readerlist, booklist));\n }" ]
[ "0.68450534", "0.67410773", "0.66612995", "0.65538", "0.6383607", "0.6326925", "0.62487334", "0.6218458", "0.62075055", "0.61961794", "0.61891896", "0.6154835", "0.61096185", "0.6085937", "0.6078784", "0.60725635", "0.6042821", "0.6042661", "0.6012426", "0.5996532", "0.59949446", "0.59605616", "0.5960297", "0.5926278", "0.5917041", "0.58980525", "0.5884688", "0.58819765", "0.5874182", "0.5860855", "0.58522445", "0.5829837", "0.5784867", "0.57748777", "0.5759263", "0.5724455", "0.5720643", "0.5707559", "0.5698286", "0.5682007", "0.56786644", "0.56776935", "0.5661623", "0.5657492", "0.5653902", "0.5652694", "0.56396663", "0.56385857", "0.5622472", "0.5614173", "0.5609306", "0.5605093", "0.5578051", "0.5578042", "0.5576162", "0.5566491", "0.55649424", "0.55588984", "0.555742", "0.5548799", "0.554812", "0.5547084", "0.5545587", "0.55441797", "0.5534372", "0.55327946", "0.55205375", "0.55139726", "0.55107385", "0.5508289", "0.5506662", "0.55057317", "0.5488465", "0.5484325", "0.5482847", "0.547742", "0.54712665", "0.54673034", "0.5454461", "0.5450352", "0.54464644", "0.5438398", "0.542946", "0.542", "0.5419054", "0.54115355", "0.5408992", "0.54063344", "0.5403005", "0.5393213", "0.53922087", "0.53909177", "0.53803986", "0.53715265", "0.5368708", "0.5362605", "0.5361995", "0.5357701", "0.53576726", "0.5357068" ]
0.82319355
0
/Returns list of books of the published by the publisher entered by the user
private static void queryBooksByPublisher(){ System.out.println("===Query Books By Publisher==="); Scanner string_input = new Scanner(System.in); System.out.println("Enter Publisher to Query Books by: "); String publisher = string_input.nextLine(); if(ALL_PUBLISHERS.containsKey(publisher)){ Iterator<String> iter = ALL_PUBLISHERS.get(publisher).iterator(); System.out.println("All books published by " + publisher + " are:"); printAllElements(iter); } else System.out.println("Sorry! There are no such publishers in our records!"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<Books> findBooksByPublisher(String publisher) {\r\n return bookController.findBooksByPublisher(publisher);\r\n }", "public Books getBooks(String title,String authors,String isbn,String publisher);", "public List<BookData> searchBookbyPublisher (String publisher) throws SQLException{\n\t\tList<BookData> list = new ArrayList<>();\n\t\t\n\t\tPreparedStatement myStmt = null;\n\t\tResultSet myRs = null;\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\tmyStmt = myConn.prepareStatement(\"select title, author_name, publisher_name, book_id from books natural join book_authors where publisher_name = ?\");\n\t\t\tmyStmt.setString(1, publisher);\n\t\t\tmyRs = myStmt.executeQuery();\n\t\t\t\n\t\t\twhile (myRs.next()) {\n\t\t\t\tBookData tempbook = convertRowToBook(myRs);\n\t\t\t\tlist.add(tempbook);\n\t\t\t}\n\t\t\t\n\t\t\treturn list;\n\t\t}\n\t\tfinally {\n\t\t\tmyRs.close();\n\t\t\tmyStmt.close();\n\t\t\n\t\t}\n\t\t\n\t}", "public void listBooks() {\n for (int g = 0; g < books.length; g++) {\n books[g].toString();\n }\n// List all books in Bookstore\n }", "public List<Book> getBooksByEditorialId(Long codePublisher) {\n String queryStr = \"SELECT b FROM Book b where b.publisher.code = :coPublisher\";\n Query query = em.createQuery(queryStr);\n query.setParameter(\"coPublisher\", codePublisher);\n\n return query.getResultList();\n }", "public List<Book> listBooks() {\n\t\tArrayList<Book> books = new ArrayList<>();\n\t\ttry (Connection con = LibraryConnection.getConnection()) {\n\t\t\tPreparedStatement stmt = con.prepareStatement(\"SELECT * FROM book\");\n\n\t\t\tResultSet rs = stmt.executeQuery();\n\t\t\twhile (rs.next()) {\n\t\t\t\tbooks.add(new Book(rs.getString(\"isbn\"), rs.getString(\"title\")));\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn books;\n\t}", "List<Book> getAllBooks();", "public static ArrayList<Book> search(String title, ArrayList<String> authors, String isbn, String publisher, String sortOrder, HashMap<Book, Integer> purchasedBooks)\n {\n ArrayList<Book> tempBookBuffer = search(title, authors, isbn, publisher, purchasedBooks);\n ArrayList<Book> searchedBooks = new ArrayList<>();\n\n for(Book b: tempBookBuffer) {\n if (b.getBookPublisher().equals(publisher) || publisher.equals(\"*\"))\n searchedBooks.add(b);\n }\n if (sortOrder.equals(\"title\")) {\n Collections.sort(searchedBooks, Book.BookTitleComparator);\n }\n else if(sortOrder.equals(\"publish-date\")){\n Collections.sort(searchedBooks,Book.BookDateComparator);\n }\n else{\n\n }\n return searchedBooks;\n }", "List<Book> getBooksByAuthorId(Integer authorId);", "ch.crif_online.www.webservices.crifsoapservice.v1_00.PublicationList getPublicationList();", "public List<Book> getBooks() {\r\n \t\t// switch dates\r\n \t\tif (filter_dateFrom.compareTo(filter_dateTo) > 0) {\r\n \t\t\tCalendar tmp = filter_dateFrom;\r\n \t\t\tfilter_dateFrom = filter_dateTo;\r\n \t\t\tfilter_dateTo = tmp;\r\n \t\t}\r\n \r\n \t\tDate yearFrom = filter_dateFrom.getTime();\r\n \t\tDate yearTo = filter_dateTo.getTime();\r\n \r\n \t\t// genre\r\n \t\tGenre genre = null;\r\n \t\tif (!filter_genre.isEmpty() && !filter_genre.equalsIgnoreCase(\"all\")) {\r\n \t\t\tgenre = genreMgr.findByName(filter_genre);\r\n \t\t\tif (genre == null) {\r\n \t\t\t\tSystem.err.println(\"Badly working database encoding!\");\r\n \t\t\t}\r\n \t\t}\r\n \r\n \t\treturn bookMgr.find(filter_name, filter_author, yearFrom, yearTo, genre, filter_isbn_issn);\r\n \t}", "public List<Book> getByAuthor(String name );", "public static ArrayList<Book> search(String title, ArrayList<String> authors, String isbn, String publisher, HashMap<Book, Integer> purchasedBooks)\n {\n ArrayList<Book> tempBookBuffer = search(title, authors, isbn, purchasedBooks);\n ArrayList<Book> searchedBooks = new ArrayList<>();\n\n for(Book b: tempBookBuffer)\n if(b.getBookPublisher().equals(publisher) || publisher.equals(\"*\"))\n searchedBooks.add(b);\n\n return searchedBooks;\n }", "public List<Book> getBooks() {\n return books;\n }", "@Override\r\n\tpublic List<Book> getBooks() {\n\t\treturn bd.findAll();\r\n\t}", "@Named(\"publisher:list\")\n @GET\n @Path(\"/publishers\")\n @Fallback(EmptyListOnNotFoundOr404.class)\n List<Publisher> listPublishers();", "public List<Book> getBooks() {\r\n\t\treturn books;\r\n\t}", "public ArrayList<Book> getListBook();", "public void viewLibraryBooks(){\n\t\tIterator booksIterator = bookMap.keySet().iterator();\n\t\tint number, i=1;\n\t\tSystem.out.println(\"\\n\\t\\t===Books in the Library===\\n\");\n\t\twhile(booksIterator.hasNext()){\t\n\t\t\tString current = booksIterator.next().toString();\n\t\t\tnumber = bookMap.get(current).size();\n\t\t\tSystem.out.println(\"\\t\\t[\" + i + \"] \" + \"Title: \" + current);\n\t\t\tSystem.out.println(\"\\t\\t Quantity: \" + number + \"\\n\");\t\t\t\n\t\t\ti += 1; \n\t\t}\n\t}", "public Collection<Book> getBooks() {\n return books;\n }", "public List<Publisher> findAllPublishers() {\n\t\tList<Publisher> result = new ArrayList<Publisher>();\n\t\t// --- 2. Controlli preliminari sui dati in ingresso ---\n\t\t// n.d.\n\t\t// --- 3. Apertura della connessione ---\n\t\tConnection conn = getCurrentJDBCFactory().getConnection();\n\t\t// --- 4. Tentativo di accesso al db e impostazione del risultato ---\n\t\ttry {\n\t\t\t// --- a. Crea (se senza parametri) o prepara (se con parametri) lo statement\n\t\t\tPreparedStatement prep_stmt = conn.prepareStatement(find_all_publishers);\n\t\t\t// --- b. Pulisci e imposta i parametri (se ve ne sono)\n\t\t\tprep_stmt.clearParameters();\n\t\t\t// --- c. Esegui l'azione sul database ed estrai il risultato (se atteso)\n\t\t\tResultSet rs = prep_stmt.executeQuery();\n\t\t\t// --- d. Cicla sul risultato (se presente) pe accedere ai valori di ogni sua tupla\n\t\t\twhile ( rs.next() ) {\n\t\t\t\tPublisher publisher = new Publisher();\n\t\t\t\tpublisher.setId(rs.getInt(publisher_id));\n\t\t\t\tpublisher.setName(rs.getString(publisher_name));\n\t\t\t\t// books.. lazy fetch\n\t\t\t\tresult.add(publisher);\n\t\t\t}\n\t\t\t// --- e. Rilascia la struttura dati del risultato\n\t\t\trs.close();\n\t\t\t// --- f. Rilascia la struttura dati dello statement\n\t\t\tprep_stmt.close();\n\t\t}\n\t\t// --- 5. Gestione di eventuali eccezioni ---\n\t\tcatch (Exception e) {\n\t\t\tgetCurrentJDBCFactory().getLogger().error(\"failed to retrieve publishers\",e);\n\t\t\te.printStackTrace();\n\t\t}\n\t\t// --- 6. Rilascio, SEMPRE E COMUNQUE, la connessione prima di restituire il controllo al chiamante\n\t\tfinally {\n\t\t\tgetCurrentJDBCFactory().releaseConnection(conn);\n\t\t}\n\t\t// --- 7. Restituzione del risultato (eventualmente di fallimento)\n\t\treturn result;\n\t}", "public String advancedSearchBooks() {\r\n List<Books> books = new ArrayList<Books>();\r\n keywords = keywords.trim();\r\n \r\n switch (searchBy) {\r\n case \"all\":\r\n return searchBooks();\r\n case \"title\":\r\n books = findBooksByTitle(keywords);\r\n break;\r\n case \"identifier\":\r\n books = findBooksByIdentifier(keywords);\r\n break;\r\n case \"contributor\":\r\n books = findBooksByContributor(keywords);\r\n break;\r\n case \"publisher\":\r\n books = findBooksByPublisher(keywords);\r\n break;\r\n case \"year\":\r\n books = findBooksByYear(keywords);\r\n break;\r\n case \"genre\":\r\n books = findBooksByGenre(keywords);\r\n break;\r\n case \"format\":\r\n books = findBooksByFormat(keywords);\r\n break;\r\n }\r\n clearFields();\r\n\r\n if (books == null || books.isEmpty()) {\r\n books = new ArrayList<Books>();\r\n }\r\n\r\n return displayBooks(books);\r\n }", "Collection<Book> getAll();", "public void listBooks() {\n String sql = \"SELECT ISBN, BookName, AuthorName, Price FROM books\";\n\n try (Connection conn = this.connect();\n Statement stmt = conn.createStatement();\n ResultSet rs = stmt.executeQuery(sql)) {\n\n // Print results\n while(rs.next()) {\n System.out.println(rs.getInt(\"ISBN\") + \"\\t\" +\n rs.getString(\"BookName\") + \"\\t\" +\n rs.getString(\"AuthorName\") + \"\\t\" +\n rs.getInt(\"Price\"));\n }\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }", "@Override\n\tpublic List<Book> getAllBooks() {\n\t\treturn bookList;\n\t}", "public Books[] getBooks() {\n return books;\n }", "@Override\n public List<Book> result(List<Book> books) {\n return search.result(books);\n }", "@GetMapping(\"/bookworm/showAllAuthors\")\n public ResponseEntity<List> showAllAuthors() {\n\n log.debug(\"Showing all the Authors whose books are present in library\");\n return ResponseEntity.ok(authorService.getAuthor());\n }", "public Iterator getBooks() {\r\n return books.iterator();\r\n }", "public String getMyBooks()\r\n {\r\n\treturn myBooks;\r\n }", "public String[] getPublisher() {\n/* 254 */ return getStringArray(\"publisher\");\n/* */ }", "public List<Book> allBooks() {\n return bookRepository.findAll();\n }", "public ObservableList<Object> selectAllBooks(){\n System.out.println(\"Printing all books...\");\n dbmanager.open();\n ObservableList<Object> books = FXCollections.observableArrayList();\n\n try{\n try (DBIterator keyIterator = dbmanager.getDB().iterator()) {\n keyIterator.seekToFirst();\n while (keyIterator.hasNext()) {\n String key = asString(keyIterator.peekNext().getKey());\n String[] splittedString = key.split(\"-\");\n\n dbmanager.incrementNextId(Integer.parseInt(splittedString[1]));\n\n if(!\"book\".equals(splittedString[0])){\n keyIterator.next();\n continue;\n }\n String resultAttribute = asString(dbmanager.getDB().get(bytes(key)));\n JSONObject jbook = new JSONObject(resultAttribute);\n\n Book book = new Book(jbook);\n \n book.setPublisher(dbmanager.getPmanager().read(jbook.getInt(\"publisher\")));\n \n JSONArray jauthors = jbook.getJSONArray(\"authors\");\n List<Author> authors = new ArrayList();\n for(int i=0; i<jauthors.length(); i++){\n \n int a=-1;\n a=jauthors.getInt(i);\n if(a>=0){ \n authors.add(dbmanager.getAmanager().read(a));\n }else{\n System.out.println(\"A book has mysterious author\"); \n }\n \n }\n \n book.setAuthors(authors);\n books.add(book);\n keyIterator.next();\n }\n }\n } catch(IOException e){\n e.printStackTrace();\n }\n dbmanager.close();\n return books;\n }", "public List<Book> getAllBooks(){\n\t\treturn this.bRepo.findAll();\n\t}", "public PageInfo<Book> getBookList() {\n \tPageHelper.startPage(1,2);\r\n List<Book> list = bookMapper.getBookList();\r\n PageInfo<Book> pageInfo=new PageInfo<Book>(list);\r\n\t\treturn pageInfo;\r\n \r\n }", "public String searchBooks() {\r\n if (keywords.isEmpty()) {\r\n return \"advanced-search\";\r\n }\r\n\r\n keywords = keywords.trim();\r\n \r\n //Get list of all the queries\r\n List<List<Books>> listOfLists = new ArrayList<List<Books>>();\r\n listOfLists.add(findBooksByGenre(keywords));\r\n listOfLists.add(findBooksByIdentifier(keywords));\r\n listOfLists.add(findBooksByContributor(keywords));\r\n listOfLists.add(findBooksByFormat(keywords));\r\n listOfLists.add(findBooksByPublisher(keywords));\r\n listOfLists.add(findBooksByTitle(keywords));\r\n listOfLists.add(findBooksByYear(keywords));\r\n\r\n clearFields();\r\n\r\n List<Books> books = new ArrayList<Books>();\r\n\r\n //Filter out useless data\r\n List<Books> tempBookList;\r\n for (int cntr = 0; cntr < listOfLists.size(); cntr++) {\r\n tempBookList = listOfLists.get(cntr);\r\n\r\n if (tempBookList == null) {\r\n continue;\r\n }\r\n\r\n if (tempBookList.isEmpty()) {\r\n continue;\r\n }\r\n\r\n books.addAll(tempBookList);\r\n }\r\n\r\n //Remove duplicates\r\n Set<Books> bookSet = new HashSet<Books>();\r\n bookSet.addAll(books);\r\n books.clear();\r\n books.addAll(bookSet);\r\n\r\n return displayBooks(books);\r\n }", "public List<AuthorPaper> getAuthorPapers(int authorId) throws SQLException;", "public ArrayList<Book> getBooks() {\n return bookList;\n }", "public Book[] getRecommendBook(){\n\t\n\t String stmnt = String.format(\n \"SELECT * FROM book \" );\n ResultSet rs = executeQuery(stmnt);\n ArrayList<Book> arr = resultSetPacker(rs, Book.class);\n\n return arr.toArray(new Book[arr.size()]);\n}", "public ArrayList<Book> gettitleBook(String title);", "public List<Books> showAllBooks(){\n String sql=\"select * from Book\";\n BaseDao baseDao=dao.executeQuery(sql,new Object[]{});\n List<Books> list=new ArrayList<>();\n list=resultSetToBook(baseDao);\n return list;\n }", "public Book[] getRecommendBooks()\n {\n String stmnt = String.format(\n \"SELECT * FROM book LIMIT %d \",\n PAGE_LIMIT);\n ResultSet rs = executeQuery(stmnt);\n ArrayList<Book> arr = resultSetPacker(rs, Book.class);\n\n return arr.toArray(new Book[arr.size()]);\n\n }", "@RequestMapping(value = \"/PubBlogs\", method = RequestMethod.GET)\n @ResponseBody\n public List<Blog> getPubBlogs() {\n List<Blog> allBlogs = blogDAO.getAllBlogs();\n List<Blog> pubBlogs = new ArrayList<>();\n\n for (int i = 0; i < allBlogs.size(); i++) {\n if (allBlogs.get(i).isPublished()) {\n pubBlogs.add(allBlogs.get(i));\n }\n }\n\n return pubBlogs;\n }", "void availableBooks(){\n\t\tSystem.out.println(\")))))Available books((((((\");\n\t\tfor(int i=0;i<books.length;i++){\n\t\t\tString book=books[i];\n\t\t\tif(book==null){\n\t\t\tcontinue;\n\t\t}\n\t\t\tSystem.out.println(\"*\"+books[i]);\n\t\t}\n\t\t\n\t}", "void viewBooks();", "public Books getBooksByAuthor(Author author) throws IOException {\n Books books = QueryGoogleBooksHelper.setUpClient();\n\n\n Books.Volumes.List volumesList = books.volumes().list(BYAUTHOR + \" \" + author.getName());\n\n Book bookToReturn = new Book();\n\n return books;\n\n }", "Publication getPubli();", "@GET\n @Produces(MediaType.APPLICATION_JSON)\n public Response getBooks() {\n return Response\n .status(Response.Status.OK)\n .entity(getBookService().getBooks())\n .build();\n }", "public String toString() {\r\n return books.toString();\r\n }", "@GetMapping(\"api/books\")\n public List<Book> getallBooks() {\n return bookService.all().getPayload();\n }", "public java.util.List<org.jooq.test.h2.generatedclasses.tables.pojos.VBook> fetchByPublishedIn(java.lang.Integer... values) {\n\t\treturn fetch(org.jooq.test.h2.generatedclasses.tables.VBook.V_BOOK.PUBLISHED_IN, values);\n\t}", "@GET\n @Produces(APPLICATION_JSON)\n @ApiOperation(value = \"Find all authors\", response = PublisherDTO.class, responseContainer = \"List\")\n @ApiResponses(value = {\n @ApiResponse(code = 200, message = \"All publishers found\"),\n @ApiResponse(code = 404, message = \"Publishers not found\")}\n )\n public Response getAllPublishers() {\n log.debug(\"REST request to get all Publishers\");\n List<PublisherDTO> result = publisherService.findAll();\n return ok(result).build();\n }", "public List<Book> getAllBooks() {\n return entityManager.createQuery(\"select b from Book b\", Book.class).getResultList();\n }", "Collection<Book> readAll();", "public List<Books> findBooksByTitle(String title) {\r\n return bookController.findBooksByTitle(title);\r\n }", "public List<Book> getBooksToReturn() {\n\t\treturn booksToReturn;\n\t}", "String getAuthorPublicationsQuery(String... varargs);", "public java.util.List<com.huqiwen.demo.book.model.Books> findAll()\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;", "public List<String > getBooks(){\n List<String> titles = new ArrayList<>();\n\n String strSQL = \"SELECT B._id, B.Title FROM TBooks B WHERE NOT B._id IN (Select TLoaned.TitleID \" +\n \" FROM TLoaned WHERE TLoaned.ReturnDate IS NULL);\";\n SQLiteDatabase db = this.getReadableDatabase();\n Cursor c = db.rawQuery(strSQL, null);\n try {\n if (c.moveToFirst()) {\n do {\n titles.add(c.getString(0) + \". \" + c.getString(1));\n } while (c.moveToNext());\n }\n }\n finally {\n c.close();\n db.close();\n }\n return titles;\n }", "public List<PrintableBook> PerformSearch_google(String[] kw, int N){\n\t\t// build the JAX-RS client object \n\t\tClient client = ClientBuilder.newClient();\n\t\tint res_cont = 0;\t// initialize number of already processed results\n\t\tint tot_res = 1;\t// initialize total number of results so that it is greater than the number of already processed results\n\t\t// build the web target\n\t\tWebTarget target = client.target(getBaseURI_google()).path(\"volumes\");\n\t\t// create empty list of PrintableBook\n\t\tList<PrintableBook> pbooks = new ArrayList<PrintableBook>();\n\t\t// prepare query string\n\t\tStringBuffer queryString = new StringBuffer(kw[0]);\n\t\tfor (int i=1; i<kw.length; i++) {\n\t\t\tqueryString.append(' ');\n\t\t\tqueryString.append(kw[i]);\n\t\t}\n\t\tint offset;\t\t// declare variable used to store offset\n\t\t// main loop on pages\n\t\tfor(int page=0; pbooks.size()<N && res_cont<tot_res; page++){\n\t\t\toffset = page*20;\n\t\t\tSystem.out.println(\"Searching \"+queryString+\" on Google books with offset \"+offset);\n\t\t\ttry {\n\t\t\t\t// perform a get request using mediaType=APPLICATION_JSON\n\t\t\t\t// and convert the response into a SearchResult object\n\t\t\t\tit.polito.dp2.rest.gbooks.client.jaxb.SearchResult result = target\n\t\t\t\t\t\t\t\t\t .queryParam(\"q\", queryString)\t\n\t\t\t\t\t\t\t\t\t .queryParam(\"printType\", \"books\")\n\t\t\t\t\t\t\t\t\t .queryParam(\"maxResults\", 20)\n\t\t\t\t\t\t\t\t\t .queryParam(\"startIndex\", offset)\n\t\t\t\t\t\t\t\t\t .request()\n\t\t\t\t\t\t\t\t\t .accept(MediaType.APPLICATION_JSON)\n\t\t\t\t\t\t\t\t\t .get(it.polito.dp2.rest.gbooks.client.jaxb.SearchResult.class);\n\t\t\t\ttot_res = result.getTotalItems().intValue();\n\t\t\t\tSystem.out.println(\"OK Response received. Total number of Items:\"+tot_res);\n\t\t\t\tSystem.out.println(\"Validating items and converting validated items to xml.\");\n\t\t\t\tfor (it.polito.dp2.rest.gbooks.client.jaxb.Items item:result.getItems()) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// validate item\n\t\t\t\t \tJAXBSource source = new JAXBSource(jc_gbooks, item);\n\t\t\t\t \tSystem.out.println(\"Validating \"+item.getSelfLink());\n\t\t\t\t \tvalidator_gbooks.validate(source);\n\t\t\t\t \tSystem.out.println(\"Validation OK\");\n\t\t\t\t \t// add item to list\n\t\t\t\t\t\tSystem.out.println(\"Adding item to list\");\n\t\t\t\t\t\tPrintableItem pi = Factory.createPrintableItem(BigInteger.valueOf(idCounter.getNextId()),item.getVolumeInfo());\t\t\t\t\n\t\t\t\t\t\tif(pi instanceof PrintableBook){\n\t\t\t\t\t\t\tpbooks.add((PrintableBook)pi);\n\t\t\t\t\t\t\tif(pbooks.size()==N) break;\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (org.xml.sax.SAXException se) {\n\t\t\t\t\t System.out.println(\"Validation Failed\");\n\t\t\t\t\t // print error messages\n\t\t\t\t\t Throwable t = se;\n\t\t\t\t\t while (t!=null) {\n\t\t\t\t\t\t String message = t.getMessage();\n\t\t\t\t\t\t if (message!= null)\n\t\t\t\t\t\t \t System.out.println(message);\n\t\t\t\t\t\t t = t.getCause();\n\t\t\t\t\t }\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\tSystem.out.println(\"Unexpected I/O Exception\");\n\t\t\t\t\t} catch (JAXBException e) {\n\t\t\t\t\t\tSystem.out.println(\"Unexpected JAXB Exception\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tres_cont = res_cont + 20;\n\t\t\t} catch(WebApplicationException e) {\n\t\t\t\tSystem.err.println(\"Error in remote operation: \"+e.getMessage());\n\t\t\t\treturn null;\t\n\t\t\t}\n\t\t}\n\t System.out.println(\"Number of validated Bibliography books from gbooks: \"+pbooks.size());\n\t return pbooks;\n\t}", "public List<Entry> getByPublisher(String publisher) {\n List<Entry> matches = new ArrayList<>();\n for (Entry l : litRegister) {\n if (l.getPublisher().contains(publisher)) {\n matches.add(l);\n }\n }\n return matches;\n }", "public ArrayList<Book> listOfBooksByAuthor (Author providedAuthor){\n //Array list for storing books written by provided author\n ArrayList<Book> authorBooks = new ArrayList<>();\n\n //loops through the booklist to find books with the author in the list of authors\n for (Book book : bookList) {\n //loops through the list of authors to see if the provided author is among thelist\n for (Author author1 : book.getAuthors()) {\n if (providedAuthor.equals(author1)) {\n authorBooks.add(book);\n }\n }\n }\n return authorBooks;\n }", "private void printAvailableBooks() {\n\t\t\n\t}", "@Override\r\n\tpublic List<Book> getBooks(String kind) {\n\t\treturn null;\r\n\t}", "@GetMapping(value = \"/{username}/books\")\n public Iterable<Book> listBooksInLibrary(@PathVariable String username,\n @RequestParam(required = false) String author,\n @RequestParam(required = false) String status) {\n\n UserBookStatus userBookStatus = StringUtils.isEmpty(status) ? null : UserBookStatus.valueOf(status.toUpperCase());\n List<UserBook> userBooks = userService.listBooks(username, author, userBookStatus);\n\n return userBooks.stream().map(userBookToBook).collect(Collectors.toList());\n }", "public Collection<ReservationDetails> getBookCopies(int bookId) throws RemoteException;", "public List<Book> getTotalBooksInLibrary() {\n\n return books;\n }", "public ArrayList<Book> getLibraryBooks() {\n return this.libraryBooks;\n }", "public void setPublisher(String publisher) {\n\tthis.publisher = publisher;\n}", "DefaultListModel getAuthorsBookModel();", "public List<BookData> searchBookbyAuthor (String author) throws SQLException{\n\t\tList<BookData> list = new ArrayList<>();\n\t\t\n\t\tPreparedStatement myStmt = null;\n\t\tResultSet myRs = null;\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\tmyStmt = myConn.prepareStatement(\"select title, author_name, publisher_name, book_id from books natural join book_authors where author_name = ?\");\n\t\t\tmyStmt.setString(1, author);\n\t\t\tmyRs = myStmt.executeQuery();\n\t\t\t\n\t\t\twhile (myRs.next()) {\n\t\t\t\tBookData tempbook = convertRowToBook(myRs);\n\t\t\t\tlist.add(tempbook);\n\t\t\t}\n\t\t\t\n\t\t\treturn list;\n\t\t}\n\t\tfinally {\n\t\t\tmyRs.close();\n\t\t\tmyStmt.close();\n\t\t\n\t\t}\n\t\t\n\t}", "List<Book> findBooksByName(String name);", "public List<Books> findBooksByContributor(String contributor) {\r\n return bookController.findBooksByContributorName(contributor);\r\n }", "public Book[] createBooks(Author[] authorList) {\r\n Book[] bookList = new Book[10];\r\n bookList[0] = createBook(BookCategory.FICTION, \"True story based on the haunted boat\", 150.00f,\r\n \"Lonely Boat\", 1, findAuthorByName(authorList, \"Daniel\"));\r\n bookList[1] = createBook(BookCategory.FICTION, \"Comedy\", 150.00f, \"Lonely Boat\", 2,\r\n findAuthorByName(authorList, \"Daniel\"));\r\n bookList[2] = createBook(BookCategory.TECHNOLOGY, \"Java best practices\", 150.00f, \"Java\", 3,\r\n findAuthorByName(authorList, \"Jeremy\"));\r\n bookList[3] = createBook(BookCategory.NETWORKING, \"Unix Server Mnagement\", 150.00f,\r\n \"Networking\", 4, findAuthorByName(authorList, \"Jeremy\"));\r\n return bookList;\r\n }", "public static ArrayList<Book> search(String title, ArrayList<String> authors, String isbn, HashMap<Book, Integer> purchasedBooks)\n {\n ArrayList<Book> tempBookBuffer = search(title, authors, purchasedBooks);\n ArrayList<Book> searchedBooks = new ArrayList<>();\n\n for(Book b: tempBookBuffer)\n if(b.getBookIsbn().equals(isbn) || isbn.equals(\"*\"))\n searchedBooks.add(b);\n\n return searchedBooks;\n }", "public ArrayList<Book> search(String part){ \n this.searchBooks = new ArrayList<Book>();\n this.numberedListOfSearch = new HashMap<Integer, Book>();\n if (part.length()>=4){\n //Adding all the searching books into an ArrayList<Book>\n //No duplicating for books having the same title\n boolean bookExist = false;\n for (Book book : this.libraryBooks){\n if ((book.getTitle().toLowerCase().contains(part.toLowerCase())) || (book.getAuthor().toLowerCase().contains(part.toLowerCase()))){\n //Check whether any books having the same title in the list\n for (Book bookSearch : this.searchBooks){\n if (bookSearch.getTitle().equals(book.getTitle())){\n bookExist = true;\n break;\n }\n }\n //If none!\n if(!bookExist){\n this.searchBooks.add(book);\n }\n }\n bookExist = false;\n }\n //To put into a numbered list for printing\n //No duplicating for books having the same title\n for (int i =0; i < (this.searchBooks.size());i++){\n // put the book in the HashMap for printing \n this.numberedListOfSearch.put(i+1, this.searchBooks.get(i));\n }\n\n //To print out\n this.println(\"The searching process has finished!\");\n String researchBooks=\"\";\n //check whether the numbered list is empty or not\n if(this.numberedListOfSearch.size() >0){\n researchBooks += \"{\";\n for (int i = 0; i < this.numberedListOfSearch.size();i++){\n researchBooks += (i+1);\n researchBooks += \": \";\n researchBooks += this.numberedListOfSearch.get(i+1).toString();\n researchBooks += \"; \";\n }\n researchBooks = researchBooks.substring(0, researchBooks.length()-2);\n researchBooks += \"}\"; \n }\n //if the numbered list is empty\n else if ( this.numberedListOfSearch.size() == 0){\n researchBooks += \"Nothing found!\";\n }\n this.println(researchBooks);\n }\n\n //If not enough input key words!\n else{\n this.println(\"Please enter more key words! At least four!!\");\n }\n return this.searchBooks;\n }", "@Override\r\n\tpublic List<BookDto> getBookList(String storename) {\n\t\tList<BookDto> blist = sqlSession.selectList(ns + \"getBookList\", storename);\t\t\r\n\t\treturn blist;\r\n\t}", "@RequestMapping(\"viewPublisher/{id}\")\n\tpublic String viewPublisher(@PathVariable long id, Model model) {\n\t\t/*model.addAttribute(\"publisher\", publisherDao.findById(id));\n\t\treturn \"viewPublisher\";*/\n\t\t\n\t\tList<Publisher> list = new ArrayList<>();\n\t\tlist.add(publisherDao.findById(id));\n\t\tmodel.addAttribute(\"publisherItems\", list);\n\t\treturn \"publisherList\";\n\t}", "String findAllPublicationsFromAuthor(final Author author) {\n\n List<Publication> publications = Stream.concat(mBooks.stream(), mMagazines.stream()).collect(Collectors.toList());\n Set<Publication> foundPublications = publications.stream()\n .filter(publication -> publication.getAuthors().contains(author.getEmail()))\n .collect(Collectors.toSet());\n\n PrintModelVisitor printVisitor = new PrintModelVisitor();\n visitPublications(foundPublications, printVisitor);\n return printVisitor.getPublications();\n }", "private static void loadBooks() {\n\tbookmarks[2][0]=BookmarkManager.getInstance().createBook(4000,\"Walden\",\"\",1854,\"Wilder Publications\",new String[] {\"Henry David Thoreau\"},\"Philosophy\",4.3);\n\tbookmarks[2][1]=BookmarkManager.getInstance().createBook(4001,\"Self-Reliance and Other Essays\",\"\",1900,\"Dover Publications\",new String[] {\"Henry David Thoreau\"},\"Philosophy\",4.3);\n\tbookmarks[2][2]=BookmarkManager.getInstance().createBook(4002,\"Light From Many Lamps\",\"\",1960,\"Wilder Publications\",new String[] {\"Henry David Thoreau\"},\"Philosophy\",4.3);\n\tbookmarks[2][3]=BookmarkManager.getInstance().createBook(4003,\"Head First Design Patterns\",\"\",1944,\"Wilder Publications\",new String[] {\"Henry David Thoreau\"},\"Philosophy\",4.3);\n\tbookmarks[2][4]=BookmarkManager.getInstance().createBook(4004,\"Effective Java Programming Language Guide\",\"\",1990,\"Wilder Publications\",new String[] {\"Eric Freeman\",\"Bert Bates\",\"Kathy Sierra\",\"Elisabeth Robson\"},\"Philosophy\",4.3);\n}", "Book getLatestBook();", "private static void queryBooksByGenre(){\n\t\tSystem.out.println(\"===Query Books By Genre===\");\n\t\tScanner string_input = new Scanner(System.in);\n\t\t\n\t\tSystem.out.println(\"Enter Genre to Query Books by: \");\n\t\tString genre = string_input.next();\n\t\tint genre_index = getGenreIndex(genre); //returns the index of the genre entered, in ALL_GENRES\n\t\t\n\t\tif(genre_index > -1){//valid genre was entered\n\t\t\tIterator<String> iter = ALL_GENRES.get(genre_index).iterator();\n\t\t\tSystem.out.println(\"All \" + genre + \" books are: \");\n\t\t\tprintAllElements(iter);\n\t\t}\n\t}", "@RequestMapping(value=\"/list\",method=RequestMethod.GET)\n\tpublic @ResponseBody\n\tList<Book> getBookList(){\n\t\tList<Book> bookList = null;\n\t\ttry{\n\t\t\tbookList = bookService.getBookList();\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t\tSystem.out.println(\"bookList returned\");\n\t\tSystem.out.println(bookList);\n\t\treturn bookList;\n\t}", "public ArrayList<Booking> viewbooklist(String email) {\n\tStudentDAO studentDAO=new StudentDAO();\n\treturn studentDAO.viewbooklist(email);\n}", "Book getBookByTitle(String title);", "@Override\n public Set<Book> query(Set<Book> books) {\n Comparator<Book> comparator = Comparator.comparing(Book::getNumberOfPages);\n List<Book> list = new LinkedList<Book>(books);\n if (!isAscending) {\n comparator = comparator.reversed();\n }\n list.sort(comparator);\n return new LinkedHashSet<>(list);\n }", "@RequestMapping(value=\"/getbooks\", method=RequestMethod.GET, produces = \"application/json\")\n\tpublic List<Book> getAll() {\n\t\tList<Book> books = new ArrayList<>();\n\t\tbooks = bookDao.getAllFromDB();\n\t\t\n\t\treturn books;\n\t}", "@Override\n\tpublic List<BookRequestVO> bookList(String bookName) {\n\t\treturn bookStorePersistDao.bookList(bookName);\n\t}", "public String displayBooks(List<Books> bookList) {\r\n if (bookList.size() == 1) {\r\n productBB.setBook(bookList.get(0));\r\n return \"product-page\";\r\n } else {\r\n resultBB.setBookList(bookList);\r\n return \"results\";\r\n }\r\n }", "@SuppressWarnings( \"unchecked\" )\n\t@Transactional\n\t@RequestMapping( value = \"/search\", method = RequestMethod.GET )\n\tpublic @ResponseBody Map<String, Object> getPublicationList( \n\t\t\t@RequestParam( value = \"query\", required = false ) String query,\n\t\t\t@RequestParam( value = \"publicationType\", required = false ) String publicationType,\n\t\t\t@RequestParam( value = \"authorId\", required = false ) String authorId,\n\t\t\t@RequestParam( value = \"eventId\", required = false ) String eventId,\n\t\t\t@RequestParam( value = \"page\", required = false ) Integer page, \n\t\t\t@RequestParam( value = \"maxresult\", required = false ) Integer maxresult,\n\t\t\t@RequestParam( value = \"source\", required = false ) String source,\n\t\t\t@RequestParam( value = \"fulltextSearch\", required = false ) String fulltextSearch,\n\t\t\t@RequestParam( value = \"year\", required = false ) String year,\n\t\t\t@RequestParam( value = \"orderBy\", required = false ) String orderBy,\n\t\t\tfinal HttpServletResponse response )\n\t{\n\t\t/* == Set Default Values== */\n\t\tif ( query == null ) \t\t\tquery = \"\";\n\t\tif ( publicationType == null ) \tpublicationType = \"all\";\n\t\tif ( page == null )\t\t\t\tpage = 0;\n\t\tif ( maxresult == null )\t\tmaxresult = 50;\n\t\tif ( fulltextSearch == null || ( fulltextSearch != null && fulltextSearch.equals( \"yes\" ) ) )\n\t\t\tfulltextSearch = \"yes\";\n\t\telse\t\t\t\t\t\t\tfulltextSearch = \"no\";\n\t\tif ( year == null || year.isEmpty() )\n\t\t\tyear = \"all\";\n\t\tif ( orderBy == null )\t\t\torderBy = \"citation\";\n\t\t// Currently, system only provides query on internal database\n\t\tsource = \"internal\";\n\t\t\t\n\t\t\n\t\t// create JSON mapper for response\n\t\tMap<String, Object> responseMap = new LinkedHashMap<String, Object>();\n\n\t\tresponseMap.put( \"query\", query );\n\t\tif ( !publicationType.equals( \"all\" ) )\n\t\t\tresponseMap.put( \"publicationType\", publicationType );\n\t\tif ( !year.equals( \"all\" ) )\n\t\t\tresponseMap.put( \"year\", year );\n\t\tresponseMap.put( \"page\", page );\n\t\tresponseMap.put( \"maxresult\", maxresult );\n\t\tresponseMap.put( \"fulltextSearch\", fulltextSearch );\n\t\tresponseMap.put( \"orderBy\", orderBy );\n\t\t\n\t\tMap<String, Object> publicationMap = publicationFeature.getPublicationSearch().getPublicationListByQuery( query, publicationType, authorId, eventId, page, maxresult, source, fulltextSearch, year, orderBy );\n\t\t\n\t\tif ( (Integer) publicationMap.get( \"totalCount\" ) > 0 )\n\t\t{\n\t\t\tresponseMap.put( \"totalCount\", (Integer) publicationMap.get( \"totalCount\" ) );\n\t\t\treturn publicationFeature.getPublicationSearch().printJsonOutput( responseMap, (List<Publication>) publicationMap.get( \"publications\" ) );\n\t\t}\n\t\telse\n\t\t{\n\t\t\tresponseMap.put( \"totalCount\", 0 );\n\t\t\tresponseMap.put( \"count\", 0 );\n\t\t\treturn responseMap;\n\t\t}\n\t}", "@Test\n public void Given_store_with_books_When_filtering_by_existing_author_Then_only_books_of_the_author_are_returned() {\n booksList.add(B1_A);\n booksList.add(B2_A);\n booksList.add(B3_B);\n\n when(dao.getBooks()).thenReturn(booksList);\n\n List<Book> booksFilteredByAuthor = store.getBooksByAuthor(B1_A.getAuthor());\n\n assertThat(booksFilteredByAuthor).containsExactlyInAnyOrder(B1_A, B2_A);\n }", "private void getPPDataUpdatePublisher(PublisherManager publisherMgr,\n ArrayList<String> publisherList, boolean isModified) {\n for(String pubKey : publisherList) {\n Uri contentUri = PublisherProviderInterface.CONTENT_URI;\n String[] projection = {PublisherProviderInterface.Columns.PUBLISHER_KEY,\n PublisherProviderInterface.Columns.DESCRIPTION,\n PublisherProviderInterface.Columns.MARKET_LINK,\n };\n String where = PublisherProviderInterface.Columns.PUBLISHER_KEY + EQUALS + Q + pubKey + Q;\n ContentResolver cr = getContentResolver();\n Cursor cursor = null;\n String description = null;\n String marketLink = null;\n try {\n cursor = cr.query(contentUri, projection, where, null, null);\n if(cursor != null && cursor.moveToFirst()) {\n do {\n description = cursor.getString(cursor.getColumnIndex(PublisherProviderInterface.Columns.DESCRIPTION));\n marketLink = cursor.getString(cursor.getColumnIndex(PublisherProviderInterface.Columns.MARKET_LINK));\n } while (cursor.moveToNext());\n }\n } catch(Exception e) {\n Log.e(TAG, \"Query failed with exception : \" + e, e);\n } finally {\n if(cursor != null) cursor.close();\n }\n if(!isModified) {\n publisherMgr.handlePublisherAdded(pubKey, description, marketLink);\n } else {\n publisherMgr.handlePublisherModified(pubKey, description, marketLink);\n }\n }\n }", "@SuppressWarnings(\"unchecked\")\n\t@Override\n\tpublic List<?> extractData(ResultSet rs) throws SQLException {\n\n\n\t\tList<Publisher> publisher = new ArrayList<Publisher>();\n\t\tBookDAO bdao = new BookDAO(conn);\n\t\t\n\t\twhile(rs.next()){\n\t\t\tPublisher b = new Publisher();\n\t\t\tb.setPublisherId(rs.getInt(\"publisherId\"));\n\t\t\tb.setPublisherName(rs.getString(\"publisherName\"));\n\t\t\tb.setPublisherAddress(rs.getString(\"publisherAddress\"));\n\t\t\tb.setPublisherPhones(rs.getString(\"publisherPhone\"));\n\t\t\t\n\t\t\tif ((b.getBooks() != null && b.getBooks().size() > 0)){\n\t\t\tfor(Book bo: b.getBooks())\n\t\t\t\tb.setBooks((List<Book>) bdao.readFirstLevel(\"select * from tbl_book where bookId = ?)\", new Object[] {bo.getBookId()}));\n\t\t }\n\t\t\tpublisher.add(b);\n\t\t}\n\t\treturn publisher;\n\t}", "public String searchByFilter() {\n if (selectedFilter.size() != 0) {\n for (Genre filterOption : selectedFilter) {\n searchTerm = searchResultTerm;\n searchBook();\n\n System.out.println(\"CURRENT NUMBER OF BOOKS: \" + books.size());\n\n BookCollection temp = this.db.getCollectionByGenre(filterOption);\n System.out.println(\"GETTING COLLECTION FOR FILTERING: \" + temp.getCollectionName() + \" NUM OF BOOKS: \"\n + temp.getCollectionBooks().size());\n filterBookList(temp.getCollectionBooks());\n System.out.println(\"UPDATED NUMBER OF BOOKS: \" + books.size());\n }\n } else {\n searchTerm = searchResultTerm;\n searchBook();\n }\n\n return \"list.xhtml?faces-redirect=true\";\n }", "public void listBooksByAuthor(String name) {\n String sql = \"SELECT ISBN, BookName, AuthorName, Price \" +\n \"FROM books \" +\n \"WHERE AuthorName = ?\";\n\n try (Connection conn = this.connect();\n PreparedStatement pstmt = conn.prepareStatement(sql)) {\n\n // Set values\n pstmt.setString(1, name);\n\n ResultSet rs = pstmt.executeQuery();\n\n // Print results\n while(rs.next()) {\n System.out.println(rs.getInt(\"ISBN\") + \"\\t\" +\n rs.getString(\"BookName\") + \"\\t\" +\n rs.getString(\"AuthorName\") + \"\\t\" +\n rs.getInt(\"Price\"));\n }\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }", "ImmutableList<SchemaOrgType> getPublisherList();", "public StrColumn getBookPublisher() {\n return delegate.getColumn(\"book_publisher\", DelegatingStrColumn::new);\n }", "public List<Book> findAll() {\n return bookRepository.findAll();\n }", "public List<Books> findBooksByFormat(String format) {\r\n return bookController.findBooksByFormat(format);\r\n }", "public void displayBook()\n\t{\n\t\tb.display();\n\t\tSystem.out.println(\"Available Books=\"+availableBooks+\"\\n\");\n\t}" ]
[ "0.7734152", "0.754171", "0.73350936", "0.6833761", "0.6712351", "0.6637367", "0.6559037", "0.65584385", "0.6557027", "0.65077657", "0.6505513", "0.6480169", "0.6426653", "0.6337849", "0.6336307", "0.6321941", "0.6303555", "0.6267246", "0.6263976", "0.6222399", "0.620272", "0.6202413", "0.62022734", "0.6201781", "0.617783", "0.6156835", "0.6140889", "0.6094956", "0.60920125", "0.60901725", "0.6086032", "0.6083516", "0.6069749", "0.60621166", "0.6054059", "0.60333455", "0.6028704", "0.60114515", "0.6004496", "0.6001648", "0.59971774", "0.5981016", "0.59808034", "0.5960566", "0.5959826", "0.5953464", "0.59532046", "0.5946618", "0.59135514", "0.59065866", "0.5867619", "0.5863763", "0.5854161", "0.58467436", "0.5842904", "0.5835348", "0.5831399", "0.58256847", "0.58096904", "0.5809323", "0.58054996", "0.58047044", "0.5801811", "0.57970554", "0.5792121", "0.5785626", "0.5784004", "0.5737882", "0.57351947", "0.57347816", "0.5733462", "0.5723696", "0.57195026", "0.5718035", "0.57070845", "0.56951845", "0.56949526", "0.5693137", "0.5690589", "0.5666043", "0.56640863", "0.5647824", "0.5647185", "0.56401724", "0.5632856", "0.5631222", "0.56267655", "0.5625703", "0.5615164", "0.5612029", "0.5595559", "0.55852836", "0.5581469", "0.55647707", "0.5561316", "0.55489486", "0.554673", "0.5538476", "0.55272776", "0.5526739" ]
0.7531028
2
/Print all elements in the iterator.
private static void printAllElements(Iterator<String> iter) { int count = 0; if(!iter.hasNext()) //if the list is empty then print out 'Empty!' System.out.println("Sorry! There are no such books in our records!"); //else if list is not empty then print out all its elements while(iter.hasNext()){ count++; String bookTitle = iter.next(); System.out.println(count + ". " + bookTitle); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void print() {\t\r\n\t\tIterator<Elemento> e = t.iterator();\r\n\t\twhile(e.hasNext())\r\n\t\t\te.next().print();\r\n\t}", "public void printAll() {\n \tfor (int i = 0; i < Table.size(); i++) {\n \t\tList<T> data = Table.get(i);\n \t\tdata.placeIterator();\n \t\twhile (!data.offEnd()) {\n \t\t\tSystem.out.print(data.getIterator() + \"\\n\");\n \t\t\tdata.advanceIterator();\n \t\t}\n \t\t\n \t}\n }", "public void printElements() {\r\n for (int i = 0; i < pageList.size(); i++) {\r\n System.out.println(i + \" : \" + pageList.get(i));\r\n }\r\n }", "public void print() {\n for (int i = 0; i < size; i++)\n System.out.print(elements[i] + \" \");\n System.out.println();\n }", "public void print() {\n\t\tint i = 1;\n\t\tfor (String s: g.keySet()) {\n\t\t\tSystem.out.print(\"Element: \" + i++ + \" \" + s + \" --> \");\n\t\t\tfor (String k: g.get(s)) {\n\t\t\t\tSystem.out.print(k + \" ### \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public void print() {\n\t\tIntNode curr;\n\t\tfor (curr = head; curr != null; curr = curr.next) {\n\t\t\tSystem.out.print(curr.key + \" \");\n\t\t}\n\t\tSystem.out.println();\n\t}", "public void print(){\n\t\tfor (int i=0; i<_size; i++){\n\t\t\tSystem.out.print(_a[i].getKey()+\"; \");\n\t\t}\n\t\tSystem.out.println();\n\t}", "private static void printCollection(String title, Iterator itr) {\n System.out.println(title);\n while (itr.hasNext())\n System.out.println(\" \" + itr.next());\n }", "public void print() {\r\n \tfor (int i = 0; i < arbres.size(); i++) {\r\n \t\tSystem.out.println(\"Ordre de \" + arbres.get(i).ordre + \":\");\r\n \t\tarbres.get(i).print(\"\");\r\n \t\tSystem.out.println();\r\n \t}\r\n }", "public void print() {\r\n\t\tfor (int i = front; i <= rear; i++) {\r\n\t\t\tSystem.out.print(arr[i].getData() + \"\\t\");\r\n\t\t}\r\n\t}", "public void print() {\n for (int i=0; i<lines.size(); i++)\n {\n System.out.println(lines.get(i));\n }\n }", "public void print() {\r\n\t\tSystem.out.print(\"|\");\r\n\t\t//loop executes until all elements of the list are printed\r\n\t\tfor (int i=0;i<capacity;i++) {\r\n\t\t\tSystem.out.print(list[i]+\" |\");\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t}", "private void printAllItems() {\n Set<ClothingItem> items = ctrl.getAllItems();\n items.stream().forEach(System.out::println);\n }", "@Override\r\n\tpublic void printResult() {\n\t\tfor(Integer i:numbers)\r\n\t\t{\r\n\t\t\tSystem.out.println(i+\" \");\r\n\t\t}\r\n\t\t\r\n\t}", "public void print (){\r\n for (int i = 0; i < graph.size(); ++i){\r\n graph.get(i).print();\r\n }\r\n }", "public void print()\n {\n for (int i=0; i<list.length; i++)\n System.out.println(i + \":\\t\" + list[i]);\n }", "public void printAll()\n {\n r.showAll();\n }", "@Override\n public void printDeque() {\n int index = moveForward(nextFirst, 1);\n for (int count = 1; count <= size; count++) {\n System.out.print(items[index] + \" \");\n index = moveForward(index, 1);\n }\n }", "public void printItems() {\n for (Item item1 : items) {\n System.out.println(item1.toString());\n }\n }", "public void print(){\n for(Recipe r : recipes){\n System.out.println(r.toString());\n }\n }", "public static void print_all() {\n for (int i = 0; i < roster.size(); i++)\n System.out.println(roster.get(i).print());\n\n System.out.println();\n }", "public void printAll() {\n\t\tNode node = root;\n\t\twhile (node != null) {\n\t\t\tSystem.out.println(node.data);\n\t\t\tnode = node.left;\n\t\t}\n\t}", "public void print()\n {\n for (Node curr = first; curr != null; curr = curr.next)\n System.out.print(curr.val + \" \");\n System.out.println();\n }", "public void printaPiedras(){\n for(Piedra p: piedras){\n System.out.println(p);\n }\n \n// Iterator<Piedra> it =piedras.iterator();\n// while(it.hasNext()){\n// System.out.println(it.next());\n// }\n \n }", "public void print() {\r\n\t\tif(isEmpty()) {\r\n\t\t\tSystem.out.printf(\"%s is Empty%n\", name);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tSystem.out.printf(\"%s: %n\", name);\r\n\t\tNode<E> current = first;//node to traverse the list\r\n\t\t\r\n\t\twhile(current != null) {\r\n\t\t\tSystem.out.printf(\"%d \", current.data);\r\n\t\t\tcurrent = current.next;\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t}", "static void print(Collection c) {\n\t\tSystem.out.print(\"{\");\n\t\tfor(Iterator iterator=c.iterator();iterator.hasNext();) {\n\t\t\tSystem.out.printf(\"\\\"%s\\\"\", iterator.next());\n\t\t\tSystem.out.print(iterator.hasNext()?\", \":\"}\\n\");\n\t\t}\n\t}", "public void print(){\r\n\t\t\t\r\n\t\t\tint i=1;\r\n\t\t\t//Iterator<Receipt> iter=reciptlist.iterator();\r\n\t\t\t\r\n\t\t\tfor(Receipt R : reciptlist){\r\n\t\t\t\r\n\t\t\t\tSystem.out.println( \"--------------------------------------\");\r\n\t\t\t\tSystem.out.println( \"Reciet number: \" +i );\r\n\t\t\t\t\t\r\n\t\t\t\t\tSystem.out.println( \"ShoeType: \" + R.getShoeType());\r\n\t\t\t\t\tSystem.out.println( \" Amount: \" + R.getAmountSold());\r\n\t\t\t\t\tSystem.out.println( \" Discounted: \" + R.getDiscount());\r\n\t\t\t\t\tSystem.out.println( \" issuedTick : \" + R.getIssuedTick());\r\n\t\t\t\t\tSystem.out.println( \" requestd tick : \" + R.getRequestTick());\r\n\t\t\t\t\tSystem.out.println( \" customer : \" + R.getCustomer());\r\n\t\t\t\t\tSystem.out.println( \" seller : \" + R.getSeller());\r\n\t\t\t\t\t\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}\r\n\t\r\n\t\t\t}", "public void print() {\n System.out.print(datum+\" \");\n if (next != null) {\n next.print();\n }\n }", "public void print() {\n int rows = this.getNumRows();\n int cols = this.getNumColumns();\n\n for (int r = 0; r < rows; r++) {\n\n for (int c = 0; c < cols; c++) {\n System.out.print(this.getString(r, c) + \", \");\n }\n\n System.out.println(\" \");\n }\n }", "public void print() {\n int n = getSeq().size();\n int m = n / printLength;\n for (int i = 0; i < m; i++) {\n printLine(i * printLength, printLength);\n }\n printLine(n - n % printLength, n % printLength);\n System.out.println();\n }", "public void print () \r\n\t{\r\n\t\tfor (int index = 0; index < count; index++)\r\n\t\t{\r\n\t\t\tif (index % 5 == 0) // print 5 columns\r\n\t\t\t\tSystem.out.println();\r\n\r\n\t\t\tSystem.out.print(array[index] + \"\\t\");\t// print next element\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t}", "public void printAll() {\n\t\tfor(int i = 0; i<r.length; i++)\n\t\t\tprintReg(i);\n\t\tprintReg(\"hi\");\n\t\tprintReg(\"lo\");\n\t\tprintReg(\"pc\");\n\t}", "public void printItems();", "public void print() {\n for (int i = 0; i < table.length; i++) {\n System.out.printf(\"%d: \", i);\n \n HashMapEntry<K, V> temp = table[i];\n while (temp != null) {\n System.out.print(\"(\" + temp.key + \", \" + temp.value + \")\");\n \n if (temp.next != null) {\n System.out.print(\" --> \");\n }\n temp = temp.next;\n }\n \n System.out.println();\n }\n }", "public void print() {\n\t\tif (cs213.isEmpty()) {\n\t\t\tSystem.out.println(\"List is empty!\");\n\t\t\treturn;\n\t\t}\n\t\telse {\n\t\t\tcs213.print();\n\t\t}\n\t\treturn;\n\t\t}", "public void print()\n {\n System.out.println(name + \"\\n\");\n for(int iterator = 0; iterator < bookList.size() ; iterator++)\n {\n System.out.println((iterator+1) +\". \" + bookList.get(iterator).getTitle()+\" by \" +bookList.get(iterator).getAuthor()); \n }\n }", "public void Print() {\n\t\tcurr = head;\n\t\twhile (curr != null) {\n\t\t\tcurr.Print();\n\t\t\tcurr = curr.next;\n\t\t}\n\t}", "public static void printAll() {\n // Print all the data in the hashtable\n RocksIterator iter = db.newIterator();\n\n for (iter.seekToFirst(); iter.isValid(); iter.next()) {\n System.out.println(new String(iter.key()) + \"\\t=\\t\" + ByteIntUtilities.convertByteArrayToDouble(iter.value()));\n }\n\n iter.close();\n }", "public void printAll() {\n Node node = head;\n\n while (node != null) {\n System.out.println(node.getStudent());\n node = node.getLink();\n }\n System.out.println();\n }", "@Override\r\n\tpublic void print()\r\n\t{\t//TODO méthode à compléter (TP1-ex11)\r\n\t\tfor (IndexEntry indexEntry : data) {\r\n\t\t\tif(indexEntry ==null){\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tSystem.out.println(indexEntry.toString());\r\n\t\t}\r\n\t}", "void print() {\n Node current = this;\n while (current != null) {\n System.out.format(\"%d \", current.value);\n current = current.next;\n }\n System.out.println();\n }", "public void print() {\n System.out.println(\"**List of books in the library.\");\n for (Book b : books){\n if(b != null) {\n System.out.println(b);\n }\n }\n System.out.println(\"**End of list\");\n }", "void printList() {\n Entry<T> node = header;\n while(node!=null){\n System.out.print(node.element+\" \");\n node = node.next;\n }\n }", "public void dump() {\n for(Object object : results) {\n System.out.println( object );\n }\n }", "public void print() {\r\n\t\tfor (ListNode temp = head; temp != null; temp = temp.link) {\r\n\t\t\tSystem.out.println(temp.data);\r\n\t\t}\r\n\t}", "public void print(){\n for(int i = 0; i < numElements; i++){\n System.out.print(myCustomStack[i] + \" \");\n }\n }", "void print() {\n for (Process process : workload) {\n System.out.println(process);\n }\n }", "public void print() {\n\t\tfor (int count = 0; count < adjacencyList.length; count++) {\n\t\t\tLinkedList<Integer> edges = adjacencyList[count];\n\t\t\tSystem.out.println(\"Adjacency list for \" + count);\n\n\t\t\tSystem.out.print(\"head\");\n\t\t\tfor (Integer edge : edges) {\n\t\t\t\tSystem.out.print(\" -> \" + edge);\n\t\t\t}\n\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public void print() {\n for (Map.Entry<String, String> entry : dictionary.entrySet()) {\r\n String key = entry.getKey();\r\n System.out.println(key + \": \" + dictionary.get(key));\r\n }\r\n }", "public void printAllNodes() {\n\t\tNode current = head;\n\n\t\twhile( current != null ) {\n\t\t\tSystem.out.println(current.data);\n\t\t\tcurrent = current.next;\n\t\t}\n\t}", "void print() {\r\n\t\tOperations.print(lexemes, tokens);\r\n\t}", "public void print() {\n\t\t\n\t\tfor (int j = 0; j < height(); j++) {\n\t\t\tfor (int i = 0; i < width(); i++) {\n\t\t\t\tSystem.out.printf(\"%3d \", valueAt(i, j));\n\t\t\t}\n\t\t\tSystem.out.printf(\"\\n\");\n\t\t}\n\t\tSystem.out.printf(\"\\n\");\t\n\t}", "public void display(){\n \tfor(int i=0;i<size;i++){\n \tSystem.out.print(elements[i]+\" \");\n \t}\n\t}", "private void print() {\n\t\t// reorganize a wraparound queue and print\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tSystem.out.print(bq[(head + i) % bq.length] + \" \");\n\t\t}\n\t\tSystem.out.println(\"\\n\");\n\t}", "public void print() {\r\n\r\n Node currentNode = this.head;\r\n while (currentNode != null) {\r\n System.out.print(currentNode.data + \" \");\r\n currentNode = currentNode.next;\r\n }\r\n\r\n }", "public void printAll(){\n for (Triangle triangle : triangles) {\n System.out.println(triangle.toString());\n }\n for (Circle circle : circles) {\n System.out.println(circle.toString());\n }\n for (Rectangle rectangle : rectangles) {\n System.out.println(rectangle.toString());\n }\n }", "public void print() {\n int j = 1, k = 0;\n System.out.println(\"Heap contents:\");\n for (E item : heap) {\n System.out.print(item+\" \");\n k++;\n if (k >= j) {\n j = j << 1;\n k = 0;\n System.out.println(\"\");\n }\n }\n System.out.println(\"\");\n }", "public void levelOrder(){\n Iterator iter = iterator();\n while(iter.hasNext() == true) {\n System.out.println(iter.next());\n }\n }", "public void print() {\n\t\tSystem.out.println(toString());\n\t}", "public void print() {\n\t\tfor(int i = 0; i < size; i++) {\n\t\t\tfor(int j = 0; j < size; j++) {\n\t\t\t\tSystem.out.print(m[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\t\n\t}", "private void iter() {\n Node curr = new Node();\n curr = head;\n while (curr != null) {\n System.out.print(curr.card + \" \");\n curr = curr.next;\n }\n }", "public void print(){\n NodeD tmp = this.head;\n\n while(tmp!=null){\n System.out.println(tmp.getObject().asString());\n tmp = tmp.getNext();\n }\n }", "public void print_list() {\n \t \n \t//define current node as\n \t node<Type> current_node = new node<>();\n \t \n \t //now keep for loop and print the answer\n \t current_node = head;\n \t \n \t //print first element\n \t System.out.println(current_node.show_element());\n \t \n \t //now run for loop\n \t for (int i = 1 ; i <= len - 1 ; i ++) {\n \t\t \n \t\t //change current node\n \t\t current_node = current_node.show_next();\n \t\t \n \t\t //just print the answer\n \t\t System.out.println(current_node.show_element());\n \t }\n }", "public void printDeque() {\n for (int i = 0; i < size(); i += 1) {\n System.out.print(get(i));\n if (i != size() - 1) {\n System.out.print(\", \");\n }\n }\n System.out.println();\n }", "public static void print()\n {\n ProductGUI.Display(\"\\n\");\n for(Product element: productList)\n {\n ProductGUI.Display(\"\\n\");\n System.out.println(element);\n ProductGUI.Display(element.toString());\n }\n }", "public void printAllProducts()\n {\n printHeading();\n \n for(Product product : stock)\n {\n System.out.println(product);\n }\n\n System.out.println();\n }", "private void printAll() {\n int numberToPrint = searchResultsTable.getItems().size();\n\n FXMLCustomerController printController = new FXMLCustomerController();\n printController = (FXMLCustomerController) printController.load();\n printController.setUpPrint(numberToPrint);\n\n if (printController.okToPrint()) {\n System.out.println(\"Printing\");\n printController.getStage().show();\n for (SearchRowItem eachItem : searchResultsTable.getItems()) {\n printController.setCustomerDetails(eachItem);\n printController.print();\n System.out.println(\"Printed : \" + eachItem.toString());\n }\n printController.endPrint();\n //printController.getStage().hide();\n }\n }", "public void print() {\n\t\tfor (int i = 0; i < TABLE_SIZE; i++) {\n\t\t\tSystem.out.print(\"|\");\n\t\t\tif (array[i] != null) {\n\t\t\t\tSystem.out.print(array[i].value);\n\t\t\t} else {\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.print(\"|\\n\");\n\t}", "public void display() {\n\t\tSystem.out.println(\"[\" + recDisplay(head) + \"]\");\n\t}", "void printList(){\n Node iter = this.head;\n\n while(iter != null)\n {\n System.out.print(iter.data+\"->\");\n iter = iter.next;\n }\n System.out.print(\"null\\n\");\n }", "public void print() {\n\t\tPrinter.print(doPrint());\n\t}", "public void print() {\n System.out.println(toString());\n }", "public void printElements() {\n\t\tfor(int i=1;i<=this.str.length()/n;i++){\r\n\t\t\tint j=i*this.n;\r\n\t\t\tSystem.out.print(this.str.charAt(j-1));\r\n\t\t}\r\n\t}", "public void print() {\n\t\t\n\t\tfor(Solution sol : population) {\n\t\t\tSystem.out.println(sol.getPossibleSolution() + \" \" + sol.getPath());\n\t\t}\n\t}", "public void print() \n //POST:\tThe contents of the linked list are printed\n\t{\n\t\tNode<T> tmp = start;\n\t\tint count = 0; //counter to keep track of how many loops occur\n\t\tif(length == 0) //if empty list \n\t\t{\n\t\t\tSystem.out.println(\"0: []\");\n\t\t\treturn;\n\t\t}\n\t\tSystem.out.println(\"start: \" + tmp.value);\n\t\tSystem.out.print(length + \": [\");\n\n\t\t//while the end of the list is not reached and it has not already looped once\n\t\twhile((tmp.next != start && count == 0) || count < 1) \n\t\t{\n\t\t\tSystem.out.print(tmp.value.toString() + \", \");\n\t\t\tif(tmp.next == start) //if we have reached the end of the list\n\t\t\t{\n\t\t\t\tcount++;\t\t//increment loop counter\n\t\t\t}\n\t\t\ttmp = tmp.next;\t\t//traverse list\n\t\t}\n\t\tSystem.out.print(\"]\\n\");\n\t}", "private static void iterator() {\n\t\t\r\n\t}", "private void printResults() {\n\t\tfor (Test test : tests) {\n\t\t\ttest.printResults();\n\t\t}\n\t}", "public static void listToPrint() {\r\n for (int i = 0; i < ListeElem.size(); i++) {\r\n ListeElem.get(i).toPrint();\r\n }\r\n\r\n }", "public void print() {\r\n for (int i : heap) {\r\n System.out.print(i + \" \");\r\n }\r\n System.out.println();\r\n }", "public void printDeque() {\n for (int index = 0; index < size; index++) {\n System.out.print(get(index) + \" \");\n }\n System.out.println(\"\\n\");\n\n }", "public void print()\n\t{\n\t\tStringBuffer print = new StringBuffer();\n\t\tif (arraySize != 0)\n\t\t{\n\t\t\tfor (int index = 0; index < arraySize - 1; index++) \n\t\t\t{ \n\t\t\t\tprint.append(array[index] + \", \");\n\t\t\t}\n\t\t\tprint.append(array[arraySize - 1]);\n\t\t\tSystem.out.println(print.toString());\n\t\t}\n\t}", "public void printStudents()\n {\n for(Student s : students)\n System.out.println(s);\n }", "public void printAllComputers( ) { \n\t\tint i=1;\n\t\tfor (Computer temp : computers ) {\n\n\t\t\tSystem.out.println(\"Computer number : \"+i);\n\t\t\ttemp.printComputerSummary();\n\t\t\ti++;\n\n\t\t}\n\t}", "public void print() {\n\t\tfor(String subj : subjects) {\n\t\t\tSystem.out.println(subj);\n\t\t}\n\t\tSystem.out.println(\"==========\");\n\t\t\n\t\tfor(StudentMarks ssm : studMarks) {\n\t\t\tSystem.out.println(ssm.student);\n\t\t\tfor(Byte m : ssm.marks) {\n\t\t\t\tSystem.out.print(m + \" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public void printList(){\n MovieNode temp = head;\t\t//Iterator\n System.out.print(\"Data: \");\n while(temp.next != null){\t\t//While theres data\n System.out.print(temp.next.data + \"->\");\t//Print the data\n temp = temp.next;\t\t\t\t\t\t\t//Point to the next MovieNode\n }\n System.out.println();\t\t\t\t\t\t//Go to the next line\n }", "public void print() {\n\t\tint l = 0;\n\t\tSystem.out.println();\n\t\tfor (int v = 0; v < vertexList.length; v++) {\n\t\t\tSystem.out.print(vertexList[v].id);\n\t\t\tfor (Neighbor nbr = vertexList[v].adjList; nbr != null; nbr = nbr.next) {\n\t\t\t\tSystem.out.print(\" -> \" + vertexList[nbr.vertexNumber].id + \"(\"\n\t\t\t\t\t\t+ nbr.weight + \")\");\n\t\t\t\tl++;\n\t\t\t}\n\t\t\tSystem.out.println(\"\\n\");\n\t\t}\n\t\tSystem.out.println(\"Number of edges = \" + l / 2);\n\t}", "public void printTree() {\n Object[] nodeArray = this.toArray();\n for (int i = 0; i < nodeArray.length; i++) {\n System.out.println(nodeArray[i]);\n }\n }", "public void print() {\n\t\ttraversePreOrder(root, 0);\n\t}", "public void print() {\r\n\t\tif (this.isEmpty()) {\r\n\t\t\tSystem.out.println(\"The linked list is empty!\");\r\n\t\t}else if (this.size() == 1) {\r\n\t\t\tSystem.out.println(head.getValue());\r\n\t\t}else {\r\n\t\t\tpointer = head;\r\n\t\t\twhile (pointer != null) {\r\n\t\t\t\tif (pointer != tail) System.out.print(pointer.getValue()+\"-->\");\r\n\t\t\t\telse System.out.println(pointer.getValue());\r\n\t\t\t\tpointer = pointer.getNext();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void print() {\n LinkedList i = this;\n\n System.out.print(\"LinkedList: \");\n while (i.next != null) {\n System.out.print(i.name + ' ');\n i = i.next;\n }\n System.out.print(i.name);\n }", "public void printOut() {\n\t\tif(root.left != null) {\n\t\t\tprintOut(root.left);\n\t\t}\n\t\t\n\t\tSystem.out.println(root.element);\n\t\t\n\t\tif(root.right != null) {\n\t\t\tprintOut(root.right);\n\t\t}\n\t}", "public void print(){\n String res = \"\" + this.number;\n for(Edge edge: edges){\n res += \" \" + edge.toString() + \" \";\n }\n System.out.println(res.trim());\n }", "@Override\n\t\t\tpublic void print() {\n\t\t\t\t\n\t\t\t}", "private void printData() {\n\n System.out.println(\"No of Stars '\" + myStars.size() + \"'.\");\n\n// Iterator<Star> it = myStars.iterator();\n// System.out.println(\"First 20 in the list\");\n// int i=0;\n// while (it.hasNext()) {\n// System.out.println(it.next().toString());\n// i++;\n// if(i==19){\n// break;\n// }\n// }\n }", "public void print() {\n System.out.println(this.toString());\n }", "@Override\n\t\tpublic void print() {\n\n\t\t}", "public void print() {\n\t\tNode temp = head;\n\n\t\tif(temp == null) {\n\t\t\treturn;\n\t\t} \n\n\t\twhile(temp.next != null) {\n\t\t\tSystem.out.print(temp.data + \"->\");\n\t\t\ttemp = temp.next;\n\t\t}\n\t\tSystem.out.println(temp.data);\n\t}", "public void printAllPlayers(){\n for (Player player : players){\n player.printPlayerInfo();\n }\n }", "public void print() {\r\n\t\tint size = list.size();\r\n\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"┌───────────────────────────┐\");\r\n\t\tSystem.out.println(\"│ \t\t\t성적 출력 \t\t │\");\r\n\t\tSystem.out.println(\"└───────────────────────────┘\");\r\n\r\n\t\tfor (int i = 0; i < size; i++) {\r\n\r\n\t\t\tExam exam = list.get(i);\r\n\t\t\tint kor = exam.getKor();\r\n\t\t\tint eng = exam.getEng();\r\n\t\t\tint math = exam.getMath();\r\n\r\n\t\t\tint total = exam.total();// kor + eng + math;\r\n\t\t\tfloat avg = exam.avg();// total / 3.0f;\r\n\t\t\tSystem.out.printf(\"성적%d > 국어:%d, 영어:%d, 수학:%d\", i + 1, kor, eng, math);\r\n\t\t\tonPrint(exam);\r\n\t\t\tSystem.out.printf(\"총점:%d, 평균:%.4f\\n\", total, avg);\r\n\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"─────────────────────────────\");\r\n\r\n\t}", "@Override\n public void printDeque() {\n int position = plusOne(nextFirst);\n for (int i = 0; i < size; i += 1) {\n System.out.print(array[position]);\n System.out.print(' ');\n position = plusOne(position);\n }\n System.out.print('\\n');\n }" ]
[ "0.810147", "0.7625329", "0.7446556", "0.73954284", "0.7179101", "0.71061134", "0.70974636", "0.7026108", "0.70098966", "0.7005079", "0.6933711", "0.6908268", "0.6878227", "0.68401885", "0.6835251", "0.6824134", "0.6810524", "0.68010026", "0.6787386", "0.67860615", "0.6763477", "0.67630506", "0.6763016", "0.67411983", "0.6720554", "0.668572", "0.6679297", "0.66658837", "0.6639791", "0.66218185", "0.6616446", "0.6611897", "0.66035175", "0.66017157", "0.6597987", "0.6591882", "0.6579126", "0.65765953", "0.65736383", "0.65733856", "0.65729225", "0.65558994", "0.65488297", "0.65371466", "0.651963", "0.6514325", "0.6507788", "0.6503036", "0.6500832", "0.6499234", "0.6487287", "0.64843005", "0.6480644", "0.6471365", "0.64548576", "0.64546776", "0.64407706", "0.6434268", "0.643364", "0.64294803", "0.64238036", "0.6421746", "0.6392753", "0.6373479", "0.6356724", "0.6343418", "0.63340485", "0.6332468", "0.63226986", "0.6318071", "0.6317153", "0.63128567", "0.63062596", "0.63031566", "0.6302899", "0.62986743", "0.62984616", "0.62916785", "0.62870413", "0.62845343", "0.62750924", "0.627056", "0.62696856", "0.6268859", "0.62669164", "0.62631106", "0.62588894", "0.6237078", "0.62347275", "0.6229373", "0.622822", "0.6226417", "0.6222873", "0.6214864", "0.6206585", "0.6206514", "0.6200287", "0.61998063", "0.6199261", "0.6198323" ]
0.7449665
2
/Returns list of books of the genre entered by the user
private static void queryBooksByGenre(){ System.out.println("===Query Books By Genre==="); Scanner string_input = new Scanner(System.in); System.out.println("Enter Genre to Query Books by: "); String genre = string_input.next(); int genre_index = getGenreIndex(genre); //returns the index of the genre entered, in ALL_GENRES if(genre_index > -1){//valid genre was entered Iterator<String> iter = ALL_GENRES.get(genre_index).iterator(); System.out.println("All " + genre + " books are: "); printAllElements(iter); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<Books> findBooksByGenre(String genre) {\r\n HttpSession session = (HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false);\r\n List<Genre> list = new ArrayList();\r\n Genre g = new Genre();\r\n g.setType(genre);\r\n list.add(g);\r\n session.setAttribute(\"lastGenre\",list);\r\n return bookController.findBooksByGenre(genre);\r\n }", "public List<Film> findAllByGenre(String genre);", "public String getGenre()\n {\n return bookGenre;\n }", "public String getBasedOnGenre(String genre) {\n String cap = genre.substring(0, 1).toUpperCase() + genre.substring(1);\n StringBuilder json = new StringBuilder();\n for (Node node: books) {\n if (node.getItem().getGenre().equals(cap)) {\n json.append(((Book)node.getItem()).getJSON()).append(\"\\n\");\n }\n }\n for (Node node: music) {\n if (node.getItem().getGenre().equals(cap)) {\n json.append(((Music)node.getItem()).getJSON()).append(\"\\n\");\n }\n }\n for (Node node: movies) {\n if (node.getItem().getGenre().equals(cap)) {\n json.append(((Movie)node.getItem()).getJSON()).append(\"\\n\");\n }\n }\n return json.toString();\n }", "private static void readBooksInfo() {\n List<eGenre> arrBook = new ArrayList<>();\n\n // 1 //\n arrBook.add(eGenre.FANTASY);\n arrBook.add(eGenre.ADVENTURE);\n book.add(new Book(1200, arrBook, \"Верн Жюль\", \"Таинственный остров\", 1875));\n arrBook.clear();\n // 2 //\n arrBook.add(eGenre.FANTASY);\n arrBook.add(eGenre.MYSTIC);\n book.add(new Book(425, arrBook, \"Григоренко Виталий\", \"Иван-душитель\", 1953));\n arrBook.clear();\n // 3 //\n arrBook.add(eGenre.DETECTIVE);\n arrBook.add(eGenre.MYSTIC);\n book.add(new Book(360, arrBook, \"Сейгер Райли\", \"Последние Девушки\", 1992));\n arrBook.clear();\n // 4 //\n arrBook.add(eGenre.DETECTIVE);\n book.add(new Book(385, arrBook, \"Ольга Володарская\", \"То ли ангел, то ли бес\", 1995));\n arrBook.clear();\n // 5 //\n arrBook.add(eGenre.NOVEL);\n arrBook.add(eGenre.ACTION);\n book.add(new Book(180, arrBook, \"Лихэйн Деннис\", \"Закон ночи\", 1944));\n arrBook.clear();\n // 6 //\n arrBook.add(eGenre.NOVEL);\n book.add(new Book(224, arrBook, \"Мураками Харуки\", \"Страна Чудес без тормозов и Конец Света\", 1985));\n arrBook.clear();\n // 7 //\n arrBook.add(eGenre.STORY);\n book.add(new Book(1200, arrBook, \"Джон Хейвуд\", \"Люди Севера: История викингов, 793–1241\", 2017));\n arrBook.clear();\n // 8 //\n arrBook.add(eGenre.ACTION);\n arrBook.add(eGenre.MYSTIC);\n arrBook.add(eGenre.DETECTIVE);\n book.add(new Book(415, arrBook, \"Линдквист Юн\", \"Впусти меня\", 2017));\n arrBook.clear();\n // 9 //\n arrBook.add(eGenre.ACTION);\n book.add(new Book(202, arrBook, \"Сухов Евгений\", \"Таежная месть\", 2016));\n arrBook.clear();\n // 10 //\n arrBook.add(eGenre.DETECTIVE);\n arrBook.add(eGenre.MYSTIC);\n book.add(new Book(231, arrBook, \"Винд Кристиан\", \"Призраки глубин\", 2019));\n arrBook.clear();\n }", "public void setGenre(ArrayList<String> genre) {\n this.genre = genre;\n }", "public void showGenre(Genre genre) {\n for (Record r : cataloue) {\n if (r.getGenre() == genre) {\n System.out.println(r);\n }\n }\n\n }", "public BookType getGenre() {\r\n return genre;\r\n }", "public void listBooks() {\n for (int g = 0; g < books.length; g++) {\n books[g].toString();\n }\n// List all books in Bookstore\n }", "public Books getBooks(String title,String authors,String isbn,String publisher);", "public ArrayList<Book> gettitleBook(String title);", "public List<Book> getBooks() {\r\n \t\t// switch dates\r\n \t\tif (filter_dateFrom.compareTo(filter_dateTo) > 0) {\r\n \t\t\tCalendar tmp = filter_dateFrom;\r\n \t\t\tfilter_dateFrom = filter_dateTo;\r\n \t\t\tfilter_dateTo = tmp;\r\n \t\t}\r\n \r\n \t\tDate yearFrom = filter_dateFrom.getTime();\r\n \t\tDate yearTo = filter_dateTo.getTime();\r\n \r\n \t\t// genre\r\n \t\tGenre genre = null;\r\n \t\tif (!filter_genre.isEmpty() && !filter_genre.equalsIgnoreCase(\"all\")) {\r\n \t\t\tgenre = genreMgr.findByName(filter_genre);\r\n \t\t\tif (genre == null) {\r\n \t\t\t\tSystem.err.println(\"Badly working database encoding!\");\r\n \t\t\t}\r\n \t\t}\r\n \r\n \t\treturn bookMgr.find(filter_name, filter_author, yearFrom, yearTo, genre, filter_isbn_issn);\r\n \t}", "public String advancedSearchBooks() {\r\n List<Books> books = new ArrayList<Books>();\r\n keywords = keywords.trim();\r\n \r\n switch (searchBy) {\r\n case \"all\":\r\n return searchBooks();\r\n case \"title\":\r\n books = findBooksByTitle(keywords);\r\n break;\r\n case \"identifier\":\r\n books = findBooksByIdentifier(keywords);\r\n break;\r\n case \"contributor\":\r\n books = findBooksByContributor(keywords);\r\n break;\r\n case \"publisher\":\r\n books = findBooksByPublisher(keywords);\r\n break;\r\n case \"year\":\r\n books = findBooksByYear(keywords);\r\n break;\r\n case \"genre\":\r\n books = findBooksByGenre(keywords);\r\n break;\r\n case \"format\":\r\n books = findBooksByFormat(keywords);\r\n break;\r\n }\r\n clearFields();\r\n\r\n if (books == null || books.isEmpty()) {\r\n books = new ArrayList<Books>();\r\n }\r\n\r\n return displayBooks(books);\r\n }", "public void setGenre(String genre) {\n this.genre = genre;\n }", "private void populateGenres(){\n try{\n Connection conn = DriverManager.getConnection(\n \"jdbc:sqlite:\\\\D:\\\\Programming\\\\Java\\\\Assignments\\\\CIS_452\\\\Music_Library\\\\album_library.sqlite\");\n Statement stmnt = conn.createStatement();\n ResultSet results = stmnt.executeQuery(\"SELECT DISTINCT genre FROM artist ORDER BY genre\");\n\n while(results.next()){\n String genre = results.getString(1);\n genreList.add(genre);\n }\n conn.close();\n } catch(SQLException e) {\n System.out.println(\"Error connecting to database: \" + e.getMessage());\n }\n }", "private static void addToGenreTable(BookDetails book, String bookTitle) {\n\t\t//ALL_GENRES representation --> Biology|Mathematics|Chemistry|Physics|Science_Fiction|Fantasy|Action|Drama|Romance|Horror|History|Autobiography|Biography \n\t\tswitch(book.getGenre()){\n\t\t\tcase Biology:\n\t\t\t\tALL_GENRES.get(0).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase Mathematics:\n\t\t\t\tALL_GENRES.get(1).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase Chemistry:\n\t\t\t\tALL_GENRES.get(2).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase Physics:\n\t\t\t\tALL_GENRES.get(3).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase Science_Fiction:\n\t\t\t\tALL_GENRES.get(4).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase Fantasy:\n\t\t\t\tALL_GENRES.get(5).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase Action:\n\t\t\t\tALL_GENRES.get(6).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase Drama:\n\t\t\t\tALL_GENRES.get(7).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase Romance:\n\t\t\t\tALL_GENRES.get(8).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase Horror:\n\t\t\t\tALL_GENRES.get(9).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase History:\n\t\t\t\tALL_GENRES.get(10).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase Autobiography:\n\t\t\t\tALL_GENRES.get(11).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase Biography:\n\t\t\t\tALL_GENRES.get(12).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tSystem.out.println(\"ERROR: Invalid Genre Input\");\n\t\t\t\tbreak;\n\t\t}\n\t}", "List<Book> getAllBooks();", "@Secured({\"ROLE_USER\", \"ROLE_ADMIN\"}) \r\n\t@Query(\"SELECT m FROM Movie m INNER JOIN m.genres g WHERE g.genreID IN (:genreID)\")\r\n\tList<Movie> findByGenreID(@Param(\"genreID\") Long genreID);", "@Override\n\tpublic List<Record> getRecordsByGenre(Genre genre) {\n\t\tSession session = HibernateSessionFactory.getSession();\n\t\tTransaction tx = session.beginTransaction();\n\t\tList<Record> list = new ArrayList<Record>();\n\t\tRecordDAO recordDAO = new RecordDAO();\n\n\t\ttry {\n\t\t\tlist = recordDAO.getRecordsByGenre(genre);\n\t\t\ttx.commit();\n\t\t} catch (RuntimeException e) {\n\t\t\te.printStackTrace();\n\t\t\ttx.rollback();\n\t\t} finally {\n\t\t\tsession.close();\n\t\t}\n\t\treturn list;\n\t}", "ImmutableList<SchemaOrgType> getGenreList();", "public String searchByFilter() {\n if (selectedFilter.size() != 0) {\n for (Genre filterOption : selectedFilter) {\n searchTerm = searchResultTerm;\n searchBook();\n\n System.out.println(\"CURRENT NUMBER OF BOOKS: \" + books.size());\n\n BookCollection temp = this.db.getCollectionByGenre(filterOption);\n System.out.println(\"GETTING COLLECTION FOR FILTERING: \" + temp.getCollectionName() + \" NUM OF BOOKS: \"\n + temp.getCollectionBooks().size());\n filterBookList(temp.getCollectionBooks());\n System.out.println(\"UPDATED NUMBER OF BOOKS: \" + books.size());\n }\n } else {\n searchTerm = searchResultTerm;\n searchBook();\n }\n\n return \"list.xhtml?faces-redirect=true\";\n }", "public static List<Genre> get() throws IOException {\n return get(null);\n }", "public List<Book> listBooks() {\n\t\tArrayList<Book> books = new ArrayList<>();\n\t\ttry (Connection con = LibraryConnection.getConnection()) {\n\t\t\tPreparedStatement stmt = con.prepareStatement(\"SELECT * FROM book\");\n\n\t\t\tResultSet rs = stmt.executeQuery();\n\t\t\twhile (rs.next()) {\n\t\t\t\tbooks.add(new Book(rs.getString(\"isbn\"), rs.getString(\"title\")));\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn books;\n\t}", "public String getGenre() {\n return genre;\n }", "public String getGenre() {\n return genre;\n }", "public List<Book> getByAuthor(String name );", "public ArrayList<Book> getListBook();", "@Override\r\n\tpublic List<Book> getBooks() {\n\t\treturn bd.findAll();\r\n\t}", "public List<String > getBooks(){\n List<String> titles = new ArrayList<>();\n\n String strSQL = \"SELECT B._id, B.Title FROM TBooks B WHERE NOT B._id IN (Select TLoaned.TitleID \" +\n \" FROM TLoaned WHERE TLoaned.ReturnDate IS NULL);\";\n SQLiteDatabase db = this.getReadableDatabase();\n Cursor c = db.rawQuery(strSQL, null);\n try {\n if (c.moveToFirst()) {\n do {\n titles.add(c.getString(0) + \". \" + c.getString(1));\n } while (c.moveToNext());\n }\n }\n finally {\n c.close();\n db.close();\n }\n return titles;\n }", "public void setGenre(String genre)\r\n {\r\n this.genre=genre;\r\n }", "@GET(\"list_movies.json\")\n Call<MoviesResponse> getMoviesList(\n @Query(\"genre\") String genre,\n @Query(\"sort_by\") String sortBy,\n @Query(\"page\") int page);", "@GET(\"genre/movie/list\")\n Call<GenreResponse> getGenreList(@Query(\"api_key\") String apikey);", "public void setGenre(int genre) {\n this.genre = genre;\n }", "public String searchBooks() {\r\n if (keywords.isEmpty()) {\r\n return \"advanced-search\";\r\n }\r\n\r\n keywords = keywords.trim();\r\n \r\n //Get list of all the queries\r\n List<List<Books>> listOfLists = new ArrayList<List<Books>>();\r\n listOfLists.add(findBooksByGenre(keywords));\r\n listOfLists.add(findBooksByIdentifier(keywords));\r\n listOfLists.add(findBooksByContributor(keywords));\r\n listOfLists.add(findBooksByFormat(keywords));\r\n listOfLists.add(findBooksByPublisher(keywords));\r\n listOfLists.add(findBooksByTitle(keywords));\r\n listOfLists.add(findBooksByYear(keywords));\r\n\r\n clearFields();\r\n\r\n List<Books> books = new ArrayList<Books>();\r\n\r\n //Filter out useless data\r\n List<Books> tempBookList;\r\n for (int cntr = 0; cntr < listOfLists.size(); cntr++) {\r\n tempBookList = listOfLists.get(cntr);\r\n\r\n if (tempBookList == null) {\r\n continue;\r\n }\r\n\r\n if (tempBookList.isEmpty()) {\r\n continue;\r\n }\r\n\r\n books.addAll(tempBookList);\r\n }\r\n\r\n //Remove duplicates\r\n Set<Books> bookSet = new HashSet<Books>();\r\n bookSet.addAll(books);\r\n books.clear();\r\n books.addAll(bookSet);\r\n\r\n return displayBooks(books);\r\n }", "@GET(\"/v1/genres\")\r\n void getGenres( //\r\n @Query(\"apikey\") String apikey, //\r\n @Query(\"pretty\") boolean pretty, //\r\n @Query(\"catalog\") String catalog, //\r\n Callback<Collection<GenreData>> callBack);", "@GET\n public List<JsonGenre> getAll() {\n \tList<Genre> genres = genreDao.getGenres();\n \tLOGGER.info(\"find \"+genres.size()+\" genres in the database\");\n \tArrayList<JsonGenre> ls = new ArrayList<JsonGenre>();\n \tfor (Genre s:genres) {\n \t\tls.add(new JsonGenre(s.getId(), s.getName()));\n \t}\n \treturn ls;\n }", "public void printAverageRatingsByGenre(){\n ThirdRatings sr = new ThirdRatings();\n int raters = sr.getRaterSize();\n System.out.println(\"read data for \" + raters + \" raters\");\n System.out.println(\"-------------------------------------\");\n \n //MovieDatabase.initialize(\"ratedmovies_short.csv\");\n MovieDatabase.initialize(\"ratedmoviesfull.csv\");\n System.out.println(\"read data for \" + MovieDatabase.size() + \" movies\");\n System.out.println(\"-------------------------------------\");\n \n Filter f = new GenreFilter(\"Comedy\"); \n int minRatings = 20;\n ArrayList<Rating> aveRat = sr.getAverageRatingsByFilter(minRatings, f);\n System.out.println(\"Found \" + aveRat.size() + \" movies\");\n System.out.println(\"-------------------------------------\");\n // sort arraylist\n Collections.sort(aveRat);\n for(Rating r: aveRat){\n System.out.println(r.getValue() + \"\\t\" + MovieDatabase.getYear(r.getItem()) + \"\\t\" \n + MovieDatabase.getTitle(r.getItem()) + \"\\t\" + MovieDatabase.getGenres(r.getItem()));\n }\n System.out.println(\"-------------------------------------\");\n \n \n }", "private static ArrayList<String> getGenre(String songID) throws SQLException {\n ArrayList<String> genres = new ArrayList<>();\n genreStatement = conn.createStatement();\n genreResultSet = genreStatement.executeQuery(\"SELECT * FROM genre, trackGenre WHERE trackGenre.track_id = '\" + songID + \"' AND trackGenre.genre = genre.name;\");\n while (genreResultSet.next()){\n genres.add(genreResultSet.getString(\"name\"));\n }\n return genres;\n }", "public String genre14(){\n String genre14MovieTitle = \" \";\n for(int i = 0; i < results.length; i++){\n if(results[i].genre()) {\n genre14MovieTitle += results[i].getTitle() + \"\\n\";\n }\n }\n System.out.println(genre14MovieTitle);\n return genre14MovieTitle;\n }", "@Override\n\tpublic List<Genre> displayAllGenres() throws MovieException {\n\t\treturn obj.displayAllGenres();\n\t}", "public void setGenre(Genre genre) {\n this.genre = genre;\n }", "public void setGenre(Genre genre) {\n this.genre = genre;\n }", "public Book[] getRecommendBook(){\n\t\n\t String stmnt = String.format(\n \"SELECT * FROM book \" );\n ResultSet rs = executeQuery(stmnt);\n ArrayList<Book> arr = resultSetPacker(rs, Book.class);\n\n return arr.toArray(new Book[arr.size()]);\n}", "public List<Books> showAllBooks(){\n String sql=\"select * from Book\";\n BaseDao baseDao=dao.executeQuery(sql,new Object[]{});\n List<Books> list=new ArrayList<>();\n list=resultSetToBook(baseDao);\n return list;\n }", "public ArrayList<MovieGenreModel> getAllGenres() {\n\t\treturn null;\n\t}", "public List<Books> findBooksByTitle(String title) {\r\n return bookController.findBooksByTitle(title);\r\n }", "private void createGenres() {\n ArrayList<String> gen = new ArrayList<>();\n //\n for (Movie mov : moviedb.getAllMovies()) {\n for (String genre : mov.getGenre()) {\n if (!gen.contains(genre.toLowerCase()))\n gen.add(genre.toLowerCase());\n }\n }\n\n Collections.sort(gen);\n\n genres = gen;\n }", "private void displayBookChoice(int n) throws IOException\n {\n System.out.println(\"Your choice is \"+genre[n]);\n System.out.println(\"Press Enter to see our \"+genre[n]+\" collection!\");\n br.readLine();\n System.out.println(\"Your choice of books includes:\");\n System.out.println();\n System.out.println(\"Code \\t\"+\"Book Name\"+Spacebar.spaces(70-9)+\"\\tAuthor\"+Spacebar.spaces(25-6)+\"\\tGenre\"+Spacebar.spaces(15-5));\n System.out.println();\n for (int i=0; i<linecount; i++)\n {\n if(book[i].genre.trim().equalsIgnoreCase(genre[n].trim()))\n System.out.println(book[i].code +\"\\t\"+book[i].name+\"\\t\"+book[i].author+\"\\t\"+book[i].genre);\n }\n }", "public Book[] getRecommendBooks()\n {\n String stmnt = String.format(\n \"SELECT * FROM book LIMIT %d \",\n PAGE_LIMIT);\n ResultSet rs = executeQuery(stmnt);\n ArrayList<Book> arr = resultSetPacker(rs, Book.class);\n\n return arr.toArray(new Book[arr.size()]);\n\n }", "@Test\r\n public void testGetGenreList() throws MovieDbException {\r\n LOG.info(\"getGenreList\");\r\n List<Genre> results = tmdb.getGenreList(LANGUAGE_DEFAULT);\r\n assertTrue(\"No genres found\", !results.isEmpty());\r\n }", "public Iterator getBooks() {\r\n return books.iterator();\r\n }", "Book getBookByTitle(String title);", "public void listBooks() {\n String sql = \"SELECT ISBN, BookName, AuthorName, Price FROM books\";\n\n try (Connection conn = this.connect();\n Statement stmt = conn.createStatement();\n ResultSet rs = stmt.executeQuery(sql)) {\n\n // Print results\n while(rs.next()) {\n System.out.println(rs.getInt(\"ISBN\") + \"\\t\" +\n rs.getString(\"BookName\") + \"\\t\" +\n rs.getString(\"AuthorName\") + \"\\t\" +\n rs.getInt(\"Price\"));\n }\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }", "public void setGenre() {\r\n this.genre = genre;\r\n }", "public Genre getGenre() {\n return genre;\n }", "public Genre getGenre() {\n return genre;\n }", "public List<Book> getBooks() {\n return books;\n }", "public Book(String title, String genre)\n {\n bookTitle = title;\n bookGenre = genre;\n }", "public Books[] getBooks() {\n return books;\n }", "public String getGenre()\r\n {\r\n String answer=genre;\r\n return answer;\r\n }", "public List<Book> getAllBooks(){\n\t\treturn this.bRepo.findAll();\n\t}", "@Override\n\tpublic List<Book> getAllBooks() {\n\t\treturn bookList;\n\t}", "public Set<String> getGenres() {\r\n return this.genres;\r\n }", "public static String[] getBookSelection(Connection conn){\n String[] validBook = new String[2];\n Scanner in = new Scanner(System.in);\n try{\n String sql = \"SELECT booktitle FROM Books WHERE booktitle = ? AND groupname = ?\";\n PreparedStatement pstmt = conn.prepareStatement(sql);\n \n System.out.print(\"Book: \");\n validBook[0] = in.nextLine();\n pstmt.setString(1, validBook[0]);\n validBook[1] = getWriterSelection(conn);\n pstmt.setString(2, validBook[1]);\n ResultSet rs = executeQ(conn, pstmt, false, false);\n if(!rs.next()){\n validBook[0] = \"\";\n validBook[1] = \"\";\n System.out.println(\"That book does not exist.\");\n }\n }catch (SQLException se) {\n System.out.println(\"Invalid Book.\");\n }\n return validBook;\n }", "List<Book> getBooksByAuthorId(Integer authorId);", "List<Book> findBooksByName(String name);", "public String getGenreString() {\r\n return genre.getTheBookType();\r\n }", "Builder addGenre(String value);", "public List<Book> getAllBooks()\n {\n List<Book> books = new LinkedList<Book>();\n\n //1. Query para la consulta\n String query = \"Select * FROM \"+ BookReaderContract.FeedBook.TABLE_NAME;\n\n //2. Obtener la referencia a la DB\n SQLiteDatabase db = this.getWritableDatabase();\n Cursor cursor = db.rawQuery(query, null);\n\n //3. Recorrer el resultado y crear un objeto Book\n Book book = null;\n if(cursor.moveToFirst()){\n do{\n book = new Book();\n book.setId(Integer.parseInt(cursor.getString(0)));\n book.setTitle(cursor.getString(1));\n book.setAuthor(cursor.getString(2));\n books.add(book);\n }while(cursor.moveToNext());\n }\n Log.d(\"getAllBooks\",books.toString());\n return books;\n }", "public Genre getGenre() {\n\n return genre;\n }", "public List<Book> allBooks() {\n return bookRepository.findAll();\n }", "@Override\n public List<Book> result(List<Book> books) {\n return search.result(books);\n }", "public String getMyBooks()\r\n {\r\n\treturn myBooks;\r\n }", "public ArrayList<Book> findFantasy() {\n ArrayList<Book> fantasyBook = new ArrayList<>();\n for (Book book : bookList) {\n if (book.getGenre().equals(BookGenres.FANTASY)) {\n fantasyBook.add(book);\n }\n }\n return fantasyBook;\n }", "void viewBooks();", "public List<Book> getAllBooks() {\n return entityManager.createQuery(\"select b from Book b\", Book.class).getResultList();\n }", "Builder addGenre(Text value);", "public List<Book> getBooks() {\r\n\t\treturn books;\r\n\t}", "public Book readBookFile()\n {\n\n String name=\"\";\n String author ;\n ArrayList<String> genre = new ArrayList<String>();\n float price=0;\n String bookId;\n String fields2[];\n String line;\n\n line = bookFile.getNextLine();\n if(line==null)\n {\n return null;\n }\n String fields[] = line.split(\" by \");\n if(fields.length>2)\n {\n int i=0;\n while (i<fields.length-1)\n {\n name+=fields[i];\n if(i<fields.length-2)\n {\n name+= \" by \";\n }\n i++;\n }\n fields2 = fields[fields.length-1].split(\"%\");\n }\n else\n {\n name = fields[0];\n fields2 = fields[1].split(\"%\");\n }\n\n author = fields2[0];\n price=Float.parseFloat(fields2[1]);\n bookId=fields2[2];\n genre.add(fields2[3]);\n genre.add(fields2[4]);\n return new Book(name,genre,author,price,bookId);\n\n\n }", "public List<Books> findBooksByContributor(String contributor) {\r\n return bookController.findBooksByContributorName(contributor);\r\n }", "void availableBooks(){\n\t\tSystem.out.println(\")))))Available books((((((\");\n\t\tfor(int i=0;i<books.length;i++){\n\t\t\tString book=books[i];\n\t\t\tif(book==null){\n\t\t\tcontinue;\n\t\t}\n\t\t\tSystem.out.println(\"*\"+books[i]);\n\t\t}\n\t\t\n\t}", "public int getGenre() {\n return genre;\n }", "public void viewLibraryBooks(){\n\t\tIterator booksIterator = bookMap.keySet().iterator();\n\t\tint number, i=1;\n\t\tSystem.out.println(\"\\n\\t\\t===Books in the Library===\\n\");\n\t\twhile(booksIterator.hasNext()){\t\n\t\t\tString current = booksIterator.next().toString();\n\t\t\tnumber = bookMap.get(current).size();\n\t\t\tSystem.out.println(\"\\t\\t[\" + i + \"] \" + \"Title: \" + current);\n\t\t\tSystem.out.println(\"\\t\\t Quantity: \" + number + \"\\n\");\t\t\t\n\t\t\ti += 1; \n\t\t}\n\t}", "public void setGenre(String genre){\n\t\t//FIXME\n\t\tthis.genre = genre;\n\t}", "@Override\r\n\tpublic List<Book> getBooks(String kind) {\n\t\treturn null;\r\n\t}", "Collection<Book> getAll();", "public Book[] getFavoriteBooks()\n {\n String stmnt = String.format(\n \"SELECT * FROM book ORDER BY rating DESC LIMIT %d \",\n PAGE_LIMIT);\n ResultSet rs = executeQuery(stmnt);\n ArrayList<Book> arr = resultSetPacker(rs, Book.class);\n\n return arr.toArray(new Book[arr.size()]);\n\n }", "private static void queryBook(){\n\t\tSystem.out.println(\"===Book Queries Menu===\");\n\t\t\n\t\t/*Display menu options*/\n\t\tSystem.out.println(\"1--> Query Books by Author\");\n\t\tSystem.out.println(\"2--> Query Books by Genre\");\n\t\tSystem.out.println(\"3--> Query Books by Publisher\");\n\t\tSystem.out.println(\"Any other number --> Exit To Main Menu\");\n\t\tSystem.out.println(\"Enter menu option: \");\n\t\tint menu_option = getIntegerInput(); //ensures user input is an integer value\n\t\t\n\t\tswitch(menu_option){\n\t\t\tcase 1:\n\t\t\t\tSystem.out.println();\n\t\t\t\tqueryBooksByAuthor();\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tSystem.out.println();\n\t\t\t\tqueryBooksByGenre();\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tSystem.out.println();\n\t\t\t\tqueryBooksByPublisher();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t}", "private void loadToChoice() {\n\t\tfor(Genre genre : genreList) {\n\t\t\tuploadPanel.getGenreChoice().add(genre.getName());\n\t\t}\n\t}", "@NonNull\n public final List<Genres> getGenres() {\n return this.genres;\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic static List<HashMap<String, String>> getChoiceGan(String choice) {\n\t\tList<rcmMusicListMain> musicLists = rcmMusicListMain.getAllMusic();\n\t\t\n\t\tList<HashMap<String, String>> aList = new ArrayList<HashMap<String, String>>();\n\t\tHashMap<String, String> aMap = new HashMap<String, String>();\n\t\tHashMap<String, String> bMap = new HashMap<String, String>();\n\t\t\n\t\tmusicLists.stream()\n\t\t\t.filter(musicList -> musicList.getGenre1().equals(choice) \n\t\t\t\t\t|| musicList.getGenre2().equals(choice))\n\t\t\t.sorted((musicList1, musicList2) -> musicList2.getPlayNum() - musicList1.getPlayNum())\n\t\t\t.limit(10).forEach(musicList -> {\n\t\t\t\t\t//System.out.println(musicList.getSeq()+\". \"+musicList.getTitle()+\" : \"+musicList.getSinger());\n\t\t\t\t\taMap.put(\"TITLE\", musicList.getTitle());\n\t\t\t\t\taMap.put(\"ITEM\", musicList.getSinger());\n\t\t\t\t\taList.add((HashMap<String, String>)aMap.clone());\n\t\t\t\t});\n\t\t\n\t\t\n\t\tfor(int i=0; i<aList.size(); i++) {\n\t\t\tbMap = aList.get(i); \n\t\t\tbMap.put(\"SEQ\", i+1+\"\");\n\t\t\tSystem.out.println(bMap.get(\"SEQ\")+\". \"+bMap.get(\"TITLE\")+\" : \"+bMap.get(\"ITEM\"));\n\t\t\t//System.out.println(aList.get(i).get(\"SEQ\")+\". \"+aList.get(i).get(\"TITLE\")+\" : \"+aList.get(i).get(\"ITEM\"));\n\t\t}\n\t\t\n\t\treturn aList; \n\t}", "public Collection<Book> getBooks() {\n return books;\n }", "public java.util.List<com.huqiwen.demo.book.model.Books> findAll()\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;", "@Nullable\n GenresPage getGenres();", "public List<PrintableBook> PerformSearch_google(String[] kw, int N){\n\t\t// build the JAX-RS client object \n\t\tClient client = ClientBuilder.newClient();\n\t\tint res_cont = 0;\t// initialize number of already processed results\n\t\tint tot_res = 1;\t// initialize total number of results so that it is greater than the number of already processed results\n\t\t// build the web target\n\t\tWebTarget target = client.target(getBaseURI_google()).path(\"volumes\");\n\t\t// create empty list of PrintableBook\n\t\tList<PrintableBook> pbooks = new ArrayList<PrintableBook>();\n\t\t// prepare query string\n\t\tStringBuffer queryString = new StringBuffer(kw[0]);\n\t\tfor (int i=1; i<kw.length; i++) {\n\t\t\tqueryString.append(' ');\n\t\t\tqueryString.append(kw[i]);\n\t\t}\n\t\tint offset;\t\t// declare variable used to store offset\n\t\t// main loop on pages\n\t\tfor(int page=0; pbooks.size()<N && res_cont<tot_res; page++){\n\t\t\toffset = page*20;\n\t\t\tSystem.out.println(\"Searching \"+queryString+\" on Google books with offset \"+offset);\n\t\t\ttry {\n\t\t\t\t// perform a get request using mediaType=APPLICATION_JSON\n\t\t\t\t// and convert the response into a SearchResult object\n\t\t\t\tit.polito.dp2.rest.gbooks.client.jaxb.SearchResult result = target\n\t\t\t\t\t\t\t\t\t .queryParam(\"q\", queryString)\t\n\t\t\t\t\t\t\t\t\t .queryParam(\"printType\", \"books\")\n\t\t\t\t\t\t\t\t\t .queryParam(\"maxResults\", 20)\n\t\t\t\t\t\t\t\t\t .queryParam(\"startIndex\", offset)\n\t\t\t\t\t\t\t\t\t .request()\n\t\t\t\t\t\t\t\t\t .accept(MediaType.APPLICATION_JSON)\n\t\t\t\t\t\t\t\t\t .get(it.polito.dp2.rest.gbooks.client.jaxb.SearchResult.class);\n\t\t\t\ttot_res = result.getTotalItems().intValue();\n\t\t\t\tSystem.out.println(\"OK Response received. Total number of Items:\"+tot_res);\n\t\t\t\tSystem.out.println(\"Validating items and converting validated items to xml.\");\n\t\t\t\tfor (it.polito.dp2.rest.gbooks.client.jaxb.Items item:result.getItems()) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// validate item\n\t\t\t\t \tJAXBSource source = new JAXBSource(jc_gbooks, item);\n\t\t\t\t \tSystem.out.println(\"Validating \"+item.getSelfLink());\n\t\t\t\t \tvalidator_gbooks.validate(source);\n\t\t\t\t \tSystem.out.println(\"Validation OK\");\n\t\t\t\t \t// add item to list\n\t\t\t\t\t\tSystem.out.println(\"Adding item to list\");\n\t\t\t\t\t\tPrintableItem pi = Factory.createPrintableItem(BigInteger.valueOf(idCounter.getNextId()),item.getVolumeInfo());\t\t\t\t\n\t\t\t\t\t\tif(pi instanceof PrintableBook){\n\t\t\t\t\t\t\tpbooks.add((PrintableBook)pi);\n\t\t\t\t\t\t\tif(pbooks.size()==N) break;\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (org.xml.sax.SAXException se) {\n\t\t\t\t\t System.out.println(\"Validation Failed\");\n\t\t\t\t\t // print error messages\n\t\t\t\t\t Throwable t = se;\n\t\t\t\t\t while (t!=null) {\n\t\t\t\t\t\t String message = t.getMessage();\n\t\t\t\t\t\t if (message!= null)\n\t\t\t\t\t\t \t System.out.println(message);\n\t\t\t\t\t\t t = t.getCause();\n\t\t\t\t\t }\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\tSystem.out.println(\"Unexpected I/O Exception\");\n\t\t\t\t\t} catch (JAXBException e) {\n\t\t\t\t\t\tSystem.out.println(\"Unexpected JAXB Exception\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tres_cont = res_cont + 20;\n\t\t\t} catch(WebApplicationException e) {\n\t\t\t\tSystem.err.println(\"Error in remote operation: \"+e.getMessage());\n\t\t\t\treturn null;\t\n\t\t\t}\n\t\t}\n\t System.out.println(\"Number of validated Bibliography books from gbooks: \"+pbooks.size());\n\t return pbooks;\n\t}", "private static void queryBooksByPublisher(){\n\t\tSystem.out.println(\"===Query Books By Publisher===\");\n\t\tScanner string_input = new Scanner(System.in);\n\t\t\n\t\tSystem.out.println(\"Enter Publisher to Query Books by: \");\n\t\tString publisher = string_input.nextLine();\n\t\t\n\t\tif(ALL_PUBLISHERS.containsKey(publisher)){\n\t\t\tIterator<String> iter = ALL_PUBLISHERS.get(publisher).iterator();\n\t\t\tSystem.out.println(\"All books published by \" + publisher + \" are:\"); \n\t\t\tprintAllElements(iter);\n\t\t}\n\t\t\n\t\telse\n\t\t\tSystem.out.println(\"Sorry! There are no such publishers in our records!\");\n\t}", "public ArrayList<Book> search(String part){ \n this.searchBooks = new ArrayList<Book>();\n this.numberedListOfSearch = new HashMap<Integer, Book>();\n if (part.length()>=4){\n //Adding all the searching books into an ArrayList<Book>\n //No duplicating for books having the same title\n boolean bookExist = false;\n for (Book book : this.libraryBooks){\n if ((book.getTitle().toLowerCase().contains(part.toLowerCase())) || (book.getAuthor().toLowerCase().contains(part.toLowerCase()))){\n //Check whether any books having the same title in the list\n for (Book bookSearch : this.searchBooks){\n if (bookSearch.getTitle().equals(book.getTitle())){\n bookExist = true;\n break;\n }\n }\n //If none!\n if(!bookExist){\n this.searchBooks.add(book);\n }\n }\n bookExist = false;\n }\n //To put into a numbered list for printing\n //No duplicating for books having the same title\n for (int i =0; i < (this.searchBooks.size());i++){\n // put the book in the HashMap for printing \n this.numberedListOfSearch.put(i+1, this.searchBooks.get(i));\n }\n\n //To print out\n this.println(\"The searching process has finished!\");\n String researchBooks=\"\";\n //check whether the numbered list is empty or not\n if(this.numberedListOfSearch.size() >0){\n researchBooks += \"{\";\n for (int i = 0; i < this.numberedListOfSearch.size();i++){\n researchBooks += (i+1);\n researchBooks += \": \";\n researchBooks += this.numberedListOfSearch.get(i+1).toString();\n researchBooks += \"; \";\n }\n researchBooks = researchBooks.substring(0, researchBooks.length()-2);\n researchBooks += \"}\"; \n }\n //if the numbered list is empty\n else if ( this.numberedListOfSearch.size() == 0){\n researchBooks += \"Nothing found!\";\n }\n this.println(researchBooks);\n }\n\n //If not enough input key words!\n else{\n this.println(\"Please enter more key words! At least four!!\");\n }\n return this.searchBooks;\n }", "public static ArrayList<Book> search(String title, HashMap<Book, Integer> purchasedBooks)\n {\n ArrayList<Book> searchedBooks = new ArrayList<>();\n\n for(Book b: purchasedBooks.keySet())\n if(b.getBookName().equals(title) || title.equals(\"*\"))\n searchedBooks.add(b);\n\n return searchedBooks;\n }", "public List<Movie> search(String title, Genre genre, WatchStatus status) {\n CriteriaBuilder cb = this.em.getCriteriaBuilder();\n \n // SELECT t FROM Serie s\n CriteriaQuery<Movie> query = cb.createQuery(Movie.class);\n Root<Movie> from = query.from(Movie.class);\n query.select(from);\n\n // ORDER BY dueDate, dueTime\n query.orderBy(cb.desc(from.get(\"releaseDate\")));\n \n // WHERE s.title LIKE :title\n Predicate p = cb.conjunction();\n \n if (title != null && !title.trim().isEmpty()) {\n p = cb.and(p, cb.like(from.get(\"title\"), \"%\" + title + \"%\"));\n query.where(p);\n }\n \n // WHERE s.genre = :genre\n if (genre != null) {\n p = cb.and(p, cb.isMember(genre,from.get(\"genres\")));\n query.where(p);\n }\n \n // WHERE s.status = :status\n if (status != null) {\n p = cb.and(p, cb.equal(from.get(\"status\"), status));\n query.where(p);\n }\n \n return em.createQuery(query).getResultList();\n }", "public Album setGenres(Set<String> genres) {\r\n this.genres = genres;\r\n return this;\r\n }" ]
[ "0.8366591", "0.6891326", "0.6752634", "0.6695363", "0.6640803", "0.6622041", "0.660734", "0.65848124", "0.6537706", "0.6495771", "0.64715", "0.6455461", "0.6399342", "0.6343736", "0.63382894", "0.63178533", "0.6303625", "0.6277429", "0.6244885", "0.6227849", "0.6220323", "0.6168187", "0.6161089", "0.616008", "0.616008", "0.6154518", "0.6149647", "0.61401147", "0.61175865", "0.6106772", "0.61040556", "0.60896826", "0.6088537", "0.6073359", "0.6035037", "0.6033594", "0.5993378", "0.5969084", "0.59632623", "0.59583193", "0.59555125", "0.59555125", "0.5953945", "0.59222794", "0.59073776", "0.58963966", "0.58828336", "0.5877656", "0.5872779", "0.58693916", "0.58651793", "0.5864829", "0.5837761", "0.583497", "0.5832251", "0.5832251", "0.5814497", "0.58105326", "0.580851", "0.579135", "0.5790307", "0.5781718", "0.5777943", "0.57751924", "0.5766428", "0.5758972", "0.5757856", "0.5757679", "0.5756846", "0.5755495", "0.5754812", "0.57519895", "0.57519716", "0.5744342", "0.57423526", "0.5740325", "0.5727397", "0.5722981", "0.57082886", "0.5698987", "0.5692032", "0.5686099", "0.5683558", "0.5681175", "0.5645997", "0.5630919", "0.5617331", "0.5614075", "0.56005347", "0.5586084", "0.5582292", "0.5581046", "0.5563762", "0.55582285", "0.55573905", "0.5550053", "0.554839", "0.5543868", "0.55404717", "0.5538667" ]
0.8164483
1
/Returns the respective index of the given genre in the ALL_GENRES ArrayList
private static int getGenreIndex(String genre){ int index = -1; if(genre.equalsIgnoreCase("biology")) index = 0; else if(genre.equalsIgnoreCase("mathematics")) index = 1; else if(genre.equalsIgnoreCase("chemistry")) index = 2; else if(genre.equalsIgnoreCase("physics")) index = 3; else if(genre.equalsIgnoreCase("science_fiction")) index = 4; else if(genre.equalsIgnoreCase("fantasy")) index = 5; else if(genre.equalsIgnoreCase("action")) index = 6; else if(genre.equalsIgnoreCase("drama")) index = 7; else if(genre.equalsIgnoreCase("romance")) index = 8; else if(genre.equalsIgnoreCase("horror")) index = 9; else if(genre.equalsIgnoreCase("history")) index = 10; else if(genre.equalsIgnoreCase("autobiography")) index = 11; else if(genre.equalsIgnoreCase("biography")) index = 12; else{ System.out.println("Invalid Genre Input: Genre entered was invalid"); } return index; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int addGenreToPlayList(){\n\t\t\n\t\tint pos =0;\n\t\t\n\t\tboolean out = false;\n\t\t\n\t\tfor(int i=0; (i<genresList.length)&&(out==false);i++){\n\t\t\n\t\tif(genresList[i] == null){\n\t\t\tout = true;\n\t\t\tpos = i;\n\t\t}\n\t\t}\n\t\treturn pos;\n\t}", "private static void queryBooksByGenre(){\n\t\tSystem.out.println(\"===Query Books By Genre===\");\n\t\tScanner string_input = new Scanner(System.in);\n\t\t\n\t\tSystem.out.println(\"Enter Genre to Query Books by: \");\n\t\tString genre = string_input.next();\n\t\tint genre_index = getGenreIndex(genre); //returns the index of the genre entered, in ALL_GENRES\n\t\t\n\t\tif(genre_index > -1){//valid genre was entered\n\t\t\tIterator<String> iter = ALL_GENRES.get(genre_index).iterator();\n\t\t\tSystem.out.println(\"All \" + genre + \" books are: \");\n\t\t\tprintAllElements(iter);\n\t\t}\n\t}", "public void showGenre(Genre genre) {\n for (Record r : cataloue) {\n if (r.getGenre() == genre) {\n System.out.println(r);\n }\n }\n\n }", "public int getGenre() {\n return genre;\n }", "public void setGenre(ArrayList<String> genre) {\n this.genre = genre;\n }", "private double getGenreScore(Movie movie) {\n double genreScore = 0;\n\n for (String genre : this.generes) {\n if (movie.getGenre().contains(genre)) {\n genreScore = genreScore + 1;\n }\n }\n return genreScore;\n }", "public int searchBook(String title){\n for (int i = 0; i < titleList.size(); i++){\n if (titleList.get(i).equals(title))\n return i;\n }\n return -1;\n }", "public void setGenre(int genre) {\n this.genre = genre;\n }", "public List<Books> findBooksByGenre(String genre) {\r\n HttpSession session = (HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false);\r\n List<Genre> list = new ArrayList();\r\n Genre g = new Genre();\r\n g.setType(genre);\r\n list.add(g);\r\n session.setAttribute(\"lastGenre\",list);\r\n return bookController.findBooksByGenre(genre);\r\n }", "public int getGenreID(String gen) {\n this.connect();\n String sqlGenre = \"SELECT genreID FROM genres WHERE genres.genreType = ?\";\n int genID = 0;\n\n try (Connection conn = this.getConnection();\n PreparedStatement genre = conn.prepareStatement(sqlGenre)) {\n genre.setString(1,gen);\n ResultSet rsG = genre.executeQuery();\n //gets genreID\n if (rsG.next()) {\n genID = rsG.getInt(\"genreID\");\n } else {\n System.out.println(\"Genre not in database!\");\n genID = addGenre(gen);\n }\n } catch(SQLException e) {\n System.out.println(e.getMessage());\n }\n return genID;\n }", "int getIndex(Book title){\n return 0;\n }", "private int indexOf(Couple assoc) {\n for (int i = 0; i < nbAssoc; i++)\n if (associations[i].equals(assoc))\n return i;\n return -1;\n }", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "public int getIndex();", "public int getIndex();", "public int getIndex();", "public int indexOfMovieID(NSArray list, Object movieID) {\n\t\tif (movieID == null) {\n\t\t\treturn -1;\n\t\t}\n\n\t\tint c = list.count();\n\t\tfor (int i = 0; i < c; i++) {\n\t\t\tNSKeyValueCoding object = (NSKeyValueCoding) list.objectAtIndex(i);\n\t\t\tObject id = object.valueForKey(MovieIDKey);\n\t\t\tif ((id != null) && (id.equals(movieID))) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\n\t\treturn -1;\n\t}", "public int getIndexOfProduct(Product p){\r\n for (int i = 0; i <allProducts.size() ; i++) {\r\n if(p.equals(allProducts.get(i))){\r\n return i ;\r\n }\r\n }\r\n return -1;\r\n }", "public int indexOfMovie(NSArray list, EOEnterpriseObject aMovie) {\n\n\t\tObject result = Application.myApplication().primaryKeyForObject(aMovie);\n\t\tif (result == null) {\n\t\t\treturn -1;\n\t\t}\n\n\t\treturn indexOfMovieID(list, result);\n\t}", "public int index();", "int index();", "public int compareGenre(Song other) {\n return this.genre.compareTo(other.getGenre());\n }", "public String hGenre(int tunnusnro) {\r\n List<Genre> kaikki = new ArrayList<Genre>();\r\n for (Genre genre : this.alkiot) {\r\n \t kaikki.add(genre);\r\n }\r\n for (int i = 0; i < kaikki.size(); i++) {\r\n if (tunnusnro == kaikki.get(i).getTunnusNro()) {\r\n return kaikki.get(i).getGenre();\r\n }\r\n }\r\n return \"ei toimi\";\r\n }", "public List<Film> findAllByGenre(String genre);", "public abstract int getIndex();", "public void setGenre(String genre) {\n this.genre = genre;\n }", "public static ArrayList<Individuo> ordInd(ArrayList<Individuo> gen){\n Individuo aux;\n ArrayList<Individuo> genaux = gen;\n for(int i=0;i<genaux.size();i++){\n for(int j=i;j<genaux.size();j++){\n if(genaux.get(i).getFenotipo() > genaux.get(j).getFenotipo()){\n aux = genaux.get(i);\n genaux.set(i, genaux.get(j));\n genaux.set(j, aux);\n }\n }\n }\n return genaux;\n }", "private int findItem(String searchItem){\n return myGrocery.indexOf(searchItem);\n }", "public void printAverageRatingsByGenre(){\n ThirdRatings sr = new ThirdRatings();\n int raters = sr.getRaterSize();\n System.out.println(\"read data for \" + raters + \" raters\");\n System.out.println(\"-------------------------------------\");\n \n //MovieDatabase.initialize(\"ratedmovies_short.csv\");\n MovieDatabase.initialize(\"ratedmoviesfull.csv\");\n System.out.println(\"read data for \" + MovieDatabase.size() + \" movies\");\n System.out.println(\"-------------------------------------\");\n \n Filter f = new GenreFilter(\"Comedy\"); \n int minRatings = 20;\n ArrayList<Rating> aveRat = sr.getAverageRatingsByFilter(minRatings, f);\n System.out.println(\"Found \" + aveRat.size() + \" movies\");\n System.out.println(\"-------------------------------------\");\n // sort arraylist\n Collections.sort(aveRat);\n for(Rating r: aveRat){\n System.out.println(r.getValue() + \"\\t\" + MovieDatabase.getYear(r.getItem()) + \"\\t\" \n + MovieDatabase.getTitle(r.getItem()) + \"\\t\" + MovieDatabase.getGenres(r.getItem()));\n }\n System.out.println(\"-------------------------------------\");\n \n \n }", "private int findIngredientByName(String name){\r\n for(int i = 0; i < ingredients.size(); i++){\r\n if(ingredients.get(i).getName().equals(name)){\r\n return i;\r\n }\r\n }\r\n\r\n return -1;\r\n }", "public void setGenre(Genre genre) {\n this.genre = genre;\n }", "public void setGenre(Genre genre) {\n this.genre = genre;\n }", "private int getIndex(String rib){\n for (int i=0;i<ribSp.getCount();i++){\n if (ribSp.getItemAtPosition(i).toString().equalsIgnoreCase(rib)){\n return i;\n }\n }\n\n return 0;\n }", "public int compareTo(String key)\n\t {\n\t return genre.compareTo(key);\n\t }", "public void printAverageRatingsByGenre(){\n \n String moviefile = \"data/ratedmovies_short.csv\";\n String ratingsfile = \"data/ratings_short.csv\";\n \n \n ThirdRatings tr = new ThirdRatings(ratingsfile);\n \n int rating_size = tr.getRaterSize();\n \n System.out.println(\"The number of raters read is : \"+ rating_size);\n \n MovieDatabase database = new MovieDatabase();\n \n database.initialize(moviefile);\n \n int movie_size = database.size();\n \n System.out.println(\"The number of movies read is : \"+ movie_size); \n \n String genre = \"Crime\";\n \n GenreFilter genre_filter = new GenreFilter(genre);\n \n ArrayList<Rating> ratings_list = tr.getAverageRatingsByFilter(1, genre_filter);\n \n HashMap<String, Double> map = new HashMap<String, Double>();\n \n Collections.sort(ratings_list);\n \n int count = 0; \n \n for(Rating rating : ratings_list){\n \n String title = database.getTitle(rating.getItem());\n \n double val = rating.getValue();\n \n String mov_genre = database.getGenres(rating.getItem());\n \n if(val != 0.0 ){\n \n map.put(title , val);\n \n count += 1;\n\n System.out.println(val + \"\\t\" + mov_genre + \"\\t\" +title );\n }\n\n }\n \n System.out.println(\"The number of movies found with minimal number of ratings is : \"+ count); \n \n \n }", "public static int getSelectedSongIndex() {\n\t\tint x =list.getSelectedIndex();\n\t\treturn x;\n\t}", "public int indexOf(K gesucht) {\r\n \r\n \t\tfor (int i=0;i<data.length;i++) {\r\n \t\t\tif(data[i] != null) { \r\n \t\t\t\tif(data[i].getKey().equals(gesucht)) { \r\n \t\t\t\t\treturn i;\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t\treturn -1;\r\n \r\n \t}", "public void setGenre(String genre)\r\n {\r\n this.genre=genre;\r\n }", "public static void Search(ArrayList<Integer> list, int val)\n{\n // Your code here\n int result = -1;\n for(int i=0; i<list.size(); i++)\n {\n if(list.get(i) == val)\n {\n result = i;\n break;\n }\n }\n System.out.print(result + \" \");\n \n}", "private int getArrayIndex() {\n\t\tswitch (getId()) {\n\t\tcase 3493:\n\t\t\treturn Recipe_For_Disaster.AGRITH_NA_NA_INDEX;\n\t\tcase 3494:\n\t\t\treturn Recipe_For_Disaster.FLAMBEED_INDEX;\n\t\tcase 3495:\n\t\t\treturn Recipe_For_Disaster.KARAMEL_INDEX;\n\t\tcase 3496:\n\t\t\treturn Recipe_For_Disaster.DESSOURT_INDEX;\n\t\t}\n\t\treturn -1;\n\t}", "public String getGenreName(int g) {\n this.connect();\n String sqlGenre = \"SELECT genreType FROM genres WHERE genreID = ?\";\n String genreName = \"\";\n\n try (Connection conn = this.getConnection();\n PreparedStatement genre = conn.prepareStatement(sqlGenre)) {\n genre.setInt(1,g);\n ResultSet rsG = genre.executeQuery();\n //gets genreID\n if (rsG.next()) {\n genreName = rsG.getString(\"genreType\");\n } else {\n System.out.println(\"Genre not in database!\");\n }\n } catch(SQLException e) {\n System.out.println(e.getMessage());\n }\n return genreName;\n }", "private static ArrayList<String> getGenre(String songID) throws SQLException {\n ArrayList<String> genres = new ArrayList<>();\n genreStatement = conn.createStatement();\n genreResultSet = genreStatement.executeQuery(\"SELECT * FROM genre, trackGenre WHERE trackGenre.track_id = '\" + songID + \"' AND trackGenre.genre = genre.name;\");\n while (genreResultSet.next()){\n genres.add(genreResultSet.getString(\"name\"));\n }\n return genres;\n }", "public void modifyGenres(ArrayList<String> genreList)// --> Bytter ut Genre-arrayen med en ny array over de nye sjangerene for lokalet.\n\t{\n\t\tgenres = genreList;\n\t}", "public int getIndex(BitChromosome bitChromosome) {\n return (int)(bitChromosome.genes & mask);\n }", "public void onGenreClick(View v) {\n // FIXME: 9ボタンのジャンル一覧ボタン押下時\n AppMeasurementWrapper.getInstance().initialize(getApplication());\n AppMeasurementWrapper.getInstance().storeTransitionSrcPoint(AppEffectClickPointEnum.HOME_GENRE_1);\n this.startGenreListActivity();\n }", "public static int findIndex(ArrayList<TrigramsOcurrence> frequencies, TrigramsOcurrence trigram) {\n\n Iterator<TrigramsOcurrence> itTrigrams = frequencies.iterator();\n int index = 0;\n TrigramsOcurrence aux = null;\n while (itTrigrams.hasNext()) {\n aux = itTrigrams.next();\n\n\n if (trigram.getFirstLetter() == aux.getFirstLetter() && trigram.getSecondLetter() == aux.getSecondLetter() && trigram.getThirdLetter() == -1 && trigram.getFrequency() == -1) {\n return index;\n }\n\n if (trigram.getFirstLetter() == aux.getFirstLetter() && trigram.getSecondLetter() == -1 && trigram.getThirdLetter() == aux.getThirdLetter() && trigram.getFrequency() == -1) {\n return index;\n }\n\n if (trigram.getFirstLetter() == -1 && trigram.getSecondLetter() == aux.getSecondLetter() && trigram.getThirdLetter() == aux.getThirdLetter() && trigram.getFrequency() == -1) {\n return index;\n }\n\n\n index++;\n }\n return -1;\n\n\n }", "@Secured({\"ROLE_USER\", \"ROLE_ADMIN\"}) \r\n\t@Query(\"SELECT m FROM Movie m INNER JOIN m.genres g WHERE g.genreID IN (:genreID)\")\r\n\tList<Movie> findByGenreID(@Param(\"genreID\") Long genreID);", "@Override\n\tpublic int getsongCount(String songGenre) {\n\t\t\n\t\t\n\t\tString query =\"select COUNT(songGenre) from genre where songGenre= ? groupby songGenre\";\n\t\tPreparedStatement ps;\n\t\tint i = 0;\n\t\tint count = 0;\n\t\ttry {\n\t\t\tps = DBConnection.getDBconnection().prepareStatement(query);\n\t\t\tResultSet rs = ps.executeQuery();\n\t\t\twhile(rs.next()) {\n\t\t\t\tGenre Genre = new Genre();\n\t\t\t\t\t\t\n\t\t\t\tcount= Genre.setsongCount(rs.getInt(\"genreName\"));\n\t\t\t\t\n\t\t\t\ti++;\n\t\t\t}\n\t\t\t\n\t\t\n\t\t\t\n\t\t} catch (ClassNotFoundException | SQLException e) {\n\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn count;\n\t}", "public Genre getGenre() {\n return genre;\n }", "public Genre getGenre() {\n return genre;\n }", "void createIndex(){\n int index=0;\n for(int i=0;i<ancogs.size();i++)\n if(!cogToIndex.containsKey(ancogs.get(i).getValue2()))\n cogToIndex.put(ancogs.get(i).getValue2(), index++);\n}", "@Override\n public int indexOf(Object restaurantTrackingNumber) {\n if (restaurantTrackingNumber instanceof String) {\n for (int i = 0; i < this.size(); i++) {\n String id = (String) restaurantTrackingNumber;\n if (id.equals(restaurants.get(i).getTrackingNumber())) {\n return i;\n }\n }\n }\n return -1;\n }", "public void testGenreSort() {\n sorter.inssortGenre();\n list = sorter.getLibrary();\n assertEquals(list.get(0).getGenre(), \"Hip-Hop\");\n assertEquals(list.get(1).getGenre(), \"R&B\");\n assertEquals(list.get(2).getGenre(), \"Rock\");\n }", "public int getIndexOfElement(Object... value);", "int[] getSelectedAuthorsBookIndexes();", "public int getIndex(\n )\n {return index;}", "public void randomGenre(View view) {\r\n String[] randomGenre = {\"Rock\", \"Funk\", \"Hip hop\", \"Country\", \"Pop\", \"Blues\", \"K-pop\", \"Punk\", \"House\", \"Soul\"};\r\n int index = (int) (Math.random() * 10);\r\n displayMessage(\"Your random genre is: \" + randomGenre[index]);\r\n }", "int indexOf(Advisor advisor);", "public int getIndex(){\r\n \treturn index;\r\n }", "public String getGenre() {\n return genre;\n }", "public String getGenre() {\n return genre;\n }", "public String genre14(){\n String genre14MovieTitle = \" \";\n for(int i = 0; i < results.length; i++){\n if(results[i].genre()) {\n genre14MovieTitle += results[i].getTitle() + \"\\n\";\n }\n }\n System.out.println(genre14MovieTitle);\n return genre14MovieTitle;\n }", "private int insideArray(ArrayList<Integer> array,int element){\r\n int index = 0;\r\n for(int arrayListElement:array){\r\n if(arrayListElement == element){\r\n return index;\r\n }\r\n index++;\r\n }\r\n return -1;\r\n }", "public void setGenre() {\r\n this.genre = genre;\r\n }", "private int indexOf(SeqItem el)\n\t{\n\t\treturn indexOf((short)el.getIndex());\n\t}", "public int getIndex()\n {\n return m_index;\n }", "public Genre getGenre() {\n\n return genre;\n }", "public void setGenre(String genre){\n\t\t//FIXME\n\t\tthis.genre = genre;\n\t}", "int getIndex(){\r\n\t\treturn index;\r\n\t}", "public int getIndex(int position);", "public String getBasedOnGenre(String genre) {\n String cap = genre.substring(0, 1).toUpperCase() + genre.substring(1);\n StringBuilder json = new StringBuilder();\n for (Node node: books) {\n if (node.getItem().getGenre().equals(cap)) {\n json.append(((Book)node.getItem()).getJSON()).append(\"\\n\");\n }\n }\n for (Node node: music) {\n if (node.getItem().getGenre().equals(cap)) {\n json.append(((Music)node.getItem()).getJSON()).append(\"\\n\");\n }\n }\n for (Node node: movies) {\n if (node.getItem().getGenre().equals(cap)) {\n json.append(((Movie)node.getItem()).getJSON()).append(\"\\n\");\n }\n }\n return json.toString();\n }", "@Override\r\n public int locate(Copiable value) {\r\n for (int i = 0; i < count; i++) {\r\n if (list[i].equals(value)) {\r\n return i;\r\n }\r\n }\r\n return -1;\r\n }", "public int searchCard(int index){\n for(int i = 0; i < cards.size(); ++i){//loop to go through the cards\n if(cards.get(i).toString().equalsIgnoreCase(playable.get(index).toString())){//checks the index\n return i;//returns the index\n }\n }\n return index;\n }", "public ArrayList<Song> searchByYear(Integer year) \r\n {\r\n return musicLibraryYearKey.get(year);\r\n \r\n }", "@Override\r\n\tpublic int getIndex() {\n\t\treturn index;\r\n\t}", "public int getIndex() {\r\n \t\t\treturn index;\r\n \t\t}", "public void addGenre() {\n ResultSet result = null;\n try {\n result = server.executeStatement(\"SELECT genreID FROM productiongenre WHERE prodID = \" + \"'\" + getId() + \"'\" + \";\");\n if(result.next())\n genre = result.getString(\"genreID\");\n } catch (SQLException e) {\n e.printStackTrace();\n }\n\n }", "public String getGenre()\r\n {\r\n String answer=genre;\r\n return answer;\r\n }", "private int findIndex(T item){\n for(int i = 0; i < numItems; i++){\n if(arr[i].equals(item))\n return i;\n }\n return -1;\n }", "private void createGenres() {\n ArrayList<String> gen = new ArrayList<>();\n //\n for (Movie mov : moviedb.getAllMovies()) {\n for (String genre : mov.getGenre()) {\n if (!gen.contains(genre.toLowerCase()))\n gen.add(genre.toLowerCase());\n }\n }\n\n Collections.sort(gen);\n\n genres = gen;\n }", "public String getAllele1(int index);", "int getIndex() {\n\t\treturn index;\n\t}", "public void searchByArtist()\n {\n String input = JOptionPane.showInputDialog(null,\"Enter the artist you'd like to search for:\");\n input = input.replaceAll(\" \", \"_\").toUpperCase(); //standardize output.\n \n Collections.sort(catalog, new ArtistComparator());\n int index = Collections.binarySearch(catalog, \n new Album(input,\"\",null), new ArtistComparator());\n //Since an artist could be listed multiple times, there is *no guarantee*\n //which artist index we find. So, we have to look at the artists\n //left and right of the initial match until we stop matching.\n if(index >= 0)\n {\n Album initial = catalog.get(index);\n String artist = initial.getArtist();\n \n ArrayList<Album> foundAlbums = new ArrayList<>();\n //this ArrayList will have only the albums of our found artist \n foundAlbums.add(initial);\n try { \n int j = index, k = index;\n while(artist.equalsIgnoreCase(catalog.get(j+1).getArtist()))\n {\n foundAlbums.add(catalog.get(j+1));\n j++;\n }\n while(artist.equalsIgnoreCase(catalog.get(k-1).getArtist()))\n {\n foundAlbums.add(catalog.get(k-1));\n k--;\n }\n }\n catch(IndexOutOfBoundsException e) {\n //happens on the last round of the while-loop test expressions\n //don't do anyhting because now we need to print out our albums.\n }\n System.out.print(\"Artist: \" + artist + \"\\nAlbums: \");\n for(Album a : foundAlbums)\n System.out.print(a.getAlbum() + \"\\n\\t\");\n System.out.println();\n }\n else System.err.println(\"Artist '\" + input + \"' not found!\\n\"); \n }", "int getOtherIds(int index);", "private int findIndexOfMax(){\n\t\tint value=0;\n\t\tint indexlocation=0;\n\t\tfor(int i=0; i<myFreqs.size();i++){\n\t\t\tif(myFreqs.get(i)>value){\n\t\t\t\tvalue = myFreqs.get(i);\n\t\t\t\tindexlocation =i;\n\t\t\t}\n\t\t}\n\t\treturn indexlocation;\n\t}", "public int getIndex() {\n \t\treturn index;\n \t}", "protected Gene getGene(int innovation) {\n\t\treturn genes.get(innovation);\n\t}", "public int getProductIndex(String choice) {\n\t\tString name = \"\";\n\t\tint x = 0;\n\t\tif(products.size() > 0) {\n\t\t\twhile(x < alphabet.length()) {\n\t\t\t\tif(choice.equals(alphabet.substring(x,x+1))) {\n\t\t\t\t\tname = products.get(x).name;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx++;\t\n\t\t\t}\n\t\t}\n\t\treturn x;\n\t}" ]
[ "0.61415637", "0.59456104", "0.58355916", "0.58080107", "0.57601154", "0.57430404", "0.5689221", "0.56857526", "0.56200165", "0.5606613", "0.55946505", "0.557999", "0.5524294", "0.5524294", "0.5524294", "0.5524294", "0.5524294", "0.5524294", "0.5524294", "0.5524294", "0.5524294", "0.5524294", "0.5524294", "0.5524294", "0.5524294", "0.551609", "0.551609", "0.551609", "0.54598534", "0.5447473", "0.54200166", "0.5337973", "0.5312641", "0.53042156", "0.5263841", "0.525574", "0.52150464", "0.52079445", "0.5185902", "0.51623815", "0.5150605", "0.512874", "0.511058", "0.511058", "0.5109817", "0.5094359", "0.50920206", "0.50616515", "0.5059424", "0.5051001", "0.5045074", "0.5043821", "0.5043612", "0.50351363", "0.50217587", "0.50205034", "0.5009157", "0.50033957", "0.4997615", "0.49938634", "0.49804446", "0.49804446", "0.49798128", "0.4972939", "0.49726608", "0.49694845", "0.49688533", "0.49679136", "0.49646214", "0.4963862", "0.49573585", "0.4957151", "0.4957151", "0.49526337", "0.49476737", "0.49456805", "0.493581", "0.4933125", "0.4932568", "0.49298418", "0.4929439", "0.49256682", "0.49253583", "0.49209034", "0.4914313", "0.49123102", "0.49116126", "0.49050245", "0.49001208", "0.4899441", "0.4898822", "0.4895578", "0.48846415", "0.48828942", "0.48722798", "0.48630932", "0.48619342", "0.48615995", "0.48615867", "0.48596185" ]
0.7481532
0
/Method asks user to enter the first name, middle name, and last name of the author whose list of book titles the user wants to view, and returns list of books written by the author.
private static void queryBooksByAuthor(){ System.out.println("===Query Books By Author==="); Scanner string_input = new Scanner(System.in); System.out.println("Enter First Name of Author to Query Books by: "); String author_firstname = string_input.next(); System.out.println("Enter Middle Name of Author to Query Books by (Type 'null' if Author has no middlename): "); String author_middlename = string_input.next(); if(author_middlename.equalsIgnoreCase("null")) author_middlename = ""; System.out.println("Enter Last Name of Author to Query Books by: "); String author_lastname = string_input.next(); String author_fullname = author_firstname + " " + author_middlename + " " + author_lastname; if(ALL_AUTHORS.containsKey(author_fullname)){//if author_full_name exists in the Hashtable then print out all of the author's book titles System.out.println("Author found!"); System.out.println(author_fullname + "'s list of book titles are: "); Iterator<String> iter = ALL_AUTHORS.get(author_fullname).iterator(); printAllElements(iter); } else System.out.println("Sorry Author name entered does not exist in our records"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<Book> getByAuthor(String name );", "public ArrayList<Book> getAuthorsBook(String last, String first) {\n\t\t//TO DO\n\t\tNode<ArrayList<Book>> current = head;\n\t\t\t\n\t\twhile (current.letter != last.charAt(0)) {\n\t\t\tcurrent = current.next;\n\t\t}\n\t\n\t\tif (current.data != null) {\n\t\t\treturn current.data;\n\t\t}else {\n\t\t\tthrow new IllegalArgumentException(\"getAuthorsBook: author does not have any books\");\n\t\t}\n\t}", "private void displayByAuthor() {\n\t\tString authorHolder; // declares authorHolder\n\t\t\n\t\tSystem.out.println(\"Please enter author of the book you would like displayed:\");\n\t\tauthorHolder = scan.next();\n\t\tscan.nextLine();\n\t\tSystem.out.println(inventoryObject.displayByAuthor(authorHolder));\n\t\tgetUserInfo();\n\t}", "DefaultListModel getAuthorsBookModel();", "public ArrayList<Book> listOfBooksByAuthor (Author providedAuthor){\n //Array list for storing books written by provided author\n ArrayList<Book> authorBooks = new ArrayList<>();\n\n //loops through the booklist to find books with the author in the list of authors\n for (Book book : bookList) {\n //loops through the list of authors to see if the provided author is among thelist\n for (Author author1 : book.getAuthors()) {\n if (providedAuthor.equals(author1)) {\n authorBooks.add(book);\n }\n }\n }\n return authorBooks;\n }", "public List<BookData> searchBookbyAuthor (String author) throws SQLException{\n\t\tList<BookData> list = new ArrayList<>();\n\t\t\n\t\tPreparedStatement myStmt = null;\n\t\tResultSet myRs = null;\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\tmyStmt = myConn.prepareStatement(\"select title, author_name, publisher_name, book_id from books natural join book_authors where author_name = ?\");\n\t\t\tmyStmt.setString(1, author);\n\t\t\tmyRs = myStmt.executeQuery();\n\t\t\t\n\t\t\twhile (myRs.next()) {\n\t\t\t\tBookData tempbook = convertRowToBook(myRs);\n\t\t\t\tlist.add(tempbook);\n\t\t\t}\n\t\t\t\n\t\t\treturn list;\n\t\t}\n\t\tfinally {\n\t\t\tmyRs.close();\n\t\t\tmyStmt.close();\n\t\t\n\t\t}\n\t\t\n\t}", "public void getAnAuthor() {\n System.out.println(\"Give author name: \");\n String key = input.next();\n for (Card s: cards) {\n if (s.autherOfBook.equals(key)) {\n System.out.println(s.titleOfBook + \" \" + s.autherOfBook + \" \" + s.subjectOfBook);\n } \n }\n }", "public Books getBooks(String title,String authors,String isbn,String publisher);", "public void listBooksByAuthor(String name) {\n String sql = \"SELECT ISBN, BookName, AuthorName, Price \" +\n \"FROM books \" +\n \"WHERE AuthorName = ?\";\n\n try (Connection conn = this.connect();\n PreparedStatement pstmt = conn.prepareStatement(sql)) {\n\n // Set values\n pstmt.setString(1, name);\n\n ResultSet rs = pstmt.executeQuery();\n\n // Print results\n while(rs.next()) {\n System.out.println(rs.getInt(\"ISBN\") + \"\\t\" +\n rs.getString(\"BookName\") + \"\\t\" +\n rs.getString(\"AuthorName\") + \"\\t\" +\n rs.getInt(\"Price\"));\n }\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }", "public static List<Book> selectBooksByAuthor(List<Book> books, String author) {\r\n List<Book> selectedBooks = new ArrayList<>();\r\n for (int i = 0; i < books.size(); i++) {\r\n if (books.get(i).getAuthor().equals(author)) {\r\n selectedBooks.add(books.get(i));\r\n }\r\n }\r\n return selectedBooks;\r\n }", "private void loopAuthors(Book book) {\n for (String s : book.getAuthors()) {\n print(s);\n }\n }", "DefaultListModel getAuthorsModel();", "public ArrayList<Book> gettitleBook(String title);", "public Book[] createBooks(Author[] authorList) {\r\n Book[] bookList = new Book[10];\r\n bookList[0] = createBook(BookCategory.FICTION, \"True story based on the haunted boat\", 150.00f,\r\n \"Lonely Boat\", 1, findAuthorByName(authorList, \"Daniel\"));\r\n bookList[1] = createBook(BookCategory.FICTION, \"Comedy\", 150.00f, \"Lonely Boat\", 2,\r\n findAuthorByName(authorList, \"Daniel\"));\r\n bookList[2] = createBook(BookCategory.TECHNOLOGY, \"Java best practices\", 150.00f, \"Java\", 3,\r\n findAuthorByName(authorList, \"Jeremy\"));\r\n bookList[3] = createBook(BookCategory.NETWORKING, \"Unix Server Mnagement\", 150.00f,\r\n \"Networking\", 4, findAuthorByName(authorList, \"Jeremy\"));\r\n return bookList;\r\n }", "public static ArrayList<Book> search(String title, ArrayList<String> authors, String isbn, String publisher, String sortOrder, HashMap<Book, Integer> purchasedBooks)\n {\n ArrayList<Book> tempBookBuffer = search(title, authors, isbn, publisher, purchasedBooks);\n ArrayList<Book> searchedBooks = new ArrayList<>();\n\n for(Book b: tempBookBuffer) {\n if (b.getBookPublisher().equals(publisher) || publisher.equals(\"*\"))\n searchedBooks.add(b);\n }\n if (sortOrder.equals(\"title\")) {\n Collections.sort(searchedBooks, Book.BookTitleComparator);\n }\n else if(sortOrder.equals(\"publish-date\")){\n Collections.sort(searchedBooks,Book.BookDateComparator);\n }\n else{\n\n }\n return searchedBooks;\n }", "@GetMapping(\"/search-author/{titleString}\")\n public List<Author> getAllAuthorsByConsistTitleString(@PathVariable(\"titleString\") String titleString){\n System.out.println(\"Query: \" + titleString);\n return authorService.getAuthorsByBookTitle(titleString);\n }", "@GetMapping(\"/author/list\")\n public String viewAuthors(ModelMap model, @SortDefault(\"firstName\") Pageable pageable) {\n //\n //List<Author> listAuthors = authorservice.listAll();\n List<Author> listAuthors = authorservice.listAll();\n for (Author author : authorRepository.findAll()) {\n log.info(author.toString());\n }\n //\n model.addAttribute(\"authors\", authorservice.find(pageable));\n //model.addAttribute(\"authors\", book.getAuthors());\n //model.addAttribute(\"listAuthors\", listAuthors);\n return \"author/list\";\n }", "public static ArrayList<Book> search(String title, ArrayList<String> authors, HashMap<Book, Integer> purchasedBooks)\n {\n ArrayList<Book> tempBookBuffer = search(title, purchasedBooks);\n ArrayList<Book> searchedBooks = new ArrayList<>();\n\n for(Book b: tempBookBuffer)\n if(containsAllAuthors(authors, b))\n searchedBooks.add(b);\n\n return searchedBooks;\n }", "public String advancedSearchBooks() {\r\n List<Books> books = new ArrayList<Books>();\r\n keywords = keywords.trim();\r\n \r\n switch (searchBy) {\r\n case \"all\":\r\n return searchBooks();\r\n case \"title\":\r\n books = findBooksByTitle(keywords);\r\n break;\r\n case \"identifier\":\r\n books = findBooksByIdentifier(keywords);\r\n break;\r\n case \"contributor\":\r\n books = findBooksByContributor(keywords);\r\n break;\r\n case \"publisher\":\r\n books = findBooksByPublisher(keywords);\r\n break;\r\n case \"year\":\r\n books = findBooksByYear(keywords);\r\n break;\r\n case \"genre\":\r\n books = findBooksByGenre(keywords);\r\n break;\r\n case \"format\":\r\n books = findBooksByFormat(keywords);\r\n break;\r\n }\r\n clearFields();\r\n\r\n if (books == null || books.isEmpty()) {\r\n books = new ArrayList<Books>();\r\n }\r\n\r\n return displayBooks(books);\r\n }", "@Test\n\tpublic void testGetBooksSortedByAuthor() {\n\t\tSystem.out.println(\"Sorting books by author name...\");\n\t\tList<Book> result = store.getBooksSortedByAuthor();\n\t\tSystem.out.println(result);\n\t}", "List<Book> getBooksByAuthorId(Integer authorId);", "public Book addBook(){\n Book book = new Book();\r\n String t = title.getText().toString();\r\n book.setTitle(t);\r\n String[] str = author.getText().toString().split(\",\");\r\n Author[] authors = new Author[str.length];\r\n int index = 0;\r\n for(String s : str){\r\n Author a = null;\r\n String[] fml = s.split(\"\\\\s+\");\r\n if(fml.length == 1){\r\n a = new Author(fml[0]);\r\n }else if(fml.length == 2){\r\n a = new Author(fml[0], fml[1]);\r\n }else if(fml.length == 3){\r\n a = new Author(fml[0], fml[1], fml[2]);\r\n }else{\r\n Toast.makeText(this, \"Invalid Author Name\", Toast.LENGTH_LONG).show();\r\n }\r\n authors[index] = a;\r\n index++;\r\n }\r\n book.setAuthors(authors);\r\n String isb = isbn.getText().toString();\r\n book.setIsbn(isb);\r\n\r\n\t\treturn book;\r\n\t}", "public static void main(String[] args) {\n // for testing, add books and find book using it's name\n /* Library.books.add(book1);\n Library.books.add(book2);\n Library.books.add(book3);\n System.out.println(\"Enter namer for Book:\");\n String bookName = sc.nextLine();\n \n for (int i = 0; i <3 ; i++) {\n\n if (Library.books.get(i).getName().equalsIgnoreCase(bookName)) {\n \n System.out.println(books.get(i).getName());\n System.out.println(i);\n }\n }*/\n \n do{\n choicesInMenu(menu());\n } while (goOn);\n //Library.addBook();\n //Library.showAllBooks();\n\n }", "public java.util.List<org.jooq.test.h2.generatedclasses.tables.pojos.VAuthor> fetchByLastName(java.lang.String... values) {\n\t\treturn fetch(org.jooq.test.h2.generatedclasses.tables.VAuthor.V_AUTHOR.LAST_NAME, values);\n\t}", "private void displayByTitle() {\n\t\tString titleHolder; // declares titleHolder\n\t\t\n\t\tSystem.out.println(\"Please enter title of the book you would like displayed:\");\n\t\ttitleHolder = scan.next();\n\t\tscan.nextLine();\n\t\tSystem.out.println(inventoryObject.displayByTitle(titleHolder));\n\t\tgetUserInfo();\n\t}", "String[] getAuthor();", "public static void bookNameSearch(Set<Book> books) {\n Pattern pattern = Pattern.compile(SEARCH_PARAMETER);\n for (Book book : books) {\n Matcher matcher = pattern.matcher(book.getBookName());\n if (matcher.find()) {\n System.out.println(book);\n }\n }\n }", "String getDocumentsAuthors(String repository, String graph);", "List<Book> findBooksByName(String name);", "@GetMapping(\"/bookworm/showAllAuthors\")\n public ResponseEntity<List> showAllAuthors() {\n\n log.debug(\"Showing all the Authors whose books are present in library\");\n return ResponseEntity.ok(authorService.getAuthor());\n }", "public void listBooks() {\n String sql = \"SELECT ISBN, BookName, AuthorName, Price FROM books\";\n\n try (Connection conn = this.connect();\n Statement stmt = conn.createStatement();\n ResultSet rs = stmt.executeQuery(sql)) {\n\n // Print results\n while(rs.next()) {\n System.out.println(rs.getInt(\"ISBN\") + \"\\t\" +\n rs.getString(\"BookName\") + \"\\t\" +\n rs.getString(\"AuthorName\") + \"\\t\" +\n rs.getInt(\"Price\"));\n }\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }", "public List<BookData> searchBookbyTitle (String name) throws SQLException{\n\t\tList<BookData> list = new ArrayList<>();\n\t\t\n\t\tPreparedStatement myStmt = null;\n\t\tResultSet myRs = null;\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\tmyStmt = myConn.prepareStatement(\"select title, author_name, publisher_name, book_id from books natural join book_authors where title = ?\");\n\t\t\tmyStmt.setString(1, name);\n\t\t\tmyRs = myStmt.executeQuery();\n\t\t\t\n\t\t\twhile (myRs.next()) {\n\t\t\t\tBookData tempbook = convertRowToBook(myRs);\n\t\t\t\tlist.add(tempbook);\n\t\t\t}\n\t\t\t\n\t\t\treturn list;\n\t\t}\n\t\tfinally {\n\t\t\tmyRs.close();\n\t\t\tmyStmt.close();\n\t\t\n\t\t}\n\t\t\n\t}", "public List<Books> findBooksByTitle(String title) {\r\n return bookController.findBooksByTitle(title);\r\n }", "String getAuthorName();", "public ObservableList<Object> selectAllBooks(){\n System.out.println(\"Printing all books...\");\n dbmanager.open();\n ObservableList<Object> books = FXCollections.observableArrayList();\n\n try{\n try (DBIterator keyIterator = dbmanager.getDB().iterator()) {\n keyIterator.seekToFirst();\n while (keyIterator.hasNext()) {\n String key = asString(keyIterator.peekNext().getKey());\n String[] splittedString = key.split(\"-\");\n\n dbmanager.incrementNextId(Integer.parseInt(splittedString[1]));\n\n if(!\"book\".equals(splittedString[0])){\n keyIterator.next();\n continue;\n }\n String resultAttribute = asString(dbmanager.getDB().get(bytes(key)));\n JSONObject jbook = new JSONObject(resultAttribute);\n\n Book book = new Book(jbook);\n \n book.setPublisher(dbmanager.getPmanager().read(jbook.getInt(\"publisher\")));\n \n JSONArray jauthors = jbook.getJSONArray(\"authors\");\n List<Author> authors = new ArrayList();\n for(int i=0; i<jauthors.length(); i++){\n \n int a=-1;\n a=jauthors.getInt(i);\n if(a>=0){ \n authors.add(dbmanager.getAmanager().read(a));\n }else{\n System.out.println(\"A book has mysterious author\"); \n }\n \n }\n \n book.setAuthors(authors);\n books.add(book);\n keyIterator.next();\n }\n }\n } catch(IOException e){\n e.printStackTrace();\n }\n dbmanager.close();\n return books;\n }", "public Book booksByThreeAuthor(){\n for(Book book:bookList){\n if(book.getAuthors().size() == 3){ //checks the number of elements in the arraylist\n return book;\n }\n }\n return null;\n }", "@GetMapping(value = \"/{username}/books\")\n public Iterable<Book> listBooksInLibrary(@PathVariable String username,\n @RequestParam(required = false) String author,\n @RequestParam(required = false) String status) {\n\n UserBookStatus userBookStatus = StringUtils.isEmpty(status) ? null : UserBookStatus.valueOf(status.toUpperCase());\n List<UserBook> userBooks = userService.listBooks(username, author, userBookStatus);\n\n return userBooks.stream().map(userBookToBook).collect(Collectors.toList());\n }", "private static void queryBooksByPublisher(){\n\t\tSystem.out.println(\"===Query Books By Publisher===\");\n\t\tScanner string_input = new Scanner(System.in);\n\t\t\n\t\tSystem.out.println(\"Enter Publisher to Query Books by: \");\n\t\tString publisher = string_input.nextLine();\n\t\t\n\t\tif(ALL_PUBLISHERS.containsKey(publisher)){\n\t\t\tIterator<String> iter = ALL_PUBLISHERS.get(publisher).iterator();\n\t\t\tSystem.out.println(\"All books published by \" + publisher + \" are:\"); \n\t\t\tprintAllElements(iter);\n\t\t}\n\t\t\n\t\telse\n\t\t\tSystem.out.println(\"Sorry! There are no such publishers in our records!\");\n\t}", "public ArrayList<Book> search(String part){ \n this.searchBooks = new ArrayList<Book>();\n this.numberedListOfSearch = new HashMap<Integer, Book>();\n if (part.length()>=4){\n //Adding all the searching books into an ArrayList<Book>\n //No duplicating for books having the same title\n boolean bookExist = false;\n for (Book book : this.libraryBooks){\n if ((book.getTitle().toLowerCase().contains(part.toLowerCase())) || (book.getAuthor().toLowerCase().contains(part.toLowerCase()))){\n //Check whether any books having the same title in the list\n for (Book bookSearch : this.searchBooks){\n if (bookSearch.getTitle().equals(book.getTitle())){\n bookExist = true;\n break;\n }\n }\n //If none!\n if(!bookExist){\n this.searchBooks.add(book);\n }\n }\n bookExist = false;\n }\n //To put into a numbered list for printing\n //No duplicating for books having the same title\n for (int i =0; i < (this.searchBooks.size());i++){\n // put the book in the HashMap for printing \n this.numberedListOfSearch.put(i+1, this.searchBooks.get(i));\n }\n\n //To print out\n this.println(\"The searching process has finished!\");\n String researchBooks=\"\";\n //check whether the numbered list is empty or not\n if(this.numberedListOfSearch.size() >0){\n researchBooks += \"{\";\n for (int i = 0; i < this.numberedListOfSearch.size();i++){\n researchBooks += (i+1);\n researchBooks += \": \";\n researchBooks += this.numberedListOfSearch.get(i+1).toString();\n researchBooks += \"; \";\n }\n researchBooks = researchBooks.substring(0, researchBooks.length()-2);\n researchBooks += \"}\"; \n }\n //if the numbered list is empty\n else if ( this.numberedListOfSearch.size() == 0){\n researchBooks += \"Nothing found!\";\n }\n this.println(researchBooks);\n }\n\n //If not enough input key words!\n else{\n this.println(\"Please enter more key words! At least four!!\");\n }\n return this.searchBooks;\n }", "public void listBooks() {\n for (int g = 0; g < books.length; g++) {\n books[g].toString();\n }\n// List all books in Bookstore\n }", "public static ArrayList<Book> search(String title, ArrayList<String> authors, String isbn, String publisher, HashMap<Book, Integer> purchasedBooks)\n {\n ArrayList<Book> tempBookBuffer = search(title, authors, isbn, purchasedBooks);\n ArrayList<Book> searchedBooks = new ArrayList<>();\n\n for(Book b: tempBookBuffer)\n if(b.getBookPublisher().equals(publisher) || publisher.equals(\"*\"))\n searchedBooks.add(b);\n\n return searchedBooks;\n }", "public List<BookData> searchBookbyPublisher (String publisher) throws SQLException{\n\t\tList<BookData> list = new ArrayList<>();\n\t\t\n\t\tPreparedStatement myStmt = null;\n\t\tResultSet myRs = null;\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\tmyStmt = myConn.prepareStatement(\"select title, author_name, publisher_name, book_id from books natural join book_authors where publisher_name = ?\");\n\t\t\tmyStmt.setString(1, publisher);\n\t\t\tmyRs = myStmt.executeQuery();\n\t\t\t\n\t\t\twhile (myRs.next()) {\n\t\t\t\tBookData tempbook = convertRowToBook(myRs);\n\t\t\t\tlist.add(tempbook);\n\t\t\t}\n\t\t\t\n\t\t\treturn list;\n\t\t}\n\t\tfinally {\n\t\t\tmyRs.close();\n\t\t\tmyStmt.close();\n\t\t\n\t\t}\n\t\t\n\t}", "private static void addNewBook(){\n\t\tSystem.out.println(\"===Add New Book===\");\n\t\tBookDetails new_book = new BookDetails();\n\t\tScanner string_input = new Scanner(System.in); //takes string input from user\n\t\tScanner integer_input = new Scanner(System.in); //takes integer input from user\n\t\t\n\t\tSystem.out.println(\"Enter BookId: \");\n\t\tint bookId = getIntegerInput(); //ensures user input is an integer value\n\t\t/*if bookId entered already exists then continually ask user to enter bookId until a bookId that does not exist is entered. \n\t\t * Do the same if bookId is less than 1 because book's in the library will not have Id's less than 1.*/\n\t\twhile(ALL_BOOKS.containsKey(bookId) || bookId < 1){\n\t\t\tSystem.out.println(\"Book Id entered already exists! Enter BookId: \");\n\t\t\tbookId = integer_input.nextInt();\n\t\t}\n\t\tnew_book.setBookId(bookId);\n\t\t\n\t\tSystem.out.println(\"Enter Book Title: \");\n\t\tString bookTitle = string_input.nextLine();\n\t\tnew_book.setBookTitle(bookTitle);\n\t\t\n\t\tString author_firstname;\n\t\tdo{\n\t\t\tSystem.out.println(\"Enter Author's First Name: \");\n\t\t\tauthor_firstname = string_input.next();\n\t\t}while(!new_book.setAuthorFirstName(author_firstname)); //loop until name input is valid (contains only letters) \n\t\t\n\t\tString author_middlename;\n\t\tdo{\n\t\t\tSystem.out.println(\"Enter Author's Middle Name (Type 'null' if author has no middle name): \");\n\t\t\tauthor_middlename = string_input.next();\n\t\t}while(!new_book.setAuthorMiddleName(author_middlename)); //loop until name input is valid (contains only letters) \n\t\t\n\t\tString author_lastname;\n\t\tdo{\n\t\t\tSystem.out.println(\"Enter Author's Last Name: \");\n\t\t\tauthor_lastname = string_input.next();\n\t\t}while(!new_book.setAuthorLastName(author_lastname)); //loop until name input is valid (contains only letters) \n\t\t\n\t\tstring_input = new Scanner(System.in);\n\t\tSystem.out.println(\"Enter Book's Publisher: \");\n\t\tString publisher = string_input.nextLine();\n\t\tnew_book.setPublisher(publisher);\n\t\t\n\t\t\n\t\t/*Set book's genre. Valid values for a book's Genre are Biology, Mathematics, Chemistry, Physics,\n\t\t * Science_Fiction, Fantasy, Action, Drama, Romance, Horror, History, Autobiography, Biography.*/\n\t\tString genre;\n\t\tdo{\n\t\t\tSystem.out.println(\"Enter Book's Genre: \");\n\t\t\tgenre = string_input.next();\n\t\t}while(!new_book.setGenre(genre)); //loop until valid genre value is entered\n\t\t\n\t\t/*Set book's condition. Valid values for a book's Condition are New, Good, Worn, Damaged.*/\n\t\tString condition;\n\t\tdo{\n\t\t\tSystem.out.println(\"Enter Book's Condition: \");\n\t\t\tcondition = string_input.next();\n\t\t}while(!new_book.setCondition(condition)); //loop until valid value for condition is entered\n\t\t\n\t\tALL_BOOKS.put(new_book.getBookId(), new_book);\n\t\taddToPublisherTable(new_book.getPublisher(), new_book.getBookTitle()); //add book's title to the ALL_PUBLISHERS Hashtable\n\t\taddToGenreTable(new_book, new_book.getBookTitle()); //add book's title to the ALL_GENRES ArrayList\n\t\taddToAuthorTable(new_book.getAuthor().toString(), new_book.getBookTitle()); //add book's title to the ALL_AUTHORS Hashtable\n\t\tSystem.out.println(\"Book Successfully Added!\");\n\t}", "@Test\n public void Given_store_with_books_When_filtering_by_existing_author_Then_only_books_of_the_author_are_returned() {\n booksList.add(B1_A);\n booksList.add(B2_A);\n booksList.add(B3_B);\n\n when(dao.getBooks()).thenReturn(booksList);\n\n List<Book> booksFilteredByAuthor = store.getBooksByAuthor(B1_A.getAuthor());\n\n assertThat(booksFilteredByAuthor).containsExactlyInAnyOrder(B1_A, B2_A);\n }", "private static void addBook() {\n\t\t\r\n\t\tString author = input(\"Enter author: \"); // varaible change A to author\r\n\t\tString title = input(\"Enter title: \"); // variable changes T to title\r\n\t\tString callNumber = input(\"Enter call number: \"); // variable name change C to callNumber\r\n\t\tbook B = lib.addBook(author, title, callNumber); //variable LIB changes to library,A to author,T to title,C to callNumber , method changes Add_book to addBook()\r\n\t\toutput(\"\\n\" + B + \"\\n\");\r\n\t\t\r\n\t}", "public Books getBooksByAuthor(Author author) throws IOException {\n Books books = QueryGoogleBooksHelper.setUpClient();\n\n\n Books.Volumes.List volumesList = books.volumes().list(BYAUTHOR + \" \" + author.getName());\n\n Book bookToReturn = new Book();\n\n return books;\n\n }", "@Override\n public List<Book> result(List<Book> books) {\n return search.result(books);\n }", "public static String[] getBookSelection(Connection conn){\n String[] validBook = new String[2];\n Scanner in = new Scanner(System.in);\n try{\n String sql = \"SELECT booktitle FROM Books WHERE booktitle = ? AND groupname = ?\";\n PreparedStatement pstmt = conn.prepareStatement(sql);\n \n System.out.print(\"Book: \");\n validBook[0] = in.nextLine();\n pstmt.setString(1, validBook[0]);\n validBook[1] = getWriterSelection(conn);\n pstmt.setString(2, validBook[1]);\n ResultSet rs = executeQ(conn, pstmt, false, false);\n if(!rs.next()){\n validBook[0] = \"\";\n validBook[1] = \"\";\n System.out.println(\"That book does not exist.\");\n }\n }catch (SQLException se) {\n System.out.println(\"Invalid Book.\");\n }\n return validBook;\n }", "Book getBookByTitle(String title);", "String findAllPublicationsFromAuthor(final Author author) {\n\n List<Publication> publications = Stream.concat(mBooks.stream(), mMagazines.stream()).collect(Collectors.toList());\n Set<Publication> foundPublications = publications.stream()\n .filter(publication -> publication.getAuthors().contains(author.getEmail()))\n .collect(Collectors.toSet());\n\n PrintModelVisitor printVisitor = new PrintModelVisitor();\n visitPublications(foundPublications, printVisitor);\n return printVisitor.getPublications();\n }", "static void createAuthorsFile () throws IOException {\n\t\tBufferedReader dataFile = new BufferedReader(new FileReader(DATAFILE));\n\t\tString inputLine;\n\t\t\n\t\tPrintWriter isbnLabeledDataFile = new PrintWriter(new FileWriter(ISBNLABELLEDDATAFILE));\n\t\t\n\t\tSet<String> books = new HashSet<String>();\n\t\twhile ((inputLine = dataFile.readLine()) != null) {\n\t\t\tif (inputLine.indexOf('\\t') == -1) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tString[] fields = inputLine.split(\"\\t\");\n\t\t\tif (fields.length != 4) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tfinal String bookId = fields[1];\n\t\t\tif (books.contains(bookId)) {\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\tbooks.add(bookId);\n\t\t\t\tString authorString = getAuthorString(bookId);\n\t\t\t\tisbnLabeledDataFile.println(bookId + \"\\t\" + authorString);\n\t\t\t\tout.println(bookId + \"\\t\" + authorString);\n\t\t\t}\n\t\t}\n\t\tdataFile.close();\n\t\tisbnLabeledDataFile.close();\n\t}", "public java.util.List<org.jooq.test.h2.generatedclasses.tables.pojos.VAuthor> fetchByFirstName(java.lang.String... values) {\n\t\treturn fetch(org.jooq.test.h2.generatedclasses.tables.VAuthor.V_AUTHOR.FIRST_NAME, values);\n\t}", "public List<Book> readByBookName(String searchString) throws Exception{\n\t\tsearchString = \"%\"+searchString+\"%\";\n\t\treturn (List<Book>) template.query(\"select * from tbl_book where title like ?\", new Object[] {searchString}, this);\n\t}", "public List<Author> selectAllAuthors();", "public void extractAuthorsName() {\r\n try {\r\n // gets all matched objects for Author Name.\r\n Matcher matcherObject = matcher.patternMatcher(\"AuthorsName\");\r\n\r\n // add name to outputResult\r\n while (matcherObject.find()) {\r\n format.Formatter(1, matcherObject.group(1));\r\n isValidFile = true;\r\n }\r\n\r\n } catch (Exception e) {\r\n System.out.println(\"Error has occured in extractAuthorsName method\");\r\n }\r\n }", "public static ArrayList<Book> search(String title, ArrayList<String> authors, String isbn, HashMap<Book, Integer> purchasedBooks)\n {\n ArrayList<Book> tempBookBuffer = search(title, authors, purchasedBooks);\n ArrayList<Book> searchedBooks = new ArrayList<>();\n\n for(Book b: tempBookBuffer)\n if(b.getBookIsbn().equals(isbn) || isbn.equals(\"*\"))\n searchedBooks.add(b);\n\n return searchedBooks;\n }", "private static String getAuthors(JSONObject volumeInfo) throws JSONException {\n JSONArray authors = volumeInfo.optJSONArray(\"authors\");\n if (authors == null) {\n Log.e(LOG_TAG, \"No authors for this book\");\n return null;\n }\n StringBuilder authorsString = new StringBuilder();\n for (int i = 0; i < authors.length(); i++) {\n authorsString.append(authors.getString(i));\n if (i + 1 < authors.length()) {\n authorsString.append(\"\\n\");\n }\n }\n return authorsString.toString();\n }", "public static void main(String[] args) {\n\t\tAuthor au1=new Author(\"Ma Ma\",\"ma@gmail.com\",'F');\r\n\t\tAuthor au2=new Author(\"Mg Mg\",\"mg@gmail.com\",'M');\r\n\t\tAuthor au3=new Author(\"Su Su\",\"su@gmail.com\",'F');\r\n\t\tBook b1=new Book(\"Software Engineering\",au1,7000);\r\n\t\tBook b2=new Book(\"Java\",au1,8000,2);\r\n\t\tSystem.out.println(\"BookInfo writing by Ma Ma:\");\r\n\t\tSystem.out.println(\"BookName:\"+b1.name+\"\\nAuthor:\"+au1.name+\"\\nPrice:\"+b1.price);\r\n\t\tSystem.out.println(\"BookName:\"+b2.name+\"\\nAuthor:\"+au1.name+\"\\nPrice:\"+b2.price+\"\\nQty:\"+b2.qty);\r\n\t\tSystem.out.println();\r\n\t\tBook b3=new Book(\"Digital\",au2,4000);\r\n\t\tBook b4=new Book(\"Management\",au2,6000,3);\r\n\t\tSystem.out.println(\"BookInfo writing by Mg Mg:\");\r\n\t\tSystem.out.println(\"BookName:\"+b3.name+\"\\nAuthor:\"+au2.name+\"\\nPrice:\"+b3.price);\r\n\t\tSystem.out.println(\"BookName:\"+b4.name+\"\\nAuthor:\"+au2.name+\"\\nPrice:\"+b4.price+\"\\nQty:\"+b4.qty);\r\n\t\tSystem.out.println();\r\n\t\tBook b5=new Book(\"Accounting\",au3,5000);\r\n\t\tBook b6=new Book(\"Javascript\",au3,9000,4);\r\n\t\tSystem.out.println(\"BookInfo writing by Su Su:\");\r\n\t\tSystem.out.println(\"BookName:\"+b5.name+\"\\nAuthor:\"+au3.name+\"\\nPrice:\"+b5.price);\r\n\t\tSystem.out.println(\"BookName:\"+b6.name+\"\\nAuthor:\"+au3.name+\"\\nPrice:\"+b6.price+\"\\nQty:\"+b6.qty);\r\n\t}", "public void listTitles() {\n for (int i = 0; i < books.length; i++) {\n System.out.println(\"The title of book\" + (i + 1) + \": \" + books[i].getTitle());\n }\n }", "Page<ExamPackage> searchListByFullnameAuthor(String fullname, int categoryID, int pageNo, int pageSiz,Sort sort);", "String getAuthorPublicationsQuery(String... varargs);", "@Query(\"FROM Author Where author_name = ?1\")\n\tList<Author> findAuthorName(String authorName);", "@Override\n public String toString() {\n return bookName + \"-\" + authorName;\n }", "public List<Book> getBooks() {\r\n \t\t// switch dates\r\n \t\tif (filter_dateFrom.compareTo(filter_dateTo) > 0) {\r\n \t\t\tCalendar tmp = filter_dateFrom;\r\n \t\t\tfilter_dateFrom = filter_dateTo;\r\n \t\t\tfilter_dateTo = tmp;\r\n \t\t}\r\n \r\n \t\tDate yearFrom = filter_dateFrom.getTime();\r\n \t\tDate yearTo = filter_dateTo.getTime();\r\n \r\n \t\t// genre\r\n \t\tGenre genre = null;\r\n \t\tif (!filter_genre.isEmpty() && !filter_genre.equalsIgnoreCase(\"all\")) {\r\n \t\t\tgenre = genreMgr.findByName(filter_genre);\r\n \t\t\tif (genre == null) {\r\n \t\t\t\tSystem.err.println(\"Badly working database encoding!\");\r\n \t\t\t}\r\n \t\t}\r\n \r\n \t\treturn bookMgr.find(filter_name, filter_author, yearFrom, yearTo, genre, filter_isbn_issn);\r\n \t}", "public String searchBooks() {\r\n if (keywords.isEmpty()) {\r\n return \"advanced-search\";\r\n }\r\n\r\n keywords = keywords.trim();\r\n \r\n //Get list of all the queries\r\n List<List<Books>> listOfLists = new ArrayList<List<Books>>();\r\n listOfLists.add(findBooksByGenre(keywords));\r\n listOfLists.add(findBooksByIdentifier(keywords));\r\n listOfLists.add(findBooksByContributor(keywords));\r\n listOfLists.add(findBooksByFormat(keywords));\r\n listOfLists.add(findBooksByPublisher(keywords));\r\n listOfLists.add(findBooksByTitle(keywords));\r\n listOfLists.add(findBooksByYear(keywords));\r\n\r\n clearFields();\r\n\r\n List<Books> books = new ArrayList<Books>();\r\n\r\n //Filter out useless data\r\n List<Books> tempBookList;\r\n for (int cntr = 0; cntr < listOfLists.size(); cntr++) {\r\n tempBookList = listOfLists.get(cntr);\r\n\r\n if (tempBookList == null) {\r\n continue;\r\n }\r\n\r\n if (tempBookList.isEmpty()) {\r\n continue;\r\n }\r\n\r\n books.addAll(tempBookList);\r\n }\r\n\r\n //Remove duplicates\r\n Set<Books> bookSet = new HashSet<Books>();\r\n bookSet.addAll(books);\r\n books.clear();\r\n books.addAll(bookSet);\r\n\r\n return displayBooks(books);\r\n }", "public void getATitle() {\n System.out.println(\"Give any title: \");\n String key = input.next();\n for (Card s: cards) {\n if (s.titleOfBook.equals(key)) {\n System.out.println(s.titleOfBook + \" \" + s.autherOfBook + \" \" + s.subjectOfBook);\n } \n }\n System.out.println(\"not Found\");\n }", "private static void addToAuthorTable(String author_name, String bookTitle) {\n\t\tif(ALL_AUTHORS.containsKey(author_name)) \n\t\t\tALL_AUTHORS.get(author_name).add(bookTitle);\n\t\t/*put author_name as a new key in ALL_AUTHORS*/\n\t\telse{\n\t\t\tHashSet<String> bookTitles_list = new HashSet<String>();\n\t\t\tbookTitles_list.add(bookTitle);\n\t\t\tALL_AUTHORS.put(author_name, bookTitles_list);\n\t\t}\n\t}", "public String getBookAuthor() {\n return bookAuthor;\n }", "private static void queryBooksByGenre(){\n\t\tSystem.out.println(\"===Query Books By Genre===\");\n\t\tScanner string_input = new Scanner(System.in);\n\t\t\n\t\tSystem.out.println(\"Enter Genre to Query Books by: \");\n\t\tString genre = string_input.next();\n\t\tint genre_index = getGenreIndex(genre); //returns the index of the genre entered, in ALL_GENRES\n\t\t\n\t\tif(genre_index > -1){//valid genre was entered\n\t\t\tIterator<String> iter = ALL_GENRES.get(genre_index).iterator();\n\t\t\tSystem.out.println(\"All \" + genre + \" books are: \");\n\t\t\tprintAllElements(iter);\n\t\t}\n\t}", "public void setAuthors(String _authors) { authors = _authors; }", "public void extractMethod(List<Book> books) {\n for (Book book : books) {\n loopAuthors(book);\n }\n }", "public List<AuthorPaper> getAuthorPapers(int authorId) throws SQLException;", "public void listBooksByName(String name) {\n String sql = \"SELECT ISBN, BookName, AuthorName, Price \" +\n \"FROM books \" +\n \"WHERE BookName = ?\";\n\n try (Connection conn = this.connect();\n PreparedStatement pstmt = conn.prepareStatement(sql)) {\n\n // Set values\n pstmt.setString(1, name);\n\n ResultSet rs = pstmt.executeQuery();\n\n // Print results\n while(rs.next()) {\n System.out.println(rs.getInt(\"ISBN\") + \"\\t\" +\n rs.getString(\"BookName\") + \"\\t\" +\n rs.getString(\"AuthorName\") + \"\\t\" +\n rs.getInt(\"Price\"));\n }\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }", "String getAuthor();", "String getAuthor();", "public static String fixAuthor_lastnameFirst(String in){\n \n // Check if we have cached this particular name string before:\n Object old = Globals.nameCache_lastFirst.get(in);\n if (old != null)\n return (String)old;\n \n //Util.pr(\"lastnamefirst: in\");\n StringBuffer sb=new StringBuffer();\n \n String[] authors = in.split(\" and \");\n for(int i=0; i<authors.length; i++){\n \t authors[i]=authors[i].trim();\n \t int comma = authors[i].indexOf(',');\n \t test:if (comma >= 0) {\n \t // There is a comma, so we assume it's ok.\n \t sb.append(authors[i]);\n }\n else {\n // The name is without a comma, so it must be rearranged.\n int pos = authors[i].lastIndexOf(' ');\n if (pos == -1) {\n // No spaces. Give up and just add the name.\n sb.append(authors[i]);\n break test;\n }\n String surname = authors[i].substring(pos+1);\n if (surname.equalsIgnoreCase(\"jr.\")) {\n pos = authors[i].lastIndexOf(' ', pos - 1);\n if (pos == -1) {\n // Only last name and jr?\n sb.append(authors[i]);\n break test;\n }\n else\n surname = authors[i].substring(pos+1);\n }\n // Ok, we've isolated the last name. Put together the rearranged name:\n sb.append(surname + \", \");\n sb.append(authors[i].substring(0, pos));\n \n }\n if (i != authors.length - 1)\n sb.append(\" and \");\n }\n /*String[] t = authors[i].split(\",\");\n if(t.length < 2) {\n // The name is without a comma, so it must be rearranged.\n t = authors[i].split(\" \");\n if (t.length > 1) {\n sb.append(t[t.length - 1]+ \",\"); // Last name\n for (int j=0; j<t.length-1; j++)\n sb.append(\" \"+t[j]);\n } else if (t.length > 0)\n sb.append(t[0]);\n }\n else {\n // The name is written with last name first, so it's ok.\n sb.append(authors[i]);\n }\n \n if(i !=authors.length-1)\n sb.append(\" and \");\n \n }*/\n //Util.pr(in+\" -> \"+sb.toString());\n String fixed = sb.toString();\n \n // Add the fixed name string to the cache.\n Globals.nameCache_lastFirst.put(in, fixed);\n \n return fixed;\n }", "public static void main(String[] args) {\n\t\tint SizeX = 10 , SizeY = 7;\n\t\tString search_type =\"\";//用書名還是書號\n\t\tString answer =\"\";\n\t\tString query = \"\";//搜尋的關鍵字\n\t\tString operation = \"\";//儲存操作的動作: 借書/還書等\n\t\tString identity = \"\";//儲存使用者身分,student/staff/exit\n\t\tScanner in = new Scanner(System.in);\n\t\tString [][] booklists = new String[SizeX][SizeY];\n\t\t//建立資料庫\n\t\tbooklists = AddBooks(\"82101\",\"Cihai\",\"Reference\",\"Shu Xincheng\",\"20000\",booklists,0);\n\t\tbooklists = AddBooks(\"80001\",\"WW2 History\",\"History\",\"Winston Churchill\",\"971\",booklists,1);\n\t\tbooklists = AddBooks(\"00003\",\"Egg 100\",\"Cookbook\",\"Su yuan ma\",\"104\",booklists,2);\n\t\tbooklists = AddBooks(\"50001\",\"Be a honest man\",\"Political\",\"Ma Ying jeou\",\"520\",booklists,3);\n\t\tbooklists = AddBooks(\"85719\",\"Sword Art Online\",\"Novel\",\"Reki Kawahara\",\"8763\",booklists,4);\n\t\tbooklists = AddBooks(\"85728\",\"Spice and Wolf\",\"Novel\",\"Isuna Hasekura\",\"510\",booklists,5);\n\t\tbooklists = AddBooks(\"85707\",\"The Old Man and the Sea\",\"Novel\",\"Ernest Hemingway\",\"127\",booklists,6);\n\t\tbooklists = AddBooks(\"85703\",\"Romance of the Three Kingdoms\",\"Novel\",\"Luo Guanzhong\",\"480\",booklists,7);\n\t\tbooklists = AddBooks(\"80005\",\"Records of the Grand Historian\",\"History\",\"Sima Qian\",\"6000\",booklists,8);\n\t\tbooklists[4][5] = \"true\";\n\t\tbooklists[4][6] = \"1\";\n\t\t\n\t\tSystem.out.println(\"【圖書館租借模擬系統】\");\n\t\tBookSystem bs = new BookSystem();\n\t\tdo{\n\t\t\tSystem.out.println(\"請問你是何種身分?學生(student)或者圖書館人員(staff)?(輸入exit離開)\");\n\t\t\tidentity = in.nextLine();\n\t\t\tif(identity.equals(\"student\")){\n\t\t\t\tdo{\n\t\t\t\t\tbs.ViewStudent(booklists, SizeX);\n\t\t\t\t\tSystem.out.println(\"請問你要進行何種操作?\");\n\t\t\t\t\tSystem.out.println(\"1. 借書(borrow)\");\n\t\t\t\t\tSystem.out.println(\"2. 還書(return)\");\n\t\t\t\t\tSystem.out.println(\"3. 預約書籍(reserve)\");\n\t\t\t\t\tSystem.out.println(\"4. 取消預約書籍(reservecancel)\");\n\t\t\t\t\tSystem.out.println(\"5. 查詢書單(search)\");\n\t\t\t\t\tSystem.out.println(\"6. 離開(exit)\");\n\t\t\t\t\toperation = in.nextLine();\n\t\t\t\t\twhile(!operation.equals(\"borrow\")&&!operation.equals(\"1\")\n\t\t\t\t\t\t&&!operation.equals(\"return\")&&!operation.equals(\"2\")\n\t\t\t\t\t\t&&!operation.equals(\"reserve\")&&!operation.equals(\"3\")\n\t\t\t\t\t\t&&!operation.equals(\"reservecancel\")&&!operation.equals(\"4\")\n\t\t\t\t\t\t&&!operation.equals(\"search\")&&!operation.equals(\"5\")\n\t\t\t\t\t\t&&!operation.equals(\"exit\")&&!operation.equals(\"6\")){\n\t\t\t\t\t\t\tSystem.out.println(\"輸入錯誤!請重新輸入:\");\n\t\t\t\t\t\t\toperation = in.nextLine();\n\t\t\t\t\t}\n\t\t\t\t\tif(!operation.equals(\"search\") && !operation.equals(\"5\")&&!operation.equals(\"exit\")&&!operation.equals(\"6\") ){\n\t\t\t\t\t\tif(operation.equals(\"borrow\")|| operation.equals(\"1\")) \n\t\t\t\t\t\t\tSystem.out.println(\"請問你要輸入[書名](bookname)還是[書號](booknum)來借閱呢?\");\n\t\t\t\t\t\telse if(operation.equals(\"return\")||operation.equals(\"2\")) \n\t\t\t\t\t\t\tSystem.out.println(\"請問你要輸入[書名](bookname)還是[書號](booknum)來還書呢?\");\n\t\t\t\t\t\telse if(operation.equals(\"reserve\")||operation.equals(\"3\")) \n\t\t\t\t\t\t\tSystem.out.println(\"請問你要輸入[書名](bookname)還是[書號](booknum)來預借呢?\");\n\t\t\t\t\t\telse if(operation.equals(\"reservecancel\")||operation.equals(\"4\")) \n\t\t\t\t\t\t\tSystem.out.println(\"請問你要輸入[書名](bookname)還是[書號](booknum)來取消預借呢?\");\n\t\t\t\t\t\tsearch_type = in.nextLine();\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(search_type.equals(\"bookname\"))\tSystem.out.print(\"請輸入書名:\");\n\t\t\t\t\t\telse if(search_type.equals(\"booknum\"))\tSystem.out.print(\"請輸入書號:\");\n\t\t\t\t\t\tanswer = in.nextLine();\n\t\t\t\t\t\tif(operation.equals(\"borrow\")||operation.equals(\"1\")) \n\t\t\t\t\t\t\tbooklists = bs.BorrowBooks(booklists,SizeX,answer,search_type);\n\t\t\t\t\t\telse if(operation.equals(\"return\")||operation.equals(\"2\")) \n\t\t\t\t\t\t\tbooklists = bs.ReturnBooks(booklists,SizeX,answer,search_type);\n\t\t\t\t\t\telse if(operation.equals(\"reserve\")||operation.equals(\"3\")) \n\t\t\t\t\t\t\tbooklists = bs.ReserveBooks(booklists,SizeX,answer,search_type);\n\t\t\t\t\t\telse if(operation.equals(\"reservecancel\")||operation.equals(\"4\")) \n\t\t\t\t\t\t\tbooklists = bs.ReserveCancel(booklists,SizeX,answer,search_type);\n\t\t\t\t\t\t\n\t\t\t\t\t}else if(operation.equals(\"search\")||operation.equals(\"5\")){\n\t\t\t\t\t\tSystem.out.println(\"請問你要以何種方式查詢呢?\");\n\t\t\t\t\t\tSystem.out.println(\"1. [書號](booknum)\");\n\t\t\t\t\t\tSystem.out.println(\"2. [書名](bookname)\");\n\t\t\t\t\t\tSystem.out.println(\"3. [種類](booktype)\");\n\t\t\t\t\t\tSystem.out.println(\"4. [全部列出](all)\");\n\t\t\t\t\t\tsearch_type = in.nextLine();\n\t\t\t\t\t\tint OrderIndex = 0;\n\t\t\t\t\t\tint TypeIndex = 0;\n\t\t\t\t\t\tif(search_type.equals(\"booknum\")){\n\t\t\t\t\t\t\tOrderIndex = 0;//依書號排列\n\t\t\t\t\t\t\tTypeIndex = 0;\n\t\t\t\t\t\t}else if(search_type.equals(\"bookname\")||search_type.equals(\"all\")){\n\t\t\t\t\t\t\tOrderIndex = 1;//依書名排列\n\t\t\t\t\t\t\tTypeIndex = 1;\n\t\t\t\t\t\t}else if(search_type.equals(\"booktype\")){\n\t\t\t\t\t\t\tOrderIndex = 1;//依書名排列\n\t\t\t\t\t\t\tTypeIndex = 2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(!search_type.equals(\"all\")){\n\t\t\t\t\t\t\tSystem.out.print(\"請輸入 \"+search_type+\"的關鍵字:\");\n\t\t\t\t\t\t\tquery = in.nextLine();\n\t\t\t\t\t\t\tbs.SearchBooks(booklists,SizeX,SizeY,query,TypeIndex,OrderIndex);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tbs.SearchBooks(booklists,SizeX,SizeY,TypeIndex,OrderIndex);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}while(!operation.equals(\"exit\"));\n\t\t\t}else if(identity.equals(\"staff\")){\n\t\t\t\tdo{\n\t\t\t\t\tSystem.out.println(\"=========This is staff page=============\");\n\t\t\t\t\tSystem.out.println(\"請問你要進行何種操作?\");\n\t\t\t\t\tSystem.out.println(\"1. 登錄新書籍(bookregister)\");\n\t\t\t\t\tSystem.out.println(\"2. 刪除書籍(bookdelete)\");\n\t\t\t\t\tSystem.out.println(\"3. 更新書籍資料(bookedit)\");\n\t\t\t\t\tSystem.out.println(\"4. 查詢書單(search)\");\n\t\t\t\t\tSystem.out.println(\"5. 查詢學生資料(viewstudent)\");\n\t\t\t\t\tSystem.out.println(\"6. 離開(exit)\");\n\t\t\t\t\toperation = in.nextLine();\n\t\t\t\t\tif(operation.equals(\"bookregister\")||operation.equals(\"1\")){\n\t\t\t\t\t\tbooklists = bs.RregisterBook(booklists,SizeX);\n\t\t\t\t\t}else if(operation.equals(\"bookdelete\")||operation.equals(\"2\")\n\t\t\t\t\t\t\t||operation.equals(\"bookedit\")||operation.equals(\"3\")){\n\t\t\t\t\t\tif(operation.equals(\"bookdelete\")||operation.equals(\"2\"))\n\t\t\t\t\t\t\tSystem.out.println(\"請問你要輸入[書名](bookname)還是[書號](booknum)來刪除書籍呢?\");\n\t\t\t\t\t\telse if(operation.equals(\"bookedit\")||operation.equals(\"3\"))\n\t\t\t\t\t\t\tSystem.out.println(\"請問你要輸入[書名](bookname)還是[書號](booknum)來修改書籍呢?\");\n\t\t\t\t\t\tsearch_type = in.nextLine();\t\t\t\t\t\t\n\t\t\t\t\t\tif(search_type.equals(\"bookname\"))\tSystem.out.print(\"請輸入書名:\");\n\t\t\t\t\t\telse if(search_type.equals(\"booknum\"))\tSystem.out.print(\"請輸入書號:\");\n\t\t\t\t\t\tanswer = in.nextLine();\n\t\t\t\t\t\tif(operation.equals(\"bookdelete\")||operation.equals(\"2\"))\n\t\t\t\t\t\t\tbooklists = bs.DeleteBooks(booklists,SizeX,SizeY,answer,search_type);\n\t\t\t\t\t\telse if(operation.equals(\"bookedit\")||operation.equals(\"3\"))\n\t\t\t\t\t\t\tbooklists = bs.EditBooks(booklists,SizeX,answer,search_type);\n\t\t\t\t\t\n\t\t\t\t\t}else if(operation.equals(\"search\")||operation.equals(\"4\")){\n\t\t\t\t\t\tSystem.out.println(\"請問你要以何種方式查詢呢?\");\n\t\t\t\t\t\tSystem.out.println(\"1. [書號](booknum)\");\n\t\t\t\t\t\tSystem.out.println(\"2. [書名](bookname)\");\n\t\t\t\t\t\tSystem.out.println(\"3. [種類](booktype)\");\n\t\t\t\t\t\tSystem.out.println(\"4. [全部列出](all)\");\n\t\t\t\t\t\tsearch_type = in.nextLine();\n\t\t\t\t\t\tint OrderIndex = 0;\n\t\t\t\t\t\tint TypeIndex = 0;\n\t\t\t\t\t\tif(search_type.equals(\"booknum\")||search_type.equals(\"1\")){\n\t\t\t\t\t\t\tOrderIndex = 0;//依書號排列\n\t\t\t\t\t\t\tTypeIndex = 0;\n\t\t\t\t\t\t}else if(search_type.equals(\"bookname\")||search_type.equals(\"all\")||search_type.equals(\"2\")||search_type.equals(\"3\")){\n\t\t\t\t\t\t\tOrderIndex = 1;//依書名排列\n\t\t\t\t\t\t\tTypeIndex = 1;\n\t\t\t\t\t\t}else if(search_type.equals(\"booktype\")||search_type.equals(\"3\")){\n\t\t\t\t\t\t\tOrderIndex = 1;//依書名排列\n\t\t\t\t\t\t\tTypeIndex = 2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(!search_type.equals(\"all\")){\n\t\t\t\t\t\t\tSystem.out.print(\"請輸入 \"+search_type+\"的關鍵字:\");\n\t\t\t\t\t\t\tquery = in.nextLine();\n\t\t\t\t\t\t\tbs.SearchBooks(booklists,SizeX,SizeY,query,TypeIndex,OrderIndex);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tbs.SearchBooks(booklists,SizeX,SizeY,TypeIndex,OrderIndex);\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(operation.equals(\"viewstudent\")||operation.equals(\"5\")){\n\t\t\t\t\t\tbs.ViewStudent(booklists,SizeX);\n\t\t\t\t\t}\n\t\t\t\t}while(!operation.equals(\"exit\"));\n\t\t\t}\n\t\t\t\n\t\t}while(!identity.equals(\"exit\"));\n\t\t\n\t\tSystem.out.println(\"感謝您使用此系統!\");\n\t}", "public void viewLibraryBooks(){\n\t\tIterator booksIterator = bookMap.keySet().iterator();\n\t\tint number, i=1;\n\t\tSystem.out.println(\"\\n\\t\\t===Books in the Library===\\n\");\n\t\twhile(booksIterator.hasNext()){\t\n\t\t\tString current = booksIterator.next().toString();\n\t\t\tnumber = bookMap.get(current).size();\n\t\t\tSystem.out.println(\"\\t\\t[\" + i + \"] \" + \"Title: \" + current);\n\t\t\tSystem.out.println(\"\\t\\t Quantity: \" + number + \"\\n\");\t\t\t\n\t\t\ti += 1; \n\t\t}\n\t}", "public void showBookingsByName(JTextArea output, String firstName, String lastName)\r\n {\r\n output.setText(\"Bookinger på \" + firstName + \" \" + lastName + \"\\n\\n\");\r\n \r\n Iterator<Booking> iter = bookings.iterator();\r\n \r\n while(iter.hasNext())\r\n {\r\n Booking booking = iter.next();\r\n \r\n if(booking.getGuest().getFirstname().equals(firstName) || \r\n booking.getGuest().getLastname().equals(lastName))\r\n {\r\n output.append(booking.toString() \r\n + \"\\n*******************************************************\\n\");\r\n }//End of if\r\n }// End of while\r\n }", "public List<Books> searchBook(String keywords,String author,double low_price,double high_price){\n /*\n * search books by keywords of book_name\n * */\n List<Books> books=null;\n ResultSet resultSet=null;\n if(keywords!=\"\"&&author==\"\"&&low_price<0&&high_price<0){\n String sql=\"select * from Book where book_name like '%\"+keywords+\"%'\";\n BaseDao baseDao=dao.executeQuery(sql,new Object[]{});\n books=resultSetToBook(baseDao);\n return books;\n }//search books by keywords and author\n else if(keywords!=\"\"&&author!=\"\"&&low_price<0&&high_price<0){\n String sql=\"select * from Book b where b.book_name like '%keywords=?%' and book_author=?\";\n BaseDao baseDao=dao.executeQuery(sql,new Object[]{keywords,author});\n books=resultSetToBook(baseDao);\n return books;\n }//search books by author\n else if(keywords==\"\"&&author!=\"\"&&low_price<0&&high_price<0){\n String sql=\"select * from Book b where book_author=?\";\n BaseDao baseDaot=dao.executeQuery(sql,new Object[]{author});\n books=resultSetToBook(baseDaot);\n return books;\n }\n else if(keywords==\"\"&&author==\"\"&&low_price>0&&high_price>0){\n String sql=\"select * from Book b where book_price>? and book_price<?\";\n BaseDao baseDao=dao.executeQuery(sql,new Object[]{low_price,high_price});\n books=resultSetToBook(baseDao);\n return books;\n }\n //search books by keywords and price\n else if(keywords!=\"\"&&author!=\"\"&&low_price>0&&high_price>0){\n String sql=\"select * from Book b where b.book_name like '%\"+keywords+\"%' \" +\n \"and book_author=? and book_price>? and book_price<?\";\n BaseDao baseDao=dao.executeQuery(sql,new Object[]{author,low_price,high_price});\n books=resultSetToBook(baseDao);\n return books;\n }\n return null;\n }", "public ArrayList<Book> getBookByPart(String titlePart) {\n titlePart = this.sanitizeString(titlePart);\n ArrayList<Book> bookList = new ArrayList<>();\n\n for (String bookTitle: this.books.keySet()) {\n if (bookTitle.contains(titlePart)) {\n bookList.add(this.books.get(bookTitle));\n }\n }\n return bookList;\n }", "String getAuthorsQuery(String wkhuskagraph, String num, Boolean mode);", "public List<String> updatePublicationAddAuthor(String firstName, String lastName, String hash) {\n\t\tfinal Post<BibTex> post = getPublicationByResourceHash(hash).get(0);\n\t\tPersonName p = new PersonName();\n\t\tp.setFirstName(firstName);\n\t\tp.setLastName(lastName);\n\t\tList<PersonName> persons = post.getResource().getAuthor();\n\t\tpersons.add(p);\n\t\tpost.getResource().setAuthor(persons);\n\t\t\n\t\treturn logic.updatePosts(Collections.<Post<? extends Resource>>singletonList(post), PostUpdateOperation.UPDATE_ALL);\n\t}", "public void searchFor(View view) {\n // Get a handle for the editable text view holding the user's search text\n EditText userInput = findViewById(R.id.user_input_edit_text);\n // Get the characters from the {@link EditText} view and convert it to string value\n String input = userInput.getText().toString();\n\n // Search filter for search text matching book titles\n RadioButton mTitleChecked = findViewById(R.id.title_radio);\n // Search filter for search text matching authors\n RadioButton mAuthorChecked = findViewById(R.id.author_radio);\n // Search filter for search text matching ISBN numbers\n RadioButton mIsbnChecked = findViewById(R.id.isbn_radio);\n\n if (!input.isEmpty()) {\n // On click display list of books matching search criteria\n // Build intent to go to the {@link QueryResultsActivity} activity\n Intent results = new Intent(MainActivity.this, QueryListOfBookActivity.class);\n\n // Get the user search text to {@link QueryResultsActivity}\n // to be used while creating the url\n results.putExtra(\"topic\", mUserSearch.getText().toString().toLowerCase());\n\n // Pass search filter, if any\n if (mTitleChecked.isChecked()) {\n // User is searching for book titles that match the search text\n results.putExtra(\"title\", \"intitle=\");\n } else if (mAuthorChecked.isChecked()) {\n // User is searching for authors that match the search text\n results.putExtra(\"author\", \"inauthor=\");\n } else if (mIsbnChecked.isChecked()) {\n // User is specifically looking for the book with the provided isbn number\n results.putExtra(\"isbn\", \"isbn=\");\n }\n\n // Pass on the control to the new activity and start the activity\n startActivity(results);\n\n } else {\n // User has not entered any search text\n // Notify user to enter text via toast\n\n Toast.makeText(\n MainActivity.this,\n getString(R.string.enter_text),\n Toast.LENGTH_SHORT)\n .show();\n }\n }", "private static void loadBooks() {\n\tbookmarks[2][0]=BookmarkManager.getInstance().createBook(4000,\"Walden\",\"\",1854,\"Wilder Publications\",new String[] {\"Henry David Thoreau\"},\"Philosophy\",4.3);\n\tbookmarks[2][1]=BookmarkManager.getInstance().createBook(4001,\"Self-Reliance and Other Essays\",\"\",1900,\"Dover Publications\",new String[] {\"Henry David Thoreau\"},\"Philosophy\",4.3);\n\tbookmarks[2][2]=BookmarkManager.getInstance().createBook(4002,\"Light From Many Lamps\",\"\",1960,\"Wilder Publications\",new String[] {\"Henry David Thoreau\"},\"Philosophy\",4.3);\n\tbookmarks[2][3]=BookmarkManager.getInstance().createBook(4003,\"Head First Design Patterns\",\"\",1944,\"Wilder Publications\",new String[] {\"Henry David Thoreau\"},\"Philosophy\",4.3);\n\tbookmarks[2][4]=BookmarkManager.getInstance().createBook(4004,\"Effective Java Programming Language Guide\",\"\",1990,\"Wilder Publications\",new String[] {\"Eric Freeman\",\"Bert Bates\",\"Kathy Sierra\",\"Elisabeth Robson\"},\"Philosophy\",4.3);\n}", "private static void queryBook(){\n\t\tSystem.out.println(\"===Book Queries Menu===\");\n\t\t\n\t\t/*Display menu options*/\n\t\tSystem.out.println(\"1--> Query Books by Author\");\n\t\tSystem.out.println(\"2--> Query Books by Genre\");\n\t\tSystem.out.println(\"3--> Query Books by Publisher\");\n\t\tSystem.out.println(\"Any other number --> Exit To Main Menu\");\n\t\tSystem.out.println(\"Enter menu option: \");\n\t\tint menu_option = getIntegerInput(); //ensures user input is an integer value\n\t\t\n\t\tswitch(menu_option){\n\t\t\tcase 1:\n\t\t\t\tSystem.out.println();\n\t\t\t\tqueryBooksByAuthor();\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tSystem.out.println();\n\t\t\t\tqueryBooksByGenre();\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tSystem.out.println();\n\t\t\t\tqueryBooksByPublisher();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t}", "public static Set<String> getAllAuthors(List<Book> books) {\r\n Set<String> allAuthors = new HashSet<>();\r\n for (Book book : books) {\r\n allAuthors.add(book.getAuthor());\r\n }\r\n return allAuthors;\r\n }", "List<FraseEntidade> getPhrasesByAuthorName(String name);", "public List<Book> listBooks() {\n\t\tArrayList<Book> books = new ArrayList<>();\n\t\ttry (Connection con = LibraryConnection.getConnection()) {\n\t\t\tPreparedStatement stmt = con.prepareStatement(\"SELECT * FROM book\");\n\n\t\t\tResultSet rs = stmt.executeQuery();\n\t\t\twhile (rs.next()) {\n\t\t\t\tbooks.add(new Book(rs.getString(\"isbn\"), rs.getString(\"title\")));\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn books;\n\t}", "List<Book> getAllBooks();", "void viewBooks();", "public void addMultipleBook() {\n Set set = new TreeSet();\n System.out.println(\" yours choice how many addressbook you want to create it:--\");\n int number = scanner.nextInt();\n\n for (int index = 1; index <= number; index++) {\n System.out.println(\"give name to your dictionary:--\");\n String name = scanner.next();\n set.add(name);\n }\n System.out.println(set);\n }", "public List<String > getBooks(){\n List<String> titles = new ArrayList<>();\n\n String strSQL = \"SELECT B._id, B.Title FROM TBooks B WHERE NOT B._id IN (Select TLoaned.TitleID \" +\n \" FROM TLoaned WHERE TLoaned.ReturnDate IS NULL);\";\n SQLiteDatabase db = this.getReadableDatabase();\n Cursor c = db.rawQuery(strSQL, null);\n try {\n if (c.moveToFirst()) {\n do {\n titles.add(c.getString(0) + \". \" + c.getString(1));\n } while (c.moveToNext());\n }\n }\n finally {\n c.close();\n db.close();\n }\n return titles;\n }", "public Book(String title, List<String> authors) {\n this.title = title;\n this.authors = authors;\n // TODO write more code if necessary\n this.setParentCollection(null);\n }", "public String getAuthor();", "private void enterAll() {\n\n String sku = \"Java1001\";\n Book book1 = new Book(\"Head First Java\", \"Kathy Sierra and Bert Bates\", \"Easy to read Java workbook\", 47.50, true);\n bookDB.put(sku, book1);\n\n sku = \"Java1002\";\n Book book2 = new Book(\"Thinking in Java\", \"Bruce Eckel\", \"Details about Java under the hood.\", 20.00, true);\n bookDB.put(sku, book2);\n\n sku = \"Orcl1003\";\n Book book3 = new Book(\"OCP: Oracle Certified Professional Jave SE\", \"Jeanne Boyarsky\", \"Everything you need to know in one place\", 45.00, true);\n bookDB.put(sku, book3);\n\n sku = \"Python1004\";\n Book book4 = new Book(\"Automate the Boring Stuff with Python\", \"Al Sweigart\", \"Fun with Python\", 10.50, true);\n bookDB.put(sku, book4);\n\n sku = \"Zombie1005\";\n Book book5 = new Book(\"The Maker's Guide to the Zombie Apocalypse\", \"Simon Monk\", \"Defend Your Base with Simple Circuits, Arduino and Raspberry Pi\", 16.50, false);\n bookDB.put(sku, book5);\n\n sku = \"Rasp1006\";\n Book book6 = new Book(\"Raspberry Pi Projects for the Evil Genius\", \"Donald Norris\", \"A dozen friendly fun projects for the Raspberry Pi!\", 14.75, true);\n bookDB.put(sku, book6);\n }", "@Override\n\tpublic List<BookRequestVO> bookList(String bookName) {\n\t\treturn bookStorePersistDao.bookList(bookName);\n\t}", "void availableBooks(){\n\t\tSystem.out.println(\")))))Available books((((((\");\n\t\tfor(int i=0;i<books.length;i++){\n\t\t\tString book=books[i];\n\t\t\tif(book==null){\n\t\t\tcontinue;\n\t\t}\n\t\t\tSystem.out.println(\"*\"+books[i]);\n\t\t}\n\t\t\n\t}", "@Override\r\n\tpublic List<Author> getAllAuthorDetails() {\n\t\treturn authorDAO.findAll();\r\n\t\t\r\n\t}", "public static void printBooks(List<Book> books) {\r\n System.out.println(\"AUTHOR, \" + \"TITLE, \" + \"GENRE, \" + \"SERIES (if any), \" + \"PART (if any), \" + \"PAGES, \" + \"YEAR, \" + \"PRICE\");\r\n\r\n for (Book book : books) {\r\n System.out.println(book.getTitle() + \", \" + book.getAuthor() + \", \" + book.getGenre() + \", \" + book.getSeries() + \", \" + book.getPartNumber() + \", \" + book.getPagesQuantity() + \", \" + book.getYearPublished() + \", \" + book.getPrice());\r\n }\r\n\r\n }" ]
[ "0.69392055", "0.6900456", "0.6787959", "0.65359604", "0.6526474", "0.6510146", "0.64693856", "0.64244324", "0.62892354", "0.6081958", "0.60551834", "0.60540366", "0.6030538", "0.601094", "0.600263", "0.5992922", "0.59716415", "0.5967339", "0.5964537", "0.59452015", "0.5942643", "0.5940692", "0.59024924", "0.5894535", "0.5883661", "0.586075", "0.5855078", "0.58490324", "0.5848924", "0.58481765", "0.5846108", "0.58184266", "0.5816951", "0.57787293", "0.57775617", "0.57752883", "0.57727534", "0.5772261", "0.574846", "0.5741702", "0.57364213", "0.57337224", "0.5733103", "0.5729692", "0.571937", "0.57176834", "0.57106894", "0.5704087", "0.5692636", "0.5685938", "0.5676277", "0.56554365", "0.5650595", "0.5632878", "0.56274307", "0.5623181", "0.56032175", "0.5598659", "0.5594944", "0.55885917", "0.5546887", "0.55410975", "0.5532721", "0.5528793", "0.5521824", "0.55073094", "0.55046666", "0.5501296", "0.5489297", "0.54886734", "0.5481847", "0.5481238", "0.5474798", "0.54705477", "0.54705477", "0.5463561", "0.54602385", "0.5457729", "0.54555136", "0.54474497", "0.54351205", "0.54218185", "0.5418757", "0.5414687", "0.54053074", "0.5404051", "0.539537", "0.53935105", "0.5388386", "0.53673196", "0.53499764", "0.53364414", "0.5326322", "0.53230923", "0.53062755", "0.5304445", "0.53010935", "0.53005934", "0.5299282", "0.5295095" ]
0.7651323
0
/Adds a new Book to the ALL_Books ArrayList
private static void addNewBook(){ System.out.println("===Add New Book==="); BookDetails new_book = new BookDetails(); Scanner string_input = new Scanner(System.in); //takes string input from user Scanner integer_input = new Scanner(System.in); //takes integer input from user System.out.println("Enter BookId: "); int bookId = getIntegerInput(); //ensures user input is an integer value /*if bookId entered already exists then continually ask user to enter bookId until a bookId that does not exist is entered. * Do the same if bookId is less than 1 because book's in the library will not have Id's less than 1.*/ while(ALL_BOOKS.containsKey(bookId) || bookId < 1){ System.out.println("Book Id entered already exists! Enter BookId: "); bookId = integer_input.nextInt(); } new_book.setBookId(bookId); System.out.println("Enter Book Title: "); String bookTitle = string_input.nextLine(); new_book.setBookTitle(bookTitle); String author_firstname; do{ System.out.println("Enter Author's First Name: "); author_firstname = string_input.next(); }while(!new_book.setAuthorFirstName(author_firstname)); //loop until name input is valid (contains only letters) String author_middlename; do{ System.out.println("Enter Author's Middle Name (Type 'null' if author has no middle name): "); author_middlename = string_input.next(); }while(!new_book.setAuthorMiddleName(author_middlename)); //loop until name input is valid (contains only letters) String author_lastname; do{ System.out.println("Enter Author's Last Name: "); author_lastname = string_input.next(); }while(!new_book.setAuthorLastName(author_lastname)); //loop until name input is valid (contains only letters) string_input = new Scanner(System.in); System.out.println("Enter Book's Publisher: "); String publisher = string_input.nextLine(); new_book.setPublisher(publisher); /*Set book's genre. Valid values for a book's Genre are Biology, Mathematics, Chemistry, Physics, * Science_Fiction, Fantasy, Action, Drama, Romance, Horror, History, Autobiography, Biography.*/ String genre; do{ System.out.println("Enter Book's Genre: "); genre = string_input.next(); }while(!new_book.setGenre(genre)); //loop until valid genre value is entered /*Set book's condition. Valid values for a book's Condition are New, Good, Worn, Damaged.*/ String condition; do{ System.out.println("Enter Book's Condition: "); condition = string_input.next(); }while(!new_book.setCondition(condition)); //loop until valid value for condition is entered ALL_BOOKS.put(new_book.getBookId(), new_book); addToPublisherTable(new_book.getPublisher(), new_book.getBookTitle()); //add book's title to the ALL_PUBLISHERS Hashtable addToGenreTable(new_book, new_book.getBookTitle()); //add book's title to the ALL_GENRES ArrayList addToAuthorTable(new_book.getAuthor().toString(), new_book.getBookTitle()); //add book's title to the ALL_AUTHORS Hashtable System.out.println("Book Successfully Added!"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addBook(Book book) {\n this.bookList.add(book);\n }", "public void addBook(Book book) {\n \tset.add(book);\n }", "public void add(Book book)\n\t{\n\t\tbooks.add(book);\n\t}", "public Book addBook(Book b){\n list.add(b);\n return b;\n }", "public void addBook(Book title)\n {\n bookList.add(title);\n }", "public void add(Book book) {\n if (books.length == numBooks){ grow(); }\n books[numBooks++] = book;\n }", "void addAll(Collection<Book> books);", "public void addBook(Book book) {\n\t\tboolean notFound = true;\n\t\tfor (Item item : items) {\n\t\t\tif(item.getName().equals(book.getName())) {\n\t\t\t\t// Found\n\t\t\t\tnotFound = false;\n\t\t\t\titem.updateQuantity();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(notFound) {\n\t\t\tItem item = new Item(book, 1);\n\t\t\titems.add(item);\n\t\t}\n\t}", "public void addNewBook(Book b) {\n if (totalbooks < books.length) {\n books[totalbooks] = b;\n totalbooks++;\n } else {\n System.out.println(\"The bookstore is full\");\n }\n\n }", "public void addBook(Book book)\r\n\t{\r\n\t\tList<Book> oldValue = items;\r\n\t\titems = new ArrayList<Book>(items);\r\n\t\titems.add(book);\r\n\t\tfirePropertyChange(\"books\", oldValue, items);\r\n\t\tfirePropertyChange(\"itemsCount\", oldValue.size(), items.size());\r\n\t}", "@Override\n\tpublic void addBook() {\n\t\t\n\t}", "public void addBook(Book b){\n\t\tbookMap.get(b.getTitle()).add(b);\n\t}", "public boolean insertBook(Book book) {\r\n books.add(book);\r\n return true;\r\n }", "public void addBookToBooks(Book book) {\n\t\tcustomerBooks.add(book);\n\t}", "@Override\n\tpublic void add() {\n\t\tHashMap<String, String> data = new HashMap<>();\n\t\tdata.put(\"title\", title);\n\t\tdata.put(\"author\", author);\n\t\tdata.put(\"publisher\", publisher);\n\t\tdata.put(\"isbn\", isbn);\n\t\tdata.put(\"bookID\", bookID);\n\t\tHashMap<String, Object> result = null;\n\t\tString endpoint = \"bookinfo/post.php\";\n\t\ttry {\n\t\t\tresult = APIClient.post(BookInfo.host + endpoint, data);\n\t\t\tvalid = result.get(\"status_code\").equals(\"Success\");\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\r\n\tpublic Book addBook(Book book) {\n\t\treturn bd.save(book);\r\n\t}", "public void addBooks(Books book){\n\n /*\n * If the book you want to add is not an instance of this Books class then you add it...\n * Don't think that's what it's supposed to do?\n */\n if (!(book instanceof Books)) {\n Books[] result = new Books[books.length + 1];\n for (int i = 0; i < books.length; i++) {\n result[i] = books[i];\n }\n result[result.length - 1] = (Books) book; // your if statement is wrong, that's why intellij warns this will always be null.\n books = result;\n }\n }", "void addbook(String book){\n\t\tthis.books[no_of_books]=book;\n\t\tno_of_books++;\n\t\tSystem.out.println(book+\" ...add\");\n\n\t}", "public void addBooking(Booking b)\r\n {\r\n bookings.add(b);\r\n }", "protected static void addBook(Book toAdd)\n {\n if (toAdd == null) // if product is null, becuase the formatting wasnt correct, then dont go forward and print out that the book wasnt added\n ProductGUI.Display(\"Book not added\\n\");\n else{\n try{\n if (!(toAdd.isAvailable(toAdd.getID(), productList))) // if the product id alrady exists, dont go forard towards adding it\n {\n ProductGUI.Display(\"Sorry. this product already exists\\n\");\n return;\n }\n else\n ProductGUI.Display(\"New book product\\n\");\n \n myProduct = new Book(toAdd.getID(), toAdd.getName(), toAdd.getYear(), toAdd.getPrice(), toAdd.getAuthor(), toAdd.getPublisher()); // make new product using this object\n productList.add(myProduct); // add product to arraylist\n \n addToMap(toAdd.getName()); // adding the product name to the hashmap\n System.out.println(\"book added to all\");\n ProductGUI.fieldReset(); // reset the fields to being blank\n } catch (Exception e){\n ProductGUI.Display(e.getMessage()+\"errorrorror\\n\");\n }\n }\n }", "public void addBook(Book aBook) {\n\t\t\n\t\tNode<ArrayList<Book>> current = head;\n\t\t//System.out.print(current.letter);\n\t\twhile (current.letter != aBook.getAuthorLastName().charAt(0)) {\n\t\t\tcurrent = current.next;\n\t\t}\n\n\t\tcurrent.data.add(aBook);\n\t\t\n\t}", "public void addBook(String name, String catogary){\n\t\tBook newBook = new Book(name, catogary);\n newBook.setAddDate();\n Library.Books.add(newBook);\n\t\tLibrary.saveObject(Library.Books,\"books.dat\");\n\t\t\n\t}", "private boolean addBook(Book book) {\n\t\tfor (int i = 0; i < items.size(); i++)\n\t\t\tif (items.get(i).keyEquals(book))\n\t\t\t\treturn false;\n\t\titems.add(book);\n\t\treturn true;\n\t}", "@Override\n\tpublic int addBook(bookInfo bookinfo) {\n\t\treturn 0;\n\t}", "public void addAll(List<Book> bookList) {\n this.mBook.clear();\n this.mBook.addAll(bookList);\n notifyDataSetChanged();\n\n }", "public void addBook(int index, Book book)\r\n\t{\r\n\t\tif(index == -1) {\r\n\t\t\tindex++;\r\n\t\t}\r\n\t\tList<Book> oldValue = items;\r\n\t\titems = new ArrayList<Book>(items);\r\n\t\titems.add(index, book);\r\n\t\tfirePropertyChange(\"books\", oldValue, items);\r\n\t\tfirePropertyChange(\"itemsCount\", oldValue.size(), items.size());\r\n\t}", "void addInBookNo(Object newInBookNo);", "public void add(int id, String name, String author, int issueDate, int returnDate) {\n\tBook book = new Book();\n\tbook.id = id;\n\tbook.name = name;\n\tbook.author = author;\n\tbook.issueDate = issueDate;\n\tbook.returnDate = returnDate;\n\tlist.add(book);\n\tSystem.out.println(\"Successfully added: \"+book.id);\n}", "@Override\r\n\tpublic boolean addBook(BookDto book) {\n\t\tsqlSession.insert(ns + \"addBook\", book);\t\t\r\n\t\treturn true;\r\n\t}", "public void addBook(String string, int i) {\n\t\tBook b= new Book(string,i);\r\n\t\tarlist.add(b);\r\n\t\t\r\n\t}", "int addBookToLibrary(Book book) {\n\t\t\n\t\t// checks if the book is already in our library \n\t\tint checkBookId = this.getBookId(book);\n\n\t\tif (checkBookId != -1) {\n\t\t\treturn checkBookId;\n\t\t}\n\t\t\n\t\t// checks if passed the amount of books we can hold\n\t\tif (this.bookCounter >= this.maxBookCapacity) {\n\t\t\treturn -1; \n\t\t}\n\t\t\t\n\t\t// adds the book to the bookshelf\n\t\tthis.bookShelf[this.bookCounter] = book; \n\t\t\n\t\t// update the counter\n\t\tthis.bookCounter ++; \n\t\t\n\t\treturn (this.bookCounter - 1); \n\t}", "@Override\n\tpublic boolean addBook(Book book) throws DAOException {\n\t\treturn false;\n\t}", "@Test\n\tpublic void testAddBook() {\n\t\t//System.out.println(\"Adding book to bookstore...\");\n\t\tstore.addBook(b5);\n\t\tassertTrue(store.getBooks().contains(b5));\n\t\t//System.out.println(store);\n\t}", "public void loadBook() {\n List<Book> books = new ArrayList<>();\n for (int i = 0; i < 5; i++) {\n Book book = new Book(\"Book-\" + i, \"Test book \" + i);\n books.add(book);\n }\n this.setBooks(books);\n }", "public boolean addBook(Books books){\n String sql=\"insert into Book(book_name,book_publish_date,book_author,book_price,scraption)values(?,?,?,?,?)\";\n boolean flag=dao.exeucteUpdate(sql,new Object[]{books.getBook_name(),books.getBook_publish_date(),\n books.getBook_author_name(),books.getBook_price(),books.getScraption()});\n return flag;\n }", "BookList push(Node book){\n BookList l = new BookList(book);\n BookList current = this;\n l.next = current;\n return l;\n }", "@Override\r\n\tpublic int insertBook(Book book) {\n\t\treturn 0;\r\n\t}", "public Book addBook(){\n Book book = new Book();\r\n String t = title.getText().toString();\r\n book.setTitle(t);\r\n String[] str = author.getText().toString().split(\",\");\r\n Author[] authors = new Author[str.length];\r\n int index = 0;\r\n for(String s : str){\r\n Author a = null;\r\n String[] fml = s.split(\"\\\\s+\");\r\n if(fml.length == 1){\r\n a = new Author(fml[0]);\r\n }else if(fml.length == 2){\r\n a = new Author(fml[0], fml[1]);\r\n }else if(fml.length == 3){\r\n a = new Author(fml[0], fml[1], fml[2]);\r\n }else{\r\n Toast.makeText(this, \"Invalid Author Name\", Toast.LENGTH_LONG).show();\r\n }\r\n authors[index] = a;\r\n index++;\r\n }\r\n book.setAuthors(authors);\r\n String isb = isbn.getText().toString();\r\n book.setIsbn(isb);\r\n\r\n\t\treturn book;\r\n\t}", "public synchronized void addBook(String title, int quantity){\n titleList.add(title);\n quantityList.add(quantity);\n borrowerList.add(new LinkedList<>());\n }", "public void addnew(book newbook) {\n\t\trepository.save(newbook);\n\t\t\n\t}", "Book addBook(String title, String[] authors, boolean silent);", "public void put(Book book) {\n\t\tboolean ok = false;\n\t\tfor (Integer isbnToLend : wishList) {\n\t\t\tif (isbnToLend == book.getIsbn()) {\n\t\t\t\tok = true;\n\t\t\t}\n\t\t}\n\t\tif (!ok) {\n\t\t\tlogger.level3(\"Proba wlozenia ksiazki ktorej nie ma na liscie do kieszeni: \" + book);\n\t\t\tthrow new EnvinronmentException(\"Proba wypozyczenia ksiazki spoza listy przez studenta: \" + this);\n\t\t}\n\t\tlogger.level1(\"Wlozono ksiazke do kieszeni: \" + book);\n\t\tlendBooks.add(book);\n\t}", "public void addLivros( LivroModel book){\n Connection connection=ConexaoDB.getConnection();\n PreparedStatement pStatement=null;\n try {\n String query=\"Insert into book(id_book,title,author,category,publishing_company,release_year,page_number,description,cover)values(null,?,?,?,?,?,?,?,?)\";\n pStatement=connection.prepareStatement(query);\n pStatement.setString(1, book.getTitulo());\n pStatement.setString(2, book.getAutor());\n pStatement.setString(3, book.getCategoria());\n pStatement.setString(4, book.getEditora());\n pStatement.setInt(5, book.getAnoDeLancamento());\n pStatement.setInt(6, book.getPaginas());\n pStatement.setString(7, book.getDescricao());\n pStatement.setString(8, book.getCapa());\n pStatement.execute();\n } catch (Exception e) {\n \n }finally{\n ConexaoDB.closeConnection(connection);\n ConexaoDB.closeStatement(pStatement);\n }\n }", "public void add(String t, String author){\r\n\t \r\n\t items.add(new Book(t, author));\r\n\t \r\n }", "void addHadithBookNo(Object newHadithBookNo);", "public void loadBooks(){\n\t\tSystem.out.println(\"\\n\\tLoading books from CSV file\");\n\t\ttry{\n\t\t\tint iD=0, x;\n\t\t\tString current = null;\n\t\t\tRandom r = new Random();\n\t\t\tBufferedReader br = new BufferedReader(new FileReader(\"../bin/books.csv\"));\n\t\t\twhile((current = br.readLine()) != null){\n\t\t\t\tString[] data = current.split(\",\");\n\t\t\t\tx = r.nextInt(6) + 15;\n\t\t\t\tfor(int i =0;i<x;i++){\n\t\t\t\t\tBook b= new Book(Integer.toHexString(iD), data[0], data[1], data[2], data[3]);\n\t\t\t\t\tif(bookMap.containsKey(data[0]) != true){\n\t\t\t\t\t\tbookMap.put(data[0], new ArrayList<Book>());\n\t\t\t\t\t}\t\n\t\t\t\t\t\t\n\t\t\t\t\tbookMap.get(data[0]).add(b);\n\t\t\t\t\tiD += 1;\n\t\t\t\t}\t\n\t\t\t}\t\t\t\n\t\t\tbr.close();\n\t\t\tSystem.out.println(\"\\tBooks Added!\");\n\t\t}catch(FileNotFoundException e){\n\t\t\tSystem.out.println(\"\\tFile not found\");\n\t\t}catch(IOException e){\n System.out.println(e.toString());\n }\n\t}", "@Override\r\n\tpublic boolean addBook(Book book) {\n\r\n\t\tif (searchBook(book.getISBN()).getISBN() == 98564567l) {\r\n\t\t\ttransactionTemplate.setReadOnly(false);\r\n\t\t\treturn transactionTemplate.execute(new TransactionCallback<Boolean>() {\r\n\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic Boolean doInTransaction(TransactionStatus status) {\r\n\t\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\t\ttry {\r\n\r\n\t\t\t\t\t\tint rows = bookDAO.addBook(book);\r\n\t\t\t\t\t\tif (rows > 0)\r\n\t\t\t\t\t\t\treturn true;\r\n\r\n\t\t\t\t\t} catch (Exception exception) {\r\n\t\t\t\t\t\tstatus.setRollbackOnly();\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn false;\r\n\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "@Override\n\tpublic void add(BookInfoVO vo) {\n\t\tbookInfoDao.add(vo);\n\t}", "public static void addBook(final @Valid Book book) {\n\t\tif (book.serie.id == null) {\r\n\t\t\tValidation.required(\"book.serie.name\", book.serie.name);\r\n\r\n\t\t\tif (book.serie.name != null) {\r\n\t\t\t\tSerie serie = Serie.find(\"byName\", book.serie.name).first();\r\n\t\t\t\tif (serie != null) {\r\n\t\t\t\t\tValidation.addError(\"book.serie.name\",\r\n\t\t\t\t\t\t\t\"La série existe déjà\",\r\n\t\t\t\t\t\t\tArrayUtils.EMPTY_STRING_ARRAY);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Validation errror treatment\r\n\t\tif (Validation.hasErrors()) {\r\n\r\n\t\t\tif (Logger.isDebugEnabled()) {\r\n\t\t\t\tfor (play.data.validation.Error error : Validation.errors()) {\r\n\t\t\t\t\tLogger.debug(error.message() + \" \" + error.getKey());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Specific treatment for isbn, just to provide example\r\n\t\t\tif (!Validation.errors(\"book.isbn\").isEmpty()) {\r\n\t\t\t\tflash.put(\"error_isbn\", Messages.get(\"error.book.isbn.msg\"));\r\n\t\t\t}\r\n\r\n\t\t\tparams.flash(); // add http parameters to the flash scope\r\n\t\t\tValidation.keep(); // keep the errors for the next request\r\n\t\t} else {\r\n\r\n\t\t\t// Create serie is needed\r\n\t\t\tif (book.serie.id == null) {\r\n\t\t\t\tbook.serie.create();\r\n\t\t\t}\r\n\r\n\t\t\tbook.create();\r\n\r\n\t\t\t// Send WebSocket message\r\n\t\t\tWebSocket.liveStream.publish(MessageFormat.format(\r\n\t\t\t\t\t\"La BD ''{0}'' a été ajoutée dans la série ''{1}''\",\r\n\t\t\t\t\tbook.title, book.serie.name));\r\n\r\n\t\t\tflash.put(\"message\",\r\n\t\t\t\t\t\"La BD a été ajoutée, vous pouvez créer à nouveau.\");\r\n\t\t}\r\n\r\n\t\tBookCtrl.prepareAdd(); // Redirection toward input form\r\n\t}", "public void onAdd() {\n String bookTitle = details[0];\n String author = details[1];\n boolean addedCorrectly = ControllerBook.addBook(this.ISBN, author, bookTitle, \"\");\n if (addedCorrectly) {\n dispose();\n } else {\n\n pack();\n }\n\n }", "ListOfBooks(){\n \tlist = new LinkedList<Book>();\n }", "public ArrayList<Book> getBooks()\n {\n ArrayList<Book> books = new ArrayList<>();\n String sql = \"SELECT [book_id]\\n\" +\n \" ,[book_title]\\n \" +\n \" ,[book_author]\\n\" +\n \" ,[book_publish_year]\\n\" +\n \" ,[book_category]\\n\" +\n \" ,[book_keyword]\\n\" +\n \" ,[book_status]\\n \" +\n \" FROM [lib_book_master]\";\n try {\n PreparedStatement statement = connection.prepareStatement(sql);\n ResultSet rs = statement.executeQuery();\n //cursor\n while(rs.next()) \n { \n int book_id = rs.getInt(\"book_id\");\n String book_title = rs.getString(\"book_title\");\n String book_author = rs.getString(\"book_author\");\n String book_publish_year = rs.getString(\"book_publish_year\");\n String book_category = rs.getString(\"book_category\");\n String book_keyword = rs.getString(\"book_keyword\");\n String book_status = rs.getString(\"book_status\");\n \n Book s = new Book(book_id,book_title, book_author, book_publish_year,book_category,book_keyword,book_status);\n books.add(s);\n }\n \n } catch (SQLException ex) {\n Logger.getLogger(DBContext.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n return books;\n }", "boolean insertBook(Book book);", "public void registerBooks(Book b) {\n\t\ttry (PreparedStatement stmt = LibraryConnection.getConnection()\n\t\t\t\t.prepareStatement(\n\t\t\t\t\t\t\"INSERT INTO book(isbn, title) VALUES ( ?, ?)\");) {\n\t\t\tstmt.setString(1, b.getIsbn());\n\t\t\tstmt.setString(2, b.getTitle());\n\t\t\tstmt.executeUpdate();\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static ArrayList<Book> fillBooksArray(ArrayList<Book> bookArrayList){\n\n bookArrayList.add(PrepareData.book1);\n bookArrayList.add(PrepareData.book2);\n bookArrayList.add(PrepareData.book3);\n bookArrayList.add(PrepareData.book4);\n bookArrayList.add(PrepareData.book5);\n bookArrayList.add(PrepareData.book6);\n\n\n return bookArrayList;\n\n\n\n }", "BookList append(Node book){\n BookList target = new BookList(book);\n\n if (this.book == null){\n this.book = target.book;\n this.next = target.next;\n return this;\n }\n else{\n target = this;\n while (target.next != null){\n \n target = target.next;\n \n }\n target.next = new BookList(book);\n\n }\n return target;\n }", "public void addBookList(BookList bookList) {\n\t\tSQLiteDatabase db = this.getWritableDatabase();\n\t\tlong newRowId;\n\t\t\n\t\tContentValues values = new ContentValues();\n\t\tvalues.put(KEY_BOOK_LIST_NAME, bookList.getListTitle());\n\t\tnewRowId = db.insert(BOOK_LIST_TABLE_NAME, null, values);\n\t\t\n\t\tif (newRowId > -1) {\n\t\t\tfor (Book book : bookList.getList()) {\n\t\t\t\tContentValues bookValues = new ContentValues();\n\t\t\t\tbookValues.put(KEY_TITLE, book.getTitle());\n\t\t\t\tbookValues.put(KEY_AUTHOR, book.getAuthor());\n\t\t\t\tbookValues.put(KEY_PRICE, book.getPrice());\n\t\t\t\tbookValues.put(KEY_DESCRIPTION, book.getDescription());\n\t\t\t\tbookValues.put(KEY_IMG_URL, book.getImgUrl());\n\t\t\t\tbookValues.put(KEY_BOOK_LIST_ID, newRowId);\n\t\t\t\tdb.insert(BOOK_TABLE_NAME, null, bookValues);\n\t\t\t}\n\t\t}\n\t\t\n\t\tdb.close();\n\t}", "public ArrayList<Book> getAllBooksArray(){\n ArrayList<Book> booksArray = new ArrayList<>();\n\n Connection con = null;\n Statement stmt = null;\n ResultSet rs = null;\n\n try{\n Class.forName(\"org.sqlite.JDBC\");\n con = DriverManager.getConnection(\"jdbc:sqlite:Library.db\");\n stmt = con.createStatement();\n String sql = \"SELECT * FROM BOOKS\";\n rs = stmt.executeQuery(sql);\n while(rs.next()){\n Book book = new Book(rs.getString(\"TITLE\"), rs.getString(\"AUTHOR\"), rs.getString(\"ILLUSTRATOR\"), rs.getString(\"ISBN\"), rs.getString(\"DECIMAL\"),\n rs.getString(\"DESCRIPTION\"), rs.getString(\"GENRE\"), rs.getBoolean(\"NON_FICTION\"));\n String tags = rs.getString(\"TAGS\");\n book.setID(rs.getInt(\"ID\"));\n book.deserializeTags(tags);\n booksArray.add(book);\n }\n rs.close();\n stmt.close();\n con.close();\n }catch(SQLException | ClassNotFoundException e){\n e.printStackTrace();\n }\n return booksArray;\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {\n if(resultCode == Activity.RESULT_OK && requestCode == REQUEST_CODE_ADD){\n if (data!=null){\n// data = getIntent();\n String returnedBookString = data.getStringExtra(\"returnedBook\");\n Book book = new Book(returnedBookString);\n bookArrayList.add(book);\n\n }\n for(Book books:bookArrayList){\n listLayout.removeAllViews();\n buildItemView(books); }\n }\n\n\n }", "public Library()\r\n\t{\r\n\t\titems = new ArrayList<Book>();\r\n\t}", "@Override\n public int addBook(Book book) throws DaoException {\n DataBaseHelper helper = new DataBaseHelper();\n ResultSet resultSet = null;\n try (Connection connection = SqlConnector.connect();\n PreparedStatement statementAdd =\n helper.prepareStatementAdd(connection, book);\n PreparedStatement statementSelect =\n helper.prepareStatementSelect(connection, book)) {\n statementAdd.executeUpdate();\n resultSet = statementSelect.executeQuery();\n resultSet.next();\n return new BookCreator().getBookId(resultSet);\n } catch (SQLException e) {\n throw new DaoException(e);\n } finally {\n close(resultSet);\n }\n }", "public Boolean addBooking(Booking aBooking) {\r\n return this.bookings.add(aBooking);\r\n }", "public ArrayList<Book> getListBook();", "public boolean addBook(Book b){\n\t\tif(books == 3){\n\t\t\treturn false;\n\t\t}\n\t\telse{\n\t\t\tif(b1 == null){\n\t\t\t\tb1 = b;\n\t\t\t\tbooks++;\n\t\t\t}\n\t\t\telse if(b2 == null){\n\t\t\t\tb2 = b;\n\t\t\t\tbooks++;\n\t\t\t}\n\t\t\telse if(b3 == null){\n\t\t\t\tb3 = b;\n\t\t\t\tbooks++;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t}", "@Override\n\tpublic void addItemBook(String login, String password, String title,\n\t\t\tString kind, String author, int nbPages) throws BadEntryException,\n\t\t\tNotMemberException, ItemBookAlreadyExistsException {\n\n\t}", "private void setUpAddBookButton()\n {\n setComponentAlignment(addBookButton, Alignment.BOTTOM_LEFT);\n addBookButton.setCaption(\"Add\");\n addBookButton.addClickListener(new Button.ClickListener() {\n public void buttonClick(Button.ClickEvent event)\n {\n Object id = bookTable.getValue();\n int book_id = (int)bookTable.getContainerProperty(id,\"id\").getValue();\n basket.add(allBooksBean.getIdByIndex(book_id-1));\n //basket.add(allBooks.get(book_id-1));\n errorLabel.setCaption(\"Successfully added book to Basket\");\n }\n });\n }", "@Override\n\tpublic void updateBookData() {\n\t\tList<Book> bookList = dao.findByHql(\"from Book where bookId > 1717\",null);\n\t\tString bookSnNumber = \"\";\n\t\tfor(Book book:bookList){\n\t\t\tfor (int i = 1; i <= book.getLeftAmount(); i++) {\n\t\t\t\t// 添加图书成功后,根据ISBN和图书数量自动生成每本图书SN号\n\t\t\t\tBookSn bookSn = new BookSn();\n\t\t\t\t// 每本书的bookSn号根据书的ISBN号和数量自动生成,\n\t\t\t\t// 如书的ISBN是123,数量是3,则每本书的bookSn分别是:123-1,123-2,123-3\n\t\t\t\tbookSnNumber = \"-\" + i;//book.getIsbn() + \"-\" + i;\n\t\t\t\tbookSn.setBookId(book.getBookId());\n\t\t\t\tbookSn.setBookSN(bookSnNumber);\n\t\t\t\t// 默认书的状态是0表示未借出\n\t\t\t\tbookSn.setStatus(new Short((short) 0));\n\t\t\t\t// 添加bookSn信息\n\t\t\t\tbookSnDao.save(bookSn);\n\t\t\t}\n\t\t}\n\t}", "private static JSONObject addObject(JSONArray bookList,Book book){\r\n bookList.add(book.toJson()); \r\n JSONObject bookObject = new JSONObject();\r\n bookObject.put(\"books\", bookList);\r\n return bookObject;\r\n }", "public BookListings(Book[] bookList) {\r\n bookListings = new Vector <Association <Book, Vector>> ();\r\n\r\n // Load the books into the BookListings\r\n for (int i = 0; i < bookList.length; i++) {\r\n Association <Book, ListingVector>> assoc = bookListings.get(i);\r\n assoc.getKey() = bookList(i);\r\n assoc.getValue() = new Vector<Listing>();\r\n }\r\n }", "public BookList(ObservableList<Book> oList){\r\n //Instantiate the bookList attribute\r\n bookList = new ArrayList<Book>();\r\n //if the parameter oList is not null, then loop through it and create a new Book object from each element,\r\n //using the getters. The enhanced for-loop works great here See Chapter 7.13. Add the new Book to the attribute\r\n //called bookList\r\n if(oList != null){\r\n for(Book bk: oList){\r\n bookList.add(new Book(bk.getTitle(), bk.getPrice()));\r\n }\r\n }\r\n\r\n }", "public void registerNewBooking(Booking b) {\n if (!newBooking.contains(b)\n && !modifiedBooking.contains(b)) {\n newBooking.add(b);\n }\n }", "private void insertBook() {\n /// Create a ContentValues object with the dummy data\n ContentValues values = new ContentValues();\n values.put(BookEntry.COLUMN_BOOK_NAME, \"Harry Potter and the goblet of fire\");\n values.put(BookEntry.COLUMN_BOOK_PRICE, 100);\n values.put(BookEntry.COLUMN_BOOK_QUANTITY, 2);\n values.put(BookEntry.COLUMN_BOOK_SUPPLIER_NAME, \"Supplier 1\");\n values.put(BookEntry.COLUMN_BOOK_SUPPLIER_PHONE, \"972-3-1234567\");\n\n // Insert the dummy data to the database\n Uri uri = getContentResolver().insert(BookEntry.CONTENT_URI, values);\n // Show a toast message\n String message;\n if (uri == null) {\n message = getResources().getString(R.string.error_adding_book_toast).toString();\n } else {\n message = getResources().getString(R.string.book_added_toast).toString();\n }\n Toast.makeText(this, message, Toast.LENGTH_LONG).show();\n }", "@Override\n\tpublic List<Book> getAllBooks() {\n\t\treturn bookList;\n\t}", "private static void addBook() {\n\t\t\r\n\t\tString author = input(\"Enter author: \"); // varaible change A to author\r\n\t\tString title = input(\"Enter title: \"); // variable changes T to title\r\n\t\tString callNumber = input(\"Enter call number: \"); // variable name change C to callNumber\r\n\t\tbook B = lib.addBook(author, title, callNumber); //variable LIB changes to library,A to author,T to title,C to callNumber , method changes Add_book to addBook()\r\n\t\toutput(\"\\n\" + B + \"\\n\");\r\n\t\t\r\n\t}", "public ArrayList<Book> getBooks() {\n return bookList;\n }", "public void addToCart(Publication book) {\n if(book != null){\n shoppingCart.add(book);\n } else {\n throw new NoSuchPublicationException();\n }\n\n }", "@Test\n public void canAddBookToLibrary(){\n library.add(book);\n assertEquals(1, library.countBooks());\n }", "public ArrayList<Book> getBookList()\r\n {\r\n ArrayList<Book> bookCopy = new ArrayList<Book>();\r\n //Add code here to copy the bookList ArrayList elements into the local variable bookCopy and return bookCopy\r\n //Hint: You will use the 2-arg Book constructor and the getters or you can add a copy constructor to the Book\r\n //Class\r\n for(Book book: bookList){\r\n Book bk = new Book(book.getTitle(), book.getPrice());\r\n bookCopy.add(bk);\r\n }\r\n return bookCopy;\r\n }", "List<Book> getAllBooks();", "private void addBookings(List<Bookings> newBookings) {\n IController<Bookings> bookingController = new Controller<>();\n IController<Students> studentController = new Controller<>();\n IController<Staff> staffController = new Controller<>();\n\n // Get all bookings\n List<Bookings> allBookings = bookingController.readAll(Bookings.class);\n\n\n // Check if any booking clashes.\n int count = 0;\n for (Bookings b : newBookings) {\n System.out.println(\"Checking availability of booking #\" + count);\n for (Bookings booking : allBookings) {\n if (b.conflictsWith(booking)) {\n throw new IllegalArgumentException(\"That booking conflicts with another booking.\");\n }\n }\n\n Modules relatedModule = b.getModule();\n\n if (!b.getRooms().isAvailable(b.getTime(), b.getEnd())) {\n throw new IllegalArgumentException(\"That room is unavailable at the time (\" + b.getTime() + \").\");\n }\n for (Students student : relatedModule.getStudents()) {\n student = studentController.readById(Students.class, student.getStudentID(), true);\n if (!student.isAvailable(b.getTime(), b.getEnd())) {\n throw new IllegalArgumentException(\"A student is unavailable at this time. [\" + b.getTime() + \"] (\" + student.getStudentID() + \")\");\n }\n }\n for (Staff staff : relatedModule.getStaff()) {\n staff = staffController.readById(Staff.class, staff.getStaffID(), true);\n\n if (!staff.isAvailable(b.getTime(), b.getEnd())) {\n throw new IllegalArgumentException(\"A staff member is unavailable at this time. [\" + b.getTime() + \"] (\" + staff.getStaffID() + \")\");\n }\n }\n\n count++;\n }\n\n // Create the bookings\n for (Bookings b : newBookings) {\n bookingController.create(b);\n System.out.println(b.confirmation() + \"\\n\");\n }\n }", "@Override\n\tpublic Long addBook(BookRequestVO request) {\n\t\tLong savedBookId = bookStorePersistDao.addBook(request);\n\t\treturn savedBookId;\n\t}", "public BookEntity addBook(Long clientsId, Long booksId) {\n ClientEntity clientEntity = clientPersistence.find(clientsId);\n BookEntity bookEntity = bookPersistence.find(booksId);\n clientEntity.getBooks().add(bookEntity);\n return bookPersistence.find(booksId);\n }", "public com.huqiwen.demo.book.model.Books create(long bookId);", "Library(List<Book> books) {\n\n // Referring to same book as\n // this keyword refers to same instance itself\n this.books = books;\n }", "private void putDataIntoTable(List<Book> books)\n {\n for(int i = 0; i<books.size(); i++)\n {\n bookTable.addItem(new Object[]{books.get(i).getId(), books.get(i).getBookName(), books.get(i).getAuthorName(), books.get(i).getDescription(), books.get(i).getBookGenreString()}, i+1);\n }\n }", "@Override\n\tpublic List<BookRequestVO> bookList(String bookName) {\n\t\treturn bookStorePersistDao.bookList(bookName);\n\t}", "@Test\r\n\tpublic void testAddChromebook() {\n\t\tassertNotNull(\"Test if there is valid Chromebook arraylist to add to\", chromebookList);\r\n\r\n\t\t// No.2 - size 1\r\n\t\tResourceCentre.addChromebook(chromebookList, cb1);\r\n\t\tassertEquals(\"Test if that Chromebook arraylist size is 1?\", 1, chromebookList.size());\r\n\r\n\t\t// No.2 - same item added, size 1\r\n\t\tassertSame(\"Test that Chromebook is added same as 1st item of the list?\", cb1, chromebookList.get(0));\r\n\r\n\t\t// No.3 - size 2\r\n\t\tResourceCentre.addChromebook(chromebookList, cb2);\r\n\t\tassertEquals(\"Test that Chromebook arraylist size is 2?\", 2, chromebookList.size());\r\n\r\n\t\t// No.3 - same item added, size 2\r\n\t\tassertSame(\"Test that Chromebook is added same as 2nd item of the list?\", cb2, chromebookList.get(1));\r\n\t\t\n\t}", "@Override\r\n\tpublic void storedBook(Book book) {\n\t\tticketDao.insertBook(book);\r\n\t}", "void addAll(List<News> data) {\n\t\t// Traverse the data list to add news item to the adapter's data set\n\t\tfor (int i = 0; i < data.size(); i++) {\n\t\t\t// Get the book at current index\n\t\t\tNews newsStory = data.get(i);\n\t\t\t// Add the book to the data set\n\t\t\tmNewsList.add(newsStory);\n\n\t\t\t// Notify the adapter of the change in the data set\n\t\t\t// so that it repopulates the view with the updated data set\n\t\t\tnotifyDataSetChanged();\n\t\t}\n\t}", "public BookList(){\n\n }", "public void setBooks(List<Book> books) {\r\n\t\tthis.books = books;\r\n\t}", "public void addBook() {\n\t\t JTextField callno = new JTextField();\r\n\t\t JTextField name = new JTextField();\r\n\t\t JTextField author = new JTextField(); \r\n\t\t JTextField publisher = new JTextField(); \r\n\t\t JTextField quantity = new JTextField(); \r\n\t\t Object[] book = {\r\n\t\t\t\t \"Callno:\",callno,\r\n\t\t\t\t \"Name:\",name,\r\n\t\t\t\t \"Author:\",author,\r\n\t\t\t\t \"Publisher:\",publisher,\r\n\t\t\t\t \"Quantity:\",quantity\r\n\t\t\t\t\r\n\t\t };\r\n\t\t int option = JOptionPane.showConfirmDialog(null, book, \"New book\", JOptionPane.OK_CANCEL_OPTION);\r\n\t\t if(option==JOptionPane.OK_OPTION) {\r\n // add to the Book database\r\n\t\t try {\r\n\t\t\t \r\n\t\t String query = \"insert into Book(callno,name,author,publisher,quantity,added_date)\"\r\n\t\t\t\t +\" values(?,?,?,?,?,GETDATE())\";\r\n\t\t \r\n\t\t PreparedStatement s = SimpleLibraryMangement.connector.prepareStatement(query);\r\n\t\t s.setString(1, callno.getText());\r\n\t\t s.setString(2, name.getText());\r\n\t\t s.setString(3, author.getText());\r\n\t\t s.setString(4, publisher.getText());\r\n\t s.setInt(5, Integer.parseInt(quantity.getText()));\r\n\t\t s.executeUpdate();\r\n\t\t JOptionPane.showMessageDialog(null, \"Add book successfully\", null, JOptionPane.INFORMATION_MESSAGE);\r\n\r\n\t\t } catch(Exception e) {\r\n\t\t\t JOptionPane.showMessageDialog(null, \"Add book failed\", null, JOptionPane.ERROR_MESSAGE);\r\n\t\t\t e.printStackTrace();\r\n\t\t }\r\n\t\t } \r\n\t\t \r\n\t}", "public void listBooks() {\n for (int g = 0; g < books.length; g++) {\n books[g].toString();\n }\n// List all books in Bookstore\n }", "public Book createBook(Book newBook) {\n\t\treturn this.sRepo.save(newBook);\n\t}", "public void AddtoCart(int id){\n \n itemdb= getBooksById(id);\n int ids = id;\n \n for(Books k:itemdb){ \n System.out.println(\"Quantity :\"+k.quantity); \n if (k.quantity>0){\n newcart.add(ids);\n System.out.println(\"Added to cartitem list with bookid\"+ ids);\n setAfterBuy(ids);\n System.out.println(\"Quantity Updated\");\n setCartitem(newcart);\n System.out.println(\"setCartitem :\"+getCartitem().size());\n System.out.println(\"New cart :\"+newcart.size());\n test.add(k);\n }\n else{\n System.out.println(\"Quantity is not enough !\");\n }\n }\n setBookcart(test);\n }", "@GetMapping(\"/addBook\")\n public String addNewBook(Model model) {\n Book newBook = new Book();\n List<Author> authors = authorService.getAllAuthor();\n List<Category> categories = categoryService.getAllCategory();\n model.addAttribute(\"authorAddBook\", authors);\n model.addAttribute(\"newBook\", newBook);\n model.addAttribute(\"categoryAddBook\", categories);\n return \"add-new-book\";\n }", "public void prepareBooks(ArrayList<Book> list) {\n\n bookList.clear();\n for(Book book : list) {\n bookList.add(book);\n }\n adapter.notifyDataSetChanged();\n }", "public Library(ArrayList<Book> collection){\n this.okToPrint = false;\n this.libraryBooks = collection;\n this.patron = new HashMap<String, Patron>();\n this.calendar = new Calendar();\n this.openOrNot = false;\n this.numberedListOfServing = new HashMap<Integer, Book>();\n this.searchBooks = new ArrayList<Book>();\n this.numberedListOfSearch = new HashMap<Integer, Book>();\n this.serveOrNot = false;\n this.searchOrNot = false;\n this.servingPatron = new Patron(null,null);\n }", "public void addBooking(Bookings b) {\n IController<Bookings> ic = new Controller<>();\n\n // Check whether the booking conflicts with another booking.\n for (Bookings booking : ic.readAll(Bookings.class)) {\n if (b.conflictsWith(booking)) {\n throw new IllegalArgumentException(\"That booking conflicts with another booking.\");\n }\n }\n\n Modules relatedModule = b.getModule();\n\n // Check whether the room is available at the given time.\n if (!b.getRooms().isAvailable(b.getTime(), b.getEnd())) {\n throw new IllegalArgumentException(\"That room is unavailable at this time.\");\n }\n // Check whether the students are available at that time.\n for (Students student : relatedModule.getStudents()) {\n if (!student.isAvailable(b.getTime(), b.getEnd())) {\n throw new IllegalArgumentException(\"A student is unavailable at this time.\");\n }\n }\n // Check whether the staff members are available at that time.\n for (Staff staff : relatedModule.getStaff()) {\n if (!staff.isAvailable(b.getTime(), b.getEnd())) {\n throw new IllegalArgumentException(\"A staff member is unavailable at this time.\");\n }\n }\n\n // Put the booking into the database.\n ic.create(b);\n System.out.println(b.confirmation() + \"\\n\");\n }", "public void addIngredientRecipe(ArrayList<IngredientRecipePOJO> ingr);" ]
[ "0.7849982", "0.7719308", "0.76773", "0.7628879", "0.7524917", "0.739432", "0.73937464", "0.7384372", "0.7381004", "0.73610634", "0.7321894", "0.72192615", "0.7191489", "0.7146644", "0.70958537", "0.70395184", "0.70225185", "0.7017792", "0.7011729", "0.6975843", "0.6955942", "0.6858975", "0.6811489", "0.67341536", "0.6716834", "0.6711146", "0.66762716", "0.66164416", "0.6583684", "0.657303", "0.650911", "0.65049", "0.650295", "0.64967334", "0.6478671", "0.6470011", "0.64609784", "0.6428216", "0.6388575", "0.63528526", "0.63470334", "0.62978446", "0.6281143", "0.62744784", "0.6251244", "0.6251066", "0.62082374", "0.6196229", "0.6167452", "0.6167328", "0.61602896", "0.6159422", "0.61517644", "0.6142575", "0.6140012", "0.6123938", "0.61166316", "0.60807115", "0.60719734", "0.607038", "0.6067041", "0.6065114", "0.60566324", "0.605167", "0.6019798", "0.60031307", "0.5990665", "0.59485984", "0.5935842", "0.5909882", "0.59033775", "0.59014225", "0.5891944", "0.58887583", "0.5888637", "0.58873737", "0.5880423", "0.58788013", "0.5871228", "0.58702445", "0.5839009", "0.58289576", "0.58206403", "0.5801685", "0.5777001", "0.57715744", "0.5769639", "0.5767306", "0.57609546", "0.5760571", "0.57486004", "0.5747826", "0.5726822", "0.57194126", "0.57037425", "0.5702888", "0.5699415", "0.568992", "0.56881535", "0.568734" ]
0.62212414
46
/Adds bookTitle to the ALL_AUTHORS ArrayList>
private static void addToAuthorTable(String author_name, String bookTitle) { if(ALL_AUTHORS.containsKey(author_name)) ALL_AUTHORS.get(author_name).add(bookTitle); /*put author_name as a new key in ALL_AUTHORS*/ else{ HashSet<String> bookTitles_list = new HashSet<String>(); bookTitles_list.add(bookTitle); ALL_AUTHORS.put(author_name, bookTitles_list); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addBook(Book title)\n {\n bookList.add(title);\n }", "private static void addToPublisherTable(String publisher, String bookTitle) {\n\t\tif(ALL_PUBLISHERS.containsKey(publisher))\n\t\t\tALL_PUBLISHERS.get(publisher).add(bookTitle);\n\t\t/*put publisher as a new key in ALL_AUTHORS*/\n\t\telse{\n\t\t\tHashSet<String> bookTitles_list = new HashSet<String>();\n\t\t\tbookTitles_list.add(bookTitle);\n\t\t\tALL_PUBLISHERS.put(publisher, bookTitles_list);\n\t\t}\n\t\t\n\t}", "public void addBook(Book aBook) {\n\t\t\n\t\tNode<ArrayList<Book>> current = head;\n\t\t//System.out.print(current.letter);\n\t\twhile (current.letter != aBook.getAuthorLastName().charAt(0)) {\n\t\t\tcurrent = current.next;\n\t\t}\n\n\t\tcurrent.data.add(aBook);\n\t\t\n\t}", "public ArrayList<Book> gettitleBook(String title);", "public void addAuthors(String author) {\n if (authorsList.contains(author)) {\n System.out.println(\"Author exist!!!\");\n }\n else {\n authorsList.add(author);\n System.out.println(\"Add author successfully!!!\");\n }\n }", "public synchronized void addBook(String title, int quantity){\n titleList.add(title);\n quantityList.add(quantity);\n borrowerList.add(new LinkedList<>());\n }", "public void addTitles(String titles){\n\n String titleSplit[] = titles.split(\",\");\n\n for (String section : titleSplit ) {\n this.titles.add(section);\n }\n }", "public void addBook(Book b){\n\t\tbookMap.get(b.getTitle()).add(b);\n\t}", "public void addAuthor(Author author){\n authors.add(author);\n }", "public List<String> updatePublicationAddAuthor(String firstName, String lastName, String hash) {\n\t\tfinal Post<BibTex> post = getPublicationByResourceHash(hash).get(0);\n\t\tPersonName p = new PersonName();\n\t\tp.setFirstName(firstName);\n\t\tp.setLastName(lastName);\n\t\tList<PersonName> persons = post.getResource().getAuthor();\n\t\tpersons.add(p);\n\t\tpost.getResource().setAuthor(persons);\n\t\t\n\t\treturn logic.updatePosts(Collections.<Post<? extends Resource>>singletonList(post), PostUpdateOperation.UPDATE_ALL);\n\t}", "public void addBook(Book book) {\n \tset.add(book);\n }", "private static void addToGenreTable(BookDetails book, String bookTitle) {\n\t\t//ALL_GENRES representation --> Biology|Mathematics|Chemistry|Physics|Science_Fiction|Fantasy|Action|Drama|Romance|Horror|History|Autobiography|Biography \n\t\tswitch(book.getGenre()){\n\t\t\tcase Biology:\n\t\t\t\tALL_GENRES.get(0).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase Mathematics:\n\t\t\t\tALL_GENRES.get(1).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase Chemistry:\n\t\t\t\tALL_GENRES.get(2).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase Physics:\n\t\t\t\tALL_GENRES.get(3).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase Science_Fiction:\n\t\t\t\tALL_GENRES.get(4).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase Fantasy:\n\t\t\t\tALL_GENRES.get(5).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase Action:\n\t\t\t\tALL_GENRES.get(6).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase Drama:\n\t\t\t\tALL_GENRES.get(7).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase Romance:\n\t\t\t\tALL_GENRES.get(8).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase Horror:\n\t\t\t\tALL_GENRES.get(9).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase History:\n\t\t\t\tALL_GENRES.get(10).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase Autobiography:\n\t\t\t\tALL_GENRES.get(11).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase Biography:\n\t\t\t\tALL_GENRES.get(12).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tSystem.out.println(\"ERROR: Invalid Genre Input\");\n\t\t\t\tbreak;\n\t\t}\n\t}", "public void listTitles() {\n for (int i = 0; i < books.length; i++) {\n System.out.println(\"The title of book\" + (i + 1) + \": \" + books[i].getTitle());\n }\n }", "void addbook(String book){\n\t\tthis.books[no_of_books]=book;\n\t\tno_of_books++;\n\t\tSystem.out.println(book+\" ...add\");\n\n\t}", "Book addBook(String title, String[] authors, boolean silent);", "public Book addBook(){\n Book book = new Book();\r\n String t = title.getText().toString();\r\n book.setTitle(t);\r\n String[] str = author.getText().toString().split(\",\");\r\n Author[] authors = new Author[str.length];\r\n int index = 0;\r\n for(String s : str){\r\n Author a = null;\r\n String[] fml = s.split(\"\\\\s+\");\r\n if(fml.length == 1){\r\n a = new Author(fml[0]);\r\n }else if(fml.length == 2){\r\n a = new Author(fml[0], fml[1]);\r\n }else if(fml.length == 3){\r\n a = new Author(fml[0], fml[1], fml[2]);\r\n }else{\r\n Toast.makeText(this, \"Invalid Author Name\", Toast.LENGTH_LONG).show();\r\n }\r\n authors[index] = a;\r\n index++;\r\n }\r\n book.setAuthors(authors);\r\n String isb = isbn.getText().toString();\r\n book.setIsbn(isb);\r\n\r\n\t\treturn book;\r\n\t}", "public void addBook(Book book) {\n this.bookList.add(book);\n }", "private void addAuthorList() {\n Intent intent = new Intent();\n ArrayList<Author> authorList = new ArrayList<>(mAuthorMap.values());\n intent.putExtra(EXTRA_AUTHOR_LIST, authorList);\n setResult(RESULT_OK, intent);\n finish();\n }", "public void add(Book book)\n\t{\n\t\tbooks.add(book);\n\t}", "private void loopAuthors(Book book) {\n for (String s : book.getAuthors()) {\n print(s);\n }\n }", "void addAll(Collection<Book> books);", "public void addBook(Book book) {\n\t\tboolean notFound = true;\n\t\tfor (Item item : items) {\n\t\t\tif(item.getName().equals(book.getName())) {\n\t\t\t\t// Found\n\t\t\t\tnotFound = false;\n\t\t\t\titem.updateQuantity();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(notFound) {\n\t\t\tItem item = new Item(book, 1);\n\t\t\titems.add(item);\n\t\t}\n\t}", "public void add(String t, String author){\r\n\t \r\n\t items.add(new Book(t, author));\r\n\t \r\n }", "static void createAuthorsFile () throws IOException {\n\t\tBufferedReader dataFile = new BufferedReader(new FileReader(DATAFILE));\n\t\tString inputLine;\n\t\t\n\t\tPrintWriter isbnLabeledDataFile = new PrintWriter(new FileWriter(ISBNLABELLEDDATAFILE));\n\t\t\n\t\tSet<String> books = new HashSet<String>();\n\t\twhile ((inputLine = dataFile.readLine()) != null) {\n\t\t\tif (inputLine.indexOf('\\t') == -1) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tString[] fields = inputLine.split(\"\\t\");\n\t\t\tif (fields.length != 4) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tfinal String bookId = fields[1];\n\t\t\tif (books.contains(bookId)) {\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\tbooks.add(bookId);\n\t\t\t\tString authorString = getAuthorString(bookId);\n\t\t\t\tisbnLabeledDataFile.println(bookId + \"\\t\" + authorString);\n\t\t\t\tout.println(bookId + \"\\t\" + authorString);\n\t\t\t}\n\t\t}\n\t\tdataFile.close();\n\t\tisbnLabeledDataFile.close();\n\t}", "@Override\n\tpublic void addBook() {\n\t\t\n\t}", "public ArrayList<String> getAuthors() {\n\t\treturn authors;\n\t}", "public void addBook(Book book)\r\n\t{\r\n\t\tList<Book> oldValue = items;\r\n\t\titems = new ArrayList<Book>(items);\r\n\t\titems.add(book);\r\n\t\tfirePropertyChange(\"books\", oldValue, items);\r\n\t\tfirePropertyChange(\"itemsCount\", oldValue.size(), items.size());\r\n\t}", "public void addAll(List<Book> bookList) {\n this.mBook.clear();\n this.mBook.addAll(bookList);\n notifyDataSetChanged();\n\n }", "public void addBookToBooks(Book book) {\n\t\tcustomerBooks.add(book);\n\t}", "@Override\n\tpublic void add() {\n\t\tHashMap<String, String> data = new HashMap<>();\n\t\tdata.put(\"title\", title);\n\t\tdata.put(\"author\", author);\n\t\tdata.put(\"publisher\", publisher);\n\t\tdata.put(\"isbn\", isbn);\n\t\tdata.put(\"bookID\", bookID);\n\t\tHashMap<String, Object> result = null;\n\t\tString endpoint = \"bookinfo/post.php\";\n\t\ttry {\n\t\t\tresult = APIClient.post(BookInfo.host + endpoint, data);\n\t\t\tvalid = result.get(\"status_code\").equals(\"Success\");\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n public String toString() {\n return bookName + \"-\" + authorName;\n }", "public ArrayList<Book> listOfBooksByAuthor (Author providedAuthor){\n //Array list for storing books written by provided author\n ArrayList<Book> authorBooks = new ArrayList<>();\n\n //loops through the booklist to find books with the author in the list of authors\n for (Book book : bookList) {\n //loops through the list of authors to see if the provided author is among thelist\n for (Author author1 : book.getAuthors()) {\n if (providedAuthor.equals(author1)) {\n authorBooks.add(book);\n }\n }\n }\n return authorBooks;\n }", "public void addAuthor(Author a)\n {\n boolean unique = true;\n \n for(Author x : authors)\n {\n if(x == a)\n {\n unique = false;\n }\n }\n \n if(unique)\n {\n authors.add(a);\n }\n }", "private static void addBook() {\n\t\t\r\n\t\tString author = input(\"Enter author: \"); // varaible change A to author\r\n\t\tString title = input(\"Enter title: \"); // variable changes T to title\r\n\t\tString callNumber = input(\"Enter call number: \"); // variable name change C to callNumber\r\n\t\tbook B = lib.addBook(author, title, callNumber); //variable LIB changes to library,A to author,T to title,C to callNumber , method changes Add_book to addBook()\r\n\t\toutput(\"\\n\" + B + \"\\n\");\r\n\t\t\r\n\t}", "void addAuthorToStream(Author author) {\n\t\tthis.entryCount.inc();\r\n\t\tboolean found = false;\r\n\r\n\t\tif (!authors.isEmpty()) {\r\n\t\t\tfor (Author a : authors) {\r\n\t\t\t\tif (a.name.equals(author.name)) {\r\n\t\t\t\t\tfound = true;\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (!found) {\r\n\t\t\tthis.authors.add(author);\r\n\r\n\t\t}\r\n\t}", "public static ArrayList<Book> fillBooksArray(ArrayList<Book> bookArrayList){\n\n bookArrayList.add(PrepareData.book1);\n bookArrayList.add(PrepareData.book2);\n bookArrayList.add(PrepareData.book3);\n bookArrayList.add(PrepareData.book4);\n bookArrayList.add(PrepareData.book5);\n bookArrayList.add(PrepareData.book6);\n\n\n return bookArrayList;\n\n\n\n }", "public static ArrayList<Book> search(String title, ArrayList<String> authors, String isbn, String publisher, String sortOrder, HashMap<Book, Integer> purchasedBooks)\n {\n ArrayList<Book> tempBookBuffer = search(title, authors, isbn, publisher, purchasedBooks);\n ArrayList<Book> searchedBooks = new ArrayList<>();\n\n for(Book b: tempBookBuffer) {\n if (b.getBookPublisher().equals(publisher) || publisher.equals(\"*\"))\n searchedBooks.add(b);\n }\n if (sortOrder.equals(\"title\")) {\n Collections.sort(searchedBooks, Book.BookTitleComparator);\n }\n else if(sortOrder.equals(\"publish-date\")){\n Collections.sort(searchedBooks,Book.BookDateComparator);\n }\n else{\n\n }\n return searchedBooks;\n }", "public void onAdd() {\n String bookTitle = details[0];\n String author = details[1];\n boolean addedCorrectly = ControllerBook.addBook(this.ISBN, author, bookTitle, \"\");\n if (addedCorrectly) {\n dispose();\n } else {\n\n pack();\n }\n\n }", "public static Set<String> getAllAuthors(List<Book> books) {\r\n Set<String> allAuthors = new HashSet<>();\r\n for (Book book : books) {\r\n allAuthors.add(book.getAuthor());\r\n }\r\n return allAuthors;\r\n }", "public void listBooks() {\n for (int g = 0; g < books.length; g++) {\n books[g].toString();\n }\n// List all books in Bookstore\n }", "@Override\n\tpublic ArrayList<BlogArticle> searchArts(String title) {\n\t\treturn blogArticleDao.searchArts(title);\n\t}", "public void add(Book book) {\n if (books.length == numBooks){ grow(); }\n books[numBooks++] = book;\n }", "public void findBookTitle(String title) {\n\t\tboolean match = false;\n\t\tfor (int i = 0; i < bookList.size(); i++) {\n\t\t\t// Find text with Contains OR find text with the full title\n\t\t\tif (bookList.get(i).getTitle().toLowerCase().contains(title.toLowerCase())\n\t\t\t\t\t|| bookList.get(i).getTitle().toLowerCase().equals(title.toLowerCase())) {\n\t\t\t\tmatch = true;\n\t\t\t\tSystem.out.println(bookList.get(i));\n\t\t\t}\n\t\t}\n\t\tif (!match) {\n\t\t\tSystem.out.println(\"Could not find the book Title\");\n\t\t}\n\t}", "public Book addBook(Book b){\n list.add(b);\n return b;\n }", "protected static void addBook(Book toAdd)\n {\n if (toAdd == null) // if product is null, becuase the formatting wasnt correct, then dont go forward and print out that the book wasnt added\n ProductGUI.Display(\"Book not added\\n\");\n else{\n try{\n if (!(toAdd.isAvailable(toAdd.getID(), productList))) // if the product id alrady exists, dont go forard towards adding it\n {\n ProductGUI.Display(\"Sorry. this product already exists\\n\");\n return;\n }\n else\n ProductGUI.Display(\"New book product\\n\");\n \n myProduct = new Book(toAdd.getID(), toAdd.getName(), toAdd.getYear(), toAdd.getPrice(), toAdd.getAuthor(), toAdd.getPublisher()); // make new product using this object\n productList.add(myProduct); // add product to arraylist\n \n addToMap(toAdd.getName()); // adding the product name to the hashmap\n System.out.println(\"book added to all\");\n ProductGUI.fieldReset(); // reset the fields to being blank\n } catch (Exception e){\n ProductGUI.Display(e.getMessage()+\"errorrorror\\n\");\n }\n }\n }", "public void addToBookName_L10N_ARRAY(entity.RateBook_BookName_L10N element);", "public String[] getAuthors() {\n return authors;\n }", "@Override\n\tpublic void addItemBook(String login, String password, String title,\n\t\t\tString kind, String author, int nbPages) throws BadEntryException,\n\t\t\tNotMemberException, ItemBookAlreadyExistsException {\n\n\t}", "@SuppressWarnings(\"UnusedParameters\")\n public void addAuthor(View view) {\n String authorName = mTextAuthor.getText().toString().trim();\n\n String errorMessage = null;\n if (authorName.length() == 0) {\n errorMessage = getString(R.string.message_author_missing);\n } else {\n if (mAuthorMap.containsKey(authorName)) {\n String message = getString(R.string.message_author_already_present);\n errorMessage = String.format(message, authorName);\n } else {\n Author a = new Author();\n a.name = authorName;\n\n Author author = authorService.getAuthorByCriteria(a);\n if (author != null) {\n a = author;\n }\n\n mAuthorMap.put(authorName, a);\n mAuthorArrayAdapter.add(a);\n\n String message = getString(R.string.message_author_added);\n message = String.format(message, authorName);\n Toast.makeText(this, message, Toast.LENGTH_SHORT).show();\n\n mTextAuthor.setText(null);\n mTextAuthor.setError(null);\n }\n }\n if (errorMessage == null) {\n mTextAuthor.setText(null);\n mTextAuthor.setError(null);\n } else {\n mTextAuthor.setError(errorMessage);\n }\n }", "private static void queryBooksByAuthor(){\n\t\tSystem.out.println(\"===Query Books By Author===\");\n\t\tScanner string_input = new Scanner(System.in);\n\t\t\n\t\tSystem.out.println(\"Enter First Name of Author to Query Books by: \");\n\t\tString author_firstname = string_input.next();\n\t\t\n\t\tSystem.out.println(\"Enter Middle Name of Author to Query Books by (Type 'null' if Author has no middlename): \");\n\t\tString author_middlename = string_input.next();\n\t\tif(author_middlename.equalsIgnoreCase(\"null\"))\n\t\t\tauthor_middlename = \"\";\n\t\t\n\t\tSystem.out.println(\"Enter Last Name of Author to Query Books by: \");\n\t\tString author_lastname = string_input.next();\n\t\t\n\t\tString author_fullname = author_firstname + \" \" + author_middlename + \" \" + author_lastname;\n\t\t\n\t\tif(ALL_AUTHORS.containsKey(author_fullname)){//if author_full_name exists in the Hashtable then print out all of the author's book titles\n\t\t\tSystem.out.println(\"Author found!\");\n\t\t\tSystem.out.println(author_fullname + \"'s list of book titles are: \"); \n\t\t\tIterator<String> iter = ALL_AUTHORS.get(author_fullname).iterator();\n\t\t\tprintAllElements(iter);\n\t\t}\n\t\telse\n\t\t\tSystem.out.println(\"Sorry Author name entered does not exist in our records\");\n\t}", "public ArrayList<Book> getListBook();", "protected List<AuthorNames> getAuthorNames() {\n return authors.values().stream()\n .map(a-> new AuthorNames(a.getFirstName(), a.getLastName()))\n .collect(Collectors.toList());\n }", "DefaultListModel getAuthorsBookModel();", "public void addBookQuantity(String title, int quantity) {\n // Search for the book...if found adjust the quantity, \t\n // otherwise, inform the user that the book is not available \n String t = title;\n int q = quantity;\n for (int h = 0; h < books.length; h++) {\n if (title.equals(books[h].getTitle())) {\n books[h].addQuantity(q);\n } else {\n System.out.println(\"Sorry book was not found\");\n }\n }\n }", "public List<Book> getByAuthor(String name );", "public void onClick(View v) {\n int bookID = MySQLiteHelper.addBook(currentBook);\n ArrayList<String> authors = currentBook.getAllAuthors();\n if (authors.isEmpty()){\n\n }\n else {\n for(String author : authors){\n // Link current book with all authors\n MySQLiteHelper.addAuthor(author);\n int authorID = MySQLiteHelper.getAuthorID(author);\n MySQLiteHelper.linkBookWithAuthor(bookID, authorID);\n }\n }\n // Then go back to book list\n startActivity(new Intent(BookDetailActivity.this, BookListViewActivity.class));\n }", "public List<BookData> searchBookbyTitle (String name) throws SQLException{\n\t\tList<BookData> list = new ArrayList<>();\n\t\t\n\t\tPreparedStatement myStmt = null;\n\t\tResultSet myRs = null;\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\tmyStmt = myConn.prepareStatement(\"select title, author_name, publisher_name, book_id from books natural join book_authors where title = ?\");\n\t\t\tmyStmt.setString(1, name);\n\t\t\tmyRs = myStmt.executeQuery();\n\t\t\t\n\t\t\twhile (myRs.next()) {\n\t\t\t\tBookData tempbook = convertRowToBook(myRs);\n\t\t\t\tlist.add(tempbook);\n\t\t\t}\n\t\t\t\n\t\t\treturn list;\n\t\t}\n\t\tfinally {\n\t\t\tmyRs.close();\n\t\t\tmyStmt.close();\n\t\t\n\t\t}\n\t\t\n\t}", "public String getBookAuthor() {\n return bookAuthor;\n }", "public List<String> getAuthors() {\n return authors;\n }", "private boolean addBook(Book book) {\n\t\tfor (int i = 0; i < items.size(); i++)\n\t\t\tif (items.get(i).keyEquals(book))\n\t\t\t\treturn false;\n\t\titems.add(book);\n\t\treturn true;\n\t}", "void addAll(List<News> data) {\n\t\t// Traverse the data list to add news item to the adapter's data set\n\t\tfor (int i = 0; i < data.size(); i++) {\n\t\t\t// Get the book at current index\n\t\t\tNews newsStory = data.get(i);\n\t\t\t// Add the book to the data set\n\t\t\tmNewsList.add(newsStory);\n\n\t\t\t// Notify the adapter of the change in the data set\n\t\t\t// so that it repopulates the view with the updated data set\n\t\t\tnotifyDataSetChanged();\n\t\t}\n\t}", "public Title(String title)\r\n {\r\n this();\r\n if( title != null )\r\n add(title);\r\n }", "String[] getAuthor();", "public static ArrayList<Book> search(String title, ArrayList<String> authors, HashMap<Book, Integer> purchasedBooks)\n {\n ArrayList<Book> tempBookBuffer = search(title, purchasedBooks);\n ArrayList<Book> searchedBooks = new ArrayList<>();\n\n for(Book b: tempBookBuffer)\n if(containsAllAuthors(authors, b))\n searchedBooks.add(b);\n\n return searchedBooks;\n }", "public List applyAuthorRule () {\n\t\treturn authors;\n\t}", "private void addToArrayList(String getName) {\n\t\tUser newUser = new User(getName);\n\t\tmgUsr.arrList.add(newUser);\n\t\tobs = FXCollections.observableArrayList(mgUsr.arrList);\n\n\t\tsetOnListView();\n\t}", "@Override\r\n\tpublic List<Author> getAllAuthorDetails() {\n\t\treturn authorDAO.findAll();\r\n\t\t\r\n\t}", "public List<String> getAuthors() {\n return Collections.unmodifiableList(mAuthors);\n }", "public void addBook(String string, int i) {\n\t\tBook b= new Book(string,i);\r\n\t\tarlist.add(b);\r\n\t\t\r\n\t}", "@Override\n\tpublic int addBook(bookInfo bookinfo) {\n\t\treturn 0;\n\t}", "public ObservableList<Object> selectAllBooks(){\n System.out.println(\"Printing all books...\");\n dbmanager.open();\n ObservableList<Object> books = FXCollections.observableArrayList();\n\n try{\n try (DBIterator keyIterator = dbmanager.getDB().iterator()) {\n keyIterator.seekToFirst();\n while (keyIterator.hasNext()) {\n String key = asString(keyIterator.peekNext().getKey());\n String[] splittedString = key.split(\"-\");\n\n dbmanager.incrementNextId(Integer.parseInt(splittedString[1]));\n\n if(!\"book\".equals(splittedString[0])){\n keyIterator.next();\n continue;\n }\n String resultAttribute = asString(dbmanager.getDB().get(bytes(key)));\n JSONObject jbook = new JSONObject(resultAttribute);\n\n Book book = new Book(jbook);\n \n book.setPublisher(dbmanager.getPmanager().read(jbook.getInt(\"publisher\")));\n \n JSONArray jauthors = jbook.getJSONArray(\"authors\");\n List<Author> authors = new ArrayList();\n for(int i=0; i<jauthors.length(); i++){\n \n int a=-1;\n a=jauthors.getInt(i);\n if(a>=0){ \n authors.add(dbmanager.getAmanager().read(a));\n }else{\n System.out.println(\"A book has mysterious author\"); \n }\n \n }\n \n book.setAuthors(authors);\n books.add(book);\n keyIterator.next();\n }\n }\n } catch(IOException e){\n e.printStackTrace();\n }\n dbmanager.close();\n return books;\n }", "private void addTitleToChosenClassList(String classTitle) {\n if (!mChosenClassesList.contains(classTitle)) {\n mChosenClassesList.add(classTitle);\n String classList = TextUtils.join(\", \", mChosenClassesList);\n mStudentClassesTextView.setVisibility(View.VISIBLE);\n mStudentClassesTextView.setText(classList);\n }\n }", "protected String getBookTitleBlock( String title )\n {\n return \"<bookinfo><title>\" + title + \"</title>\";\n }", "public Book(String title, List<String> authors) {\n this.title = title;\n this.authors = authors;\n // TODO write more code if necessary\n this.setParentCollection(null);\n }", "public List<String > getBooks(){\n List<String> titles = new ArrayList<>();\n\n String strSQL = \"SELECT B._id, B.Title FROM TBooks B WHERE NOT B._id IN (Select TLoaned.TitleID \" +\n \" FROM TLoaned WHERE TLoaned.ReturnDate IS NULL);\";\n SQLiteDatabase db = this.getReadableDatabase();\n Cursor c = db.rawQuery(strSQL, null);\n try {\n if (c.moveToFirst()) {\n do {\n titles.add(c.getString(0) + \". \" + c.getString(1));\n } while (c.moveToNext());\n }\n }\n finally {\n c.close();\n db.close();\n }\n return titles;\n }", "List<String> getAuthorsList() {\r\n\t\tList<String> authorList = new ArrayList<String>() ;\r\n\t\t\r\n\t\t// Populate the list of authors\r\n\t\tfor(Collaborator c: collaborators) {\r\n\t\t\tauthorList.add(c.getAuthorName()) ;\r\n\t\t}\r\n\t\treturn authorList ;\r\n\t}", "public ArrayList<Book> getBookList()\r\n {\r\n ArrayList<Book> bookCopy = new ArrayList<Book>();\r\n //Add code here to copy the bookList ArrayList elements into the local variable bookCopy and return bookCopy\r\n //Hint: You will use the 2-arg Book constructor and the getters or you can add a copy constructor to the Book\r\n //Class\r\n for(Book book: bookList){\r\n Book bk = new Book(book.getTitle(), book.getPrice());\r\n bookCopy.add(bk);\r\n }\r\n return bookCopy;\r\n }", "public ArrayList<Book> getAuthorsBook(String last, String first) {\n\t\t//TO DO\n\t\tNode<ArrayList<Book>> current = head;\n\t\t\t\n\t\twhile (current.letter != last.charAt(0)) {\n\t\t\tcurrent = current.next;\n\t\t}\n\t\n\t\tif (current.data != null) {\n\t\t\treturn current.data;\n\t\t}else {\n\t\t\tthrow new IllegalArgumentException(\"getAuthorsBook: author does not have any books\");\n\t\t}\n\t}", "public void sortAuthor(){\r\n \r\n Book temp; // used for swapping books in the array\r\n for(int i=0; i<items.size(); i++) {\r\n\r\n\t // Check to see the item is a book. We will only\r\n //use books.\r\n\t if(items.get(i).getItemType() != Item.ItemTypes.BOOK)\r\n\t continue;\r\n\t\t\t\t\t\r\n\t for(int j=i+1; j<items.size(); j++) {\r\n\t\t // We consider only books\r\n\t // We consider only magazines\r\n\t if(items.get(j).getItemType() != Item.ItemTypes.BOOK)\r\n\t\t continue;\r\n\t\t // Compare the authors of the two books\r\n\t if(((Book)items.get(i)).getAuthor().compareTo(((Book)items.get(j)).getAuthor()) > 0) {\r\n\t\t // Swap the items\r\n\t\t temp = (Book)items.get(i);\r\n\t\t items.remove(i);\r\n\t\t items.add(i, items.get(j-1));\r\n\t\t items.remove(j);\r\n\t\t items.add(j, temp);\r\n\t }\r\n\t }\r\n\t }\r\n\t\t// Print the magazines\r\n for(int i=0; i<items.size(); i++)\r\n\t if(items.get(i).getItemType() == Item.ItemTypes.BOOK)\r\n\t\tSystem.out.println(items.get(i).toString());\r\n \t\r\n }", "private static void readBooksInfo() {\n List<eGenre> arrBook = new ArrayList<>();\n\n // 1 //\n arrBook.add(eGenre.FANTASY);\n arrBook.add(eGenre.ADVENTURE);\n book.add(new Book(1200, arrBook, \"Верн Жюль\", \"Таинственный остров\", 1875));\n arrBook.clear();\n // 2 //\n arrBook.add(eGenre.FANTASY);\n arrBook.add(eGenre.MYSTIC);\n book.add(new Book(425, arrBook, \"Григоренко Виталий\", \"Иван-душитель\", 1953));\n arrBook.clear();\n // 3 //\n arrBook.add(eGenre.DETECTIVE);\n arrBook.add(eGenre.MYSTIC);\n book.add(new Book(360, arrBook, \"Сейгер Райли\", \"Последние Девушки\", 1992));\n arrBook.clear();\n // 4 //\n arrBook.add(eGenre.DETECTIVE);\n book.add(new Book(385, arrBook, \"Ольга Володарская\", \"То ли ангел, то ли бес\", 1995));\n arrBook.clear();\n // 5 //\n arrBook.add(eGenre.NOVEL);\n arrBook.add(eGenre.ACTION);\n book.add(new Book(180, arrBook, \"Лихэйн Деннис\", \"Закон ночи\", 1944));\n arrBook.clear();\n // 6 //\n arrBook.add(eGenre.NOVEL);\n book.add(new Book(224, arrBook, \"Мураками Харуки\", \"Страна Чудес без тормозов и Конец Света\", 1985));\n arrBook.clear();\n // 7 //\n arrBook.add(eGenre.STORY);\n book.add(new Book(1200, arrBook, \"Джон Хейвуд\", \"Люди Севера: История викингов, 793–1241\", 2017));\n arrBook.clear();\n // 8 //\n arrBook.add(eGenre.ACTION);\n arrBook.add(eGenre.MYSTIC);\n arrBook.add(eGenre.DETECTIVE);\n book.add(new Book(415, arrBook, \"Линдквист Юн\", \"Впусти меня\", 2017));\n arrBook.clear();\n // 9 //\n arrBook.add(eGenre.ACTION);\n book.add(new Book(202, arrBook, \"Сухов Евгений\", \"Таежная месть\", 2016));\n arrBook.clear();\n // 10 //\n arrBook.add(eGenre.DETECTIVE);\n arrBook.add(eGenre.MYSTIC);\n book.add(new Book(231, arrBook, \"Винд Кристиан\", \"Призраки глубин\", 2019));\n arrBook.clear();\n }", "public Book(final String title) {\n this.title = title;\n }", "public String getBookTitle() {\n return bookTitle;\n }", "public void addBooks(Books book){\n\n /*\n * If the book you want to add is not an instance of this Books class then you add it...\n * Don't think that's what it's supposed to do?\n */\n if (!(book instanceof Books)) {\n Books[] result = new Books[books.length + 1];\n for (int i = 0; i < books.length; i++) {\n result[i] = books[i];\n }\n result[result.length - 1] = (Books) book; // your if statement is wrong, that's why intellij warns this will always be null.\n books = result;\n }\n }", "public void addLiteratureToSeries(String seriesTitle, Book newLiterature) {\n Iterator<Literature> it = literatureRegister.iterator();\n\n while(it.hasNext()) {\n Literature literature = it.next();\n\n if (literature.getTitle().equals(seriesTitle) && literature instanceof BookSeries) {\n ((BookSeries) literature).addBook(newLiterature);\n }\n }\n }", "public ArrayList<String> getMyBookList()\r\n {\r\n\treturn myBookList;\r\n }", "@Override\n\tpublic List<Book> getAllBooks() {\n\t\treturn bookList;\n\t}", "public ArrayList<Book> getAllBooksArray(){\n ArrayList<Book> booksArray = new ArrayList<>();\n\n Connection con = null;\n Statement stmt = null;\n ResultSet rs = null;\n\n try{\n Class.forName(\"org.sqlite.JDBC\");\n con = DriverManager.getConnection(\"jdbc:sqlite:Library.db\");\n stmt = con.createStatement();\n String sql = \"SELECT * FROM BOOKS\";\n rs = stmt.executeQuery(sql);\n while(rs.next()){\n Book book = new Book(rs.getString(\"TITLE\"), rs.getString(\"AUTHOR\"), rs.getString(\"ILLUSTRATOR\"), rs.getString(\"ISBN\"), rs.getString(\"DECIMAL\"),\n rs.getString(\"DESCRIPTION\"), rs.getString(\"GENRE\"), rs.getBoolean(\"NON_FICTION\"));\n String tags = rs.getString(\"TAGS\");\n book.setID(rs.getInt(\"ID\"));\n book.deserializeTags(tags);\n booksArray.add(book);\n }\n rs.close();\n stmt.close();\n con.close();\n }catch(SQLException | ClassNotFoundException e){\n e.printStackTrace();\n }\n return booksArray;\n }", "Book(String t, String a, String g, String[] b){\n\t\ttitle = t;\n\t\tauthor = a;\n\t\tgenre = g;\n\t\ttags = new ArrayList<String>();\n\t\tfor(int i=0; i<b.length; i++)\n\t\t\ttags.add(b[i]);\n\t}", "public void extractAuthorsName() {\r\n try {\r\n // gets all matched objects for Author Name.\r\n Matcher matcherObject = matcher.patternMatcher(\"AuthorsName\");\r\n\r\n // add name to outputResult\r\n while (matcherObject.find()) {\r\n format.Formatter(1, matcherObject.group(1));\r\n isValidFile = true;\r\n }\r\n\r\n } catch (Exception e) {\r\n System.out.println(\"Error has occured in extractAuthorsName method\");\r\n }\r\n }", "protected void addTag(String title) {\n\t\tReaderDataBase.insertDataBase(this, title, mFilenameString,\n\t\t\t\tBookPageFactory.sPercent);\n\t}", "public void prepareBooks(ArrayList<Book> list) {\n\n bookList.clear();\n for(Book book : list) {\n bookList.add(book);\n }\n adapter.notifyDataSetChanged();\n }", "public void addBook(int index, Book book)\r\n\t{\r\n\t\tif(index == -1) {\r\n\t\t\tindex++;\r\n\t\t}\r\n\t\tList<Book> oldValue = items;\r\n\t\titems = new ArrayList<Book>(items);\r\n\t\titems.add(index, book);\r\n\t\tfirePropertyChange(\"books\", oldValue, items);\r\n\t\tfirePropertyChange(\"itemsCount\", oldValue.size(), items.size());\r\n\t}", "Builder addAuthor(String value);", "public void prepareTitle()\n {\n DuelTitle title = new DuelTitle();\n addObject(title, 539, 186);\n }", "private void librarian()throws IOException\n {\n //File Handling starts here with reading into each of the different files to obtain set of books along with relevant data.\n FileReader fauthor = new FileReader(\"BookAuthorList.txt\"); \n BufferedReader bufferAuthor = new BufferedReader(fauthor);\n\n FileReader fgenre = new FileReader(\"BookGenreList.txt\"); \n BufferedReader bufferGenre = new BufferedReader(fgenre);\n\n FileReader fname = new FileReader(\"BookNameList.txt\"); \n BufferedReader bufferName = new BufferedReader(fname);\n\n FileReader fnumber = new FileReader(\"BookNumberList.txt\"); \n BufferedReader bufferNumber = new BufferedReader(fnumber);\n\n for(int i=0; i<linecount; i++) //instance variable linecount\n {\n book[i] = new Book(\"1000\", \"Book Name\", \"Author of Book\", \"Genre of Book\"); //instantiating array element to avoid NullPointerException\n book[i].code = bufferNumber.readLine();\n book[i].author = bufferAuthor.readLine();\n book[i].genre = bufferGenre.readLine();\n book[i].name = bufferName.readLine();\n }\n /*\n * The following for loop trims each of the lines obtained from the file, to remove spaces and help maintain equal number of characters.\n */\n for(int i=0; i<linecount; i++) //trimming\n {\n book[i].code = book[i].code.trim();\n book[i].author = book[i].author.trim();\n book[i].genre = book[i].genre.trim();\n book[i].name = book[i].name.trim();\n }\n\n for(int i=0; i<linecount; i++) //add set number of lines. this helps in making tabular forms\n {\n /*\n * Utilising concatenation from Library classes here. \n * Function spaces is called.\n */\n book[i].code = book[i].code.concat(Spacebar.spaces(5 - book[i].code.length()));\n book[i].author = book[i].author.concat(Spacebar.spaces(25 - book[i].author.length()));\n book[i].genre = book[i].genre.concat(Spacebar.spaces(15 - book[i].genre.length()));\n book[i].name = book[i].name.concat(Spacebar.spaces(70 - book[i].name.length()));\n }\n }", "public BookList(ObservableList<Book> oList){\r\n //Instantiate the bookList attribute\r\n bookList = new ArrayList<Book>();\r\n //if the parameter oList is not null, then loop through it and create a new Book object from each element,\r\n //using the getters. The enhanced for-loop works great here See Chapter 7.13. Add the new Book to the attribute\r\n //called bookList\r\n if(oList != null){\r\n for(Book bk: oList){\r\n bookList.add(new Book(bk.getTitle(), bk.getPrice()));\r\n }\r\n }\r\n\r\n }", "public static ArrayList<Book> search(String title, ArrayList<String> authors, String isbn, String publisher, HashMap<Book, Integer> purchasedBooks)\n {\n ArrayList<Book> tempBookBuffer = search(title, authors, isbn, purchasedBooks);\n ArrayList<Book> searchedBooks = new ArrayList<>();\n\n for(Book b: tempBookBuffer)\n if(b.getBookPublisher().equals(publisher) || publisher.equals(\"*\"))\n searchedBooks.add(b);\n\n return searchedBooks;\n }", "public ArrayList<Book> getBookByPart(String titlePart) {\n titlePart = this.sanitizeString(titlePart);\n ArrayList<Book> bookList = new ArrayList<>();\n\n for (String bookTitle: this.books.keySet()) {\n if (bookTitle.contains(titlePart)) {\n bookList.add(this.books.get(bookTitle));\n }\n }\n return bookList;\n }", "public void loadBook() {\n List<Book> books = new ArrayList<>();\n for (int i = 0; i < 5; i++) {\n Book book = new Book(\"Book-\" + i, \"Test book \" + i);\n books.add(book);\n }\n this.setBooks(books);\n }", "@Override\n public String toString() {\n String authorNames=\"\";\n for(Author a:authors){\n authorNames+=\", \"+a.toString();\n }\n return super.toString()\n +\", BookID: \"+bookID\n +\", RackNo: \"+rackNo\n +\", Edition: \"+edition\n +\", Authors: \"+(authors.length>0?authorNames.substring(2):\"\");\n }" ]
[ "0.7416399", "0.6647745", "0.6612556", "0.65279263", "0.623243", "0.62044406", "0.6161927", "0.6088421", "0.60778147", "0.60748947", "0.6058166", "0.6052799", "0.6030597", "0.6023155", "0.602102", "0.600697", "0.59962374", "0.59501225", "0.59256285", "0.5879074", "0.5853315", "0.5830021", "0.5820971", "0.5802943", "0.5797757", "0.5705447", "0.5675512", "0.56694984", "0.56676394", "0.5609797", "0.5600439", "0.5581396", "0.5573447", "0.55547756", "0.5541561", "0.55223", "0.5488695", "0.54841024", "0.5476386", "0.5476336", "0.5476223", "0.546979", "0.546075", "0.5451141", "0.5446588", "0.54407376", "0.53985476", "0.5371929", "0.5357038", "0.5356448", "0.53292876", "0.5326554", "0.53255177", "0.53249073", "0.53245854", "0.53162426", "0.53161", "0.53100777", "0.52967054", "0.5290524", "0.5286361", "0.52789515", "0.5277578", "0.527297", "0.52697206", "0.52649426", "0.5254427", "0.5250842", "0.52504957", "0.5247923", "0.52447695", "0.5241616", "0.5224555", "0.52158844", "0.52118766", "0.52023005", "0.5200806", "0.52006197", "0.5197626", "0.51957536", "0.5185831", "0.5185375", "0.518323", "0.5178207", "0.5174386", "0.51696956", "0.5165325", "0.5162353", "0.51582557", "0.51575893", "0.5154518", "0.5152981", "0.5152752", "0.5146006", "0.5141155", "0.5139076", "0.5133928", "0.5128135", "0.5125268", "0.51219815" ]
0.73973745
1
/Adds book title to respective index of its genre to the ALL_GENRES ArrayList>
private static void addToGenreTable(BookDetails book, String bookTitle) { //ALL_GENRES representation --> Biology|Mathematics|Chemistry|Physics|Science_Fiction|Fantasy|Action|Drama|Romance|Horror|History|Autobiography|Biography switch(book.getGenre()){ case Biology: ALL_GENRES.get(0).add(bookTitle); break; case Mathematics: ALL_GENRES.get(1).add(bookTitle); break; case Chemistry: ALL_GENRES.get(2).add(bookTitle); break; case Physics: ALL_GENRES.get(3).add(bookTitle); break; case Science_Fiction: ALL_GENRES.get(4).add(bookTitle); break; case Fantasy: ALL_GENRES.get(5).add(bookTitle); break; case Action: ALL_GENRES.get(6).add(bookTitle); break; case Drama: ALL_GENRES.get(7).add(bookTitle); break; case Romance: ALL_GENRES.get(8).add(bookTitle); break; case Horror: ALL_GENRES.get(9).add(bookTitle); break; case History: ALL_GENRES.get(10).add(bookTitle); break; case Autobiography: ALL_GENRES.get(11).add(bookTitle); break; case Biography: ALL_GENRES.get(12).add(bookTitle); break; default: System.out.println("ERROR: Invalid Genre Input"); break; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void createGenres() {\n ArrayList<String> gen = new ArrayList<>();\n //\n for (Movie mov : moviedb.getAllMovies()) {\n for (String genre : mov.getGenre()) {\n if (!gen.contains(genre.toLowerCase()))\n gen.add(genre.toLowerCase());\n }\n }\n\n Collections.sort(gen);\n\n genres = gen;\n }", "public List<Books> findBooksByGenre(String genre) {\r\n HttpSession session = (HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false);\r\n List<Genre> list = new ArrayList();\r\n Genre g = new Genre();\r\n g.setType(genre);\r\n list.add(g);\r\n session.setAttribute(\"lastGenre\",list);\r\n return bookController.findBooksByGenre(genre);\r\n }", "private static void readBooksInfo() {\n List<eGenre> arrBook = new ArrayList<>();\n\n // 1 //\n arrBook.add(eGenre.FANTASY);\n arrBook.add(eGenre.ADVENTURE);\n book.add(new Book(1200, arrBook, \"Верн Жюль\", \"Таинственный остров\", 1875));\n arrBook.clear();\n // 2 //\n arrBook.add(eGenre.FANTASY);\n arrBook.add(eGenre.MYSTIC);\n book.add(new Book(425, arrBook, \"Григоренко Виталий\", \"Иван-душитель\", 1953));\n arrBook.clear();\n // 3 //\n arrBook.add(eGenre.DETECTIVE);\n arrBook.add(eGenre.MYSTIC);\n book.add(new Book(360, arrBook, \"Сейгер Райли\", \"Последние Девушки\", 1992));\n arrBook.clear();\n // 4 //\n arrBook.add(eGenre.DETECTIVE);\n book.add(new Book(385, arrBook, \"Ольга Володарская\", \"То ли ангел, то ли бес\", 1995));\n arrBook.clear();\n // 5 //\n arrBook.add(eGenre.NOVEL);\n arrBook.add(eGenre.ACTION);\n book.add(new Book(180, arrBook, \"Лихэйн Деннис\", \"Закон ночи\", 1944));\n arrBook.clear();\n // 6 //\n arrBook.add(eGenre.NOVEL);\n book.add(new Book(224, arrBook, \"Мураками Харуки\", \"Страна Чудес без тормозов и Конец Света\", 1985));\n arrBook.clear();\n // 7 //\n arrBook.add(eGenre.STORY);\n book.add(new Book(1200, arrBook, \"Джон Хейвуд\", \"Люди Севера: История викингов, 793–1241\", 2017));\n arrBook.clear();\n // 8 //\n arrBook.add(eGenre.ACTION);\n arrBook.add(eGenre.MYSTIC);\n arrBook.add(eGenre.DETECTIVE);\n book.add(new Book(415, arrBook, \"Линдквист Юн\", \"Впусти меня\", 2017));\n arrBook.clear();\n // 9 //\n arrBook.add(eGenre.ACTION);\n book.add(new Book(202, arrBook, \"Сухов Евгений\", \"Таежная месть\", 2016));\n arrBook.clear();\n // 10 //\n arrBook.add(eGenre.DETECTIVE);\n arrBook.add(eGenre.MYSTIC);\n book.add(new Book(231, arrBook, \"Винд Кристиан\", \"Призраки глубин\", 2019));\n arrBook.clear();\n }", "public void setGenre(ArrayList<String> genre) {\n this.genre = genre;\n }", "public void addBook(Book title)\n {\n bookList.add(title);\n }", "public void addGenre(String newGenre) {\n this.genre.add(newGenre);\n }", "private static void queryBooksByGenre(){\n\t\tSystem.out.println(\"===Query Books By Genre===\");\n\t\tScanner string_input = new Scanner(System.in);\n\t\t\n\t\tSystem.out.println(\"Enter Genre to Query Books by: \");\n\t\tString genre = string_input.next();\n\t\tint genre_index = getGenreIndex(genre); //returns the index of the genre entered, in ALL_GENRES\n\t\t\n\t\tif(genre_index > -1){//valid genre was entered\n\t\t\tIterator<String> iter = ALL_GENRES.get(genre_index).iterator();\n\t\t\tSystem.out.println(\"All \" + genre + \" books are: \");\n\t\t\tprintAllElements(iter);\n\t\t}\n\t}", "public ArrayList<Book> gettitleBook(String title);", "public void modifyGenres(ArrayList<String> genreList)// --> Bytter ut Genre-arrayen med en ny array over de nye sjangerene for lokalet.\n\t{\n\t\tgenres = genreList;\n\t}", "public void addGenre(String genre) throws SQLException {\n myGenreManager.addGenre(genre);\n allGenres.add(genre);\n }", "@Override\n\tpublic void addGenre(Genre genre) throws MovieException {\n obj.addGenre(genre);\n\t}", "public int addGenreToPlayList(){\n\t\t\n\t\tint pos =0;\n\t\t\n\t\tboolean out = false;\n\t\t\n\t\tfor(int i=0; (i<genresList.length)&&(out==false);i++){\n\t\t\n\t\tif(genresList[i] == null){\n\t\t\tout = true;\n\t\t\tpos = i;\n\t\t}\n\t\t}\n\t\treturn pos;\n\t}", "private void populateGenres(){\n try{\n Connection conn = DriverManager.getConnection(\n \"jdbc:sqlite:\\\\D:\\\\Programming\\\\Java\\\\Assignments\\\\CIS_452\\\\Music_Library\\\\album_library.sqlite\");\n Statement stmnt = conn.createStatement();\n ResultSet results = stmnt.executeQuery(\"SELECT DISTINCT genre FROM artist ORDER BY genre\");\n\n while(results.next()){\n String genre = results.getString(1);\n genreList.add(genre);\n }\n conn.close();\n } catch(SQLException e) {\n System.out.println(\"Error connecting to database: \" + e.getMessage());\n }\n }", "Builder addGenre(Text value);", "public void setGenre(int genre) {\n this.genre = genre;\n }", "Builder addGenre(String value);", "public ArrayList<MovieGenreModel> getAllGenres() {\n\t\treturn null;\n\t}", "public void printAverageRatingsByGenre(){\n ThirdRatings sr = new ThirdRatings();\n int raters = sr.getRaterSize();\n System.out.println(\"read data for \" + raters + \" raters\");\n System.out.println(\"-------------------------------------\");\n \n //MovieDatabase.initialize(\"ratedmovies_short.csv\");\n MovieDatabase.initialize(\"ratedmoviesfull.csv\");\n System.out.println(\"read data for \" + MovieDatabase.size() + \" movies\");\n System.out.println(\"-------------------------------------\");\n \n Filter f = new GenreFilter(\"Comedy\"); \n int minRatings = 20;\n ArrayList<Rating> aveRat = sr.getAverageRatingsByFilter(minRatings, f);\n System.out.println(\"Found \" + aveRat.size() + \" movies\");\n System.out.println(\"-------------------------------------\");\n // sort arraylist\n Collections.sort(aveRat);\n for(Rating r: aveRat){\n System.out.println(r.getValue() + \"\\t\" + MovieDatabase.getYear(r.getItem()) + \"\\t\" \n + MovieDatabase.getTitle(r.getItem()) + \"\\t\" + MovieDatabase.getGenres(r.getItem()));\n }\n System.out.println(\"-------------------------------------\");\n \n \n }", "public void setGenre(String genre) {\n this.genre = genre;\n }", "@Override\n\tpublic String addGenre(Genre songName, Genre songArtist, Genre songBpm, Genre songGenre) {\n\t\treturn null;\n\t}", "public void addBook(Book b){\n\t\tbookMap.get(b.getTitle()).add(b);\n\t}", "public void listBooks() {\n for (int g = 0; g < books.length; g++) {\n books[g].toString();\n }\n// List all books in Bookstore\n }", "private static void addToAuthorTable(String author_name, String bookTitle) {\n\t\tif(ALL_AUTHORS.containsKey(author_name)) \n\t\t\tALL_AUTHORS.get(author_name).add(bookTitle);\n\t\t/*put author_name as a new key in ALL_AUTHORS*/\n\t\telse{\n\t\t\tHashSet<String> bookTitles_list = new HashSet<String>();\n\t\t\tbookTitles_list.add(bookTitle);\n\t\t\tALL_AUTHORS.put(author_name, bookTitles_list);\n\t\t}\n\t}", "public void setGenre(Genre genre) {\n this.genre = genre;\n }", "public void setGenre(Genre genre) {\n this.genre = genre;\n }", "public void setGenre() {\r\n this.genre = genre;\r\n }", "@Override\n\tpublic void addBook() {\n\t\t\n\t}", "public void addBookQuantity(String title, int quantity) {\n // Search for the book...if found adjust the quantity, \t\n // otherwise, inform the user that the book is not available \n String t = title;\n int q = quantity;\n for (int h = 0; h < books.length; h++) {\n if (title.equals(books[h].getTitle())) {\n books[h].addQuantity(q);\n } else {\n System.out.println(\"Sorry book was not found\");\n }\n }\n }", "public void setGenre(String genre)\r\n {\r\n this.genre=genre;\r\n }", "private static ArrayList<String> getGenre(String songID) throws SQLException {\n ArrayList<String> genres = new ArrayList<>();\n genreStatement = conn.createStatement();\n genreResultSet = genreStatement.executeQuery(\"SELECT * FROM genre, trackGenre WHERE trackGenre.track_id = '\" + songID + \"' AND trackGenre.genre = genre.name;\");\n while (genreResultSet.next()){\n genres.add(genreResultSet.getString(\"name\"));\n }\n return genres;\n }", "public synchronized void addBook(String title, int quantity){\n titleList.add(title);\n quantityList.add(quantity);\n borrowerList.add(new LinkedList<>());\n }", "public String getGenre()\n {\n return bookGenre;\n }", "public void testGenreSort() {\n sorter.inssortGenre();\n list = sorter.getLibrary();\n assertEquals(list.get(0).getGenre(), \"Hip-Hop\");\n assertEquals(list.get(1).getGenre(), \"R&B\");\n assertEquals(list.get(2).getGenre(), \"Rock\");\n }", "@Override\n\tpublic List<Genre> displayAllGenres() throws MovieException {\n\t\treturn obj.displayAllGenres();\n\t}", "private void saveGenres(){\n\t\tFile genreList = new File(Paths.get(\"genres.txt\").toString());\n\t\ttry{\n\t\t\tBufferedWriter writer = new BufferedWriter(new FileWriter(genreList));\n\t\t\tfor (String s : genres){\n\t\t\t\twriter.write(s);\n\t\t\t\twriter.newLine();\n\t\t\t}\n\t\t\twriter.close();\n\t\t} catch(IOException ex){\n\t\t\t\n\t\t}\n\t}", "public void addGrocery(String title)\n {\n SQLiteDatabase db = this.getWritableDatabase();\n System.out.println(\"\\n\\nAdding to grocery list \"+title);\n ContentValues values = new ContentValues();\n values.put(KEY_TITLE,title);\n db.insert(TABLE_GROCERIES,null,values);\n db.close();\n }", "public void showGenre(Genre genre) {\n for (Record r : cataloue) {\n if (r.getGenre() == genre) {\n System.out.println(r);\n }\n }\n\n }", "public BookType getGenre() {\r\n return genre;\r\n }", "public void addTitles(String titles){\n\n String titleSplit[] = titles.split(\",\");\n\n for (String section : titleSplit ) {\n this.titles.add(section);\n }\n }", "public void addBook(Book book) {\n \tset.add(book);\n }", "public void listTitles() {\n for (int i = 0; i < books.length; i++) {\n System.out.println(\"The title of book\" + (i + 1) + \": \" + books[i].getTitle());\n }\n }", "private static void addToPublisherTable(String publisher, String bookTitle) {\n\t\tif(ALL_PUBLISHERS.containsKey(publisher))\n\t\t\tALL_PUBLISHERS.get(publisher).add(bookTitle);\n\t\t/*put publisher as a new key in ALL_AUTHORS*/\n\t\telse{\n\t\t\tHashSet<String> bookTitles_list = new HashSet<String>();\n\t\t\tbookTitles_list.add(bookTitle);\n\t\t\tALL_PUBLISHERS.put(publisher, bookTitles_list);\n\t\t}\n\t\t\n\t}", "public void addBook(Book book) {\n\t\tboolean notFound = true;\n\t\tfor (Item item : items) {\n\t\t\tif(item.getName().equals(book.getName())) {\n\t\t\t\t// Found\n\t\t\t\tnotFound = false;\n\t\t\t\titem.updateQuantity();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(notFound) {\n\t\t\tItem item = new Item(book, 1);\n\t\t\titems.add(item);\n\t\t}\n\t}", "public void setGenre(String genre){\n\t\t//FIXME\n\t\tthis.genre = genre;\n\t}", "public void setGenre(String genreStr) {\n String genresRemovedCommas = genreStr.replaceAll(COMMA, EMPTY);\r\n String[] genresArray = genresRemovedCommas.split(SPACE);\r\n Collections.addAll(genres, genresArray);\r\n }", "void addbook(String book){\n\t\tthis.books[no_of_books]=book;\n\t\tno_of_books++;\n\t\tSystem.out.println(book+\" ...add\");\n\n\t}", "void addAll(Collection<Book> books);", "public Album setGenres(Set<String> genres) {\r\n this.genres = genres;\r\n return this;\r\n }", "public ArrayList<Book> search(String part){ \n this.searchBooks = new ArrayList<Book>();\n this.numberedListOfSearch = new HashMap<Integer, Book>();\n if (part.length()>=4){\n //Adding all the searching books into an ArrayList<Book>\n //No duplicating for books having the same title\n boolean bookExist = false;\n for (Book book : this.libraryBooks){\n if ((book.getTitle().toLowerCase().contains(part.toLowerCase())) || (book.getAuthor().toLowerCase().contains(part.toLowerCase()))){\n //Check whether any books having the same title in the list\n for (Book bookSearch : this.searchBooks){\n if (bookSearch.getTitle().equals(book.getTitle())){\n bookExist = true;\n break;\n }\n }\n //If none!\n if(!bookExist){\n this.searchBooks.add(book);\n }\n }\n bookExist = false;\n }\n //To put into a numbered list for printing\n //No duplicating for books having the same title\n for (int i =0; i < (this.searchBooks.size());i++){\n // put the book in the HashMap for printing \n this.numberedListOfSearch.put(i+1, this.searchBooks.get(i));\n }\n\n //To print out\n this.println(\"The searching process has finished!\");\n String researchBooks=\"\";\n //check whether the numbered list is empty or not\n if(this.numberedListOfSearch.size() >0){\n researchBooks += \"{\";\n for (int i = 0; i < this.numberedListOfSearch.size();i++){\n researchBooks += (i+1);\n researchBooks += \": \";\n researchBooks += this.numberedListOfSearch.get(i+1).toString();\n researchBooks += \"; \";\n }\n researchBooks = researchBooks.substring(0, researchBooks.length()-2);\n researchBooks += \"}\"; \n }\n //if the numbered list is empty\n else if ( this.numberedListOfSearch.size() == 0){\n researchBooks += \"Nothing found!\";\n }\n this.println(researchBooks);\n }\n\n //If not enough input key words!\n else{\n this.println(\"Please enter more key words! At least four!!\");\n }\n return this.searchBooks;\n }", "public void printAverageRatingsByGenre(){\n \n String moviefile = \"data/ratedmovies_short.csv\";\n String ratingsfile = \"data/ratings_short.csv\";\n \n \n ThirdRatings tr = new ThirdRatings(ratingsfile);\n \n int rating_size = tr.getRaterSize();\n \n System.out.println(\"The number of raters read is : \"+ rating_size);\n \n MovieDatabase database = new MovieDatabase();\n \n database.initialize(moviefile);\n \n int movie_size = database.size();\n \n System.out.println(\"The number of movies read is : \"+ movie_size); \n \n String genre = \"Crime\";\n \n GenreFilter genre_filter = new GenreFilter(genre);\n \n ArrayList<Rating> ratings_list = tr.getAverageRatingsByFilter(1, genre_filter);\n \n HashMap<String, Double> map = new HashMap<String, Double>();\n \n Collections.sort(ratings_list);\n \n int count = 0; \n \n for(Rating rating : ratings_list){\n \n String title = database.getTitle(rating.getItem());\n \n double val = rating.getValue();\n \n String mov_genre = database.getGenres(rating.getItem());\n \n if(val != 0.0 ){\n \n map.put(title , val);\n \n count += 1;\n\n System.out.println(val + \"\\t\" + mov_genre + \"\\t\" +title );\n }\n\n }\n \n System.out.println(\"The number of movies found with minimal number of ratings is : \"+ count); \n \n \n }", "public void addGenreAction()\n\t{\n\t\tViewNavigator.loadScene(\"Add Genre\", ViewNavigator.ADD_GENRE_SCENE);\n\t}", "public ArrayList<Book> getListBook();", "@Override\n\tpublic List<Book> getAllBooks() {\n\t\treturn bookList;\n\t}", "private static void loadBooks() {\n\tbookmarks[2][0]=BookmarkManager.getInstance().createBook(4000,\"Walden\",\"\",1854,\"Wilder Publications\",new String[] {\"Henry David Thoreau\"},\"Philosophy\",4.3);\n\tbookmarks[2][1]=BookmarkManager.getInstance().createBook(4001,\"Self-Reliance and Other Essays\",\"\",1900,\"Dover Publications\",new String[] {\"Henry David Thoreau\"},\"Philosophy\",4.3);\n\tbookmarks[2][2]=BookmarkManager.getInstance().createBook(4002,\"Light From Many Lamps\",\"\",1960,\"Wilder Publications\",new String[] {\"Henry David Thoreau\"},\"Philosophy\",4.3);\n\tbookmarks[2][3]=BookmarkManager.getInstance().createBook(4003,\"Head First Design Patterns\",\"\",1944,\"Wilder Publications\",new String[] {\"Henry David Thoreau\"},\"Philosophy\",4.3);\n\tbookmarks[2][4]=BookmarkManager.getInstance().createBook(4004,\"Effective Java Programming Language Guide\",\"\",1990,\"Wilder Publications\",new String[] {\"Eric Freeman\",\"Bert Bates\",\"Kathy Sierra\",\"Elisabeth Robson\"},\"Philosophy\",4.3);\n}", "Builder addGenre(URL value);", "public void addBook(Book aBook) {\n\t\t\n\t\tNode<ArrayList<Book>> current = head;\n\t\t//System.out.print(current.letter);\n\t\twhile (current.letter != aBook.getAuthorLastName().charAt(0)) {\n\t\t\tcurrent = current.next;\n\t\t}\n\n\t\tcurrent.data.add(aBook);\n\t\t\n\t}", "ImmutableList<SchemaOrgType> getGenreList();", "private void loadToChoice() {\n\t\tfor(Genre genre : genreList) {\n\t\t\tuploadPanel.getGenreChoice().add(genre.getName());\n\t\t}\n\t}", "public void printAverageRatingsByYearAfterAndGenre(){\n ThirdRatings sr = new ThirdRatings();\n int raters = sr.getRaterSize();\n System.out.println(\"read data for \" + raters + \" raters\");\n System.out.println(\"-------------------------------------\");\n \n //MovieDatabase.initialize(\"ratedmovies_short.csv\");\n MovieDatabase.initialize(\"ratedmoviesfull.csv\");\n System.out.println(\"read data for \" + MovieDatabase.size() + \" movies\");\n System.out.println(\"-------------------------------------\");\n \n AllFilters f = new AllFilters();\n YearAfterFilter y = new YearAfterFilter(1990);\n GenreFilter g = new GenreFilter(\"Drama\");\n f.addFilter(y);\n f.addFilter(g);\n int minRatings = 8;\n ArrayList<Rating> aveRat = sr.getAverageRatingsByFilter(minRatings, f);\n System.out.println(\"Found \" + aveRat.size() + \" movies\");\n System.out.println(\"-------------------------------------\");\n // sort arraylist\n Collections.sort(aveRat);\n for(Rating r: aveRat){\n System.out.println(r.getValue() + \"\\t\" \n + MovieDatabase.getYear(r.getItem()) + \"\\t\"\n + MovieDatabase.getTitle(r.getItem()) + \"\\t\"\n + MovieDatabase.getGenres(r.getItem()));\n }\n System.out.println(\"-------------------------------------\");\n \n \n }", "public void addLiteratureToSeries(String seriesTitle, Book newLiterature) {\n Iterator<Literature> it = literatureRegister.iterator();\n\n while(it.hasNext()) {\n Literature literature = it.next();\n\n if (literature.getTitle().equals(seriesTitle) && literature instanceof BookSeries) {\n ((BookSeries) literature).addBook(newLiterature);\n }\n }\n }", "public String genre14(){\n String genre14MovieTitle = \" \";\n for(int i = 0; i < results.length; i++){\n if(results[i].genre()) {\n genre14MovieTitle += results[i].getTitle() + \"\\n\";\n }\n }\n System.out.println(genre14MovieTitle);\n return genre14MovieTitle;\n }", "public void setGenre(TheatreGenre genre) {\n\t\tthis.genre = genre;\n\t}", "public void addGenre() {\n ResultSet result = null;\n try {\n result = server.executeStatement(\"SELECT genreID FROM productiongenre WHERE prodID = \" + \"'\" + getId() + \"'\" + \";\");\n if(result.next())\n genre = result.getString(\"genreID\");\n } catch (SQLException e) {\n e.printStackTrace();\n }\n\n }", "public Book(String title, String genre)\n {\n bookTitle = title;\n bookGenre = genre;\n }", "public void putMovieData(String movieName, String movieDate, String genre) {\n String[] columns = {MovieUriContract.GenreEntry._ID, MovieUriContract.GenreEntry.COLUMN_NAME};\n\n try{\n Cursor cursor = providerClient.query(\n MovieUriContract.GenreEntry.CONTENT_URI,\n columns,\n null,\n null,\n null\n );\n\n int genreId = -1;\n if(cursor.moveToFirst()) {\n genreId = cursor.getColumnIndex(genre);\n }\n cursor.close();\n\n if(genreId >= 0) {\n ContentValues movieValues = new ContentValues();\n movieValues.put(MovieUriContract.MovieEntry.COLUMN_NAME, movieName);\n movieValues.put(MovieUriContract.MovieEntry.COLUMN_RELEASE_DATE, movieDate);\n movieValues.put(MovieUriContract.MovieEntry.COLUMN_GENRE, genreId);\n providerClient.update(\n MovieUriContract.GenreEntry.CONTENT_URI,\n movieValues,\n null,\n null);\n }\n else {\n view.setErrorMessage();\n }\n } catch (RemoteException e) {\n e.printStackTrace();\n }\n }", "public void populateGenreMap(ItemContainer itemContainer) {\n\t\tfor (Genres genre : itemContainer.getGenres()) {\n\t\t\tif (everyGenre.containsKey(genre.getGenre())) {\n\t\t\t\tTreeSet<Genres> genres = everyGenre.get(genre.getGenre());\n\t\t\t\tgenres.add(genre);\n\t\t\t\teveryGenre.put(genre.getGenre(), genres);\n\t\t\t} else {\n\t\t\t\tTreeSet<Genres> tempSet = new TreeSet<Genres>();\n\t\t\t\ttempSet.add(genre);\n\t\t\t\teveryGenre.put(genre.getGenre(), tempSet);\n\t\t\t}\n\t\t}\n\t}", "void addAfter(String title, Song song) {\n Song selectedSong = lookupTitle(title);\n if (selectedSong != null) {\n int index = songlist.indexOf(selectedSong);\n if (index != -1)\n songlist.add(index+1, song);\n else\n songlist.add(song);\n }\n else\n songlist.add(song);\n }", "public void loadBook() {\n List<Book> books = new ArrayList<>();\n for (int i = 0; i < 5; i++) {\n Book book = new Book(\"Book-\" + i, \"Test book \" + i);\n books.add(book);\n }\n this.setBooks(books);\n }", "public ObservableList<String> getAllGenres(){\n return allGenres;\n }", "private static void initializeAllGenresList(){\n\t\tfor(int i = 0; i < 13; i ++){\n\t\t\tALL_GENRES.add(new HashSet<String>());\n\t\t}\n\t}", "public void add(Book book)\n\t{\n\t\tbooks.add(book);\n\t}", "Book(String t, String a, String g, String[] b){\n\t\ttitle = t;\n\t\tauthor = a;\n\t\tgenre = g;\n\t\ttags = new ArrayList<String>();\n\t\tfor(int i=0; i<b.length; i++)\n\t\t\ttags.add(b[i]);\n\t}", "@Override\r\n\tpublic ArrayList<String> allMovies()\r\n\t{\r\n\t\tArrayList<String> sortedMovieTitles = new ArrayList<String>();\r\n\t\t\r\n\t\tsortedMovieTitles = movieTitles;\r\n\t\t\r\n\t\tCollections.sort(movieTitles);\r\n\t\t\r\n\t\treturn sortedMovieTitles;\r\n\t}", "public void addBook(int index, Book book)\r\n\t{\r\n\t\tif(index == -1) {\r\n\t\t\tindex++;\r\n\t\t}\r\n\t\tList<Book> oldValue = items;\r\n\t\titems = new ArrayList<Book>(items);\r\n\t\titems.add(index, book);\r\n\t\tfirePropertyChange(\"books\", oldValue, items);\r\n\t\tfirePropertyChange(\"itemsCount\", oldValue.size(), items.size());\r\n\t}", "public void printAverageRatingsByYearAfterAndGenre(){\n \n String moviefile = \"data/ratedmovies_short.csv\";\n String ratingsfile = \"data/ratings_short.csv\";\n \n \n ThirdRatings tr = new ThirdRatings(ratingsfile);\n \n int rating_size = tr.getRaterSize();\n \n System.out.println(\"The number of raters read is : \"+ rating_size);\n \n MovieDatabase database = new MovieDatabase();\n \n database.initialize(moviefile);\n \n int movie_size = database.size();\n \n System.out.println(\"The number of movies read is : \"+ movie_size); \n \n int year = 1980;\n String genre = \"Romance\";\n \n AllFilters all_filter = new AllFilters();\n GenreFilter gf = new GenreFilter(genre);\n YearAfterFilter yf = new YearAfterFilter(year);\n \n all_filter.addFilter(yf);\n all_filter.addFilter(gf);\n \n ArrayList<Rating> ratings_list = tr.getAverageRatingsByFilter(1, all_filter);\n \n HashMap<String, Double> map = new HashMap<String, Double>();\n \n Collections.sort(ratings_list);\n \n int count = 0; \n \n for(Rating rating : ratings_list){\n \n String title = database.getTitle(rating.getItem());\n \n double val = rating.getValue();\n \n String mov_genre = database.getGenres(rating.getItem());\n \n int mov_year = database.getYear(rating.getItem());\n \n if(val != 0.0 ){\n \n map.put(title , val);\n \n count += 1;\n\n System.out.println(val + \"\\t\" + mov_genre + \"\\t\" + mov_year + \"\\t\" + title );\n }\n\n }\n \n System.out.println(\"The number of movies found with minimal number of ratings is : \"+ count); \n \n \n }", "private void searchedByTitle(ArrayList<Movie> movies)\n {\n ArrayList<Movie> searchResult = new ArrayList<Movie>();\n \n String title = insertTitle();\n searchResult = checkExistence(movies, title);\n displayExistanceResult(searchResult, title);\n }", "Book addBook(String title, String[] authors, boolean silent);", "public void add(Book book) {\n if (books.length == numBooks){ grow(); }\n books[numBooks++] = book;\n }", "private static void loadMovies() {\n\tbookmarks[1][0]=BookmarkManager.getInstance().createMovie(3000,\"Citizen Kane\",1941,new String[] {\"Orson Welles,Joseph Cotten\"},new String[] {\"Orson Welles\"},MovieGenre.CLASSICS,8.5);\n\tbookmarks[1][1]=BookmarkManager.getInstance().createMovie(3001,\"The Grapes of Wrath\",1940,new String[] {\"Henry Fonda,Jane Darwell\"},new String[]{\"John Ford\"},MovieGenre.CLASSICS,8.2);\n\tbookmarks[1][2]=BookmarkManager.getInstance().createMovie(3002,\"A Touch of Greatness\",2004,new String[] {\"Albert Cullum\"},new String[] {\"Leslie Sullivan\"},MovieGenre.DOCUMENTARIES,7.3);\n\tbookmarks[1][3]=BookmarkManager.getInstance().createMovie(3003,\"The Big Bang Theory\",2007,new String[] {\"Kaley Cuoco,Jim Parsons\"},new String[] {\"Chuck Lorre,Bill Prady\"},MovieGenre.TV_SHOWS,8.7);\n\tbookmarks[1][3]=BookmarkManager.getInstance().createMovie(3004,\"Ikiru\",1952,new String[] {\"Takashi Shimura,Minoru Chiaki\"},\tnew String[] {\"Akira Kurosawa\"}\t,MovieGenre.FOREIGN_MOVIES,8.4);\n}", "public void addMultipleBook() {\n Set set = new TreeSet();\n System.out.println(\" yours choice how many addressbook you want to create it:--\");\n int number = scanner.nextInt();\n\n for (int index = 1; index <= number; index++) {\n System.out.println(\"give name to your dictionary:--\");\n String name = scanner.next();\n set.add(name);\n }\n System.out.println(set);\n }", "@Override\n\tpublic ArrayList<BlogArticle> searchArts(String title) {\n\t\treturn blogArticleDao.searchArts(title);\n\t}", "public void onGenreClick(View v) {\n // FIXME: 9ボタンのジャンル一覧ボタン押下時\n AppMeasurementWrapper.getInstance().initialize(getApplication());\n AppMeasurementWrapper.getInstance().storeTransitionSrcPoint(AppEffectClickPointEnum.HOME_GENRE_1);\n this.startGenreListActivity();\n }", "public Artist(String name, Genre mainGenre) {\n this.name = name;\n this.cataloue = new ArrayList<Record>();\n this.mainGenre = mainGenre;\n }", "public void addBook(String string, int i) {\n\t\tBook b= new Book(string,i);\r\n\t\tarlist.add(b);\r\n\t\t\r\n\t}", "public Set<String> getGenres() {\r\n return this.genres;\r\n }", "public List<Film> findAllByGenre(String genre);", "void addBefore(String title, Song song) {\n Song selectedSong = lookupTitle(title);\n if (selectedSong != null) {\n int index = songlist.indexOf(selectedSong);\n if (index != -1)\n songlist.add(index, song);\n else\n songlist.add(song);\n }\n else\n songlist.add(song);\n }", "public ArrayList<Book> getBookByPart(String titlePart) {\n titlePart = this.sanitizeString(titlePart);\n ArrayList<Book> bookList = new ArrayList<>();\n\n for (String bookTitle: this.books.keySet()) {\n if (bookTitle.contains(titlePart)) {\n bookList.add(this.books.get(bookTitle));\n }\n }\n return bookList;\n }", "public static ArrayList<Book> search(String title, ArrayList<String> authors, String isbn, String publisher, String sortOrder, HashMap<Book, Integer> purchasedBooks)\n {\n ArrayList<Book> tempBookBuffer = search(title, authors, isbn, publisher, purchasedBooks);\n ArrayList<Book> searchedBooks = new ArrayList<>();\n\n for(Book b: tempBookBuffer) {\n if (b.getBookPublisher().equals(publisher) || publisher.equals(\"*\"))\n searchedBooks.add(b);\n }\n if (sortOrder.equals(\"title\")) {\n Collections.sort(searchedBooks, Book.BookTitleComparator);\n }\n else if(sortOrder.equals(\"publish-date\")){\n Collections.sort(searchedBooks,Book.BookDateComparator);\n }\n else{\n\n }\n return searchedBooks;\n }", "public void addBook(Book book)\r\n\t{\r\n\t\tList<Book> oldValue = items;\r\n\t\titems = new ArrayList<Book>(items);\r\n\t\titems.add(book);\r\n\t\tfirePropertyChange(\"books\", oldValue, items);\r\n\t\tfirePropertyChange(\"itemsCount\", oldValue.size(), items.size());\r\n\t}", "public String getGenre() {\n return genre;\n }", "public String getGenre() {\n return genre;\n }", "public int getGenre() {\n return genre;\n }", "private void setBooksInfo () {\n infoList = new ArrayList<> ();\n\n\n // item number 1\n\n Info info = new Info ();// this class will help us to save data easily !\n //set the title >> it can be Book name or Topic title ...\n info.setInfoTitle (\"ما هي اضطرابات طيف التوحد؟\");\n\n //set the description of the Topic or the website ....\n info.setInfoDescription (\"سيساعدك هذا المستند على معرفة اضطراب طيف التوحد بشكل عام\");\n\n // we can add book url or download >>\n info.setInfoPageURL (\"https://firebasestorage.googleapis.com/v0/b/autismapp-b0b6a.appspot.com/o/material%2FInfo-Pack-for\"\n + \"-translation-Arabic.pdf?alt=media&token=69b19a8d-8b4c-400a-a0eb-bb5c4e5324e6\");\n\n infoList.add (info); //adding item 1 to list\n\n\n/* // item number 2\n info = new Info ();// save the second Book\n //set the title >> it can be Book name or Topic title ...\n info.setInfoTitle (\"Solve My Autism\");\n\n //set the description of the Topic or the website ....\n info.setInfoDescription (\"this Book has will help patient of Autism to get better by communicate with experts ...\");\n\n // we can add the url >>\n info.setInfoPageURL (\"https://material.io/\");\n\n infoList.add (info);//adding item number 2 to list\n\n\n // item 3\n info = new Info ();// save the third Book\n //set the title >> it can be website name or Topic title ...\n info.setInfoTitle (\"Autism Community\");\n\n //set the description of the Topic or the website ....\n info.setInfoDescription (\"this an Book about patient of Autism and how to help them get better ...\");\n\n // we can add the url >>\n info.setInfoPageURL (\"https://www.tutorialspoint.com/android/index.html\");\n infoList.add (info);// adding item 3 to list\n\n // item number 4\n info = new Info ();// save the second Book\n //set the title >> it can be Book name or Topic title ...\n info.setInfoTitle (\"Solve My Autism part 2\");\n\n //set the description of the Topic or the website ....\n info.setInfoDescription (\"this Book has will help patient of Autism to get better by communicate with experts ...\");\n\n // we can add the url >>\n info.setInfoPageURL (\"https://material.io/\");\n\n infoList.add (info);//adding item number 4 to list\n\n\n // item 5\n info = new Info ();// save the third Book\n //set the title >> it can be website name or Topic title ...\n info.setInfoTitle (\"Autism Community 2\");\n\n //set the description of the Topic or the website ....\n info.setInfoDescription (\"this an Book about patient of Autism and how to help them get better ...\");\n\n // we can add the url >>\n info.setInfoPageURL (\"https://www.tutorialspoint.com/android/index.html\");\n infoList.add (info);// adding item 5 to list*/\n\n\n displayInfo (infoList);\n\n }", "public List<String > getBooks(){\n List<String> titles = new ArrayList<>();\n\n String strSQL = \"SELECT B._id, B.Title FROM TBooks B WHERE NOT B._id IN (Select TLoaned.TitleID \" +\n \" FROM TLoaned WHERE TLoaned.ReturnDate IS NULL);\";\n SQLiteDatabase db = this.getReadableDatabase();\n Cursor c = db.rawQuery(strSQL, null);\n try {\n if (c.moveToFirst()) {\n do {\n titles.add(c.getString(0) + \". \" + c.getString(1));\n } while (c.moveToNext());\n }\n }\n finally {\n c.close();\n db.close();\n }\n return titles;\n }", "public ArrayList<Book> getAllBooksArray(){\n ArrayList<Book> booksArray = new ArrayList<>();\n\n Connection con = null;\n Statement stmt = null;\n ResultSet rs = null;\n\n try{\n Class.forName(\"org.sqlite.JDBC\");\n con = DriverManager.getConnection(\"jdbc:sqlite:Library.db\");\n stmt = con.createStatement();\n String sql = \"SELECT * FROM BOOKS\";\n rs = stmt.executeQuery(sql);\n while(rs.next()){\n Book book = new Book(rs.getString(\"TITLE\"), rs.getString(\"AUTHOR\"), rs.getString(\"ILLUSTRATOR\"), rs.getString(\"ISBN\"), rs.getString(\"DECIMAL\"),\n rs.getString(\"DESCRIPTION\"), rs.getString(\"GENRE\"), rs.getBoolean(\"NON_FICTION\"));\n String tags = rs.getString(\"TAGS\");\n book.setID(rs.getInt(\"ID\"));\n book.deserializeTags(tags);\n booksArray.add(book);\n }\n rs.close();\n stmt.close();\n con.close();\n }catch(SQLException | ClassNotFoundException e){\n e.printStackTrace();\n }\n return booksArray;\n }", "private static void idVorhanden() {\n\t\tLinkedHashSet<String> genre = new LinkedHashSet<String>();\t\t\t// benötigt, um duplikate von genres zu entfernen\n\t\tLinkedHashSet<String> darsteller = new LinkedHashSet<String>();\t\t// benötigt, um duplikate von darstellern zu entfernen\n\t\tString kinofilm = \"\";\t\t\t\t\t\t\t\t\t\t\t\t// benötigt für die Ausgabe des Filmtitels und Jahr\n\t\t\n\t\tsetSql(\"SELECT g.GENRE, m.TITLE, m.YEAR, mc.CHARACTER, p.NAME from Movie m JOIN MOVgen MG ON MG.MOVIEID = M.MOVIEID right JOIN GENRE G ON MG.GENREID = G.GENREID\\n\"\n\t\t\t\t\t+ \"\t\t\t\tright JOIN MOVIECHARACTER MC ON M.MOVIEID = MC.MOVIEID JOIN PERSON P ON MC.PERSONID = P.PERSONID\\n\"\n\t\t\t\t\t+ \"\t\t\t\tWHERE M.MOVIEID = \" + movieID);\t// SQL Abfrage, um Genre, Title, Year, Character und Name eines Films zu bekommen\n\t\t\n\t\tsqlAbfrage();\t\t\t\t\t\t\t\t\t// SQL Abfrage ausführen und Ergebnis im ResultSet speichern\n\t\t\n\t\ttry {\n\t\t\n\t\t\tif(!rs.next()) {\t\t\t\t\t\t\t// prüfe, ob das ResultSet leer ist\n\t\t\t\tSystem.out.println();\n\t\t\t\tSystem.out.println(\"MovieID ungültig. Bitte eine der folgenden MovieID's angeben: \"); // Meldung ausgeben, dass ID ungültig ist\n\t\t\t\tidProblem();\t\t\t\t\t\t\t// wenn movieID nicht vorhanden, führe idProblem() aus, um mögliche Filme anzuzeigen\n\t\t\t} else {\n\t\t\t\trs.isBeforeFirst();\t\t\t\t\t\t// Durch die if-Abfrage springt der Cursor des ResultSets einen weiter und muss zurück auf die erste Stelle\n\t\t\t\twhile (rs.next()) {\t\t\t\t\t\t// Zeilenweises durchgehen des ResultSets \"rs\"\n\t\t\t\t\t/*\n\t\t\t\t\t * Aufbau des ResultSets \"rs\":\n\t\t\t\t\t * eine oder mehrere Zeilen mit folgenden Spalten:\n\t\t\t\t\t * GENRE | TITLE | YEAR | CHARACTER | NAME\n\t\t\t\t\t * (1) (2) (3) (4) (5)\n\t\t\t\t\t */\n\t\t\t\t\tgenre.add(rs.getString(1));\t\t\t\t\t\t\t\t\t\t\t// speichern und entfernen der Duplikate der Genres in \"genre\"\n\t\t\t\t\tkinofilm = (rs.getString(2) + \" (\" + rs.getString(3) + \")\");\t\t// Speichern des Filmtitels und des Jahrs in \"kinolfilm\"\n\t\t\t\t\tdarsteller.add(rs.getString(4) + \": \" + rs.getString(5));\t\t\t// speichern und entfernen der Duplikate der Darsteller in \"darsteller\"\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\t * Zur besseres Ausgabe, werden die LinkedHashSets in ArrayLists übertragen\n\t\t\t\t * Grund: Es ist nicht möglich auf einzelne, bestimmte Elemente des HashSets zuzugreifen.\n\t\t\t\t * Bedeutet: HashSet.get(2) existiert nicht, ArrayList.get(2) existiert.\n\t\t\t\t */\n\t\t\t\tArrayList<String> genreArrayList = new ArrayList<String>();\n\t\t\t\t\tfor (String s : genre) {\n\t\t\t\t\t\tgenreArrayList.add(s);\n\t\t\t\t\t}\n\n\t\t\t\tArrayList<String> darstellerArrayList = new ArrayList<String>();\n\t\t\t\t\tfor (String s : darsteller) {\n\t\t\t\t\t\tdarstellerArrayList.add(s);\n\t\t\t\t\t}\n\n\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t * Ausgabe der Kinofilm Daten nach vorgegebenen Format:\n\t\t\t\t\t\t\t * \n\t\t\t\t\t\t\t * Kinofilm: Filmtitel (Year)\n\t\t\t\t\t\t\t * Genre: ... | ... | ..\n\t\t\t\t\t\t\t * Darsteller:\n\t\t\t\t\t\t\t * Character: Name\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tSystem.out.println();\t\t\t\t\t\t\t\t// erzeugt Leerzeile\n\t\t\t\t\t\t\tSystem.out.println(\"Kinofilme: \" + kinofilm);\t\t// Ausgabe: Kinofilm: Filmtitel (Year)\n\t\t\t\t\t\t\tSystem.out.print(\"Genre: \" + genreArrayList.get(0)); // Ausgabe des ersten Genres, vermeidung des Zaunpfahlproblems\n\n\t\t\t\t\t\t\tfor (int i = 1; i < genreArrayList.size(); i++) {\t\t// Ausgabe weiterer Genres, solange es weitere Einträge in\t\n\t\t\t\t\t\t\t\tSystem.out.print(\" | \" + genreArrayList.get(i)); \t// der ArrayList \"genreArrayList\" gibt\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tSystem.out.println();\t\t\t\t\t\t\t\t// erzeugt Leerzeile\n\t\t\t\t\t\t\tSystem.out.println(\"Darsteller:\");\t\t\t\t\t// Ausgabe: Darsteller:\n\t\t\t\t\t\t\tfor (int i = 0; i < darstellerArrayList.size(); i++) {\t// Ausgabe der Darsteller, solange es\n\t\t\t\t\t\t\t\tSystem.out.println(\" \" + darstellerArrayList.get(i));\t// Darsteller in der \"darstellerArrayList\" gibt\n\t\t\t\t\t\t\t}\t\t\t\n\t\t\t}\n\t\t\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(e); // Ausgabe Fehlermeldung\n\t\t}\n\t}", "public void addRecord(String name, Genre genre) {\n cataloue.add(new Record(name, genre));\n }", "boolean contains(Book title){\n return false;\n }", "public ArrayList<Book> getBooks() {\n return bookList;\n }" ]
[ "0.67970204", "0.6578355", "0.65773386", "0.6568015", "0.65168196", "0.6493369", "0.63290226", "0.62422985", "0.62199634", "0.6212021", "0.6118393", "0.599999", "0.59978616", "0.59021926", "0.5824418", "0.580602", "0.57740873", "0.57423574", "0.5728521", "0.5715623", "0.5667612", "0.5654281", "0.56447667", "0.56288743", "0.56288743", "0.56043947", "0.56002367", "0.55767584", "0.55576867", "0.5548138", "0.554396", "0.55388075", "0.55370593", "0.55203474", "0.5515412", "0.5513859", "0.55101514", "0.54921347", "0.5472628", "0.5468236", "0.5462596", "0.5462589", "0.54534566", "0.545333", "0.54445106", "0.54357", "0.54049575", "0.5380297", "0.5365533", "0.53493106", "0.5332567", "0.53083885", "0.5275225", "0.5272134", "0.5270296", "0.5260075", "0.52363026", "0.5210604", "0.5208847", "0.5199473", "0.51906896", "0.51805466", "0.5174844", "0.51745784", "0.5151022", "0.5149645", "0.5131427", "0.5129", "0.51260877", "0.5119577", "0.51167536", "0.51165634", "0.51149994", "0.50928545", "0.50817776", "0.5078175", "0.50711256", "0.5069076", "0.5067237", "0.5064886", "0.5061141", "0.505892", "0.505428", "0.50497407", "0.5047857", "0.504568", "0.5041679", "0.5039947", "0.50391036", "0.5038497", "0.50336224", "0.50336224", "0.5025625", "0.50253314", "0.5015129", "0.5003107", "0.5001404", "0.49921304", "0.49915117", "0.49855497" ]
0.75703627
0
/Adds bookTitle to the ALL_PUBLISHERS ArrayList>
private static void addToPublisherTable(String publisher, String bookTitle) { if(ALL_PUBLISHERS.containsKey(publisher)) ALL_PUBLISHERS.get(publisher).add(bookTitle); /*put publisher as a new key in ALL_AUTHORS*/ else{ HashSet<String> bookTitles_list = new HashSet<String>(); bookTitles_list.add(bookTitle); ALL_PUBLISHERS.put(publisher, bookTitles_list); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addBook(Book title)\n {\n bookList.add(title);\n }", "private static void addToAuthorTable(String author_name, String bookTitle) {\n\t\tif(ALL_AUTHORS.containsKey(author_name)) \n\t\t\tALL_AUTHORS.get(author_name).add(bookTitle);\n\t\t/*put author_name as a new key in ALL_AUTHORS*/\n\t\telse{\n\t\t\tHashSet<String> bookTitles_list = new HashSet<String>();\n\t\t\tbookTitles_list.add(bookTitle);\n\t\t\tALL_AUTHORS.put(author_name, bookTitles_list);\n\t\t}\n\t}", "public ArrayList<Book> gettitleBook(String title);", "public void listTitles() {\n for (int i = 0; i < books.length; i++) {\n System.out.println(\"The title of book\" + (i + 1) + \": \" + books[i].getTitle());\n }\n }", "public void addBook(Book aBook) {\n\t\t\n\t\tNode<ArrayList<Book>> current = head;\n\t\t//System.out.print(current.letter);\n\t\twhile (current.letter != aBook.getAuthorLastName().charAt(0)) {\n\t\t\tcurrent = current.next;\n\t\t}\n\n\t\tcurrent.data.add(aBook);\n\t\t\n\t}", "public void addTitles(String titles){\n\n String titleSplit[] = titles.split(\",\");\n\n for (String section : titleSplit ) {\n this.titles.add(section);\n }\n }", "public void addBook(Book book) {\n \tset.add(book);\n }", "public void addBook(Book b){\n\t\tbookMap.get(b.getTitle()).add(b);\n\t}", "private static void addToGenreTable(BookDetails book, String bookTitle) {\n\t\t//ALL_GENRES representation --> Biology|Mathematics|Chemistry|Physics|Science_Fiction|Fantasy|Action|Drama|Romance|Horror|History|Autobiography|Biography \n\t\tswitch(book.getGenre()){\n\t\t\tcase Biology:\n\t\t\t\tALL_GENRES.get(0).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase Mathematics:\n\t\t\t\tALL_GENRES.get(1).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase Chemistry:\n\t\t\t\tALL_GENRES.get(2).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase Physics:\n\t\t\t\tALL_GENRES.get(3).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase Science_Fiction:\n\t\t\t\tALL_GENRES.get(4).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase Fantasy:\n\t\t\t\tALL_GENRES.get(5).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase Action:\n\t\t\t\tALL_GENRES.get(6).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase Drama:\n\t\t\t\tALL_GENRES.get(7).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase Romance:\n\t\t\t\tALL_GENRES.get(8).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase Horror:\n\t\t\t\tALL_GENRES.get(9).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase History:\n\t\t\t\tALL_GENRES.get(10).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase Autobiography:\n\t\t\t\tALL_GENRES.get(11).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tcase Biography:\n\t\t\t\tALL_GENRES.get(12).add(bookTitle);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tSystem.out.println(\"ERROR: Invalid Genre Input\");\n\t\t\t\tbreak;\n\t\t}\n\t}", "public void add(Book book)\n\t{\n\t\tbooks.add(book);\n\t}", "void addAll(Collection<Book> books);", "Book addBook(String title, String[] authors, boolean silent);", "void addbook(String book){\n\t\tthis.books[no_of_books]=book;\n\t\tno_of_books++;\n\t\tSystem.out.println(book+\" ...add\");\n\n\t}", "public void addAuthors(String author) {\n if (authorsList.contains(author)) {\n System.out.println(\"Author exist!!!\");\n }\n else {\n authorsList.add(author);\n System.out.println(\"Add author successfully!!!\");\n }\n }", "public void addBook(Book book) {\n this.bookList.add(book);\n }", "public void addBook(Book book)\r\n\t{\r\n\t\tList<Book> oldValue = items;\r\n\t\titems = new ArrayList<Book>(items);\r\n\t\titems.add(book);\r\n\t\tfirePropertyChange(\"books\", oldValue, items);\r\n\t\tfirePropertyChange(\"itemsCount\", oldValue.size(), items.size());\r\n\t}", "public synchronized void addBook(String title, int quantity){\n titleList.add(title);\n quantityList.add(quantity);\n borrowerList.add(new LinkedList<>());\n }", "public List<String> updatePublicationAddAuthor(String firstName, String lastName, String hash) {\n\t\tfinal Post<BibTex> post = getPublicationByResourceHash(hash).get(0);\n\t\tPersonName p = new PersonName();\n\t\tp.setFirstName(firstName);\n\t\tp.setLastName(lastName);\n\t\tList<PersonName> persons = post.getResource().getAuthor();\n\t\tpersons.add(p);\n\t\tpost.getResource().setAuthor(persons);\n\t\t\n\t\treturn logic.updatePosts(Collections.<Post<? extends Resource>>singletonList(post), PostUpdateOperation.UPDATE_ALL);\n\t}", "@Override\n\tpublic void addBook() {\n\t\t\n\t}", "public void listBooks() {\n for (int g = 0; g < books.length; g++) {\n books[g].toString();\n }\n// List all books in Bookstore\n }", "private void notifyWishlists(String title) {\n\t\tfor(User u:LibrarySystem.getInstance().users) {\n\t\t\tfor(String wish:u.getWishlist()) {\n\t\t\t\tif(wish.equalsIgnoreCase(title)) {\n\t\t\t\t\tu.notify(\"An item from your wishlist had been added: \" + title + \"!\");\n\t\t\t\t\t//u.getWishlist().remove(title);\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "private void loopAuthors(Book book) {\n for (String s : book.getAuthors()) {\n print(s);\n }\n }", "public static ArrayList<Book> search(String title, ArrayList<String> authors, String isbn, String publisher, String sortOrder, HashMap<Book, Integer> purchasedBooks)\n {\n ArrayList<Book> tempBookBuffer = search(title, authors, isbn, publisher, purchasedBooks);\n ArrayList<Book> searchedBooks = new ArrayList<>();\n\n for(Book b: tempBookBuffer) {\n if (b.getBookPublisher().equals(publisher) || publisher.equals(\"*\"))\n searchedBooks.add(b);\n }\n if (sortOrder.equals(\"title\")) {\n Collections.sort(searchedBooks, Book.BookTitleComparator);\n }\n else if(sortOrder.equals(\"publish-date\")){\n Collections.sort(searchedBooks,Book.BookDateComparator);\n }\n else{\n\n }\n return searchedBooks;\n }", "public List<BookData> searchBookbyPublisher (String publisher) throws SQLException{\n\t\tList<BookData> list = new ArrayList<>();\n\t\t\n\t\tPreparedStatement myStmt = null;\n\t\tResultSet myRs = null;\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\tmyStmt = myConn.prepareStatement(\"select title, author_name, publisher_name, book_id from books natural join book_authors where publisher_name = ?\");\n\t\t\tmyStmt.setString(1, publisher);\n\t\t\tmyRs = myStmt.executeQuery();\n\t\t\t\n\t\t\twhile (myRs.next()) {\n\t\t\t\tBookData tempbook = convertRowToBook(myRs);\n\t\t\t\tlist.add(tempbook);\n\t\t\t}\n\t\t\t\n\t\t\treturn list;\n\t\t}\n\t\tfinally {\n\t\t\tmyRs.close();\n\t\t\tmyStmt.close();\n\t\t\n\t\t}\n\t\t\n\t}", "private static void queryBooksByPublisher(){\n\t\tSystem.out.println(\"===Query Books By Publisher===\");\n\t\tScanner string_input = new Scanner(System.in);\n\t\t\n\t\tSystem.out.println(\"Enter Publisher to Query Books by: \");\n\t\tString publisher = string_input.nextLine();\n\t\t\n\t\tif(ALL_PUBLISHERS.containsKey(publisher)){\n\t\t\tIterator<String> iter = ALL_PUBLISHERS.get(publisher).iterator();\n\t\t\tSystem.out.println(\"All books published by \" + publisher + \" are:\"); \n\t\t\tprintAllElements(iter);\n\t\t}\n\t\t\n\t\telse\n\t\t\tSystem.out.println(\"Sorry! There are no such publishers in our records!\");\n\t}", "public void addBook(Book book) {\n\t\tboolean notFound = true;\n\t\tfor (Item item : items) {\n\t\t\tif(item.getName().equals(book.getName())) {\n\t\t\t\t// Found\n\t\t\t\tnotFound = false;\n\t\t\t\titem.updateQuantity();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(notFound) {\n\t\t\tItem item = new Item(book, 1);\n\t\t\titems.add(item);\n\t\t}\n\t}", "public void findBookTitle(String title) {\n\t\tboolean match = false;\n\t\tfor (int i = 0; i < bookList.size(); i++) {\n\t\t\t// Find text with Contains OR find text with the full title\n\t\t\tif (bookList.get(i).getTitle().toLowerCase().contains(title.toLowerCase())\n\t\t\t\t\t|| bookList.get(i).getTitle().toLowerCase().equals(title.toLowerCase())) {\n\t\t\t\tmatch = true;\n\t\t\t\tSystem.out.println(bookList.get(i));\n\t\t\t}\n\t\t}\n\t\tif (!match) {\n\t\t\tSystem.out.println(\"Could not find the book Title\");\n\t\t}\n\t}", "public static ArrayList<Book> search(String title, ArrayList<String> authors, String isbn, String publisher, HashMap<Book, Integer> purchasedBooks)\n {\n ArrayList<Book> tempBookBuffer = search(title, authors, isbn, purchasedBooks);\n ArrayList<Book> searchedBooks = new ArrayList<>();\n\n for(Book b: tempBookBuffer)\n if(b.getBookPublisher().equals(publisher) || publisher.equals(\"*\"))\n searchedBooks.add(b);\n\n return searchedBooks;\n }", "public void addAuthor(Author author){\n authors.add(author);\n }", "public ArrayList<String> getMyBookList()\r\n {\r\n\treturn myBookList;\r\n }", "public void addBookToBooks(Book book) {\n\t\tcustomerBooks.add(book);\n\t}", "@Override\n\tpublic List<Book> getAllBooks() {\n\t\treturn bookList;\n\t}", "List<String> getAllTitles(){\n return mAllTitles;\n }", "public ArrayList<Book> listOfBooksByAuthor (Author providedAuthor){\n //Array list for storing books written by provided author\n ArrayList<Book> authorBooks = new ArrayList<>();\n\n //loops through the booklist to find books with the author in the list of authors\n for (Book book : bookList) {\n //loops through the list of authors to see if the provided author is among thelist\n for (Author author1 : book.getAuthors()) {\n if (providedAuthor.equals(author1)) {\n authorBooks.add(book);\n }\n }\n }\n return authorBooks;\n }", "public void addBooks(Books book){\n\n /*\n * If the book you want to add is not an instance of this Books class then you add it...\n * Don't think that's what it's supposed to do?\n */\n if (!(book instanceof Books)) {\n Books[] result = new Books[books.length + 1];\n for (int i = 0; i < books.length; i++) {\n result[i] = books[i];\n }\n result[result.length - 1] = (Books) book; // your if statement is wrong, that's why intellij warns this will always be null.\n books = result;\n }\n }", "public synchronized List<String> borrowerList(String borrower){\n List<String> list = new LinkedList<>();\n for (int i = 0; i < titleList.size(); i++){\n for (String name : borrowerList.get(i)){\n if (name.equals(borrower))\n list.add(titleList.get(i));\n }\n }\n return list;\n }", "public List<BookData> searchBookbyTitle (String name) throws SQLException{\n\t\tList<BookData> list = new ArrayList<>();\n\t\t\n\t\tPreparedStatement myStmt = null;\n\t\tResultSet myRs = null;\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\tmyStmt = myConn.prepareStatement(\"select title, author_name, publisher_name, book_id from books natural join book_authors where title = ?\");\n\t\t\tmyStmt.setString(1, name);\n\t\t\tmyRs = myStmt.executeQuery();\n\t\t\t\n\t\t\twhile (myRs.next()) {\n\t\t\t\tBookData tempbook = convertRowToBook(myRs);\n\t\t\t\tlist.add(tempbook);\n\t\t\t}\n\t\t\t\n\t\t\treturn list;\n\t\t}\n\t\tfinally {\n\t\t\tmyRs.close();\n\t\t\tmyStmt.close();\n\t\t\n\t\t}\n\t\t\n\t}", "private void addToArrayList(String getName) {\n\t\tUser newUser = new User(getName);\n\t\tmgUsr.arrList.add(newUser);\n\t\tobs = FXCollections.observableArrayList(mgUsr.arrList);\n\n\t\tsetOnListView();\n\t}", "@Test\n\tpublic void testGetBooksSortedByTitle() {\n\t\tSystem.out.println(\"Sorting books by title...\");\n\t\tList<Book> result = store.getBooksSortedByTitle();\n\t\tSystem.out.println(result);\n\t}", "@Override\n\tpublic void addItemBook(String login, String password, String title,\n\t\t\tString kind, String author, int nbPages) throws BadEntryException,\n\t\t\tNotMemberException, ItemBookAlreadyExistsException {\n\n\t}", "public String getBookTitle() {\n return bookTitle;\n }", "public ArrayList<Book> getListBook();", "public List<Books> findBooksByTitle(String title) {\r\n return bookController.findBooksByTitle(title);\r\n }", "public Book addBook(){\n Book book = new Book();\r\n String t = title.getText().toString();\r\n book.setTitle(t);\r\n String[] str = author.getText().toString().split(\",\");\r\n Author[] authors = new Author[str.length];\r\n int index = 0;\r\n for(String s : str){\r\n Author a = null;\r\n String[] fml = s.split(\"\\\\s+\");\r\n if(fml.length == 1){\r\n a = new Author(fml[0]);\r\n }else if(fml.length == 2){\r\n a = new Author(fml[0], fml[1]);\r\n }else if(fml.length == 3){\r\n a = new Author(fml[0], fml[1], fml[2]);\r\n }else{\r\n Toast.makeText(this, \"Invalid Author Name\", Toast.LENGTH_LONG).show();\r\n }\r\n authors[index] = a;\r\n index++;\r\n }\r\n book.setAuthors(authors);\r\n String isb = isbn.getText().toString();\r\n book.setIsbn(isb);\r\n\r\n\t\treturn book;\r\n\t}", "public void addAll(List<Book> bookList) {\n this.mBook.clear();\n this.mBook.addAll(bookList);\n notifyDataSetChanged();\n\n }", "@Override\n public String toString() {\n return bookName + \"-\" + authorName;\n }", "public void removeAllAlbumTitle() {\r\n\t\tBase.removeAll(this.model, this.getResource(), ALBUMTITLE);\r\n\t}", "@Override\n\tpublic ArrayList<BlogArticle> searchArts(String title) {\n\t\treturn blogArticleDao.searchArts(title);\n\t}", "public ArrayList<Book> getBooks() {\n return bookList;\n }", "public void loadBook() {\n List<Book> books = new ArrayList<>();\n for (int i = 0; i < 5; i++) {\n Book book = new Book(\"Book-\" + i, \"Test book \" + i);\n books.add(book);\n }\n this.setBooks(books);\n }", "public ArrayList<String> getAuthors() {\n\t\treturn authors;\n\t}", "@Override\n\tpublic void add() {\n\t\tHashMap<String, String> data = new HashMap<>();\n\t\tdata.put(\"title\", title);\n\t\tdata.put(\"author\", author);\n\t\tdata.put(\"publisher\", publisher);\n\t\tdata.put(\"isbn\", isbn);\n\t\tdata.put(\"bookID\", bookID);\n\t\tHashMap<String, Object> result = null;\n\t\tString endpoint = \"bookinfo/post.php\";\n\t\ttry {\n\t\t\tresult = APIClient.post(BookInfo.host + endpoint, data);\n\t\t\tvalid = result.get(\"status_code\").equals(\"Success\");\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void put(Book book) {\n\t\tboolean ok = false;\n\t\tfor (Integer isbnToLend : wishList) {\n\t\t\tif (isbnToLend == book.getIsbn()) {\n\t\t\t\tok = true;\n\t\t\t}\n\t\t}\n\t\tif (!ok) {\n\t\t\tlogger.level3(\"Proba wlozenia ksiazki ktorej nie ma na liscie do kieszeni: \" + book);\n\t\t\tthrow new EnvinronmentException(\"Proba wypozyczenia ksiazki spoza listy przez studenta: \" + this);\n\t\t}\n\t\tlogger.level1(\"Wlozono ksiazke do kieszeni: \" + book);\n\t\tlendBooks.add(book);\n\t}", "public ArrayList<Book> getBookByPart(String titlePart) {\n titlePart = this.sanitizeString(titlePart);\n ArrayList<Book> bookList = new ArrayList<>();\n\n for (String bookTitle: this.books.keySet()) {\n if (bookTitle.contains(titlePart)) {\n bookList.add(this.books.get(bookTitle));\n }\n }\n return bookList;\n }", "public void addToBookName_L10N_ARRAY(entity.RateBook_BookName_L10N element);", "public static ArrayList<Book> fillBooksArray(ArrayList<Book> bookArrayList){\n\n bookArrayList.add(PrepareData.book1);\n bookArrayList.add(PrepareData.book2);\n bookArrayList.add(PrepareData.book3);\n bookArrayList.add(PrepareData.book4);\n bookArrayList.add(PrepareData.book5);\n bookArrayList.add(PrepareData.book6);\n\n\n return bookArrayList;\n\n\n\n }", "public Book addBook(Book b){\n list.add(b);\n return b;\n }", "public void sortAuthor(){\r\n \r\n Book temp; // used for swapping books in the array\r\n for(int i=0; i<items.size(); i++) {\r\n\r\n\t // Check to see the item is a book. We will only\r\n //use books.\r\n\t if(items.get(i).getItemType() != Item.ItemTypes.BOOK)\r\n\t continue;\r\n\t\t\t\t\t\r\n\t for(int j=i+1; j<items.size(); j++) {\r\n\t\t // We consider only books\r\n\t // We consider only magazines\r\n\t if(items.get(j).getItemType() != Item.ItemTypes.BOOK)\r\n\t\t continue;\r\n\t\t // Compare the authors of the two books\r\n\t if(((Book)items.get(i)).getAuthor().compareTo(((Book)items.get(j)).getAuthor()) > 0) {\r\n\t\t // Swap the items\r\n\t\t temp = (Book)items.get(i);\r\n\t\t items.remove(i);\r\n\t\t items.add(i, items.get(j-1));\r\n\t\t items.remove(j);\r\n\t\t items.add(j, temp);\r\n\t }\r\n\t }\r\n\t }\r\n\t\t// Print the magazines\r\n for(int i=0; i<items.size(); i++)\r\n\t if(items.get(i).getItemType() == Item.ItemTypes.BOOK)\r\n\t\tSystem.out.println(items.get(i).toString());\r\n \t\r\n }", "@Override\r\n\tpublic void getTitle(String title) {\n\t\t\r\n\t}", "public void add(Book book) {\n if (books.length == numBooks){ grow(); }\n books[numBooks++] = book;\n }", "private static void queryBooksByAuthor(){\n\t\tSystem.out.println(\"===Query Books By Author===\");\n\t\tScanner string_input = new Scanner(System.in);\n\t\t\n\t\tSystem.out.println(\"Enter First Name of Author to Query Books by: \");\n\t\tString author_firstname = string_input.next();\n\t\t\n\t\tSystem.out.println(\"Enter Middle Name of Author to Query Books by (Type 'null' if Author has no middlename): \");\n\t\tString author_middlename = string_input.next();\n\t\tif(author_middlename.equalsIgnoreCase(\"null\"))\n\t\t\tauthor_middlename = \"\";\n\t\t\n\t\tSystem.out.println(\"Enter Last Name of Author to Query Books by: \");\n\t\tString author_lastname = string_input.next();\n\t\t\n\t\tString author_fullname = author_firstname + \" \" + author_middlename + \" \" + author_lastname;\n\t\t\n\t\tif(ALL_AUTHORS.containsKey(author_fullname)){//if author_full_name exists in the Hashtable then print out all of the author's book titles\n\t\t\tSystem.out.println(\"Author found!\");\n\t\t\tSystem.out.println(author_fullname + \"'s list of book titles are: \"); \n\t\t\tIterator<String> iter = ALL_AUTHORS.get(author_fullname).iterator();\n\t\t\tprintAllElements(iter);\n\t\t}\n\t\telse\n\t\t\tSystem.out.println(\"Sorry Author name entered does not exist in our records\");\n\t}", "public void addLiteratureToSeries(String seriesTitle, Book newLiterature) {\n Iterator<Literature> it = literatureRegister.iterator();\n\n while(it.hasNext()) {\n Literature literature = it.next();\n\n if (literature.getTitle().equals(seriesTitle) && literature instanceof BookSeries) {\n ((BookSeries) literature).addBook(newLiterature);\n }\n }\n }", "private boolean addBook(Book book) {\n\t\tfor (int i = 0; i < items.size(); i++)\n\t\t\tif (items.get(i).keyEquals(book))\n\t\t\t\treturn false;\n\t\titems.add(book);\n\t\treturn true;\n\t}", "public void addAlbumTitle( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.add(this.model, this.getResource(), ALBUMTITLE, value);\r\n\t}", "public static Set<String> getAllAuthors(List<Book> books) {\r\n Set<String> allAuthors = new HashSet<>();\r\n for (Book book : books) {\r\n allAuthors.add(book.getAuthor());\r\n }\r\n return allAuthors;\r\n }", "public void loadBookList(java.util.List<LdPublisher> ls) {\r\n final ReffererConditionBookList reffererCondition = new ReffererConditionBookList() {\r\n public void setup(LdBookCB cb) {\r\n cb.addOrderBy_PK_Asc();// Default OrderBy for Refferer.\r\n }\r\n };\r\n loadBookList(ls, reffererCondition);\r\n }", "void addAuthorToStream(Author author) {\n\t\tthis.entryCount.inc();\r\n\t\tboolean found = false;\r\n\r\n\t\tif (!authors.isEmpty()) {\r\n\t\t\tfor (Author a : authors) {\r\n\t\t\t\tif (a.name.equals(author.name)) {\r\n\t\t\t\t\tfound = true;\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (!found) {\r\n\t\t\tthis.authors.add(author);\r\n\r\n\t\t}\r\n\t}", "@Override\r\n\tpublic ArrayList<String> allMovies()\r\n\t{\r\n\t\tArrayList<String> sortedMovieTitles = new ArrayList<String>();\r\n\t\t\r\n\t\tsortedMovieTitles = movieTitles;\r\n\t\t\r\n\t\tCollections.sort(movieTitles);\r\n\t\t\r\n\t\treturn sortedMovieTitles;\r\n\t}", "public void prepareTitle()\n {\n DuelTitle title = new DuelTitle();\n addObject(title, 539, 186);\n }", "public List<Book> getByAuthor(String name );", "public ArrayList<Book> getBookList()\r\n {\r\n ArrayList<Book> bookCopy = new ArrayList<Book>();\r\n //Add code here to copy the bookList ArrayList elements into the local variable bookCopy and return bookCopy\r\n //Hint: You will use the 2-arg Book constructor and the getters or you can add a copy constructor to the Book\r\n //Class\r\n for(Book book: bookList){\r\n Book bk = new Book(book.getTitle(), book.getPrice());\r\n bookCopy.add(bk);\r\n }\r\n return bookCopy;\r\n }", "public void addBookQuantity(String title, int quantity) {\n // Search for the book...if found adjust the quantity, \t\n // otherwise, inform the user that the book is not available \n String t = title;\n int q = quantity;\n for (int h = 0; h < books.length; h++) {\n if (title.equals(books[h].getTitle())) {\n books[h].addQuantity(q);\n } else {\n System.out.println(\"Sorry book was not found\");\n }\n }\n }", "private void addTitleToChosenClassList(String classTitle) {\n if (!mChosenClassesList.contains(classTitle)) {\n mChosenClassesList.add(classTitle);\n String classList = TextUtils.join(\", \", mChosenClassesList);\n mStudentClassesTextView.setVisibility(View.VISIBLE);\n mStudentClassesTextView.setText(classList);\n }\n }", "public void setBookName(java.lang.String value);", "@Test\n\tpublic void testGetBooksSortedByAuthor() {\n\t\tSystem.out.println(\"Sorting books by author name...\");\n\t\tList<Book> result = store.getBooksSortedByAuthor();\n\t\tSystem.out.println(result);\n\t}", "public String getTitle()\n {\n return bookTitle;\n }", "public void addMultipleBook() {\n Set set = new TreeSet();\n System.out.println(\" yours choice how many addressbook you want to create it:--\");\n int number = scanner.nextInt();\n\n for (int index = 1; index <= number; index++) {\n System.out.println(\"give name to your dictionary:--\");\n String name = scanner.next();\n set.add(name);\n }\n System.out.println(set);\n }", "public void addAlbumTitle(java.lang.String value) {\r\n\t\tBase.add(this.model, this.getResource(), ALBUMTITLE, value);\r\n\t}", "private void displayByTitle() {\n\t\tString titleHolder; // declares titleHolder\n\t\t\n\t\tSystem.out.println(\"Please enter title of the book you would like displayed:\");\n\t\ttitleHolder = scan.next();\n\t\tscan.nextLine();\n\t\tSystem.out.println(inventoryObject.displayByTitle(titleHolder));\n\t\tgetUserInfo();\n\t}", "public static ArrayList<Book> search(String title, ArrayList<String> authors, HashMap<Book, Integer> purchasedBooks)\n {\n ArrayList<Book> tempBookBuffer = search(title, purchasedBooks);\n ArrayList<Book> searchedBooks = new ArrayList<>();\n\n for(Book b: tempBookBuffer)\n if(containsAllAuthors(authors, b))\n searchedBooks.add(b);\n\n return searchedBooks;\n }", "public ArrayList<Book> getLibraryBooks() {\n return this.libraryBooks;\n }", "static void createAuthorsFile () throws IOException {\n\t\tBufferedReader dataFile = new BufferedReader(new FileReader(DATAFILE));\n\t\tString inputLine;\n\t\t\n\t\tPrintWriter isbnLabeledDataFile = new PrintWriter(new FileWriter(ISBNLABELLEDDATAFILE));\n\t\t\n\t\tSet<String> books = new HashSet<String>();\n\t\twhile ((inputLine = dataFile.readLine()) != null) {\n\t\t\tif (inputLine.indexOf('\\t') == -1) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tString[] fields = inputLine.split(\"\\t\");\n\t\t\tif (fields.length != 4) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tfinal String bookId = fields[1];\n\t\t\tif (books.contains(bookId)) {\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\tbooks.add(bookId);\n\t\t\t\tString authorString = getAuthorString(bookId);\n\t\t\t\tisbnLabeledDataFile.println(bookId + \"\\t\" + authorString);\n\t\t\t\tout.println(bookId + \"\\t\" + authorString);\n\t\t\t}\n\t\t}\n\t\tdataFile.close();\n\t\tisbnLabeledDataFile.close();\n\t}", "public boolean insertBook(Book book) {\r\n books.add(book);\r\n return true;\r\n }", "public void add(String t, String author){\r\n\t \r\n\t items.add(new Book(t, author));\r\n\t \r\n }", "void addAll(List<News> data) {\n\t\t// Traverse the data list to add news item to the adapter's data set\n\t\tfor (int i = 0; i < data.size(); i++) {\n\t\t\t// Get the book at current index\n\t\t\tNews newsStory = data.get(i);\n\t\t\t// Add the book to the data set\n\t\t\tmNewsList.add(newsStory);\n\n\t\t\t// Notify the adapter of the change in the data set\n\t\t\t// so that it repopulates the view with the updated data set\n\t\t\tnotifyDataSetChanged();\n\t\t}\n\t}", "public String getAllPapers(){\r\n\t\tString allPapers = \"\";\r\n\t\tif(papers != null){\r\n\t\t\tfor(int index = 0; index < papers.size(); ++index){\r\n\t\t\t\tallPapers += papers.get(index).getTitleOfPaper() + \"\\n\\t\";\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tallPapers = \"No papers have been added.\";\r\n\t\t}\r\n\t\t\r\n\t\treturn allPapers;\r\n\t}", "boolean contains(Book title){\n return false;\n }", "public void prepareBooks(ArrayList<Book> list) {\n\n bookList.clear();\n for(Book book : list) {\n bookList.add(book);\n }\n adapter.notifyDataSetChanged();\n }", "public List<BookData> searchBookbyAuthor (String author) throws SQLException{\n\t\tList<BookData> list = new ArrayList<>();\n\t\t\n\t\tPreparedStatement myStmt = null;\n\t\tResultSet myRs = null;\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\tmyStmt = myConn.prepareStatement(\"select title, author_name, publisher_name, book_id from books natural join book_authors where author_name = ?\");\n\t\t\tmyStmt.setString(1, author);\n\t\t\tmyRs = myStmt.executeQuery();\n\t\t\t\n\t\t\twhile (myRs.next()) {\n\t\t\t\tBookData tempbook = convertRowToBook(myRs);\n\t\t\t\tlist.add(tempbook);\n\t\t\t}\n\t\t\t\n\t\t\treturn list;\n\t\t}\n\t\tfinally {\n\t\t\tmyRs.close();\n\t\t\tmyStmt.close();\n\t\t\n\t\t}\n\t\t\n\t}", "public List<Books> findBooksByPublisher(String publisher) {\r\n return bookController.findBooksByPublisher(publisher);\r\n }", "public static ArrayList<Book> search(String title, HashMap<Book, Integer> purchasedBooks)\n {\n ArrayList<Book> searchedBooks = new ArrayList<>();\n\n for(Book b: purchasedBooks.keySet())\n if(b.getBookName().equals(title) || title.equals(\"*\"))\n searchedBooks.add(b);\n\n return searchedBooks;\n }", "@Override\n public void onResume() {\n super.onResume();\n if(book != null) {\n //Also send the first author\n String author = \"\";\n if(!book.getVolumeInfo().getAuthors().isEmpty()) {\n author = book.getVolumeInfo().getAuthors().get(0);\n }\n getPresenter().searchBooks(book.getVolumeInfo().getTitle(), author);\n }\n }", "void addBefore(String title, Song song) {\n Song selectedSong = lookupTitle(title);\n if (selectedSong != null) {\n int index = songlist.indexOf(selectedSong);\n if (index != -1)\n songlist.add(index, song);\n else\n songlist.add(song);\n }\n else\n songlist.add(song);\n }", "public void addBusinessToFavorites(Business business) {\n for(Business b : favorites) {\n if(b.getTitle().equals(business.getTitle()))\n return;\n }\n\n //add business to favorites list.\n favorites.add(business);\n }", "private List<? extends Publication> sortPublicationsAfterTitle(Collection<? extends Publication> publicationList) {\n\n return publicationList.stream().sorted(Comparator.comparing(Publication::getTitle)).collect(Collectors.toList());\n }", "public List<BookData> getAllBooks() throws Exception{\n\t\tList<BookData> list = new ArrayList<>();\n\t\tStatement myStmt = null;\n\t\tResultSet myRs = null;\n\t\t\n\t\ttry {\n\t\t\tmyStmt = myConn.createStatement();\n\t\t\tmyRs = myStmt.executeQuery(\"select title, author_name, publisher_name, book_id from books natural join book_authors\");\n\t\t\t\n\t\t\twhile (myRs.next()) {\n\t\t\t\tBookData tempbook = convertRowToBook(myRs);\n\t\t\t\tlist.add(tempbook);\n\t\t\t}\n\t\t\t\n\t\t\treturn list;\n\t\t}\n\t\tfinally {\n\t\t\tmyRs.close();\n\t\t\tmyStmt.close();\n\t\t\t\n\t\t}\n\t\t\n\t}", "private static void loadBooks() {\n\tbookmarks[2][0]=BookmarkManager.getInstance().createBook(4000,\"Walden\",\"\",1854,\"Wilder Publications\",new String[] {\"Henry David Thoreau\"},\"Philosophy\",4.3);\n\tbookmarks[2][1]=BookmarkManager.getInstance().createBook(4001,\"Self-Reliance and Other Essays\",\"\",1900,\"Dover Publications\",new String[] {\"Henry David Thoreau\"},\"Philosophy\",4.3);\n\tbookmarks[2][2]=BookmarkManager.getInstance().createBook(4002,\"Light From Many Lamps\",\"\",1960,\"Wilder Publications\",new String[] {\"Henry David Thoreau\"},\"Philosophy\",4.3);\n\tbookmarks[2][3]=BookmarkManager.getInstance().createBook(4003,\"Head First Design Patterns\",\"\",1944,\"Wilder Publications\",new String[] {\"Henry David Thoreau\"},\"Philosophy\",4.3);\n\tbookmarks[2][4]=BookmarkManager.getInstance().createBook(4004,\"Effective Java Programming Language Guide\",\"\",1990,\"Wilder Publications\",new String[] {\"Eric Freeman\",\"Bert Bates\",\"Kathy Sierra\",\"Elisabeth Robson\"},\"Philosophy\",4.3);\n}", "public List applyAuthorRule () {\n\t\treturn authors;\n\t}", "public List<String > getBooks(){\n List<String> titles = new ArrayList<>();\n\n String strSQL = \"SELECT B._id, B.Title FROM TBooks B WHERE NOT B._id IN (Select TLoaned.TitleID \" +\n \" FROM TLoaned WHERE TLoaned.ReturnDate IS NULL);\";\n SQLiteDatabase db = this.getReadableDatabase();\n Cursor c = db.rawQuery(strSQL, null);\n try {\n if (c.moveToFirst()) {\n do {\n titles.add(c.getString(0) + \". \" + c.getString(1));\n } while (c.moveToNext());\n }\n }\n finally {\n c.close();\n db.close();\n }\n return titles;\n }", "public void addBook(String string, int i) {\n\t\tBook b= new Book(string,i);\r\n\t\tarlist.add(b);\r\n\t\t\r\n\t}" ]
[ "0.6839395", "0.65243375", "0.62428766", "0.61008596", "0.59302396", "0.5900285", "0.5812862", "0.576617", "0.5626082", "0.55758667", "0.5563584", "0.5522525", "0.55121565", "0.55062187", "0.5480458", "0.5461777", "0.5446985", "0.54468054", "0.5440508", "0.5433022", "0.5424053", "0.54239523", "0.5409192", "0.5404132", "0.5372243", "0.5320287", "0.5307342", "0.529405", "0.5291356", "0.5286143", "0.52798235", "0.5248043", "0.5226538", "0.52241826", "0.5182372", "0.5178127", "0.5153178", "0.5151899", "0.5148258", "0.5144871", "0.51239353", "0.51125693", "0.5106523", "0.5088258", "0.5087403", "0.5080274", "0.5066725", "0.5060299", "0.50564516", "0.5055655", "0.50415003", "0.5039332", "0.5028196", "0.50271213", "0.5007864", "0.5007285", "0.5005953", "0.5004337", "0.49983165", "0.49878195", "0.49627846", "0.49608195", "0.49587163", "0.49476802", "0.493001", "0.49258816", "0.49243551", "0.49207842", "0.49206713", "0.49124786", "0.49094716", "0.49079403", "0.49056077", "0.49043885", "0.4904316", "0.4897911", "0.48911893", "0.48757595", "0.48733073", "0.48725212", "0.48722246", "0.48572758", "0.48546013", "0.48533165", "0.48481384", "0.48469043", "0.4831599", "0.4828862", "0.48270324", "0.4826982", "0.4820241", "0.48152572", "0.4808436", "0.48063442", "0.4805849", "0.48013332", "0.480077", "0.4800467", "0.47992572", "0.4797405" ]
0.71011144
0
/This method asks the user to enter the Id of the book to be borrowed, and checks if the book has already been borrowed. If the book has not already been borrowed then the user enters the details of the student borrowing the book; if the student does not currently have another book already borrowed, then the student is allowed to checkout the book.
private static void checkoutBook(){ System.out.println("===Book Checkout==="); Scanner string_input = new Scanner(System.in); //gets String values entered by the user Scanner integer_input = new Scanner(System.in); //gets integer values entered by the user boolean exit = false; //indicates whether method should be exited System.out.println("Enter Id of book to be checked out: "); int bookId = getIntegerInput();//ensures user input is an integer value //if bookId entered does not exist then continually ask user to enter bookId until a bookId that exists is entered while(!ALL_BOOKS.containsKey(bookId)){ System.out.println("Book Id entered does not exist! Enter BookId: "); bookId = integer_input.nextInt(); } /*Print statements to notify book has been found, the book's details, and its availabilty*/ System.out.println("Book Found!"); System.out.println(ALL_BOOKS.get(bookId).getBookTitle() + " | Written By: " + ALL_BOOKS.get(bookId).getAuthor().toString() + " | Published By: " + ALL_BOOKS.get(bookId).getPublisher()); String availabilty = !ALL_BOOKS.get(bookId).getBorrowed() ? "Available" : "Currently Borrowed"; //stores whether book is currently borrowed or not. System.out.println(availabilty); if(!ALL_BOOKS.get(bookId).getBorrowed()){//if book is available to be borrowed then change it's status and set the date it should be returned (Next Month From Date of Borrowing) System.out.println("Enter Id of student borrowing the book: "); int studentId = getIntegerInput();//ensures user input is an integer value if(!studentExists(studentId)){ //if student Id entered does not exists System.out.println("Student Id entered does not exist. Do you want to add a new student? (Y --> Yes/ Any other button --> No): "); String user_option = string_input.next(); if(user_option.equalsIgnoreCase("Y")) studentId = addNewStudent(); //adds a new student to the ALL_STUDENTS ArrayList and returns this new student's Id else exit = true; //exit to main menu } /*Students cannot borrow more than one book at a time. Thus if the student's bookIdBorrowed is greater than 0 then * it implies the student currently has a book borrowed.*/ else if(ALL_STUDENTS.get(studentId).getBookIdBorrowed() > 0){ StudentDetails student = ALL_STUDENTS.get(studentId); //stores student trying to checkout the book BookDetails bookBorrowed = ALL_BOOKS.get(student.getBookIdBorrowed()); //stores book currently borrowed by the student System.out.println("Sorry! Only one book can be borrowed at a time."); System.out.println(student.getFullName() + " currently has borrowed " + bookBorrowed.getBookTitle()); System.out.println("Please come back later when " + bookBorrowed.getBookTitle() + " is returned"); exit = true; //exit to main menu } /*If the method has not been exited at this point then it implies the student can be borrow the book.*/ if(!exit){ BookDetails book = ALL_BOOKS.get(bookId); Calendar return_date = new GregorianCalendar(); //get the current date return_date.add(Calendar.MONTH, 1); //set the return date to the next month from the current date book.setBorrowed(true); //indicates book has been borrowed book.setDateToReturn(return_date); //set book's return date ALL_STUDENTS.get(studentId).setBookIdBorrowed(book.getBookId()); //indicate that the student has borrowed this book book.setStudentBorrowed(studentId); //indicates book has been borrowed by the student with the given ID System.out.println("You Are All Set!"); System.out.println(book.getBookId() + " | " + book.getBookTitle() + " is due " + SDF.format(return_date.getTime())); } } else System.out.println("Sorry check back later to borrow this book"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void returnBook(){\n\t\tSystem.out.println(\"===Book Return===\");\n\t\tScanner integer_input = new Scanner(System.in);\n\t\t\n\t\tSystem.out.println(\"Enter Id of book being returned: \");\n\t\tint bookId = getIntegerInput();//ensures user input is an integer value\n\t\t//if bookId entered does not exist then continually ask user to enter bookId until a bookId that exists is entered\n\t\t\t\twhile(!ALL_BOOKS.containsKey(bookId)){\n\t\t\t\t\tSystem.out.println(\"Book Id entered does not exist! Enter BookId: \");\n\t\t\t\t\tbookId = integer_input.nextInt();\n\t\t\t\t}\n\t\t\n\t\t/*Print statements to notify book has been found, the book's details, and its availabilty*/\n\t\tSystem.out.println(\"Book Found!\");\n\t\tSystem.out.println(ALL_BOOKS.get(bookId).getBookTitle() + \" | Written By: \" + ALL_BOOKS.get(bookId).getAuthor().toString() + \"| Published By: \" + ALL_BOOKS.get(bookId).getPublisher());\n\t\tString availabilty = !ALL_BOOKS.get(bookId).getBorrowed() ? \"Available\" : \"Currently Borrowed\"; //stores whether book is currently borrowed or not.\n\t\tSystem.out.println(availabilty);\n\t\t\n\t\t\n\t\t\n\t\tif(ALL_BOOKS.get(bookId).getBorrowed()){//if book was borrowed then validate student doing the book return, change the book's status, and calculate how much student should be fined \t\n\t\t\tBookDetails book = ALL_BOOKS.get(bookId);\n\t\t\t\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println(\"Enter Id of student returning the book: \");\n\t\t\tint studentId = getIntegerInput();//ensures user input is an integer value\n\t\t\t\n\t\t\t/*Verify student Id entered matches the Id of the student who borrowed the book*/\n\t\t\tif(studentId == book.getStudentBorrowed()){\n\t\t\t\tFineResult fine = calculateFine(book.getDateToReturn()); //calculate how many days overdue the book was returned and how much student should be fined.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//If book was returned on time then this method will return 0 for both the number of days overdue and the student's fine.\n\t\t\t\tbook.setBorrowed(false); //indicates book has been returned and is now available to be borrowed by someone else\n\t\t\t\tbook.resetDateToReturn();; //reset book's return date\n\t\t\t\tbook.setStudentBorrowed(0); //reset to default value, indicating no student is current borrowing this book\n\t\t\t\t\n\t\t\t\t/*Display Statements to user indicating book was successfully returned, and how much student was fined*/\n\t\t\t\tSystem.out.println(\"You Are All Set!\");\n\t\t\t\tSystem.out.println(\"Book Id: \" + book.getBookId() + \" | \" + book.getBookTitle() + \" has been returned\");\n\t\t\t\tSystem.out.println(ALL_STUDENTS.get(studentId).getFullName() + \" returned the book \" + fine.days_overdue + \" days overdue\" + \" | Fine Amount Charged: \" + fine.days_overdue + \" * \" + FINE_RATE + \" = GHc\" + fine.fine);\n\t\t\t\t\n\t\t\t\tALL_STUDENTS.get(studentId).setBookIdBorrowed(0); //reset to default value, indicating no book is currently borrowed by this student\n\t\t\t\tALL_STUDENTS.get(studentId).addFine(fine.fine); //add the respective fine to this students fine total. If student accrued no fine on this return, fine value added will be 0.\n\t\t\t\tSystem.out.println(\"Total Fine on account: GHc\" + ALL_STUDENTS.get(studentId).getTotalFine());\n\t\t\t\t/*If Student's total fine is greater than 0 then add student to the FINED_STUDENTS Hashtable*/\n\t\t\t\taddFinedStudentsToTable(ALL_STUDENTS.get(studentId));\n\t\t\t}\n\t\t\telse{\n\t\t\t\tSystem.out.println(\"ERROR Verifying Student Id: Only Student who borrowed the book can return this book\");\n\t\t\t}\n\t\t}\n\t\telse\n\t\t\tSystem.out.println(\"ERROR: Can't return book that was not borrowed!\");\n\t}", "boolean borrowBook(int bookId, int patronId) {\n\t\t\n\t\t// checks if the book and patron id are not valid or the book is not available \n\t\tif (!this.isBookIdValid(bookId) || !this.isPatronIdValid(patronId) ||\n\t\t\t\t!this.isBookAvailable(bookId)) {\n\t\t\treturn false; \n\t\t}\n\t\t\n\t\t// checks if the patron took out too many books or wont like that book \n\t\tif (this.patronBookCount[patronId] > this.maxBorrowedBooks ||\n\t\t!this.patronlist[patronId].willEnjoyBook(this.bookShelf[bookId])) {\n\t\t\treturn false; \n\t\t}\n\t\t\n\t\t// sets that book to taken \n\t\tthis.bookShelf[bookId].setBorrowerId(patronId);\n\t\t\n\t\t// adds one to the patrons counter\n\t\tthis.patronBookCount[patronId]++; \n\t\t\n\t\t// it was a successful borrow\n\t\treturn true; \n\t}", "private static void addNewBook(){\n\t\tSystem.out.println(\"===Add New Book===\");\n\t\tBookDetails new_book = new BookDetails();\n\t\tScanner string_input = new Scanner(System.in); //takes string input from user\n\t\tScanner integer_input = new Scanner(System.in); //takes integer input from user\n\t\t\n\t\tSystem.out.println(\"Enter BookId: \");\n\t\tint bookId = getIntegerInput(); //ensures user input is an integer value\n\t\t/*if bookId entered already exists then continually ask user to enter bookId until a bookId that does not exist is entered. \n\t\t * Do the same if bookId is less than 1 because book's in the library will not have Id's less than 1.*/\n\t\twhile(ALL_BOOKS.containsKey(bookId) || bookId < 1){\n\t\t\tSystem.out.println(\"Book Id entered already exists! Enter BookId: \");\n\t\t\tbookId = integer_input.nextInt();\n\t\t}\n\t\tnew_book.setBookId(bookId);\n\t\t\n\t\tSystem.out.println(\"Enter Book Title: \");\n\t\tString bookTitle = string_input.nextLine();\n\t\tnew_book.setBookTitle(bookTitle);\n\t\t\n\t\tString author_firstname;\n\t\tdo{\n\t\t\tSystem.out.println(\"Enter Author's First Name: \");\n\t\t\tauthor_firstname = string_input.next();\n\t\t}while(!new_book.setAuthorFirstName(author_firstname)); //loop until name input is valid (contains only letters) \n\t\t\n\t\tString author_middlename;\n\t\tdo{\n\t\t\tSystem.out.println(\"Enter Author's Middle Name (Type 'null' if author has no middle name): \");\n\t\t\tauthor_middlename = string_input.next();\n\t\t}while(!new_book.setAuthorMiddleName(author_middlename)); //loop until name input is valid (contains only letters) \n\t\t\n\t\tString author_lastname;\n\t\tdo{\n\t\t\tSystem.out.println(\"Enter Author's Last Name: \");\n\t\t\tauthor_lastname = string_input.next();\n\t\t}while(!new_book.setAuthorLastName(author_lastname)); //loop until name input is valid (contains only letters) \n\t\t\n\t\tstring_input = new Scanner(System.in);\n\t\tSystem.out.println(\"Enter Book's Publisher: \");\n\t\tString publisher = string_input.nextLine();\n\t\tnew_book.setPublisher(publisher);\n\t\t\n\t\t\n\t\t/*Set book's genre. Valid values for a book's Genre are Biology, Mathematics, Chemistry, Physics,\n\t\t * Science_Fiction, Fantasy, Action, Drama, Romance, Horror, History, Autobiography, Biography.*/\n\t\tString genre;\n\t\tdo{\n\t\t\tSystem.out.println(\"Enter Book's Genre: \");\n\t\t\tgenre = string_input.next();\n\t\t}while(!new_book.setGenre(genre)); //loop until valid genre value is entered\n\t\t\n\t\t/*Set book's condition. Valid values for a book's Condition are New, Good, Worn, Damaged.*/\n\t\tString condition;\n\t\tdo{\n\t\t\tSystem.out.println(\"Enter Book's Condition: \");\n\t\t\tcondition = string_input.next();\n\t\t}while(!new_book.setCondition(condition)); //loop until valid value for condition is entered\n\t\t\n\t\tALL_BOOKS.put(new_book.getBookId(), new_book);\n\t\taddToPublisherTable(new_book.getPublisher(), new_book.getBookTitle()); //add book's title to the ALL_PUBLISHERS Hashtable\n\t\taddToGenreTable(new_book, new_book.getBookTitle()); //add book's title to the ALL_GENRES ArrayList\n\t\taddToAuthorTable(new_book.getAuthor().toString(), new_book.getBookTitle()); //add book's title to the ALL_AUTHORS Hashtable\n\t\tSystem.out.println(\"Book Successfully Added!\");\n\t}", "private void butCheckActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_butCheckActionPerformed\n\n Borrower bor = createBorrower();\n String date = tfDate.getText();\n\n if (driver.dateFormatValid(date)) {\n //valid date format, perform check out/in\n if (radBorrow.isSelected()) {\n //check out\n\n Book book = createBook();//create book\n\n if (!book.isOnLoan()) {\n //book is not on loan, can be loaned out\n\n //perform loan, inform user of success\n if (bor.borrow(book, date)) {\n driver.infoMessageNormal(\"\\\"\" + book.getTitle() + \"\\\" loaned successfully to \" + bor.getName());\n\n } else {\n driver.errorMessageNormal(\"Book could not be loaned\");\n }\n\n } else {\n //is on loan\n driver.errorMessageNormal(\"\\\"\" + book.getTitle() + \"\\\" is already on loan.\");\n\n }\n\n } else if (radReturn.isSelected()) {\n //check in / returning\n\n Book book = createBook();\n\n if (book.isOnLoan()) {\n //book is on loan, and can be returned\n\n if (bor.returnBook(book, date)) {\n driver.infoMessageNormal(\"\\\"\" + book.getTitle() + \"\\\" has been returned.\");\n\n } else {\n driver.infoMessageNormal(\"The book could not be returned.\");\n }\n\n } else {\n //not on loan\n driver.infoMessageNormal(\"\\\"\" + book.getTitle() + \"\\\" is not on loan.\");\n }\n\n } else {\n driver.errorMessageNormal(\"Please select whether the book is being checked in or being returned.\");\n }\n\n } else {\n //invalid format\n driver.errorMessageNormal(\"Please ensure the date is in the format DD/MM/YYY\");\n }\n\n\n }", "@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\tString message=\"\";\n\t\tboolean isError=false;\n\t\tString userId=jtfUser.getText().trim();\n Matcher m=Pattern.compile(\"(\\\\d{\"+userId.length()+\"})\").matcher(userId);\n if(m.matches()){\n// System.out.println(\"输入的是数字 \"+m.group(1));\n List list=new Dao().getUserBorrowInfo(userId);\n if(list.size()==0){\n \tmessage=\"此用户不存在!\"+\"\\n\";\n \tJOptionPane.showMessageDialog(null, message, \"提示\", JOptionPane.WARNING_MESSAGE);\n \treturn;\n }else{\n \tbookNum=(Integer)list.get(1);\n \tbookTime=(Integer)list.get(2);\n \tmessage=\"用户名:\"+list.get(0)+\"\\n\";\n }\n } else {\n \tmessage=\"用户号含有字母:\"+userId+\"\\n\";\n \tJOptionPane.showMessageDialog(null, message, \"提示\", JOptionPane.WARNING_MESSAGE);\n return;\n }\n int borrowingNum=new Dao().getBorrowNum(userId);\n boolean isOverTime=new Dao().isOvertime(userId);\n if(isOverTime){\n \t//有超期的书\n \tmessage+=\"有超期的书,不能借阅!\";\n \tJOptionPane.showMessageDialog(null, message, \"提示\", JOptionPane.WARNING_MESSAGE);\n return;\n }\n\t\tString bookId=jtfBook.getText().trim();\n\t\tMatcher book=Pattern.compile(\"(\\\\d{\"+bookId.length()+\"})\").matcher(bookId);\n if(book.matches()){\n// System.out.println(\"输入的是数字 \"+book.group(1)); \n List list=new Dao().getbookBorrowInfo(Integer.parseInt(bookId));\n if(list.size()==0){\n \tJOptionPane.showMessageDialog(null, \"没有此书,您输入的书编号可能有误!\");\n \treturn;\n }\n message+=\"书名:\"+list.get(0)+\"\\n\";\n if((list.get(1).equals(\"借出\"))){\n \t//此书已经借出,输入的书号有误\n \tmessage+=\"此书已借出,您输入的书号有误吧!\\n\";\n \tJOptionPane.showMessageDialog(null, message, \"提示\", JOptionPane.WARNING_MESSAGE);\n return;\n }else if(list.get(1).equals(\"被预约\")){\n \tmessage+=\"此书被预约,还未到馆\";\n \tJOptionPane.showMessageDialog(null, message, \"提示\", JOptionPane.WARNING_MESSAGE);\n return;\n }else if(list.get(1).equals(\"预约到馆\")){\n \t//此书被预约,若不是此用户预约的,不能借\n \tint id=Integer.parseInt(bookId);\n \tif(!new Dao().isUserOrdered(userId, id)){\n \t\t//不是此用户预约的,不能借\n \t\tmessage+=\"此书已被预约,不能借\";\n \tJOptionPane.showMessageDialog(null, message, \"提示\", JOptionPane.WARNING_MESSAGE);\n return;\n \t}else{\n \t\t//此书是此用户预约的 ,可以借\n \t\tint response=JOptionPane.showConfirmDialog(null, message, \"图书借阅确认\", JOptionPane.YES_NO_OPTION);\n \t if(response==0){\n \t \t//按下yes按钮\n \t \tSystem.out.println(\"预约yes\");\n \t \tnew Dao().clearOrdered(userId, id);\n \t\tnew Dao().borrow(userId, id, bookTime);\n \t\treturn;\n \t }else{\n \t \tSystem.out.println(\"预约no\");\n \t \t//按下no按钮\n \t \treturn;\n \t }\n \t\t\n \t}\n }else if(borrowingNum>=bookNum){\n \t//已经借满,不能再借\n \tmessage+=\"已经借满不能再借!\";\n \tJOptionPane.showMessageDialog(null, message, \"提示\", JOptionPane.WARNING_MESSAGE);\n return;\n }\n }else{\n// System.out.println(\"输入的含有字母\" + bookId+\"\\n\");\n message+=\"书编号含有字母:\"+bookId;\n \tJOptionPane.showMessageDialog(null, message, \"提示\", JOptionPane.WARNING_MESSAGE);\n return;\n }\n //满足借阅的所有条件,且此书在馆(不是此用户预约的),可以借阅图书\n\t\tint response=JOptionPane.showConfirmDialog(null, message, \"图书借阅确认\", JOptionPane.YES_NO_OPTION);\n\t if(response==0){\n//\t \tSystem.out.println(\"按下了yes按钮\");\n\t \tnew Dao().borrow(userId, Integer.parseInt(bookId), bookTime);\n\t }else if(response==1){\n//\t \tSystem.out.println(\"按下了no按钮\");\n\t }\n\t}", "boolean isBookAvailable(int bookId) {\n\t\t\n\t\t// checks if the books id is valid\n\t\tif (!this.isBookIdValid(bookId)) {\n\t\t\treturn false; \n\t\t}\n\t\t\n\t\t// checks if the book is not taken \n\t\tif(this.bookShelf[bookId].currentBorrowerId == -1) {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// the book is taken \n\t\treturn false;\n\t}", "public void getBookScanned(int bookId) {\n\t\tif (!state.equals(ControlState.READY)) {\r\n\t\t\tthrow new RuntimeException(\"ReturnBookControl: cannot call bookScanned except in READY state\");\r\n\t\t}\t\r\n\t\tBook curBook = library.Book(bookId); //Changed instance lIbRaRy to library and changed variable name BOOK_ID to bookId and class name book to Book\r\n\t\t\r\n\t\tif (curBook == null) { //Changed instance CUR_book to curBook\r\n\t\t\tuserInterface.display(\"Invalid Book Id\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (!curBook.onLoan()) { //Changed method name to verb starting with lowercase and in camelBack\r\n\t\t\tuserInterface.display(\"Book has not been borrowed\");\r\n\t\t\treturn;\r\n\t\t}\t\t\r\n\t\tcurrentLoan = library.getLoanByBookId(bookId);\t//Changed method name to verb starting with lowercase and in camelBack\r\n\t\tdouble overDueFine = 0.0; //Changed variable name to a meaningful word\r\n\t\tif (currentLoan.isOverDue()) { //Changed method name to verb starting with lowercase and in camelBack\r\n\t\t\toverDueFine = library.calculateOverDueFine(currentLoan); //Changed method name to verb starting with lowercase and in camelBack\r\n\t\t}\r\n\t\tuserInterface.display(\"Inspecting\");\r\n\t\tuserInterface.display(CUR_book.toString());\r\n\t\tuserInterface.display(currentLoan.toString());\r\n\t\t\r\n\t\tif (currentLoan.overDue()) { //Changed method name to verb starting with lowercase and in camelBack\r\n\t\t\tuserInterface.display(String.format(\"\\nOverdue fine : $%.2f\", overDueFine));\r\n\t\t}\r\n\t\tuserInterface.setState(ReturnBookUI.UI_STATE.INSPECTING);\r\n\t\tstate = ControlState.INSPECTING;\t\t\r\n\t}", "void returnBook(int bookId) {\n\t\t\n\t\t// check if the book id is not valid \n\t\tif (!this.isBookIdValid(bookId)){\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// checks if that book was never taken out\n\t\tif (this.isBookAvailable(bookId))\n\t\t{\n\t\t\treturn; \n\t\t}\n\t\t\t\t\n\t\t// sets the counter on that patron as one less \n\t\tthis.patronBookCount[this.bookShelf[bookId].getCurrentBorrowerId()]--;\n\t\t\n\t\t// sets the current borrower to none\n\t\tthis.bookShelf[bookId].returnBook();\n\t}", "public synchronized void checkIn(int bookTaken, int id){\n \tint returnBook = bookTaken;\n \t\n \t//if else clause to return the correct book\n \tif(returnBook == 0){\n \t\tA.setAvailable(true);\n \t}\n \telse if(returnBook == 1){\n \t\tB.setAvailable(true);\n \t}\n \telse if(returnBook == 2){\n \t\tC.setAvailable(true);\n \t}\n \telse if(returnBook == 3){\n \t\tD.setAvailable(true);\n \t}\n \telse if(returnBook == 4){\n \t\tE.setAvailable(true);\n \t}\n \t\n \t\n \t//notify the waiting clients that a book as been returned\n \tnotifyAll();\n }", "public void issueBook() {\n\t\t JTextField callno = new JTextField();\r\n\t\t JTextField name = new JTextField();\r\n\t\t JTextField id = new JTextField(); \r\n\t\t JTextField contact = new JTextField(); \r\n\t\t Object[] issued = {\r\n\t\t\t\t \"Bookcallno:\",callno,\r\n\t\t\t\t \"Student ID:\",id,\r\n\t\t\t\t \"Name:\",name,\r\n\t\t\t\t \"Contact:\",contact\r\n\t\t\t\t\r\n\t\t };\r\n\t\t int option = JOptionPane.showConfirmDialog(null, issued, \"New issued book\", JOptionPane.OK_CANCEL_OPTION);\r\n\t\t if(option==JOptionPane.OK_OPTION) {\r\n\t\t\tint check = checkBook(callno.getText());\r\n\t\t\tif(check==-1) {\r\n\t\t\t\t JOptionPane.showMessageDialog(null, \"Wrong book call number\", null, JOptionPane.ERROR_MESSAGE);\r\n\t\t\t\t return;\r\n\t\t\t}\r\n\t\t\telse if(check == 0) {\r\n\t\t\t\t JOptionPane.showMessageDialog(null, \"Book is not available right now\", null, JOptionPane.ERROR_MESSAGE);\r\n\t\t\t\t return;\r\n\t\t\t}\r\n // add to the Book database\r\n\t\t try {\r\n\t\t\t \r\n\t\t String query = \"insert into Issued(bookcallno,studentId,studentName,studentContact,issued_date)\"\r\n\t\t\t\t +\" values(?,?,?,?,GETDATE())\";\r\n\t\t \r\n\t\t PreparedStatement s = SimpleLibraryMangement.connector.prepareStatement(query);\r\n\t\t s.setString(1, callno.getText());\r\n\t\t s.setInt(2, Integer.parseInt(id.getText()));\r\n\t\t s.setString(3, name.getText());\r\n\t\t s.setString(4, contact.getText());\r\n\t\t \r\n\t\t s.executeUpdate();\r\n\t\t updateIssuedBook(callno.getText());\r\n\t\t JOptionPane.showMessageDialog(null, \"Issue book successfully\", null, JOptionPane.INFORMATION_MESSAGE);\r\n\r\n\t\t } catch(Exception e) {\r\n\t\t\t JOptionPane.showMessageDialog(null, \"Issue book failed\", null, JOptionPane.ERROR_MESSAGE);\r\n\t\t\t e.printStackTrace();\r\n\t\t }\r\n\t\t } \r\n\t }", "public void borrowBook()\r\n {\r\n noOfBooks = noOfBooks + 1;\r\n System.out.println(\"Books on loan: \" + noOfBooks); \r\n }", "public boolean checkoutBooking() {\r\n\t\tScanner scan = new Scanner(System.in);\r\n\t\tboolean bookUpdateSuccess = false;\r\n\r\n\t\t/**\r\n\t\t*\tSet the endTime as now\r\n\t\t*/\r\n\t\t/**\r\n\t\t*\tGet the number of milliSeconds from the system time and set it to the java.sql.Date\r\n\t\t*\tobject to create a booking number and also to set the start time.\r\n\t\t*/\r\n\t\tlong dateTimeMillis = System.currentTimeMillis();\r\n\t\t/**\r\n\t\t*\tThis date is for generating String bookingNo using the date and time values\r\n\t\t*/\r\n\t\tjava.util.Date date = new java.util.Date(dateTimeMillis);\r\n\t\t/**\r\n\t\t*\tPass the current date in sql.Timestamp object.\r\n\t\t*/\r\n\t\tendTime = new java.sql.Timestamp(date.getTime());\r\n\r\n\t\t/**\r\n\t\t*\tCalculate the cost base on the time elapsed between the start time and end time\r\n\t\t*\tdurationMinutes = (difference b/w end and start time) / 1000 to convert millis to seconds / 60 to convert seconds to minutes\r\n\t\t*/\r\n\t\tlong start = startTime.getTime();\r\n\t\tlong end = endTime.getTime();\r\n\t\tlong durationMinutes = (end - start)/60000;\r\n\r\n\t\t/**\r\n\t\t*\tThe cost is set as Rs. 1.27 per minuteand hence will be calulated using durationMinutes\r\n\t\t* The cost will be calculated according to absolute minutes and no decimals will be considered there\r\n\t\t*/\r\n\t\tcost = durationMinutes * 1.27;\r\n\r\n\t\t/**\r\n\t\t*\tShow the cost and confirm to checkout.\r\n\t\t*/\r\n\t\tSystem.out.print(\"\\n\\tTotal cost calculated: \" + cost + \"\\n\\n\\t1. Confirm Checkout\\n\\t2. Cancel\\n\\t\\t>> \");\r\n\t\tint opt = scan.nextInt();\r\n\r\n\t\tswitch (opt) {\r\n\t\t\tcase 1: {\t//confirm checkout\r\n\t\t\t\t//do nothing and move ahead towards the checkout procedure\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tcase 2: {\t//Cancel\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tdefault: {\r\n\t\t\t\tSystem.out.println(\"Invalid Option\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t/**\r\n\t\t*\tSince connecting to database (DbConnection()) and updating data (executeUpdateParklot())\r\n\t\t* throw SQLException and throwing an exception from multiple levels again and again is not\r\n\t\t*\ta good way, so its is needed to catch the exception here.\r\n\t\t*/\r\n\t\ttry {\r\n\t\t\t/**\r\n\t\t\t*\tCreate a connection to the database\r\n\t\t\t*/\r\n\t\t\tDbConnection checkoutBookingConn = new DbConnection();\r\n\r\n\r\n\t\t\t/**\r\n\t\t\t*\tupdate the data in table\r\n\t\t\t*/\r\n\t\t\tbookUpdateSuccess = checkoutBookingConn.executeUpdateBooking(endTime, cost, bookingNo);\r\n\r\n\r\n\t\t} catch(SQLException SqlExcep) {\r\n\t\t\tSystem.out.println(\"No booking with the given booking number found.\");\r\n\t\t\t//SqlExcep.printStackTrace();\r\n\t\t} catch (ClassNotFoundException cnfExecp) {\r\n\t\t\tcnfExecp.printStackTrace();\r\n\t\t} finally {\r\n\t\t\t/*try {\r\n\t\t\t\t//validateConn.closeDbConnection();\r\n\t\t\t} catch(SQLException SqlExcep) {\r\n\t\t\t\tSqlExcep.printStackTrace();\r\n\t\t\t}*/\r\n\t\t}\r\n\t\treturn bookUpdateSuccess;\r\n\t}", "public void checkOutBook(String isbn) {\n\n\t\tif (bookExists(isbn)) {\n\t\t\tfor (Book theBook : bookList) {\n\t\t\t\tString bookCode = theBook.getIsbn();\n\t\t\t\tif (bookCode.equals(isbn)) {\n\t\t\t\t\tif (bookType(bookCode) != 3) {\n\t\t\t\t\t\tif (theBook.getAvailable() >= 1) {\n\t\t\t\t\t\t\ttheBook.setAvailable(theBook.getAvailable() - 1);\n\t\t\t\t\t\t\tSystem.out.println(\"Book checked out successfully. Enjoy your reading!\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tSystem.out.println(\n\t\t\t\t\t\t\t\t\t\"Sorry, there are no more copies of this book available to check out. Please try another book.\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out.println(\"Sorry, you can't check out periodicals.\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tSystem.out.println(\"That ISBN does not exist in our system. Please enter a valid ISBN.\");\n\t\t}\n\n\t}", "public List<BorrowBook> borrowedBook(int uId) {\n\t\treturn null;\r\n\t}", "public boolean canBorrowBook(User user) {\r\n \t\tif (book == null) {\r\n \t\t\treturn false;\r\n \t\t}\r\n \r\n \t\t// Zkontroluje, jestli náhodou nemám půjčený exemplář\r\n \t\tList<Exemplar> exemplars = exemplarMgr.findByBook(book);\r\n \t\tif (!exemplars.isEmpty()) {\r\n \t\t\tfor (Exemplar e : exemplars) {\r\n \t\t\t\tSystem.out.println(e);\r\n \t\t\t\t// book is already borrowed or borrowed by user\r\n \t\t\t\tif (e.getIsBorrowed() || e.isBorrowedByUser(user)) {\r\n \t\t\t\t\treturn false;\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \r\n \t\tList<Booking> booking = bookingMgr.find(book);\r\n \t\t// no booking record\r\n \t\tif (booking.isEmpty()) {\r\n \t\t\treturn true;\r\n \t\t}\r\n \r\n \t\t// can borrow only if is first in list\r\n \t\tif (booking.get(0).getUser().getIduser() == user.getIduser()) {\r\n \t\t\treturn true;\r\n \t\t}\r\n \r\n \t\treturn false;\r\n \t}", "private void borrowBookGenre() throws IOException\n {\n librarian();\n int flag = 0;\n boolean repeat = false;\n char iRepeat='a';\n int choice = 13;//int choice is set as 13 because if somehow an integer is not entered properly, it will repeat due to the do while loop.\n int selectedCode = 0;\n do\n {System.out.println(\"\\fWelcome. Here, you can borrow a book based on its genre.\");\n System.out.println(\"No of genres: \"+genre.length);\n for (int i = 0; i<genre.length; i++)\n {\n System.out.println((i+1)+\": \"+genre[i]); //Displays Genres\n }\n System.out.println(\"\");\n System.out.println(\"Enter your choice in an integer form.\");\n\n while(flag == 0)\n {\n flag = 1;\n try\n {\n do\n {\n choice = Integer.parseInt(br.readLine());\n }while(choice>=12 || choice == 0);\n }\n catch(Exception e)\n {\n System.out.println(\"Error: \"+e.getMessage());\n System.out.println(\"Please enter the number as an integer from 1 to 11.\");\n flag = 0;\n\n }\n }\n flag = 0;\n switch (choice)\n {\n case 1: displayBookChoice(0);\n break;\n case 2: displayBookChoice(1);\n break;\n case 3: displayBookChoice(2);\n break;\n case 4: displayBookChoice(3);\n break;\n case 5: displayBookChoice(4);\n break;\n case 6: displayBookChoice(5);\n break;\n case 7: displayBookChoice(6);\n break;\n case 8: displayBookChoice(7);\n break;\n case 9: displayBookChoice(8);\n break;\n case 10: displayBookChoice(9);\n break;\n case 11: displayBookChoice(10);\n break;\n default: System.out.println(\"Error: You inputed a wrong number.\");\n }\n\n System.out.println(\"Enter the code of the book you'd like to borrow.\");\n\n while(flag == 0)\n {\n flag = 1;\n try\n {\n do\n {\n selectedCode = Integer.parseInt(br.readLine());\n }while(selectedCode > linecount || selectedCode == 0);\n }\n catch(Exception e)\n {\n System.out.println(\"Error: \"+e.getMessage());\n System.out.println(\"Please enter the valid integer code on the left.\");\n flag = 0;\n\n }\n }\n flag = 0;\n System.out.println(\"\\fYou have selected \"+book[selectedCode-1].name.trim()+ \" by \"+book[selectedCode-1].author.trim());\n System.out.println(\"Y or y: If this is the book you want.\");\n System.out.println(\"N or n: If this is NOT the book you wanted.\");\n while(flag == 0)\n {\n flag = 1;\n try\n {\n\n do\n { \n iRepeat = (char)br.readLine().charAt(0);\n //System.out.println(\"You entered: \"+iRepeat);\n }while(iRepeat != 'y' && iRepeat != 'n' && iRepeat != 'N' && iRepeat != 'Y' );\n }\n catch(Exception e)\n {\n System.out.println(\"Error: \"+e.getMessage());\n System.out.println(\"Please enter either y or n.\");\n flag = 0;\n\n }\n }\n flag = 0;\n if (iRepeat == 'n' || iRepeat == 'N')\n {\n System.out.println(\"Okay. Press Enter to go back.\");\n br.readLine();\n repeat = true;\n }\n else\n repeat = false;\n }while(repeat == true);\n System.out.println(\"\");\n System.out.println(\"1: YES I am a member, and I possess a Library Card.\");\n System.out.println(\"2: NO I do not possess a Library Card.\");\n while(flag == 0)\n {\n flag = 1;\n try\n {\n do\n {\n choice = Integer.parseInt(br.readLine());\n }while(choice<1 || choice>2);\n }\n catch(Exception e)\n {\n System.out.println(\"Error: \"+e.getMessage());\n System.out.println(\"Please enter your choice, 1 or 2.\");\n flag = 0;\n\n }\n }\n flag = 0;\n\n if (choice == 2)\n {\n System.out.println(\"\\fYou will now enter the Library Card Creation Area. Press Enter to continue.\");\n br.readLine();\n createCard();\n }\n\n if (choice == 1)\n {\n System.out.println(\"Enter the name on your library card.\");\n String n = br.readLine();\n\n if(Checkfile.fileExist(n) == true) //calling function from class Checkfile to check whether the file with the name inputed exists.\n {\n System.out.println(\"Yes, you appear to have a Library Card!\");\n if(selectedCode <= linecount)\n {\n\n String d = book[selectedCode-1].name;\n bookPrinter(n,d);\n\n System.out.println(\"Here is your book! You borrowed \"+book[selectedCode-1].name.trim()+\".\");\n\n Art.display6();\n System.out.println(\"\");\n }\n }\n else\n {\n System.out.println(\"The name you mentioned doesn't seem to exist in our registry.\");\n System.out.println(\"You will now be guided to the main menu\");\n br.readLine();\n menu();\n }\n }\n System.out.println(\"You will now return to the main menu. \\nPRESS ENTER.\");\n br.readLine();\n menu();\n }", "@Test\n public void testBorrowBook() throws Exception {\n Friend friend = friendManager.getFriend(\"pp\");\n PaperBook paperBook = homeLibrary.getPaperBookByISBN(1234567890L);\n Borrowable borrowable = paperBook.getBorrowable();\n friend.getAccount().addBorrowable(borrowable);\n BorrowRecord borrowRecord = friend.getAccount().borrowBook(borrowable);\n //Reading for a while\n Thread.sleep(500);\n friend.getAccount().returnBook(borrowRecord);\n }", "boolean isBookIdValid(int bookId) {\n\t\t\n\t\t// checks if the id is to big for the book case or if that location is not taken \n\t\tif (bookId >= this.maxBookCapacity || this.bookShelf[bookId] == null || bookId < 0) {\n\t\t\treturn false; \n\t\t}\n\t\t\n\t\treturn true; \n\t}", "private Borrower createBorrower() {\n Borrower bor = null;\n try {\n bor = new Borrower(Integer.parseInt(tfBorrowerID.getText()), driver);\n } catch (NumberFormatException nfe) {\n driver.errorMessageNormal(\"Please enter numbers only the Borrower ID and Book ID fields.\");\n }\n return bor;\n }", "public Boolean canBorrowBook() {\n\t\tif (loans.size() >= getLoanLimit()) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "@PostMapping(\"/transaction/issue_book\")\n public String issueBook(@RequestParam(\"book_id\") int bookId) throws Exception {\n\n Authentication authentication = SecurityContextHolder.getContext().getAuthentication();\n User user = (User) authentication.getPrincipal();\n\n if(!user.isStudent()){\n throw new AuthorizationServiceException(\"Admins can not issue book\");\n }\n\n int studentId = user.getUserTypeId();\n\n return transactionService.issueBook(bookId, studentId);\n }", "public void setBookId(String bookId) {\n this.bookId = bookId;\n }", "public void checkoutBook(Library library, Book book) {\n library.removeBook(book);\n// Add the book to the borrowers booklist\n books.add(book);\n }", "public boolean enter (Student me)\r\n {\r\n boolean studentHasBook = false;\r\n \r\n if ((me.myLocker) == null)\r\n {\r\n me.sentToOffice (\"does not have a locker.\");\r\n me.myLocker = new Locker (me);\r\n me.myLocker.putJacket (new Jacket (me));\r\n return false;\r\n }\r\n else if (me.myJacket != null)\r\n {\r\n me.myLocker.putJacket (me.myJacket);\r\n return false;\r\n }\r\n for (int i = 0; i < me.books.length; i++)\r\n {\r\n if (me.books[i] != null)\r\n { \r\n if (me.books[i].course.equals (\"ICS4U0\"))\r\n return true;\r\n }\r\n }\r\n me.sentToOffice (\"does not have the correct book.\");\r\n for (int i = 0; i < me.books.length; i++)\r\n {\r\n if (me.books[i] == null)\r\n me.books[i] = me.myLocker.getABook (\"ICS4U0\");\r\n }\r\n for (int i = 0; i < me.books.length; i++)\r\n {\r\n if (me.books[i] != null)\r\n {\r\n if (me.books[i].course.equals (\"ICS4U0\"))\r\n studentHasBook = true;\r\n }\r\n }\r\n if (!studentHasBook)\r\n {\r\n me.books [0] = new Book ();\r\n me.books [0].course = \"ICS4U0\";\r\n me.books[0].title = \"AP Prep - Computer Science A\";\r\n }\r\n return false;\r\n }", "private Book createBook() {\n Book book = null;\n\n try {\n\n //determine if fiction or non-fiction\n if (radFiction.isSelected()) {\n //fiction book\n book = new Fiction(Integer.parseInt(tfBookID.getText()));\n\n } else if (radNonFiction.isSelected()) {\n //non-fiction book\n book = new NonFiction(Integer.parseInt(tfBookID.getText()));\n\n } else {\n driver.errorMessageNormal(\"Please selecte fiction or non-fiction.\");\n }\n } catch (NumberFormatException nfe) {\n driver.errorMessageNormal(\"Please enter numbers only the Borrower ID and Book ID fields.\");\n }\n return book;\n }", "public void readBook()\n\t{\n\t\tb.input();\n\t\tSystem.out.print(\"Enter number of available books:\");\n\t\tavailableBooks=sc.nextInt();\n\t}", "public void reserveBook(String cardNo, String book_id) throws SQLException {\n\t\tPreparedStatement myStmt = null;\n\t\t\n\t\tString query = \" insert into book_loans (book_id, branch_id, card_no, date_out, date_due)\"\n\t\t + \" values (?, 9745, ?, curdate(), curdate()+7)\";\n\t\t\n\t\tmyStmt = myConn.prepareStatement(query);\n\t\t\n\t\tmyStmt.setString(1, book_id);\n\t\tmyStmt.setString(2, cardNo);\n\t\t\n\t\t\n\t\t\n\t\tmyStmt.execute();\n\t\t\n\t}", "public int saveLoan(String ISBN10, int borrower_id) throws SQLException {\n\t\tmySQLJDBC.setPreparedSql(\"select flag from borrower where borrower_id=?;\", borrower_id);\n\t\tResultSet res = mySQLJDBC.excuteQuery();\n\t\tint s = 90;\n\t\tif(res.next())\n\t\t\ts = res.getInt(\"flag\");\n\t\t//check if borrower is NOT flagged\n\t\tif (s == 0) {\n\t\t\tmySQLJDBC.setPreparedSql(\"select isAvailable from book where ISBN10=?;\", ISBN10);\n\t\t\tres = mySQLJDBC.excuteQuery();\n\t\t\tif(res.next())\n\t\t\t\ts = res.getInt(\"isAvailable\");\n\t\t\t//check if book is available\n\t\t\tif(s != 0) {\n\t\t\t\tmySQLJDBC.setPreparedSql(\"insert into book_loan (ISBN10, borrower_id, date_out, due_date) values (?, ?, SYSDATE(), DATE_ADD(SYSDATE(), INTERVAL 14 DAY));\", ISBN10,borrower_id);\n\t\t\t\tint resupdate = mySQLJDBC.executeUpdate();\n\t\t\t\t//if insert was successful, change book availability\n\t\t\t\tif (resupdate != -1) {\n\t\t\t\t\tmySQLJDBC.setPreparedSql(\"update book set isAvailable=0 where ISBN10=?;\", ISBN10);\n\t\t\t\t\tresupdate = mySQLJDBC.executeUpdate();\n\t\t\t\t\t//if update availability was successful, count no. of loans\n\t\t\t\t\tif(resupdate == 1) {\n\t\t\t\t\t\tmySQLJDBC.setPreparedSql(\"select borrower_id, count(*) from book_loan where date_in is null and borrower_id=?;\", borrower_id);\n\t\t\t\t\t\tres = mySQLJDBC.excuteQuery();\n\t\t\t\t\t\tif(res.next())\n\t\t\t\t\t\t\ts = res.getInt(\"count(*)\");\n\t\t\t\t\t\t//if count >= 3, change flag to 1\n\t\t\t\t\t\tif(s >= 3) {\n\t\t\t\t\t\t\tmySQLJDBC.setPreparedSql(\"update borrower set flag = 1 where borrower_id=?;\", borrower_id);\n\t\t\t\t\t\t\tresupdate = mySQLJDBC.executeUpdate();\n\t\t\t\t\t\t\t//if update was successful, return success\n\t\t\t\t\t\t\tif (resupdate != -1) {\n\t\t\t\t\t\t\t\tmySQLJDBC.close();\n\t\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//update flag was not successful\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tmySQLJDBC.close();\n\t\t\t\t\t\t\t\treturn -1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//i count < 3, just return success\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tmySQLJDBC.close();\n\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//update availability was not successful\n\t\t\t\t\telse {\n\t\t\t\t\t\tmySQLJDBC.close();\n\t\t\t\t\t\treturn -1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//insert loan was not successful\n\t\t\t\telse {\n\t\t\t\t\tmySQLJDBC.close();\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//book is checked out\n\t\t\telse {\n\t\t\t\tmySQLJDBC.close();\n\t\t\t\treturn -2;\n\t\t\t}\n\t\t}\n\t\t//borrower is flagged, return reason\n\t\telse {\n\t\t\t//borrower has more than 3 books checked out\n\t\t\t//mySQLJDBC.setPreparedSql(\"select flag from borrower where borrower_id=?;\", borrower_id);\n\t\t\t//res = mySQLJDBC.excuteQuery();\n\t\t\t//if(res.next()) {\n\t\t\t\t//s = res.getInt(\"flag\");\n\t\t\t\t//mySQLJDBC.close();\n\t\t\t//}\n\t\t\tmySQLJDBC.close();\n\t\t\tif(s == 1) { //s=1 --> more than 3 books checked out\n\t\t\t\treturn -3; \n\t\t\t}\n\t\t\telse if(s == 2){ //s=2 --> more than $5 owed\n\t\t\t\treturn -4;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn -5;\n\t\t\t}\n\t\t}\n\t}", "private void reserveBook ( String bookName, String authorName ) throws IOException {\r\n\t\t\r\n\t\tboolean result = false ;\t\t// Initially false\r\n\t\tBook demandedBook = new Book ( bookName, authorName ) ;\r\n\t\t// returns null if the book is not available\r\n\t\tBook availableBook = lib.getBookDatabase().get(demandedBook) ;\r\n\t\t\r\n\t\t// order the book if it is available\r\n\t\tif ( availableBook != null ) {\r\n\t\t\t// the book is shared among all students of library. Hence, Synchronization is mandatory\r\n\t\t\tsynchronized ( availableBook ) {\r\n\t\t\t\tif ( availableBook.order() ) {\r\n\t\t\t\t\t// return true if order successful\r\n\t\t\t\t\tresult = true ;\r\n\t\t\t\t} \r\n\t\t\t}\r\n\t\t} \r\n\r\n\t\tString resultString = Integer.toString( result ? 1 : 0 ) ; // result string\r\n\t\tbyte[] replyData = resultString.getBytes() ; // result byte either 1 or 0\r\n\t\t\r\n\t\t// get client address and port from the UDP message client sended initially\r\n\t\tDatagramPacket sendPack = new DatagramPacket ( replyData, replyData.length, control.getAddress(),\r\n\t\t\tcontrol.getPort() ) ;\r\n\t\tsendData.send(sendPack);\r\n\t\t\r\n\t\tString message ;\r\n\t\t// Generate appropriate message and write it to log\r\n\t\tif ( result ) {\r\n\t\t\tmessage = \"A book named \" + bookName + \" by \" + authorName + \r\n\t\t\t\t\t\" was reserved at \" + Calendar.getInstance().getTime() + \" (Copies Left: \" + availableBook.getCopies() + \")\" ;\t\r\n\t\t} else {\r\n\t\t\tmessage = \"An unsucessful attempt to reserve \" + bookName + \" by \" +\r\n\t\t\t\t\tauthorName + \" was made at \" + Calendar.getInstance().getTime() ;\r\n\t\t}\r\n\t\t\r\n\t\tlib.writeLog ( message ) ;\r\n\t\treturn ;\r\n\t\t\r\n\t}", "public com.huqiwen.demo.book.model.Books fetchByPrimaryKey(long bookId)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;", "private void enterBook() {\n String sku;\n String author;\n String description;\n double price;\n String title;\n boolean isInStock;\n String priceTmp;\n String inStock;\n Scanner keyb = new Scanner(System.in);\n\n System.out.println(\"Enter the sku number.\"); // Enter the SKU number\n sku = keyb.nextLine();\n\n System.out.println(\"Enter the title of the book.\"); // Enter the title\n title = keyb.nextLine();\n\n System.out.println(\"Enter the author of the book.\"); // Enter the author\n author = keyb.nextLine();\n\n System.out.println(\"Enter the price of the book.\"); // Enter the price of the book\n priceTmp = keyb.nextLine();\n price = Double.parseDouble(priceTmp);\n\n System.out.println(\"Enter a description of the book.\"); // Enter the description of the book\n description = keyb.nextLine();\n\n System.out.println(\"Enter whether the book is in stock (\\\"Y\\\"|\\\"N\\\").\"); // in stock?\n inStock = keyb.nextLine();\n if (inStock.equalsIgnoreCase(\"Y\")) {\n isInStock = true;\n } else if (inStock.equalsIgnoreCase(\"N\")) {\n isInStock = false;\n } else {\n System.out.println(\"Not a valid entry. In stock status is unknown; therefore, it will be listed as no.\");\n isInStock = false;\n }\n\n Book book = new Book(title, author, description, price, isInStock);\n bookDB.put(sku, book);\n }", "private boolean renterMenu() {\n System.out.println(\"BOOKING TESTING!!!!!!!!!!!!!!\");\n try {\n\n User user = UserRepository.getUser(\"testrsin\");\n\n System.out.println(\"USERRRRRRRRRR!!!!!!!!!!!!!!\");\n System.out.println(user.toString());\n\n BookingRepository\n .booking(\"testlisting\", \"2018-12-01\", \"2018-12-10\", user);\n Booking booking = BookingRepository\n .getBooking(\"testlisting\", \"2018-12-01\", \"2018-12-10\", user);\n\n System.out.println(\"BOOKING!!!!!!!!!!!!!!\");\n System.out.println(booking.toString());\n\n //BookingRepository\n // .deleteBooking(\"testlisting\", \"2018-12-01\", \"2018-12-10\", user);\n\n\n /*\n THE LISITING TESTS\n */\n ReviewRepository.createListingReview(\"testlisting\", \"testrsin\", \"l \"\n + \"review\", 1);\n\n //DID NOT STAY AT LISTING\n //ReviewRepository.createListingReview(\"testlisting\", \"rentersin\", \"l \"\n // + \"review\", 1);\n\n\n /*\n THE HOST REVIEWS\n */\n //Proper Test\n ReviewRepository.createHostReview(\"testhsin\", \"testrsin\", \"PROPER TEST \"\n + \"HOST REVIEW\", 1);\n\n //Bad Dates Test but booked\n\n\n //BOOKING CANCELLING\n BookingRepository\n .cancelBooking(\"testlisting\", \"2018-12-01\", \"2018-12-10\", user);\n booking = BookingRepository\n .getBooking(\"testlisting\", \"2018-12-01\", \"2018-12-10\", user);\n\n System.out.println(\"CANCELLED TESTING!!!!!!!!!!!!!!\");\n System.out.println(booking.toString());\n\n //Not booked at all GOOD\n //ReviewRepository.createHostReview(\"testhsin\", \"rentersin\", \"USER NOT \"\n // + \"BOOKED\", 1);\n\n //cancelled GOOD\n //ReviewRepository.createHostReview(\"testhsin\", \"testrsin\", \"CANCELLED \"\n // + \"TESTING SHOULD NOT APPEAR\", 1);\n\n System.out.println(\"DELETE TESTING!!!!!!!!!!!!!!\");\n\n } catch (Exception exception) {\n System.out.println(\"OH NO\");\n exception.printStackTrace();\n return true;\n }\n return true;\n }", "@Override\n\tpublic int findBookBorrow(int id) {\n\t\treturn this.borrowrecordMapper.findBookBorrow(id);\n\t}", "public void book(long bookRecordId) {\n book(bookRecordId, false);\n }", "public ArrayList<Book> checkIn(int... bookNumbers){\n ArrayList<Book> checkInBooks = new ArrayList<Book>();\n for (int number : bookNumbers){\n if(this.numberedListOfServing.containsKey(number)){\n this.numberedListOfServing.get(number).checkIn();\n this.libraryBooks.add(this.numberedListOfServing.get(number));\n checkInBooks.add(this.numberedListOfServing.get(number));\n this.servingPatron.giveBack(this.numberedListOfServing.get(number));\n this.println(this.numberedListOfServing.get(number).getTitle()+\" Check In successfully!\");\n this.numberedListOfServing.remove(number);\n }\n else{\n this.println(\"Number \"+number +\" is out of range! Please enter the number in range!!\");\n }\n } \n return checkInBooks;\n }", "@Test\n\tpublic void testBook() throws Exception {\n\t\tString createdReservationID = bookingManagement.book(USER_ID, Arrays.asList(room1.getId()),\n\t\t\t\tvalidStartDate, validEndDate);\n\t\t// a reservation must be returned\n\t\tassertNotNull(\"Reservation id is null\", createdReservationID);\n\t\tassertFalse(\"Reservation id is emtpy\", createdReservationID.isEmpty());\n\t\t// check if returned reservation is correct\n\t\tReservation createdReservation = bookingManagement.getReservation(createdReservationID);\n\t\tassertNotNull(\"Reservation of returned id was not found\", createdReservation);\n\n\t\tassertEquals(USER_ID, createdReservation.getBookingUserId());\n\n\t\tassertEquals(1, createdReservation.getBookedFacilityIds().size());\n\t\tassertTrue(createdReservation.getBookedFacilityIds().contains(room1.getId()));\n\t\tassertEquals(validStartDate, createdReservation.getStartTime());\n\t\tassertEquals(validEndDate, createdReservation.getEndTime());\n\t}", "public void availableBookings(int bID){\n int index=0;\n String n = null;\n Services s = new Services();\n\n System.out.println(\"\\n\"+ Login.businessList.get(bID).getName()+ \" [opening hours]\");\n System.out.println(\"-----------------------------\");\n workday.printFile(Login.businessList.get(bID).getUsername());\n System.out.println(\"-----------------------------\");\n System.out.println(\"\\nSelect a Service.\");\n s.printService(Login.businessList.get(bID).getUsername());\n\n Scanner reader = new Scanner(System.in);\n do {\n System.out.print(\"Enter Service ID: \");\n n = reader.nextLine();\n index = s.checkID(n);\n }while(index==0);\n\n }", "private void returnBookButtonMouseClicked(java.awt.event.MouseEvent evt) {\n if (checkList() == true) {\n if (checkReturn().equalsIgnoreCase(\"null\")) {\n try {\n String uQuery = \"update student set day_of_return='\"+ getReturnDateSTR() +\"', fee='\" + getFee() +\"' where book_id=\" + bookIDTextField.getText() + \" and rb_id=\" + studentIDField.getText();\n Connection conn = DBConnector.connectDB();\n PreparedStatement pst = conn.prepareStatement(uQuery);\n pst.execute();\n pst.close();\n System.out.println(\"Return Completed!\");\n\n Connection myConn = DBConnector.connectDB();\n String u2Query = \"update book set availability='Yes' where book_id=\" + bookIDTextField.getText() ;\n PreparedStatement mypststmt = myConn.prepareStatement(u2Query);\n mypststmt.execute();\n System.out.println(\"Update Completed!\");\n\n jLabel_overDue.setText(\"Over Due by \" + Long.toString(getDiffDays()) + \" day(s)\");\n jLabel_totalFee.setText(\"Total Fee: $\" + String.valueOf(getFee()));\n\n JOptionPane.showMessageDialog(null, \"Book Returned Successfully\");\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n } else {\n JOptionPane.showMessageDialog(null, \"Book Already Returned\");\n }\n } else {\n JOptionPane.showMessageDialog(null, \"Book ID or Student ID is Incorrect\");\n }\n }", "public double borrow(String memberId) throws BorrowException, IdException\r\n\t{\r\n\t\tif(memberId.length() != 3 )\r\n\t\t{\r\n\t\t\tthrow new IdException(\"Error -- member Id is not correct length of 3\");\r\n\t\t}\r\n\t\tif(!borrowed())\r\n\t\t{\r\n\t\t\tfor(int x = hireHistory.length - 1; x > 0; x--)\r\n\t\t\t{\r\n\t\t\t\thireHistory[x] = hireHistory[x - 1];\r\n\t\t\t}\r\n\t\t\tcurrentlyBorrowed = new HiringRecord(id + \"_\"+memberId + \"_\", fee, new DateTime());\r\n\t\t\thireHistory[0] = currentlyBorrowed;\r\n\t\t\treturn fee;\r\n\t\t}\r\n\t\telse //is on loan\r\n\t\t{\r\n\t\t\tthrow new BorrowException(\"Item \"+ title + \"is already on loan!\");\r\n\t\t}\r\n\t}", "public void onActivityResult(int requestCode, int resultCode, Intent data) {\n\n super.onActivityResult(requestCode, resultCode, data);\n if (requestCode == 325) {\n if (resultCode == Activity.RESULT_OK) {\n String result = data.getStringExtra(\"RESULT_ISBN\");\n if (result.equals(clickedBook.getISBN())){\n //owner confirm receive returned book\n Toast.makeText(getActivity(), \"You successfully received this book\", Toast.LENGTH_SHORT).show();\n currentBookDocRef.update(\"returnDenoted\",\"false\");\n currentBookDocRef.update(\"status\",\"Available\");\n currentBookDocRef.update(\"borrowerID\", FieldValue.delete());\n currentBookDocRef.update(\"borrowerUname\", FieldValue.delete());\n currentBookDocRef.update(\"lat\", FieldValue.delete());\n currentBookDocRef.update(\"lng\", FieldValue.delete());\n borrowerSideBorrowedBookRef.update(\"returnDenoted\",\"false\");\n\n // for borrower,remove book from BorrowedBook\n borrowerSideBorrowedBookRef.delete();\n\n }\n else {\n Toast.makeText(getActivity(), \"The ISBN you scaned does not match the ISBN of the book\", Toast.LENGTH_SHORT).show();\n\n }\n }\n }\n }", "public synchronized int borrowBook(String title, String borrower){\n //Check is available quantity is greater than 0\n int bookIndex = searchBook(title);\n if (bookIndex == -1)\n return -1;\n\n if (quantityList.get(bookIndex) == 0)\n return 0;\n\n quantityList.set(bookIndex, quantityList.get(bookIndex) - 1);\n borrowerList.get(bookIndex).add(borrower);\n return 1;\n }", "private boolean book() throws Exception {\n\t\tSystem.out.println(\"Enter date car required: \");\n\t\tSystem.out.println(\"format DD/MM/YYYY)\");\n\t\tString dateEntered = console.nextLine();\n\t\tDateRegex dateChecker = new DateRegex(dateEntered);\n\t\tint day = Integer.parseInt(dateEntered.substring(0, 2));\n\t\tint month = Integer.parseInt(dateEntered.substring(3, 5));\n\t\tint year = Integer.parseInt(dateEntered.substring(6));\n\t\tDateTime dateRequired = new DateTime(day, month, year);\n\t\t\n\t\tif (!DateUtilities.dateIsNotInPast(dateRequired) || !DateUtilities.dateIsNotMoreThan7Days(dateRequired)) {\n\t\t\tthrow new InvalidBookingDateException(\"Error: Date is invalid, must be within the coming week.\");\n//\t\t\tSystem.out.println(\"Date is invalid, must be within the coming week.\");\n//\t\t\treturn false;\n\t\t}\n\t\t\n\t\tString[] availableCars = application.book(dateRequired);\n\t\t\n\t\tfor (int i = 0; i < availableCars.length; i++) {\n\t\t\tSystem.out.println(availableCars[i]);\n\t\t}\n\t\t\n\t\tif (availableCars.length != 0) {\n\t\t\tSystem.out.println(\"Please enter a number from the list:\");\n\t\t\tString itemSelectedInString = console.nextLine();\n\t\t\t\n\t\t\ttry {\n\t\t\t\tint numberStringChecker = Integer.parseInt(itemSelectedInString);\n\t\t\t}\n\t\t\t\n\t\t\tcatch (NumberFormatException e) {\n\t\t\t\tSystem.out.println(\"Error: Please enter a numeric value.\");\n\t\t\t}\n\t\t\t\n//\t\t\tif (itemSelectedInString.contains(\"[a-zA-Z]+\")) {\n//\t\t\t\tthrow new InvalidCharacterException(\"Error: Input must be a numeric value.\");\n//\t\t\t}\n\t\t\t\n\t\t\tint itemSelected = Integer.parseInt(itemSelectedInString);\n\t\t\t\n\t\t\tif (itemSelected == 0) {\n\t\t\t\tthrow new InvalidZeroUserInputException(\"Error: Number cannot be 0.\");\n\t\t\t}\n\t\t\t\n\t\t\tString regNo = availableCars[itemSelected - 1];\n\t\t\tregNo = regNo.substring(regNo.length() - 6);\n\t\t\tSystem.out.println(\"Please enter your first name:\");\n\t\t\tString firstName = console.nextLine();\n\t\t\tSystem.out.println(\"Please enter your last name:\");\n\t\t\tString lastName = console.nextLine();\n\t\t\tSystem.out.println(\"Please enter the number of passengers:\");\n\t\t\t\n\t\t\ttry {\n\t\t\t\tint numPassengers = Integer.parseInt(console.nextLine());\n\t\t\t\tString result = application.book(firstName, lastName, dateRequired, numPassengers, regNo);\n\t\t\t\tSystem.out.println(result);\n\t\t\t}\n\t\t\t\n\t\t\tcatch (NumberFormatException e) {\n\t\t\t\tSystem.out.println(\"Error: The number of passengers should be in numeric input.\");\n\t\t\t}\n\t\t} \n\t\t\n\t\telse {\n\t\t\tSystem.out.println(\"There are no available cars on this date.\");\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public void borrowBooks(int number)\r\n {\r\n noOfBooks = noOfBooks + number;\r\n System.out.println(\"Books on loan: \" + noOfBooks); \r\n }", "void issuebook(String book){\n\t\tfor(int i=0;i<books.length;i++)\n\t\t{\n\t\t\tif(books[i]!=null && this.books[i].equals(book)){\n\t\t\t\tSystem.out.println(\"this book issue\");\n\t\t\t\tthis.books[i]=null;\n\t\t\t\treturn;\n\t\t}\t\t\t}System.out.println(\"this book not available\");\n\n\t}", "public static void printAddBook(int result, Integer memId, String bookID) {\n if (result > 0) {\n System.out.println(\"The book added successfully to member \" + memId + \".\\n\");\n } else {\n if (result == -1) {\n System.out.println(\"The book \" + bookID + \" is already taken \\n\");\n }\n if (result == -2) {\n System.out.println(\"The member \" + memId + \" doesn`t exist \\n\");\n }\n if (result == -3) {\n System.out.println(\"The member \" + memId + \" already have 10 books \\n\");\n }\n }\n }", "public void setBookId(Integer bookId) {\n this.bookId = bookId;\n }", "public void setBookId(Integer bookId) {\n this.bookId = bookId;\n }", "public void setBookId(Integer bookId) {\n this.bookId = bookId;\n }", "private void userHasBooking() throws SQLException {\n BookingModel bookingModel2 = new BookingModel();\n if (bookingModel2.checkUserBooking(employeeID)) {\n hasBooking = true;\n } else {\n hasBooking = false;\n }\n\n }", "@Test(expected = IllegalArgumentException.class)\n\tpublic void testBookWithEmptyUserID() throws Exception {\n\t\tbookingManagement.book(\"\", Arrays.asList(room1.getId()), validStartDate, validEndDate);\n\t}", "private void handleBooking() {\n\t\tString customerID;\n\t\tint recNo = table.getSelectedRow();\n\t\tif(recNo == -1){\n\t\t\treturn;\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tcustomerID = JOptionPane.showInputDialog(mainPanel,\n\t\t\t\t\t\"Enter Customer ID (8 Digits)\");\n\t\t\tif (customerID != null) {\t\n\t\t\t\tcontroller.reserveRoom(recNo, customerID);\n\t\n\t\t\t\tupdateTable(nameSearchBar.getText(),\n\t\t\t\t\t\tlocationSearchBar.getText());\n\t\t\t}\n\t\t} catch (final InvalidCustomerIDException icide) {\n\t\t\tJOptionPane.showMessageDialog(mainPanel, \"Invalid format!\");\n\t\t} catch (final BookingServiceException bse) {\n\t\t\tJOptionPane.showMessageDialog(mainPanel, bse.getMessage());\n\t\t} catch (final ServiceUnavailableException sue) {\n\t\t\tJOptionPane.showMessageDialog(null, sue.getMessage());\n\t\t\tSystem.exit(0);\n\t\t}\n\t}", "public synchronized void checkOut(int choice, int id) throws InterruptedException{\n \t\n \t//If else clause to check out the appropriate book\n \t//if the book is available it is checked out if it is not available the thread waits\n \tif(choice == 0){\n \t\tif(A.isAvailable()){\n \t\t\t\n \t\t\tA.setAvailable(false);\n \t\t}\n \t\telse{\n \t\t\tSystem.out.println(\"Client \" + Integer.toString(id) + \" is waiting for Book 0.\" );\n \t\t\twait();\n \t\t}\n \t}\n \telse if(choice == 1){\n \t\tif(B.isAvailable()){\n \t\t\t\n \t\t\tB.setAvailable(false);\n \t\t}\n \t\telse{\n \t\t\tSystem.out.println(\"Client \" + Integer.toString(id) + \" is waiting for Book 1.\" );\n \t\t\twait();\n \t\t}\n \t}\n \telse if(choice == 2){\n \t\tif(C.isAvailable()){\n \t\t\t\n \t\t\tC.setAvailable(false);\n \t\t}\n \t\telse{\n \t\t\tSystem.out.println(\"Client \" + Integer.toString(id) + \" is waiting for Book 2.\" );\n \t\t\twait();\n \t\t}\n \t}\n \telse if(choice == 3){\n \t\tif(D.isAvailable()){\n \t\t\n \t\t\tD.setAvailable(false);\n \t\t}\n \t\telse{\n \t\t\tSystem.out.println(\"Client \" + Integer.toString(id) + \" is waiting for Book 3.\" );\n \t\t\twait();\n \t\t}\n \t}\n \telse if(choice == 4){\n \t\tif(E.isAvailable()){\n \t\t\t\n \t\t\tE.setAvailable(false);\n \t\t}\n \t\telse{\n \t\t\tSystem.out.println(\"Client \" + Integer.toString(id) + \" is waiting for Book 4.\" );\n \t\t\twait();\n \t\t}\n \t}\n \t\n \t\n }", "public boolean issueBook()\n\t{\n\t\tif(availableBooks==0)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tavailableBooks--;;\n\t\t\treturn true;\n\t\t}\n\t}", "public void confirmBooking(){\n double ticketPrice = 56.0;\n double mealPrice = 30.0;\n if (student || child )\n ticketPrice = ticketPrice/2;\n else\n ticketPrice = ticketPrice*0.8;\n \n if (child )\n mealPrice = mealPrice/2;\n else\n mealPrice = mealPrice*0.9;\n double totalPrice = ticketPrice + mealPrice;\n System.out.println(getName()+\"\\nTicket price:$\"+ticketPrice+\"\\nMeal Price:$\"+mealPrice+\"\\nTotal price:$\"+totalPrice+\"\\nConfirm booking for \"+getName()+\" (Y/N)\");\n setBooked();\n System.out.println(getBooked()+\"\\n\\n\");\n }", "public void actionPerformed(ActionEvent e){\n boolean sentinel = false;\n try{\n if(listOfEBooks.getSelectedItem() == null) {\n new errorWindow(\"No E-Book was selected\");\n return;\n }\n\n if(nameField.getText().equals(\"\")) {\n new errorWindow(\"Enter a name for the E-Book!\");\n sentinel = true;\n }\n if(classForField.getText().equals(\"\")){\n new errorWindow(\"Enter the name of the class for the E-Book\");\n sentinel = true;\n }\n if(redemptionCodeField.getText().equals(\"\")){\n new errorWindow(\"Enter the redemption code of the E-Book\");\n sentinel = true;\n }\n\n if(sentinel == true){\n return;\n }\n else {\n //Updates the E-Book when it is set to have no owner.\n if(redemptionStatusComboBox.getSelectedItem().equals(\"false\")){\n EBook temp = (EBook)listOfEBooks.getSelectedItem();\n books.remove(temp);\n redemptionCodes.remove(temp.getRedemptionCode()+\",\");\n temp.setBookName(nameField.getText());\n temp.setClassFor(classForField.getText());\n temp.setRedemptionCode(redemptionCodeField.getText());\n temp.setRedemptionStatus(Boolean.parseBoolean(redemptionStatusComboBox.getSelectedItem().toString()));\n books.put(temp);\n redemptionCodes.put(redemptionCodeField.getText()+\",\");\n DefaultTableModel table = (DefaultTableModel)database.getModel();\n table.setValueAt(nameField.getText(), inputedEBook.getRowLocation() - numberOfRowsRemoved, 0);\n table.setValueAt(classForField.getText(), inputedEBook.getRowLocation() - numberOfRowsRemoved, 1);\n table.setValueAt(redemptionCodeField.getText(), inputedEBook.getRowLocation() - numberOfRowsRemoved, 2);\n table.setValueAt(redemptionStatusComboBox.getSelectedItem(), inputedEBook.getRowLocation() - numberOfRowsRemoved, 3);\n dispose();\n }\n else {\n //Checks to see if the inputed changes are appropiate.\n EBook temp = (EBook)listOfEBooks.getSelectedItem();\n books.remove(temp);\n if(studentNameField.getText().equals(\"\")){\n new errorWindow(\"Insert a name\");\n sentinel = true;\n }\n if(gradeLevelField.getText().equals(\"\")){\n new errorWindow(\"Insert a grade level\");\n sentinel = true;\n }\n \n try{\n int gradeLevel = Integer.parseInt(gradeLevelField.getText().trim());\n if(Integer.parseInt(gradeLevelField.getText().trim()) < 1 || Integer.parseInt(gradeLevelField.getText().trim()) > 12){\n new errorWindow(\"Grade Level should be between 1 and 12th\");\n sentinel = true;\n }\n }catch(NumberFormatException nfe){\n new errorWindow(\"Grade Level must be a number\");\n }\n\n \n if(sentinel == true){\n return;\n }\n //Updates the E-Book for an E-Book that has no owner.\n if(temp.getRedemptionStatus() == false){\n redemptionCodes.remove(temp.getRedemptionCode()+\",\");\n unredeemedEBooks.remove(temp);\n temp.setBookName(nameField.getText());\n temp.setClassFor(classForField.getText());\n temp.setRedemptionCode(redemptionCodeField.getText());\n temp.setRedemptionStatus(Boolean.parseBoolean(redemptionStatusComboBox.getSelectedItem().toString()));\n temp.setOwner(new Student(studentNameField.getText(), Integer.parseInt(gradeLevelField.getText())));\n books.put(temp);\n redemptionCodes.put(redemptionCodeField.getText()+\",\");\n DefaultTableModel table = (DefaultTableModel)database.getModel();\n table.setValueAt(nameField.getText(), inputedEBook.getRowLocation() - numberOfRowsRemoved, 0);\n table.setValueAt(classForField.getText(), inputedEBook.getRowLocation() - numberOfRowsRemoved, 1);\n table.setValueAt(redemptionCodeField.getText(), inputedEBook.getRowLocation() - numberOfRowsRemoved, 2);\n table.setValueAt(redemptionStatusComboBox.getSelectedItem(), inputedEBook.getRowLocation() - numberOfRowsRemoved, 3);\n table.setValueAt(studentNameField.getText(), inputedEBook.getRowLocation() - numberOfRowsRemoved, 4);\n table.setValueAt(gradeLevelField.getText(), inputedEBook.getRowLocation() - numberOfRowsRemoved, 5);\n dispose();\n }\n //Updates the E-Book if the E-Book already has an owner.\n else {\n redemptionCodes.remove(temp.getRedemptionCode()+\",\");\n temp.setBookName(nameField.getText());\n temp.setClassFor(classForField.getText());\n temp.setRedemptionCode(redemptionCodeField.getText());\n temp.setRedemptionStatus(Boolean.parseBoolean(redemptionStatusComboBox.getSelectedItem().toString()));\n temp.setRedemptionStatus(Boolean.parseBoolean(redemptionStatusComboBox.getSelectedItem().toString()));\n temp.setOwner(new Student(studentNameField.getText(), Integer.parseInt(gradeLevelField.getText())));\n books.put(temp);\n redemptionCodes.put(redemptionCodeField.getText()+\",\");\n DefaultTableModel table = (DefaultTableModel)database.getModel();\n table.setValueAt(nameField.getText(), inputedEBook.getRowLocation() - numberOfRowsRemoved, 0);\n table.setValueAt(classForField.getText(), inputedEBook.getRowLocation() - numberOfRowsRemoved, 1);\n table.setValueAt(redemptionCodeField.getText(), inputedEBook.getRowLocation() - numberOfRowsRemoved, 2);\n table.setValueAt(redemptionStatusComboBox.getSelectedItem(), inputedEBook.getRowLocation() - numberOfRowsRemoved, 3);\n table.setValueAt(studentNameField.getText(), inputedEBook.getRowLocation() - numberOfRowsRemoved, 4);\n table.setValueAt(gradeLevelField.getText(), inputedEBook.getRowLocation() - numberOfRowsRemoved, 5);\n dispose();\n }\n }\n }\n }catch(IOException ex){\n ex.printStackTrace();\n }\n }", "public void bookItin(View view){\n try{\n // Get index of itinerary from tis user\n EditText numberEdit = (EditText) findViewById(R.id.numberEdit);\n int index = Integer.parseInt(numberEdit.getText().toString());\n Client thisClient = system.getClient(userInfo[0]);\n Itinerary itin = selectionItinerary.get(index);\n // Store this users booked itinerary\n thisClient.bookItin(itin);\n system.addClient(thisClient);\n bookedItins.add(itin);\n TextView displayText = (TextView) findViewById(R.id.displayText);\n displayText.setText(\"This Itinerary booked successfully: \" + itin.toString());\n }catch (Exception e){\n // Let user know if itinerary cannot be stored\n TextView displayText = (TextView) findViewById(R.id.displayText);\n displayText.setText(\"No such itinerary found. Please choose\\n\" +\n \"number from search list displayed\");\n Button button = (Button) findViewById(R.id.bookButton);\n button.setEnabled(false);\n EditText numberEdit = (EditText) findViewById(R.id.numberEdit);\n numberEdit.setText(\"\");\n }\n }", "private void selectBook(Book book){\n\t\tthis.book = book;\n\t\tshowView(\"ModifyBookView\");\n\t\tif(book.isInactive()){\n\t\t\tstateChangeRequest(Key.MESSAGE, new MessageEvent(MessageType.INFO, \"Heads Up! This book is archived. It must be recovered before it can be modified.\"));\n\t\t}else if(book.isLost()){\n\t\t\tstateChangeRequest(Key.MESSAGE, new MessageEvent(MessageType.INFO, \"Heads Up! This book is lost. It must be recovered before it can be modified.\"));\n\t\t}\n\t}", "private static void addBook() {\n\t\t\r\n\t\tString author = input(\"Enter author: \"); // varaible change A to author\r\n\t\tString title = input(\"Enter title: \"); // variable changes T to title\r\n\t\tString callNumber = input(\"Enter call number: \"); // variable name change C to callNumber\r\n\t\tbook B = lib.addBook(author, title, callNumber); //variable LIB changes to library,A to author,T to title,C to callNumber , method changes Add_book to addBook()\r\n\t\toutput(\"\\n\" + B + \"\\n\");\r\n\t\t\r\n\t}", "public void addBorrow(int book_id, int user_id, String return_date, String remarks) {\n\t\ttry (Connection conn = DriverManager.getConnection(this.hostUrl,this.username,this.password)) {\n\t\t System.out.println(\"Database connected!\");\n\t\t // Statement stmt = conn.createStatement();\n\t\t PreparedStatement stmt=conn.prepareStatement(\"insert into borrows(book_id,user_id,issue_date,return_date,remarks) values(?,?,now(),?,?)\"); \n\t\t stmt.setInt(1,book_id);//1 specifies the first parameter in the query \n\t\t stmt.setInt(2,user_id);\n\t\t stmt.setString(3,return_date);\n\t\t stmt.setString(4,remarks);\n\t\t \n\t\t stmt.executeUpdate(); \n\t\t conn.close(); \n\n\t\t} catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t}", "public void setBookId(String bookId) {\r\n this.bookId = bookId == null ? null : bookId.trim();\r\n }", "public void insertBooking(){\n \n Validator v = new Validator();\n if (createBookingType.getValue() == null)\n {\n \n Dialogs.create()\n .owner(prevStage)\n .title(\"Error!\")\n .masthead(null)\n .message(\"Set Booking Type!\")\n .showInformation();\n \n return;\n \n }\n if (createBookingType.getValue().toString().equals(\"Repair\"))\n Dialogs.create()\n .owner(prevStage)\n .title(\"Error!\")\n .masthead(null)\n .message(\"Go to Diagnosis and Repair tab for creating Repair Bookings!\")\n .showInformation();\n \n \n if(v.checkBookingDate(parseToDate(createBookingDate.getValue(),createBookingTimeStart.localTimeProperty().getValue()),\n parseToDate(createBookingDate.getValue(),createBookingTimeEnd.localTimeProperty().getValue()))\n && customerSet)\n \n { \n \n int mID = GLOBAL.getMechanicID();\n \n try {\n mID = Integer.parseInt(createBookingMechanic.getSelectionModel().getSelectedItem().toString().substring(0,1));\n } catch (Exception ex) {\n Dialogs.create()\n .owner(prevStage)\n .title(\"Error!\")\n .masthead(null)\n .message(\"Set Mechanic!\")\n .showInformation();\n return;\n }\n \n if (mID != GLOBAL.getMechanicID())\n if (!getAuth(mID)) return;\n \n createBookingClass();\n dbH.insertBooking(booking);\n booking.setID(dbH.getLastBookingID());\n appointment = createAppointment(booking);\n closeWindow();\n \n }\n else\n {\n String extra = \"\";\n if (!customerSet) extra = \" Customer and/or Vehicle is not set!\";\n Dialogs.create()\n .owner(prevStage)\n .title(\"Error!\")\n .masthead(null)\n .message(\"Errors with booking:\"+v.getError()+extra)\n .showInformation();\n }\n \n }", "public void setBookId(String bookId) {\n\t\tthis.bookId = bookId == null ? null : bookId.trim();\n\t}", "private static void borrow() {\n\t\tnew BorrowBookUI(new borrowBookControl()()).run();\t// method changes BorrowBookControl to borrowBookControl()\t\r\n\t}", "public com.huqiwen.demo.book.model.Books create(long bookId);", "public Bookcopys(String idbook, String copyid, String status) {\r\n\t\tsuper();\r\n\t\tthis.idbook = idbook;\r\n\t\tthis.copyid = copyid;\r\n\t\tthis.status = status;\r\n\t}", "private void btnTakeBookActionPerformed(java.awt.event.ActionEvent evt) {\n DefaultTableModel model = (DefaultTableModel) tblStudentsBookList.getModel();\n lblTakeBookLimit.setText(new texts().takeBookLimit() + takeBookLimit + \" )\");\n if (model.getRowCount() < takeBookLimit) {\n String BookID = txtID.getText().trim();\n int bookID = Integer.parseInt(BookID);\n String bookName = txtBookName.getText().trim();\n String ISBN_NO = txtISBN_No.getText().trim();\n int ISBN_No = Integer.parseInt(ISBN_NO);\n String BookStatus = txtBookStatus.getText().trim();\n String StudentID = lblStudentID.getText().trim();\n int studentID = sNum.studentID;\n int bookGenreIndex = comboBxBookGenre.getSelectedIndex();\n if (bookGenreIndex <= 0) {\n JOptionPane.showMessageDialog(null, new texts().selectLine());\n return;\n }\n bookGenre bookGenre = bookGenreList.get(bookGenreIndex - 1);\n\n int authorIndex = comboBxAuthor.getSelectedIndex();\n if (authorIndex <= 0) {\n JOptionPane.showMessageDialog(null, new texts().selectLine());\n return;\n }\n DAL.author valueOfAuthor = authorList.get(authorIndex - 1);\n\n int publisherIndex = comboBxPublisher.getSelectedIndex();\n if (publisherIndex <= 0) {\n JOptionPane.showMessageDialog(null, new texts().selectLine());\n return;\n }\n DAL.publisher valueOfPublisher = publisherList.get(publisherIndex - 1);\n\n String takeDate = (bas.format(today));\n String with = new texts().withStudent();\n new servicesBooks().vtUpdateStudent(bookID, with);\n servicesStudentsBook book = new servicesStudentsBook();\n book.vtAdd(studentID, bookID, bookName, bookGenre.getBookGenreID(), valueOfAuthor.getAuthorID(), ISBN_No, BookStatus, valueOfPublisher.getPublisherID(), takeDate);\n new servicesStudentsBook().vtUpdateStudent(bookID, with);\n takeBookLimit -= 1;\n } else {\n lblTakeBookLimit.setText(\"alınabilir kitap limti dolduğu için kitap alamazsınız\");\n }\n List();\n Clean();\n }", "public void setBorrowerId(Integer borrowerId) {\n this.borrowerId = borrowerId;\n }", "public Boolean verifyBook(Book book){\n //booklist.contains() - is a method in the arraylist that returns true if the item is in the arraylist\n return bookList.contains(book);\n }", "private void updateBook(final Properties bookData){\n\t\tnew SwingWorker<Boolean, Void>() {\n\n\t\t\t@Override\n\t\t\tprotected Boolean doInBackground() {\n\t\t\t\tJDBCBroker.getInstance().startTransaction();\n\t\t\t\tif(book.isLost()){\n\t\t\t\t\tBorrower borrower = book.getBorrowerThatLost();\n\t\t\t\t\tif(borrower == null || !borrower.subtractMonetaryPenaltyForLostBook(book)){\n\t\t\t\t\t\tJDBCBroker.getInstance().rollbackTransaction();\n\t\t\t\t\t\tstateChangeRequest(Key.MESSAGE, new MessageEvent(MessageType.ERROR, \"Whoops! An error occurred while saving.\"));\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbookData.setProperty(\"Status\", \"Active\");\n\t\t\t\tbook.stateChangeRequest(bookData);\n\t\t\t\treturn book.save();\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void done() {\n\t\t\t\tboolean success = false;\n\t\t\t\ttry {\n\t\t\t\t\tsuccess = get();\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\tsuccess = false;\n\t\t\t\t} catch (ExecutionException e) {\n\t\t\t\t\tsuccess = false;\n\t\t\t\t}\n\t\t\t\tif(success){\n\t\t\t\t\tJDBCBroker.getInstance().commitTransaction();\n\t\t\t\t\tstateChangeRequest(Key.BACK, \"ListBooksView\");\n\t\t\t\t\tlistBooksTransaction.stateChangeRequest(Key.MESSAGE, new MessageEvent(MessageType.SUCCESS, \"Well done! The book was sucessfully saved.\"));\n\t\t\t\t}else{\n\t\t\t\t\tJDBCBroker.getInstance().rollbackTransaction();\n\t\t\t\t\tList<String> inputErrors = book.getErrors();\n\t\t\t\t\tif(inputErrors.size() > 0){\n\t\t\t\t\t\tstateChangeRequest(Key.MESSAGE, new MessageEvent(MessageType.ERROR, \"Aw shucks! There are errors in the input. Please try again.\", inputErrors));\n\t\t\t\t\t}else{\n\t\t\t\t\t\tstateChangeRequest(Key.MESSAGE, new MessageEvent(MessageType.ERROR, \"Whoops! An error occurred while saving.\"));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}.execute();\n\t}", "@Test(expected = BookingNotAllowedException.class)\n\tpublic void testBookNotAllowed() throws Exception {\n\t\tdataHelper.createPersistedReservation(USER_ID, new ArrayList<String>(), validStartDate, validEndDate);\n\t\tbookingManagement.book(USER_ID, Arrays.asList(room1.getId()), validStartDate, validEndDate);\n\t}", "private void saveBook() {\n // Read from input fields\n // Use trim to eliminate leading or trailing white space\n String productName = etTitle.getText().toString().trim();\n String author = etAuthor.getText().toString().trim();\n String price = etPrice.getText().toString().trim();\n String quantity = etEditQuantity.getText().toString().trim();\n String supplier = etSupplier.getText().toString().trim();\n String supplierPhoneNumber = etPhoneNumber.getText().toString().trim();\n\n // If this is a new book and all of the fields are blank.\n if (currentBookUri == null &&\n TextUtils.isEmpty(productName) && TextUtils.isEmpty(author) &&\n TextUtils.isEmpty(price) && quantity.equals(getString(R.string.zero)) &&\n TextUtils.isEmpty(supplier) && TextUtils.isEmpty(supplierPhoneNumber)) {\n // Exit the activity without saving a new book.\n finish();\n return;\n }\n\n // Make sure the book title is entered.\n if (TextUtils.isEmpty(productName)) {\n Toast.makeText(this, R.string.enter_title, Toast.LENGTH_SHORT).show();\n return;\n }\n\n // Make sure the author is entered.\n if (TextUtils.isEmpty(author)) {\n Toast.makeText(this, R.string.enter_author, Toast.LENGTH_SHORT).show();\n return;\n }\n\n // Make sure the price is entered.\n if (TextUtils.isEmpty(price)) {\n Toast.makeText(this, R.string.enter_price, Toast.LENGTH_SHORT).show();\n return;\n }\n\n // Make sure the quantity is entered if it is a new book.\n // Can be zero when editing book, in case the book is out of stock and user wants to change\n // other information, but hasn't received any new inventory yet.\n if (currentBookUri == null && (quantity.equals(getString(R.string.zero)) ||\n quantity.equals(\"\"))) {\n Toast.makeText(this, R.string.enter_quantity, Toast.LENGTH_SHORT).show();\n return;\n }\n\n // Make sure the supplier is entered.\n if (TextUtils.isEmpty(supplier)) {\n Toast.makeText(this, R.string.enter_supplier, Toast.LENGTH_SHORT).show();\n return;\n }\n\n // Make sure the supplier's phone number is entered.\n if (TextUtils.isEmpty(supplierPhoneNumber)) {\n Toast.makeText(this, R.string.enter_suppliers_phone_number,\n Toast.LENGTH_SHORT).show();\n return;\n }\n\n // Convert the price to a double.\n double bookPrice = Double.parseDouble(price);\n\n // Convert the quantity to an int, if there is a quantity entered, if not set it to zero.\n int bookQuantity = 0;\n if (!quantity.equals(\"\")) {\n bookQuantity = Integer.parseInt(quantity);\n }\n\n // Create a new map of values, where column names are the keys\n ContentValues values = new ContentValues();\n values.put(BookEntry.COLUMN_BOOK_PRODUCT_NAME, productName);\n values.put(BookEntry.COLUMN_BOOK_AUTHOR, author);\n values.put(BookEntry.COLUMN_BOOK_PRICE, bookPrice);\n values.put(BookEntry.COLUMN_BOOK_QUANTITY, bookQuantity);\n values.put(BookEntry.COLUMN_BOOK_SUPPLIER, supplier);\n values.put(BookEntry.COLUMN_BOOK_SUPPLIER_PHONE_NUMBER, supplierPhoneNumber);\n\n // Check if this is a new or existing book.\n if (currentBookUri == null) {\n // Insert a new book into the provider, returning the content URI for the new book.\n Uri newUri = getContentResolver().insert(BookEntry.CONTENT_URI, values);\n\n // Show a toast message depending on whether or not the insertion was successful.\n if (newUri == null) {\n // If the row ID is null, then there was an error with insertion.\n Toast.makeText(this, R.string.save_error, Toast.LENGTH_SHORT).show();\n } else {\n // Otherwise, the insertion was successful, display a toast.\n Toast.makeText(this, R.string.save_successful, Toast.LENGTH_SHORT).show();\n }\n } else {\n // Check to see if any updates were made if not, no need to update the database.\n if (!bookHasChanged) {\n // Exit the activity without updating the book.\n finish();\n } else {\n // Update the book.\n int rowsUpdated = getContentResolver().update(currentBookUri, values, null,\n null);\n\n // Show a toast message depending on whether or not the update was successful.\n if (rowsUpdated == 0) {\n // If no rows were updated, then there was an error with the update.\n Toast.makeText(this, R.string.update_error, Toast.LENGTH_SHORT).show();\n } else {\n // Otherwise, the update was successful, display a toast.\n Toast.makeText(this, R.string.update_successful,\n Toast.LENGTH_SHORT).show();\n }\n }\n }\n\n // Exit the activity, called here so the user can enter all of the required fields.\n finish();\n }", "public ArrayList<Book> checkOut(int... bookNumbers){\n ArrayList<Book> checkOutBooks = new ArrayList<Book>();\n for (int number : bookNumbers){\n //No more than 3 books allowed!\n if(this.numberedListOfSearch.containsKey(number)){\n if(this.servingPatron.getBooks().size()<3){\n this.libraryBooks.remove(this.numberedListOfSearch.get(number));\n this.numberedListOfSearch.get(number).checkOut(this.calendar.getDate()+7);\n this.servingPatron.take(this.numberedListOfSearch.get(number));\n checkOutBooks.add(this.numberedListOfSearch.get(number)); \n this.println( this.numberedListOfSearch.get(number).getTitle()+\" check out successfully!\");\n this.numberedListOfSearch.remove(number);\n }\n else{\n this.println(\"The patron already have checked out 3 books!!! No more books!\");\n }\n }\n else{\n this.println(\"Number\"+number +\" is out of range! Please enter the number in range!!\");\n }\n }\n //Update the serving HashMap!\n for (int i = 0;i < (this.servingPatron.getBooks().size());i++){\n this.numberedListOfServing.put(i+1, this.servingPatron.getBooks().get(i));\n }\n return checkOutBooks;\n }", "public boolean addBook(Books books){\n String sql=\"insert into Book(book_name,book_publish_date,book_author,book_price,scraption)values(?,?,?,?,?)\";\n boolean flag=dao.exeucteUpdate(sql,new Object[]{books.getBook_name(),books.getBook_publish_date(),\n books.getBook_author_name(),books.getBook_price(),books.getScraption()});\n return flag;\n }", "private void onOK() {\n String borrowDateString = Borrowed.getSelectID();\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\");\n try {\n Date borrowDate = sdf.parse(borrowDateString);\n Calendar calendar = Calendar.getInstance();\n calendar.setTime(borrowDate);\n calendar.add(Calendar.MONTH, 3);\n long shouldReturn = calendar.getTimeInMillis();\n long returnDate = System.currentTimeMillis();\n long betweenDays = (returnDate - shouldReturn) / (1000 * 60 * 60 * 24);\n if (betweenDays > 0) {\n JOptionPane.showMessageDialog(this, \"请缴费\" + betweenDays * 0.2f + \"元\", \"提示\", JOptionPane.WARNING_MESSAGE);\n BorrowedDao borrowedDao = new BorrowedDao();\n try {\n borrowedDao.returnBook(Reader.getSelectID(), Book.getSelectID(), Borrowed.getSelectID(), true);\n JOptionPane.showMessageDialog(this, \"还书成功\", \"提示\", JOptionPane.WARNING_MESSAGE);\n dispose();\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n JOptionPane.showMessageDialog(this, \"还书失败\", \"提示\", JOptionPane.WARNING_MESSAGE);\n } catch (SQLException e) {\n e.printStackTrace();\n JOptionPane.showMessageDialog(this, \"还书失败\", \"提示\", JOptionPane.WARNING_MESSAGE);\n }\n } else {\n BorrowedDao borrowedDao = new BorrowedDao();\n try {\n borrowedDao.returnBook(Reader.getSelectID(), Book.getSelectID(), Borrowed.getSelectID(), true);\n JOptionPane.showMessageDialog(this, \"还书成功\", \"提示\", JOptionPane.WARNING_MESSAGE);\n dispose();\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n JOptionPane.showMessageDialog(this, \"还书失败\", \"提示\", JOptionPane.WARNING_MESSAGE);\n } catch (SQLException e) {\n e.printStackTrace();\n JOptionPane.showMessageDialog(this, \"还书失败\", \"提示\", JOptionPane.WARNING_MESSAGE);\n }\n }\n } catch (ParseException e) {\n e.printStackTrace();\n }\n }", "public void showMemberBookings()\n {\n try\n {\n System.out.println(\"Please enter the memeber ID\");\n int memberId =sc.nextInt();\n Member mem = sportsClub.searchMember(memberId); \n \n if(mem==null || mem.getBookings()==null)\n {\n System.out.println(\"Sorry! Member is not found.\");\n }\n else\n {\n for(Booking bookingObj : mem.getBookings())\n {\n System.out.println(\"Booking made by \"+mem.getMemberName() +\" for \" + bookingObj.getBookingDate() + \" at \" + bookingObj.getBookingTime() + \" for \" + bookingObj.getBookingEndTime() + \" minutes on Court number \" + bookingObj.getCourt().getCourtId());\n\n }\n if(mem.getBookings().size()==0)\n System.out.println(\"Sorry! Currebtly no bookings done by the member \");\n }\n }\n catch(Exception e)\n {\n System.out.println(\"Error\"+e);\n }\n\n }", "@Test(expected = IllegalArgumentException.class)\n\tpublic void testBookWithNullUserID() throws Exception {\n\t\tbookingManagement.book(null, Arrays.asList(room1.getId()), validStartDate, validEndDate);\n\t}", "public void actionPerformed(ActionEvent arg0) {//YABDA\n\t\t\t\t\t\t\t\n\t\t\t\tif (prenomE.getText().equals(\"\")){\n\t\t\t\t\t\n\t\t\t\t\tJOptionPane.showMessageDialog(frame, \"Vous devez être un adherant pour emprunter\",\"Inscrivez-Vous !\",JOptionPane.ERROR_MESSAGE);\n\t\t\t\t\t\n\t\t\t\t\tidetudiant.setText(\"\");\n\t\t prenomE.setText(\"\");\n\t\t idL.setText(\"\");\n\t\t dispo.setText(\"\");\n\t\t nomL.setText(\"\");\n\t\t typeL.setText(\"\");\n\t\t dateE.setText(\"\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse{\n\t\t\t\t\ttry {\n\t\t\t\t\t\t\n\t\t\t\t\t\t//get all books have same id as inserted\n\t\t\t query=\"select * from books where BookId='\"+idL.getText()+\"';\"; \n\t\t\t stmt=con.createStatement(); //Statement is an interface that represent query result in a table\n\t\t\t \t\t\t\t\t\t\t//and in order to create statement you need connection\n\t\t\t rs=stmt.executeQuery(query); \n\t\t\t if (rs.next()) {\n\t\t\t \t \n\t\t\t \t if(dispo.getText().equals(\"YES\")){//if available\n\t\t\t \t\t \n\t\t\t \t\t //Insert his details to issue table\n\t\t\t \t\t query=\"insert into issue values('\"+idetudiant.getText()+\"','\"+prenomE.getText()+\"','\"+typeL.getText()+\"','\"+idL.getText()+\"','\"+nomL.getText()+\"','\"+Address+\"','\"+dateE.getText()+\"');\";\n\t\t\t \t\t stmt.executeUpdate(query); \n\t\t\t \t\t \n\t\t\t \t\t //Show msg that is is beend issue.\n\t\t\t \t\t JOptionPane.showMessageDialog(frame,\"Document Titulaire id = \"+idL.getText()+\" est emprunter à \"+prenomE.getText());\n\t\t\t \n\t\t\t \t\t //update availabilty of book0\n\t\t\t \n\t\t\t \t\t query=\"update books set Available= 'NO' where BookId='\"+idL.getText()+\"'; \";\n\t\t\t \t\t stmt.executeUpdate(query); \n\n\t\t\t\t\t\t\n\t\t\t \t}\n\n\t\t\t \t //If not available\n\t\t\t \t if(dispo.getText().equals(\"NO\")) {\n\t\t\t \t\t JOptionPane.showMessageDialog(frame,\"Ce Document Selectionné n'est pas disponible \");\n\t\t\t \t }\n\t\t\t \t // if there isn't any availability then show there is no book\n\t\t\t \t if(dispo.getText().equals(\"\"))\n\t\t\t \t {\n\t\t\t \t\t JOptionPane.showMessageDialog(frame,\"On n'as pas ce Document dans notre Bibliothéque\");\n\t\t\t \t }\n\t\t\t \n\t\t\t\t // reset to vide\n\t\t\t\t idetudiant.setText(\"\");\n\t\t\t\t prenomE.setText(\"\");\n\t\t\t\t idL.setText(\"\");\n\t\t\t\t dispo.setText(\"\");\n\t\t\t\t nomL.setText(\"\");\n\t\t\t\t typeL.setText(\"\");\n\t\t\t\t dateE.setText(\"\");\n\t\t\t \n\t\t\t }\n\t\t\t\t\t}\n\t\t\t\t\tcatch(SQLException e) {\n\t\t\t\t\t\tSystem.out.println(e.getMessage());\n\t\t\t\t\t\t//Maw bech y9olek duplicate primary key ==>Duplicate entry 'AHED26' for key 'PRIMARY'\n\t\t\t\t\t//\tSystem.out.println(e.getErrorCode());\n\t\t\t\t\t\t if(e.getErrorCode()==1062)\n\t\t\t\t\t\t\t JOptionPane.showMessageDialog(frame,\"L'etudiant doit Emprunter qu'un seul Document à la fois\",\"Désoler\",JOptionPane.ERROR_MESSAGE);\n\t\t\t\t\t}/*Fin catch*/\n\t\t\t\t}/*Fin else*/\n\t\t\t}", "@Then(\"book information must match the api for {}\")\n public void book_information_must_match_the_api_for_The_kite_runner(String book) {\n String query = \"SELECT id FROM books WHERE name = '\" + book + \"'\";\n String id = DBUtils.getCellValue(query).toString();\n // get the token\n AuthenticationUtility authenticationUtility = new LibrarianAuthenticationUtility();\n String token = authenticationUtility.getToken();\n // use the id to make the call to api\n Response response = given().\n log().all().\n header(\"x-library-token\", token).\n pathParam(\"id\", id).\n when().\n get(Endpoints.GET_BOOK_BY_ID).\n prettyPeek();\n // verify response vs ui\n response.then().statusCode(200).contentType(ContentType.JSON);\n Book bookPojo = response.as(Book.class);\n\n assertThat(bookPojo.getName(), is(booksPage.bookName.getAttribute(\"value\")));\n assertThat(bookPojo.getAuthor(), is(booksPage.author.getAttribute(\"value\")));\n assertThat(bookPojo.getIsbn(), is(booksPage.isbn.getAttribute(\"value\")));\n assertThat(bookPojo.getDescription(), is(booksPage.description.getAttribute(\"value\")));\n\n }", "public synchronized int borrow(String student, String name) {\n\t\tfor (Book b : inventory) {\n\t\t\tif (b.name.equals(name)) {\n\t\t\t\tif (b.quantity == 0) {\n\t\t\t\t\treturn 0;\n\t\t\t\t} else {\n\t\t\t\t\tb.quantity--;\n\t\t\t\t\trecord_id++;\n\t\t\t\t\trecord.add(new Record(student, name, record_id));\n\t\t\t\t\treturn record_id;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}", "public void setBookid(Integer bookid) {\n this.bookid = bookid;\n }", "public void setBookid(Integer bookid) {\n this.bookid = bookid;\n }", "public static void createAccount()\r\n\t {\r\n\t\t String name;\r\n\t\t String username;\r\n\t\t String password;\r\n\t\t ArrayList<Book> booksLent = null;\r\n\t\t System.out.println(\"Enter your name\");\r\n\t\t Scanner src = new Scanner(System.in);\r\n\t\t name = src.next();\r\n\t\t System.out.println(\"Enter your username\");\r\n\t\t src = new Scanner(System.in);\r\n\t\t username = src.next();\r\n\t\t System.out.println(\"Enter your password\");\r\n\t\t src = new Scanner(System.in);\r\n\t\t password = src.next();\r\n\t\t \r\n\t\t Student stu = new Student(name, username, password, booksLent, 0);\r\n\t\t studentAccount = stu;\r\n\t\t FileReader.getStudents().add(stu);\r\n\t\t FileReader.update();\r\n\t\t Display.studentDisplay(studentAccount);\r\n\t }", "public void setBorrowed(boolean isBorrowed){ this.isBorrowed = isBorrowed; }", "@Override\n\tpublic boolean withdraw(User loggedInUser, String chosenBook)\n\t\t\tthrows BookDoesNotExistException, TooManyBooksAlreadyWithdrawnException {\n\t\treturn false;\n\t}", "public void setBookId(long bookId) {\n _sTransaction.setBookId(bookId);\n }", "public void checkout(Document doc){\n if (this.documents.contains(doc)){\n System.out.println(\"user \" + this.name + \" already have this document\");\n return;\n }\n if (doc.copiesNumber() > 0) {\n //System.out.println(\"patron \" + this.name + \" checked \" + doc.getTitle());\n if (doc.getKeys().contains(\"reference\")){\n System.out.println(\"Impossible to checkout. The document \" + doc.getTitle() + \" is reference book\");\n return;\n }\n documents.add(doc);\n doc.setCopies(doc.copiesNumber() - 1);\n if (!doc.getClass().toString().equals(\"class Documents.Book\")){\n doc.daysRemained = 14;\n }\n else if (this.type.equals(\"faculty\")){\n doc.daysRemained = 28;\n } else{\n Book b = (Book) doc;\n if (b.isBestSeller()){\n doc.daysRemained = 14;\n }\n else {\n doc.daysRemained = 21;\n }\n }\n System.out.println(\"The book \\\"\" + doc.getTitle() + \"\\\" are checked out by \" + name);\n }\n\n else{\n System.out.println(\"No available documents for \" + name);\n }\n\n //TODO: rewrite list of documents\n }", "private void addCard() { \n\t\tint sic_idHolder; // declares sic_idHolder\n\t\tString titleHolder; // declares titleHolder\n\t\tString authorHolder; // declares authorHolder\n\t\tdouble priceHolder; // declares priceHolder\n\t\tint quantityHolder; // declares quantityHolder\n\t\t\n\t\t\n\t\tSystem.out.println(\"Making a new card:\\nPlease enter the new SIC-ID: \");\n\t\tsic_idHolder = scan.nextInt(); // prompts user to input the ID\n\t\tscan.nextLine();\n\t\t\n\t\tif(inventoryObject.cardExists(sic_idHolder) != true) {\n\t\t\tSystem.out.println(\"Please enter the title of the book: \");\n\t\t\ttitleHolder = scan.next(); // prompts user to input the title\n\t\t\tscan.nextLine();\n\t\t\tSystem.out.println(\"Please enter the author of the book\");\n\t\t\tauthorHolder = scan.next(); // prompts user to input the author\n\t\t\tscan.nextLine();\n\t\t\tSystem.out.println(\"Please enter the price of the book\");\n\t\t\tpriceHolder = scan.nextDouble(); // prompts user to input the price\n\t\t\tscan.nextLine();\n\t\t\n\t\t\tif(priceHolder < 0) { // checks to make sure priceHolder is positive\n\t\t\t\tSystem.out.println(\"ERROR! Price must be greater than or equal to 0:\");\n\t\t\t\tgetUserInfo();\n\t\t}\n\t\t\n\t\tSystem.out.println(\"Please enter the number of books in invetory\");\n\t\tquantityHolder = scan.nextInt(); // prompts user to input the quantity\n\t\tscan.nextLine();\n\t\t\n\t\tif(quantityHolder <= 0) { // checks to make sure quantity isn't less than 1\n\t\t\tSystem.out.println(\"Error! Quantity must be greater than 0\\n\"); \n\t\t\tgetUserInfo();\n\t\t}\n\t\tinventoryObject.addStockIndexCard(sic_idHolder, titleHolder, authorHolder, priceHolder, quantityHolder); // calls addStockIndexCard from InventoryManagement\n\t\tgetUserInfo();\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"ERROR: The ID you entered is already in the system\\n\");\n\t\t\tgetUserInfo();\n\t\t}\n\t}", "@PutMapping(\"/{username}/books/{bookId}\")\n public Book markBookInLibrary(@PathVariable String username,\n @PathVariable Long bookId,\n @RequestBody Book book) {\n\n UserBookStatus userBookStatus = UserBookStatus.valueOf(book.getStatus().toUpperCase());\n UserBook userBook = userService.markBook(username, bookId, userBookStatus);\n return userBookToBook.apply(userBook);\n }", "@Override\r\n\tpublic boolean addBook(Book book) {\n\r\n\t\tif (searchBook(book.getISBN()).getISBN() == 98564567l) {\r\n\t\t\ttransactionTemplate.setReadOnly(false);\r\n\t\t\treturn transactionTemplate.execute(new TransactionCallback<Boolean>() {\r\n\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic Boolean doInTransaction(TransactionStatus status) {\r\n\t\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\t\ttry {\r\n\r\n\t\t\t\t\t\tint rows = bookDAO.addBook(book);\r\n\t\t\t\t\t\tif (rows > 0)\r\n\t\t\t\t\t\t\treturn true;\r\n\r\n\t\t\t\t\t} catch (Exception exception) {\r\n\t\t\t\t\t\tstatus.setRollbackOnly();\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn false;\r\n\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public void setBooked(){\n Scanner scan = new Scanner(System.in);\n String input = scan.nextLine();\n if (input.equals(\"Y\")||input.equals(\"y\"))\n booked = true;\n else \n booked = false;\n }", "public User saveBook(String id, SavedBook savebook){\n User user = getById(id);\n if(user!=null){\n for(SavedBook book : user.getSavedBooks()){\n if(book.getBookId() ==(savebook.getBookId())){\n return user;\n }\n }\n System.out.println(user.getSavedBooks().add((SavedBook) savebook));\n userRepo.save(user);\n return user;\n }\n throw new UserNotFoundException(\"\");\n }", "@Override\r\n\tpublic boolean createBooking(Booking_IF bk) {\r\n\t\tPreparedStatement myStatement = null;\r\n\t\tString query = null;\r\n\t\tint count = 0;\r\n\t\ttry{\r\n\t\t\tquery = \"insert into Booking values(?,?);\";\r\n\t\t\tmyStatement = myCon.prepareStatement(query);\r\n\t\t\tmyStatement.setInt(2, bk.getUserid());\r\n\t\t\tmyStatement.setInt(1, bk.getShiftid());\r\n\t\t\tcount = myStatement.executeUpdate();\r\n\t\t} catch(Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} finally{\r\n\t\t\ttry {\r\n\t\t\t\tif (myStatement != null)\r\n\t\t\t\t\tmyStatement.close();\r\n\t\t\t}\r\n\t\t\tcatch(Exception e){\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(count!=1){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t}", "public boolean bookLot() {\r\n\t\tboolean bookUpdateSuccess = false;\r\n\t\t/**\r\n\t\t*\tSince connecting to database (DbConnection()) and updating data (executeUpdateParklot())\r\n\t\t* throw SQLException and throwing an exception from multiple levels again and again is not\r\n\t\t*\ta good way, so its is needed to catch the exception here.\r\n\t\t*/\r\n\t\ttry {\r\n\t\t\t/**\r\n\t\t\t*\tCreate a connection to the database\r\n\t\t\t*/\r\n\t\t\tDbConnection bookLotConn = new DbConnection();\r\n\t\t\t/**\r\n\t\t\t*\tupdate the data in table\r\n\t\t\t*/\r\n\t\t\tbookUpdateSuccess = bookLotConn.executeUpdateParklot(lotNo, 1);\r\n\r\n\r\n\t\t} catch(SQLException SqlExcep) {\r\n\t\t\tSystem.out.println(\"**************Error Connecting to the Database**************\");\r\n\t\t\tSqlExcep.printStackTrace();\r\n\t\t} catch (ClassNotFoundException cnfExecp) {\r\n\t\t\tcnfExecp.printStackTrace();\r\n\t\t} finally {\r\n\t\t\t/*try {\r\n\t\t\t\t//validateConn.closeDbConnection();\r\n\t\t\t} catch(SQLException SqlExcep) {\r\n\t\t\t\tSqlExcep.printStackTrace();\r\n\t\t\t}*/\r\n\t\t}\r\n\t\treturn bookUpdateSuccess;\r\n\t}", "static void presentBookingHistory(User booker) {\r\n\t\tBooking bookings = new Booking();\r\n\t\tResultSet historyRs = null;\r\n\r\n\t\tSystem.out.printf(\"*%14s%10s%18s%28s%28s%15s%11s\\n\", \"Booking No\", \"Lot No\", \"Car No\", \"Start Time\", \"End Time\", \"Cost\", \"*\");\r\n\t\tSystem.out.println(\"*****************************************************************************************************************************\");\r\n\t\ttry {\r\n\t\t\tDbConnection historyConn = new DbConnection();\r\n\t\t\thistoryRs = historyConn.fetchSelectUserByUNameBookings(booker.getUName());\r\n\t\t\twhile (historyRs.next()) {\r\n\t\t\t\tjava.sql.Timestamp endTime = historyRs.getTimestamp(6);\r\n\t\t\t\t/**\r\n\t\t\t\t*\tTo show only the ones which are not checked out yet\r\n\t\t\t\t*\tIf a record with end time as 0 is found, it will be considered as not booked and shown\r\n\t\t\t\t*/\r\n\t\t\t\tif (endTime.getTime() != 0) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tString bookingNo = historyRs.getString(1);\r\n\t\t\t\tint lotNo = historyRs.getInt(3);\r\n\t\t\t\tString carNo = historyRs.getString(4);\r\n\t\t\t\tjava.sql.Timestamp startTime = historyRs.getTimestamp(5);\r\n\t\t\t\tint cost = historyRs.getInt(7);\r\n\t\t\t\tbookings.setAllValues(bookingNo, lotNo, carNo, startTime, endTime, cost);\r\n\r\n\t\t\t\tbookings.showBookHistory();\r\n\t\t\t}\r\n\t\t} catch(SQLException SqlExcep) {\r\n\t\t\tSystem.out.println(\"No records with the given booking number found\");\r\n\t\t\t//SqlExcep.printStackTrace();\r\n\t\t} catch (ClassNotFoundException cnfExecp) {\r\n\t\t\tcnfExecp.printStackTrace();\r\n\t\t} catch (NullPointerException npExcep) {\r\n\t\t\tnpExcep.printStackTrace();\r\n\t\t} finally {\r\n\t\t\t/*try {\r\n\t\t\t\t//validateConn.closeDbConnection();\r\n\t\t\t} catch(SQLException SqlExcep) {\r\n\t\t\t\tSqlExcep.printStackTrace();\r\n\t\t\t}*/\r\n\t\t}\r\n\t}", "private void makeBooking()\n {\n Scanner sc= new Scanner(System.in);\n Date dt = new Date();\n System.out.println(\"Enter Registered member ID: \");\n int memberID = sc.nextInt();\n if(sportsClub.memberIdentity(memberID))//check id exist or not\n {\n Member mem = sportsClub.searchMember(memberID); // get the obj of that member based on ID\n if(mem != null)\n {\n if(mem.getFinancial())\n {\n \n \n System.out.println(\"Enter the Sport Name u want to Play :\");\n System.out.println(\"Basketball\\nBadminton\" );\n Scanner sc1= new Scanner(System.in);\n String userSportName=sc1.nextLine();\n\n if(mem.statusSport(userSportName))\n {\n Scanner sc2= new Scanner(System.in);\n System.out.println(\"Enter the date u want to play in this format dd-MM-yyyy : \"); \n String stringData=sc2.nextLine();\n LocalDate date = DateUtility.convertDate(stringData);\n System.out.println(\"Please enter the Start Time \"); \n stringData=sc2.nextLine();\n LocalTime startTime = DateUtility.convertTime(stringData);\n System.out.println(\"Please enter the End Time\"); \n stringData=sc2.nextLine();\n LocalTime endTime= DateUtility.convertTime(stringData);\n \n DateUtility du=new DateUtility();\n duration=(int)(du.timeBetweenDateTimes(startTime,endTime));//calculats to get the duration \n Sport s = sportsClub.findSport(userSportName);\n\n if(s.timeCheck(mem.getTotalDuration(userSportName, date)+ duration))//total duration checking (without exceeding limits\n { \n\n if(sportsClub.validateTime(date, startTime, duration)==1)//check the pass condition for the given statement\n { \n\n System.out.println(\"=========Available List==========\");\n for(Court courtObj : s.getAvailableCourts(date, startTime, duration))\n {\n System.out.println(\"\\tCourt number \" + courtObj.getCourtId() + \" is available\");\n } \n System.out.println(\"=====================================\");\n Scanner in= new Scanner(System.in);\n System.out.println(\"Which Court would you like to play in?\");\n int courtNumber = in.nextInt();\n\n Court courtObj = null;\n for(Court c : s.getCourtList())\n {\n if(c.getCourtId() == courtNumber)\n {\n courtObj = c;\n }\n }\n\n Booking book = new Booking(dt.getTime(),date,startTime,endTime,mem,courtObj);\n mem.addBooking(book);\n courtObj.addBooking(book);\n System.out.println(\"Successfully booked the court!\");\n\n }\n else if(sportsClub.validateTime(date, startTime, duration)==5)\n System.out.println(\"Booking done between 8-11pm\");\n else if(sportsClub.validateTime(date, startTime, duration)==4)\n System.out.println(\"only 7 days Advance is available\");\n else if(sportsClub.validateTime(date, startTime, duration )==2)\n System.out.println(\"Booking cannot be done\");\n else if(sportsClub.validateTime(date, startTime, duration)==1)\n System.out.println(\"Bookings cant be advanved by years\");\n else if(sportsClub.validateTime(date, startTime, duration) < 0)\n System.out.println(\"Bookings cant be done for previously!\");\n }\n else\n System.out.println(\"Sorry no slots available for sort\"+userSportName);\n }\n else\n {\n System.out.println(\"Sorry! sport is not is not available.\");\n\n }\n\n }\n else\n System.out.println(\"Finances are poor!\");\n }\n }\n else\n System.out.println(\"Sorry you are not in any club!\");\n\n }", "private void checkExistenceBookItem(HttpServletRequest request, HttpServletResponse response, HttpSession session, RequestDispatcher dispatcher) throws IOException, ServletException {\n\t\t\n\t\tString bookItemCode = (String) session.getAttribute(\"bookCodeFromUserNoRegisterBefore\");\n\t\t//Set name of book to \"\" to check existence\n\t\t\n\t\tthis.bookItem.getValueProperties()[BookItem.BOOK_ITEM_TITLE] = \"\";\n\t\t//Get information about book has Id is bookItemId\n\t\t\n\t\tthis.bookItem.getValueInformations(bookItemCode, BookItem.BOOK_ITEM_CODE);\n\t\t\n\t\tif(!this.bookItem.getValueProperties()[BookItem.BOOK_ITEM_TITLE].equals(\"\")) {\n\t\t\t//Set attributes to display to user\n\t\t\t\n\t\t\tsession.setAttribute(\"codeLendBookNoRegisterLendingBook\", bookItemCode);\n\t\t\tsession.setAttribute(\"requestFromBookItem\", \"checkAvaibleBookItemNoRegisterBefore\");\n\t\t\tsession.setAttribute(\"bookItemIdFromBookItemController\", this.bookItem.getValueProperties()[BookItem.BOOK_ITEM_ID]);\n\t\t\t//Send redirect to BookTitleController\n\t\t\t\n\t\t\tresponse.sendRedirect(\"BookTitleController\");\n\t\t\t\n\t\t\treturn;\n\t\t} else {\n\t\t\t//Set attributes to display errors to user\n\t\t\t\n\t\t\tsession.setAttribute(\"styleSuccessLendingBookNotRegister\", \"display: none;\");\n\t\t\tsession.setAttribute(\"styleResultNoRegisterLendingBookContent\", \"display: block;\");\n\t\t\tsession.setAttribute(\"styleErrorUserNoRegisterLendingBookContent\", \"display: none;\");\n\t\t\tsession.setAttribute(\"styleNotFoundBookItemIdNoRegisterBeforeLendingBook\", \"display: block;\");\n\t\t\tsession.setAttribute(\"styleErrorNotAvaiableToLendingNoRegister\", \"display: none;\");\n\t\t\tsession.setAttribute(\"styleErrorBookItemNoRegisterLendingBook\", \"display: block;\");\n\t\t\tsession.setAttribute(\"styleInfringeRolesNotRegisterLendingBook\", \"display: none;\");\n\t\t\t//Create dispatcher and forward to main.jsp\n\t\t\t\n\t\t\tdispatcher = getServletContext().getRequestDispatcher(\"/main.jsp\");\n\t\t\tdispatcher.forward(request, response);\n\t\t\t\n\t\t\treturn;\n\t\t}\n\t}", "public void toCheckIn(String newCommand){\n if(this.serveOrNot == false){\n this.println(\"Please serve first!\");\n }\n else{\n String bookNumbers = newCommand.substring(7).trim();\n if (bookNumbers.length() == 0){\n this.println(\"Please enter the book number to check in!\");\n }\n else{\n String[] bookNumberList = bookNumbers.split(\",\");\n //check see if the numberlist is out of range or not, if everything is correct, within the checkNum function, we implement checkIn\n checkNum(bookNumberList, true);\n } \n //this.println(printPatronInfo());\n }\n \n }", "public Borrower(String fName, String lName, String lNumber, int numberOfBooks, \r\n String street, String town, String postcode)\r\n {\r\n firstName = fName;\r\n lastName = lName;\r\n libraryNumber = lNumber;\r\n noOfBooks = numberOfBooks; \r\n address = new Address(street, town, postcode);\r\n }", "@Override\n public void onClick(View v) {\n\n Log.d(\"accepted\", \"confirm button clicked\");\n\n bookRef.get().addOnCompleteListener(new OnCompleteListener<DocumentSnapshot>() {\n @Override\n public void onComplete(@NonNull Task<DocumentSnapshot> task) {\n if (task.isSuccessful()) {\n DocumentSnapshot document = task.getResult();\n if (document.exists()) {\n // set borrower status to 'borrowed'\n Map<String, String> status = (Map<String, String>) document.getData().get(\"status\");\n status.put(\"borrower\", null);\n\n bookRef.update(\"status\", status);\n\n finish();\n }\n }\n }\n });\n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n String idbook = request.getParameter(\"book\");\r\n request.setAttribute(\"book\", BookManager.getById(Integer.parseInt(idbook)));\r\n RequestDispatcher rd = request.getRequestDispatcher(\"borrow.jsp\");\r\n rd.forward(request, response);\r\n }" ]
[ "0.73618376", "0.6871017", "0.67654276", "0.6464853", "0.63965607", "0.6357133", "0.63466847", "0.6268266", "0.61658716", "0.60271096", "0.60200626", "0.5989281", "0.5983688", "0.59221447", "0.5874552", "0.5861467", "0.5853606", "0.5799265", "0.576901", "0.576899", "0.57495415", "0.57386523", "0.573762", "0.57010233", "0.56923175", "0.56778246", "0.5653851", "0.5647117", "0.5645596", "0.561994", "0.55822474", "0.5575727", "0.5538064", "0.5518035", "0.5517989", "0.55053", "0.5503181", "0.5502583", "0.5499985", "0.5488554", "0.5488242", "0.5479032", "0.5478748", "0.54785305", "0.546896", "0.54662293", "0.54662293", "0.54662293", "0.5441634", "0.5434577", "0.54214406", "0.54165566", "0.54124856", "0.54119056", "0.5408492", "0.5405385", "0.54024094", "0.53708327", "0.5368815", "0.5364465", "0.53636503", "0.5352366", "0.5345156", "0.5336103", "0.5322088", "0.53170955", "0.5316834", "0.52944344", "0.52851784", "0.5278151", "0.527415", "0.52709407", "0.5270573", "0.5255145", "0.52449614", "0.52344614", "0.5233754", "0.52331847", "0.52214396", "0.5216628", "0.5216628", "0.52050066", "0.5194657", "0.5193354", "0.5187958", "0.5184761", "0.51804644", "0.51800114", "0.5178143", "0.51633424", "0.5161488", "0.51516885", "0.5150886", "0.5140107", "0.51392114", "0.5134877", "0.5125444", "0.51173484", "0.51171637", "0.5117078" ]
0.7690281
0
/Checks if studentId entered exists by checking if the given student Id entered does not lead to an IndexOutOfBoundsException in the ALL_STUDENTS ArrayList
private static boolean studentExists(int studentId){ try{ ALL_STUDENTS.get(studentId); return true; } catch(IndexOutOfBoundsException e){ return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic boolean findStudentIdExists(String studentId) {\n\t\treturn db.findStudentIdExists(studentId);\r\n\t}", "public boolean addStudent(int studentID) {\n\n boolean found = false;\n\n for (int i = 0; i < this.students.size(); i++) {\n if (getStudentID(i) == studentID) {\n found = true;\n break;\n }\n }\n if (found) {\n System.out.println(\"This student is already participating in this course!\");\n return true;\n } else {\n this.students.add(studentID);\n return false;\n }\n }", "private void checkID(int ID)\r\n {\r\n if(student_IDs.contains(ID))\r\n {\r\n throw new IllegalArgumentException(\"There is already a student that exists with this ID: \" + ID);\r\n }\r\n }", "private boolean checkDuplicate(int id) {\r\n boolean x = false;\r\n for (Registration registration : studentRegList) {\r\n if (id == registration.getCourseId()) {\r\n x = true;\r\n break;\r\n }\r\n x = false;\r\n }\r\n return x;\r\n }", "private int studentExists(String name) {\n\n // validate name\n if (name == null || name == \"\") {\n return -1;\n }\n\n for (int i = 0; i < studentList.size(); i++) {\n if (name.equals((studentList.get(i)).getName())) {\n // return index if name is equal\n return i;\n }\n }\n // student does not exist\n return -1;\n }", "public boolean addNew(Student st){\n for(Student stItem : listStudents){\r\n // check for duplicate id\r\n if(stItem.getId() == st.getId()) return false;\r\n \r\n// if(checkRule(stItem, st)) break;\r\n// else return false;\r\n \r\n }\r\n this.listStudents.add(st);\r\n return true;\r\n }", "public boolean containsStudent(final int matrnr) {\n return students.containsKey(matrnr);\n }", "private static String searchStudent ( int studentId){\n for (Student s : studentDB) {\n if (s.getID() == studentId) {\n return s.getName();\n }\n }\n return \"\";\n }", "private boolean studentExists(int student) throws SQLException {\n\t\tString sql = \"SELECT * FROM student WHERE student_num ==?\";\n\n\t\ttry (PreparedStatement ps = c.prepareStatement(sql)) {\n\t\t\tps.setInt(1, student);\n\t\t\tResultSet results = ps.executeQuery();\n\t\t\treturn results.next();\n\n\t\t}\n\t}", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof Students)) {\r\n return false;\r\n }\r\n Students other = (Students) object;\r\n if ((this.studentId == null && other.studentId != null) || (this.studentId != null && !this.studentId.equals(other.studentId))) {\r\n return false;\r\n }\r\n return true;\r\n }", "public ArrayList<Student> filterSearchStudentList(int stuNum){\n \n ArrayList<Student> filteredList = new ArrayList<Student>();\n \n int existance = 0;\n\n for(int i = 0; i<studList.size(); i++){\n \n if(studList.get(i).getStuNumber() <= stuNum){\n \n Student keyListOb = new Student(studList.get(i).getFullName(), studList.get(i).getStuNumber(), studList.get(i).getGPA());\n filteredList.add(keyListOb);\n }\n \n else{\n existance++;\n }\n }\n if(existance == studList.size()){\n System.out.println(\"\\nNo results\");\n }\n\n for(int i =0; i<filteredList.size();i++){\n System.out.println(\"Student Name: \" + filteredList.get(i).getFullName() + \", Student Number: \" + filteredList.get(i).getStuNumber() + \", Student GPA: \" + filteredList.get(i).getGPA());\n }\n\n return filteredList;\n }", "public boolean checkStudentID(Student s) {\n\t\tboolean res = false;\n\t\tConnection conn = DBUtil.getConn();\n\t\tStatement stmt = DBUtil.createStmt(conn);\n\t\tString sql = \"select * from student where stu_ID=%d\";\n\t\tsql = String.format(sql, s.getID());\n\t\tSystem.out.println(sql);\n\t\tResultSet rst = DBUtil.getRs(stmt, sql);\n\t\ttry {\n\t\t\tif (rst.next()) {\n\t\t\t\tres = true;\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\tres = false;\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\tDBUtil.closeStmt(stmt);\n\t\t\tDBUtil.closeConn(conn);\n\t\t\tDBUtil.closeRs(rst);\n\t\t}\n\t\treturn res;\n\t}", "boolean checkItem (List<Student> search, int item){\r\n // We use for loop to search\r\n for (int i = 0; i < search.size(); i++) {\r\n // if item exists, then we reutrn true\r\n if (item == i){\r\n return true;\r\n }\r\n }\r\n // else if it doesn't, then we return false\r\n return false;\r\n }", "public static int search(Student[] student,int studentID){\n for(int i=0;i<student.length;i++){\n if(student[i].getStudentID()==studentID){\n return i;\n } \n }\n return -1;//if there is not student id in array,this result will be -1\n }", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof Student)) {\r\n return false;\r\n }\r\n Student other = (Student) object;\r\n if ((this.studentid == null && other.studentid != null) || (this.studentid != null && !this.studentid.equals(other.studentid))) {\r\n return false;\r\n }\r\n return true;\r\n }", "public static void removeStudent(ArrayList<Student> sList,String id){\n\t\tint found=0;\n\t\tfor(int i=0;i<sList.size();i++){\n\t\t\tif(sList.get(i).getId().equals(id)){\n\t\t\t\tSystem.out.println(\"Student with ID \"+id+\" is deleted.\");\n\t\t\t\tsList.remove(i); found=1; break;\n\t\t\t}\n\t\t}\n\t\tif(found==0){System.out.println(\"No such student is found.\");}\n\t}", "public void checkDuplicate (ArrayList studentAnswer, int answer) {\r\n if (!studentAnswer.contains(answer)){\r\n studentAnswer.add(answer);\r\n }\r\n }", "private void ADDStudents(Student s) {\n\t\t\tint exist = 0;\n\n\t\t\tif(data.size() > 0) {\n\t\t\t\tfor(Student st: data) {\n\t\t\t\t\tif(s.id == st.id) {\n\t\t\t\t\t\texist = 1;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tthrow new Exception(\"This student already in the table.\");\n\t\t\t\t\t\t\t}catch(Exception ex){\n\t\t\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"This student already in the table.\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tIDField.setText(\"\");\n\t\t\t\t\t\tfirstNameField.setText(\"\");\n\t\t\t\t\t\tlastNameField.setText(\"\");\n\t\t\t\t\t\tgenderField.setText(\"\");\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t\t}\n\t\t\t\tdata.add(s);\n\t\t\t\tObject[] row = new Object[4];\n\t\t\t\trow[0] = \"\" + s.id;\n\t\t\t\trow[1] = s.firstName;\n\t\t\t\trow[2] = s.lastName;\n\t\t\t\trow[3] = s.gender;\n\t\t\t\tmodel.addRow(row);\n\t\t\t if(exist ==1) {\n\t\t\t\t data.remove(s);\n\t\t\t\t model.removeRow(data.size());\n\t\t\t }\n\t\t\t\t\n\t\t\t}", "@Override\r\n public boolean equals(Object object)\r\n {\n if (!(object instanceof Student))\r\n {\r\n return false;\r\n }\r\n Student other = (Student) object;\r\n if ((this.idStudent == null && other.idStudent != null) || (this.idStudent != null && !this.idStudent.equals(other.idStudent)))\r\n {\r\n return false;\r\n }\r\n return true;\r\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof Student)) {\n return false;\n }\n Student other = (Student) object;\n if ((this.studentID == null && other.studentID != null) || (this.studentID != null && !this.studentID.equals(other.studentID))) {\n return false;\n }\n return true;\n }", "@Override\n public boolean equals(Object o) {\n if (this == o) {\n return true;\n }\n if (!(o instanceof Student)) {\n return false;\n }\n return id != null && id.equals(((Student) o).id);\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof Student)) {\n return false;\n }\n Student other = (Student) object;\n if ((this.estId == null && other.estId != null) || (this.estId != null && !this.estId.equals(other.estId))) {\n return false;\n }\n return true;\n }", "public String entryValidation(Student student) {\r\n\t\tint i = 0;\r\n\t\t// For looping i times (i being rows in the database)\r\n\t\tfor (i = 0 ; i < getStudents().size() ; i++) {\r\n\t\t\t// If there's already a record with the same name, refuse to enter it\r\n\t\t\tif (student.getName().equalsIgnoreCase(students.get(i).getName()))\r\n\t\t\t{\r\n\t\t\t\t// Faces message for user\r\n\t FacesMessage message = new FacesMessage(\"• Error: Duplicate entry '\" + student.getName() + \"' for key 'name'\");\r\n\t FacesContext context = FacesContext.getCurrentInstance();\r\n\t context.addMessage(addButton.getClientId(context), message);\r\n\t // Do nothing pretty much & return\r\n\t\t\t\treturn \"addStudent.xhtml\";\r\n\t\t\t}\r\n\t\t\t// If there's already a record with the same Student ID\r\n\t\t\tif (student.getSid().equalsIgnoreCase(students.get(i).getSid()))\r\n\t\t\t{\r\n\t\t\t\t// Faces message for user\r\n\t FacesMessage message = new FacesMessage(\"• Error: Duplicate entry '\" + student.getSid() + \"' for key 'PRIMARY'\");\r\n\t FacesContext context = FacesContext.getCurrentInstance();\r\n\t context.addMessage(addButton.getClientId(context), message);\r\n\t // Do nothing pretty much & return\r\n\t\t\t\treturn \"addStudent.xhtml\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t// If it's a unique name stick the student in the database & return to the previous page\r\n\t\tinsert(student); \t\t\t\r\n\t\treturn \"studentDisplay.xhtml\";\r\n\t}", "public boolean checkExistenceId(int id) {\n\t\tfor (int i=0; i<getDataLength(); i++) {\n\t\t\tif (this.dataList.get(i).getId()==id)\n\t\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "private Student getStudentByID(String sid) {\n\t\tfor(Student student: students) {\r\n\t\t\t//no need to check for null as Array list is dynamic and \r\n\t\t\tif(student.getStudentId().equals(sid)) {\r\n\t\t\t\treturn student;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//return null if sid was not found\r\n\t\treturn null;\r\n\t}", "public void addStudentWithId(int id) {\n\t\tfor(Team team : this.schoolClass.getTeams()) {\n\t\t\tif(team.containsStudentWithId(id)) {\n\t\t\t\tSystem.out.println(\"Adding a Student From Team \" + team.getName());\n\t\t\t\tif(activeTurnTeamIndex < 0) {\n\t\t\t\t\tactiveTurnTeamIndex = 0;\n\t\t\t\t}\n\t\t\t\tclearUpToDateStatus();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}", "public static void changeGrade(Student[] student,int studentID,ExamGrade examGrade){\n int count=0; //there is count int because of finding given student id have or not\n for(int i=0;i<student.length;i++){\n if(student[i].getStudentID()==studentID){\n student[i].setExamGrade(examGrade);\n ++count;\n }\n }\n\n if(count==0){//if caunt do not equal 0,it says that the given student id is in the array\n System.out.println(\"No such student\");\n }\n }", "public boolean deleteStudent(String id) {\n\t\tfor (String key : list.keySet()) {\n\t\t\tif (id.equals(key)){\n\t\t\t\tlist.remove(key);\n\t\t\t\treturn true;\n\t\t\t}\t\t\t\t\n\t\t}\n\t\treturn false;\n\t}", "public boolean isOnAList(Student student) {\n return (getWaitlist().contains(student) || getMorningRoster().contains(student) \n || getEveningRoster().contains(student));\n }", "public static boolean checkIfStudentExists(String MatricNo) {\n\t\treturn StudentList.stream().anyMatch(Student -> MatricNo.equals(Student.getMatricNo()));\n\t}", "boolean containsStudentWith(String name);", "@Override\n\tpublic boolean isUserExist(StudentForm student) {\n\t\treturn false;\n\t}", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof Students)) {\r\n return false;\r\n }\r\n Students other = (Students) object;\r\n if ((this.sno == null && other.sno != null) || (this.sno != null && !this.sno.equals(other.sno))) {\r\n return false;\r\n }\r\n return true;\r\n }", "private void printStudListByCourse() throws Exception {\n String courseID = null;\n ArrayList<Student> studentList = new ArrayList<Student>();\n\n Scanner sc = new Scanner(System.in);\n\n System.out.println(\"\\nPlease enter course ID\");\n courseID = sc.nextLine();\n while(!courseID.matches(\"^[a-zA-Z]{2}[0-9]{4}$\")){\n System.out.println(\"Invalid input! Please enter a valid index number!\");\n courseID = sc.nextLine();\n }\n\n studentList= this.adminManager.getStudentByCourse(courseID);\n if(studentList == null){\n System.out.println(\"\\nThere is no such a course index\\n\\n\");\n System.exit(1);\n }\n if (studentList.isEmpty()){\n System.out.println(\"\\nThere is no student registered for this course ID\\n\\n\");\n return;\n }\n else{\n System.out.println(\"Hang on a moment while we load database.\\n\\n\");\n System.out.println(\"------------------------------------------------------\");\n System.out.println(\" STUDENT NAME GENDER NATIONALITY\");\n System.out.println(\"------------------------------------------------------\");\n //\n for(Student student:studentList){\n System.out.println(String.format(\"%20s %6s %s\",student.getName(),student.getGender(),student.getNationality()));\n }\n\n System.out.println(\"------------------------------------------------------\\n\");\n }\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof Student)) {\n return false;\n }\n Student other = (Student) object;\n if ((this.studentuserID == null && other.studentuserID != null) || (this.studentuserID != null && !this.studentuserID.equals(other.studentuserID))) {\n return false;\n }\n return true;\n }", "@GetMapping(\"/students/{studentID}\")\n\t\tpublic Student getStudent(@PathVariable int studentID){\n\t\t\t\n\t\t\t\n\t\t\t//check to see the if the list size is available on the students list array\n\t\t\tif ((studentID >= theStudents.size()) || (studentID<0)) {\n\t\t\t\t\n\t\t\t\tthrow new StudentNotFoundException(\"Student not found :\" + studentID);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t/*\n\t\t\t * For this example we using the ID as array index reference \n\t\t\t */\n\t\t\treturn theStudents.get(studentID);\n\t\t}", "void checkNotFound(Integer id);", "public Student searchStudent(String id) {\n\t\tfor (String key : list.keySet()) {\n\t\t\tif(id.equals(key))\n\t\t\t\treturn list.get(key);\n\t\t}\n\t\treturn null;\n\t}", "@Test\n public void execute_invalidStudentIndexFilteredList_failure() {\n showStudentAtIndex(model, INDEX_FIRST_STUDENT);\n Index outOfBoundIndex = INDEX_SECOND_STUDENT;\n // ensures that outOfBoundIndex is still in bounds of address book list\n assertTrue(outOfBoundIndex.getZeroBased() < model.getAddressBook().getStudentList().size());\n\n MarkStudentAttCommand markStudentAttCommand = new MarkStudentAttCommand(outOfBoundIndex, FIRST_WEEK);\n\n assertCommandFailure(markStudentAttCommand, model, Messages.MESSAGE_INVALID_STUDENT_DISPLAYED_INDEX);\n }", "private void findEntry() {\n String desiredId = idField.getText();\n Student student = studentHashMap.get(desiredId);\n\n try {\n if (student == null) {\n throw new NoMatchFoundException();\n } else if (this.checkInput(student) == false) {\n throw new InputMismatchException();\n } else if (studentHashMap.containsKey(desiredId)) {\n this.displayStatusPanel(\n \"EMPLID: \" + desiredId + \"\\n\" + student.toString(),\n \"Find\",\n JOptionPane.INFORMATION_MESSAGE\n );\n } else {\n throw new NoMatchFoundException();\n }\n } catch(NoMatchFoundException ex) {\n this.displayStatusPanel(\n \"Error: Entry not found.\",\n \"Error\",\n JOptionPane.WARNING_MESSAGE\n );\n } catch(InputMismatchException e) {\n this.displayStatusPanel(\n \"Error: Information does not match data on file.\",\n \"Error\",\n JOptionPane.WARNING_MESSAGE\n );\n }\n }", "private boolean isIndexExist(int index) {\n return index >= 0 && index < size();\n }", "public Student findStudent(int id);", "public static void remove(String studentID) {\n Integer StuID = Integer.parseInt(studentID);\n for (int i = 0; i < roster.size(); i++)\n if (roster.get(i).getStudentID().equals(StuID))\n {\n roster.remove((roster.get(i).getStudentID() - 1));\n System.out.println(\"Student \" + studentID + \" was successfully removed from the list.\");\n return;\n }\n System.out.println(\"Error: A student with ID number \" + studentID + \" was not found.\");\n }", "@Override\r\n\t\tpublic boolean equals (Object o) {\r\n\t\t if (!(o instanceof Student) || o == null) {\r\n\t\t \treturn false; \r\n\t\t }\r\n\t\t // Checking if student number and name are equal\r\n\t\t Student s = (Student) o;\r\n\t\t return studentID.equals(s.studentID) && name.equals(s.name);\r\n\t\t}", "public String add(Student s) {\r\n\t\tString addString = new String();\r\n\t\t\r\n\t\tif(find(s) == -1) {\r\n\t\t\tint i = 0;\r\n\t\t\ttry {\r\n\t\t\t\twhile(list[i] != null) {\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}\r\n\t\t\t\tlist[i] = s;\r\n\t\t\t\tnumStudents++;\r\n\t\t\t} \r\n\t\t\tcatch(Exception e) {\r\n\t\t\t\tgrow();\r\n\t\t\t\tadd(s);\r\n\t\t\t}\t\r\n\t\t}\r\n\t\telse {\r\n\t\t\tSystem.out.println(\"\\nCannot Add! student already in list\");\r\n\t\t\taddString = addString + \"\\nCannot Add! student already in list\";\r\n\t\t}\r\n\t\t\r\n\t\treturn addString;\r\n\t\t\r\n\t\t\r\n\t}", "public void setStudentId(String studentId) {\r\n this.studentId = studentId;\r\n }", "private int getIndexIfStoreObjWithIdAlreadyExists(String storeId, List<Store> storeList) {\n for (int i = 0; i < storeList.size(); i++) {\n Store store = storeList.get(i);\n String id = store.getStoreId();\n if (!TextUtils.isEmpty(id) && id.equalsIgnoreCase(storeId))\n return i;\n }\n return -1;\n }", "@Override\n\tpublic boolean equals(Object obj) {\n\t\tif(obj == this){\n\t\t\treturn true;\n\t\t}\n\t\tif(obj instanceof Student){\n\t\t\tStudent s = (Student)obj;\n\t\t\tif(s.sid == this.sid){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "@Override\r\n\tpublic boolean equals(Object arg0) {\n\t\t Student s=(Student)arg0;\r\n\t\treturn this.id==s.id;\r\n\t}", "public boolean add(Student aStudent)\r\n\t{\n\t\tboolean check = false;\r\n\t\t\r\n\t\t//\tIf array is full, stop inserting more Student objects in array\r\n\t\tif (pointer >= size)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"\\nSorry: classroom is full.\");\r\n\t\t\t\r\n\t\t\treturn check;\r\n\t\t}\r\n\t\t\r\n\t\t//\tIf student's has gpa is not between 0 and 4, or name is not given, do not insert Student object in array\r\n\t\telse if (aStudent.getName().trim().isEmpty() || aStudent.getGPA() < 0 || aStudent.getGPA() > 4)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"\\nSorry: Name has no characters or gpa is not between 0 & 4.\");\r\n\t\t\tpointer++;\r\n\t\t\t\r\n\t\t\treturn check;\r\n\t\t}\r\n\r\n\t\t//\tIf student gpa is between 0 and 4, and there is place in array, insert new Student object\r\n\t\telse\r\n\t\t{\r\n\t\t\tstudents[pointer] = aStudent;\r\n\t\t\tpointer++;\r\n\t\t\tcheck = true;\r\n\t\t\t\r\n\t\t\treturn check;\t\t\r\n\t\t}\r\n\t}", "public Student findStudent(int studentNumber)\r\n {\r\n for(Student s : students) // look in the list\r\n {\r\n if(s.getStudentNumber() == studentNumber) // if the student number is the same\r\n return s;\r\n }\r\n\r\n return null;\r\n }", "@Override\n\tpublic boolean insert(Student student) {\n\t\treturn sDao.insert(student) > 0;\n\t}", "public Student searchForStudent(int ID)\r\n {\r\n boolean found = false;\r\n Student student = null;\r\n Node currentNode = first_node;\r\n\r\n while(!found && currentNode != null)\r\n {\r\n if(currentNode.getData().getStudent_ID() == ID)\r\n {\r\n found = true;\r\n student = currentNode.getData();\r\n }\r\n else\r\n {\r\n currentNode = currentNode.getNextNode();\r\n }\r\n }\r\n return student;\r\n }", "public boolean addStudent(Student student) throws DocumentException, IOException {\n String name = student.getName();\n if(getUser(name)==null){//hasn't got a user called the same name\n String password = student.getPassword();\n Student.Speciality speciality = student.getSpeciality();\n String mail = student.getMail();\n root = document.getRootElement();\n Element root2 = root.addElement(\"student\");\n int nb = root.elements().size()-1;\n root2.addAttribute(\"id\", String.valueOf(nb));\n Element usernameElement = root2.addElement(\"username\");\n Element passwordElement = root2.addElement(\"password\");\n Element mailElement = root2.addElement(\"mail\");\n Element specialityElement = root2.addElement(\"speciality\");\n usernameElement.setText(name);\n passwordElement.setText(password);\n mailElement.setText(mail);\n specialityElement.setText(speciality.name());\n writeXML();\n return true;\n }\n else{//the same name already in the list\n return false;\n }\n }", "public static boolean isIDUsed(LinkedList<Stamp> stamps,int id)\n {\n\n for(int i = 0; i < stamps.size();i++){\n if(stamps.get(i).getID() == id){\n return true;\n }\n }\n return false;\n }", "private static int validateId(Artist[] painterObject, int arrayCount) {\n\t\tboolean flag = true;\n\t\tSystem.out.println(\"Enter painter id:\");\n\t\tint id = AllValidationChecks.positiveIntegerCheck();\n\t\tfor (int i = 0; i < arrayCount; i++) {\n\t\t\tif (id == painterObject[i].getId()) {\n\t\t\t\tflag = false;\n\t\t\t}\n\t\t}\n\t\tif (flag) {\n\t\t\treturn id;\n\t\t} else {\n\t\t\tSystem.out.println(\"id already exists\");\n\t\t\treturn validateId(painterObject, arrayCount);\n\t\t}\n\t}", "public boolean addTeacher(int teacherID) {\n\n boolean found = false;\n\n for (int i = 0; i < this.teachers.size(); i++) {\n if (getTeacherID(i) == teacherID) {\n found = true;\n break;\n }\n }\n if (found) {\n System.out.println(\"This teacher is already teaching in this course!\");\n return true;\n } else {\n this.teachers.add(teacherID);\n return false;\n }\n }", "public boolean getNewStudents(String schoolId) {\r\n\t\tConnection conn = null;\r\n\t\tPreparedStatement pstmt = null;\r\n\t\tResultSet rs = null;\r\n\t\ttry {\r\n\t\t\tconn = driver.connect(DATA_SOURCE, null);\r\n\t\t\tpstmt = conn.prepareCall(Constants.GET_NEW_STUDENTS);\r\n\t\t\tpstmt.setLong(1, Long.valueOf(schoolId));\r\n\t\t\trs = pstmt.executeQuery();\r\n\t\t\tif (rs.next()) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} finally {\r\n\t\t\ttry {\r\n\t\t\t\trs.close();\r\n\t\t\t} catch (Exception e2) {\r\n\t\t\t}\r\n\t\t\ttry {\r\n\t\t\t\tpstmt.close();\r\n\t\t\t} catch (Exception e2) {\r\n\t\t\t}\r\n\t\t\ttry {\r\n\t\t\t\tconn.close();\r\n\t\t\t} catch (Exception e2) {\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public void setStudentId(Integer studentId) {\n this.studentId = studentId;\n }", "public void setStudentId(Integer studentId) {\n this.studentId = studentId;\n }", "public void setStudentId(Long studentId) {\n this.studentId = studentId;\n }", "private void viewStudent() {\n //Lesen wir die ID\n Scanner sc = new Scanner(System.in);\n System.out.print(\"ID of the student to be viewed: \");\n long ID = sc.nextLong();\n\n Student s = ctrl.getStudent(ID);\n if (s != null)\n System.out.println(s.toString()); //wir zeigen die Student\n else\n System.out.println(\"Student with this ID doesn't exist!\");\n }", "@Test\n public void test1() {\n CourseAdd Course_Adder = new CourseAdd(MPCS_52011,Amanda,con);\n int updates = Course_Adder.getState().addStudent(Course_Adder,MPCS_52011,Amanda);\n assertEquals(1,updates); // Assert that an update was made\n List<Integer> StudentIDs = new ArrayList<Integer>();\n assertTrue(MPCS_52011.getStudents().contains(Amanda)); // Check if Amanda Present in course\n try{ // Check Database\n Statement stmt=con.createStatement();\n ResultSet rs=stmt.executeQuery(\"select StudentID from Course_Student where course_code = '\" + MPCS_52011.getcode() + \"';\");\n while(rs.next()){\n StudentIDs.add(rs.getInt(1)); // Add each student ID from database\n }\n }catch (Exception e){\n System.out.println(e);\n }\n assertTrue(StudentIDs.contains(Amanda.getID())); // Check if Amanda present in course\n }", "private static boolean setStudentInput(int i, String value, StudentDetails student){\n\t\tswitch (i){\n\t\tcase 0:\n\t\t\tif(Integer.parseInt(value) < 1){//checks if value for student Id is < 1. Students cannot have Id numbers less than 1.\n\t\t\t\tSystem.out.println(\"ERROR: Invalid Student Id! Student Id cannot be less than 1.\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tstudent.setId(Integer.parseInt(value));\n\t\t\treturn true;\n\t\tcase 1:\n\t\t\treturn student.setFirstName(value); //returns false if name input was invalid\n\t\tcase 2:\n\t\t\treturn student.setMiddleName(value); //returns false if name input was invalid\n\t\tcase 3:\n\t\t\treturn student.setLastName(value); //returns false if name input was invalid\n\t\tcase 4:\n\t\t\treturn student.setGrade(Integer.parseInt(value)); //returns false if grade input was invalid\t\t\t\n\t\tcase 5:\n\t\t\t/*check if bookId exists. If bookId exists set student's bookIdBorrowed property to bookId. If student has\n\t\t\tnot borrowed a book, then bookId borrowed should be 0.*/\n\t\t\tif(ALL_BOOKS.containsKey(Integer.parseInt(value)) || Integer.parseInt(value) == 0){\n\t\t\t\tstudent.setBookIdBorrowed(Integer.parseInt(value));\n\t\t\t\treturn true; //indicates no error was encountered when setting bookIdBorrowed\n\t\t\t}\n\t\t\telse{\n\t\t\t\tSystem.out.println(\"ERROR: BookId does not exist!\");\n\t\t\t\treturn false; //indicates error setting bookIdBorrowed\n\t\t\t}\n\t\tcase 6:\n\t\t\tstudent.setTotalFine(Double.parseDouble(value));\n\t\t\treturn true;\n\t\tdefault: //error input, a student can only have up to 7 fields\n\t\t\tSystem.out.println(\"Invalid Property\");\n\t\t\treturn false;\n\t\t}\t\n\t}", "private static int addNewStudent(){\n\t\tSystem.out.println(\"===Add New Student To Database===\");\n\t\tScanner string_input = new Scanner(System.in); //gets String input from the user\n\t\tScanner integer_input = new Scanner(System.in); //get integer input from the user\n\t\tStudentDetails new_student = new StudentDetails();\n\t\t\n\t\tString firstname;\n\t\tdo{\n\t\t\tSystem.out.println(\"Enter new student's first name: \");\n\t\t\tfirstname = string_input.next();\n\t\t}while(!new_student.setFirstName(firstname)); //loop until name input is valid\n\t\t\n\t\tString middlename;\n\t\tdo{\n\t\t\tSystem.out.println(\"Enter new student's middle name (Type 'null' if author has no middle name): \");\n\t\t\tmiddlename = string_input.next();\n\t\t}while(!new_student.setMiddleName(middlename)); //loop until name input is valid\n\t\t\n\t\tString lastname;\n\t\tdo{\n\t\t\tSystem.out.println(\"Enter new student's last name: \");\n\t\t\tlastname = string_input.next();\n\t\t}while(!new_student.setLastName(lastname)); //loop until name input is valid\n\t\t\n\t\tint grade;\n\t\tdo{\n\t\t\tSystem.out.println(\"Enter new student's grade (9 - 12): \");\n\t\t\tgrade = integer_input.nextInt();\n\t\t}while(!new_student.setGrade(grade)); //loop until name input is valid\n\t\t\n\t\tALL_STUDENTS.add(new_student);\n\t\tint new_studentId = ALL_STUDENTS.size() - 1; //since student was the most recently added element to the ALL_STUDENTS ArrayList, its index should be ALL_STUDENTS.size() - 1. Student's index in this ArrayList should be the new student's Id.\n\t\tnew_student.setId(new_studentId); //set the new student's Id\n\t\t\n\t\treturn new_student.getId();\n\t}", "public boolean containsId(String key, Long userId) {\n if(index.containsKey(key)) {\n return index.get(key).contains(userId);\n }\n return false;\n }", "@Override\n public boolean inputCheck(ArrayList<Integer> arr, int input,int index){\n if(arr.get(index) == input){return true;}\n return false;\n }", "public void setStudentId(int studentId) {\n\t\tStudentId = studentId;\n\t}", "public boolean add(Student student) {\r\n\t\ttry {\r\n\t\t\treturn students.add(student);\r\n\t\t} catch(Exception error) {\r\n\t\t\terror.printStackTrace();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "private int getIndexIfItemObjAlreadyExists(String itemId, List<Item> itemList) {\n for (int i = 0; i < itemList.size(); i++) {\n Item item = itemList.get(i);\n String id = item.getItemId();\n if (!TextUtils.isEmpty(id) && id.equalsIgnoreCase(itemId))\n return i;\n }\n return -1;\n }", "public void addStudent(Student student){\n if (students.size() >=0 && students.size() <=5)\n students.add(student);\n else throw new ArrayIndexOutOfBoundsException();\n }", "public ArrayList<Student> retrieveStudentsInvitedByTeam(int teamId) {\r\n\t\tArrayList<Student> students = new ArrayList<Student>();\r\n\t\tHashMap<String, ArrayList<String>> map = MySQLConnector.executeMySQL(\"select\", \"SELECT * FROM team_request WHERE team_id = \" + teamId);\r\n\t\tSet<String> keySet = map.keySet();\r\n\t\tIterator<String> iterator = keySet.iterator();\r\n\t\t\r\n\t\twhile (iterator.hasNext()){\r\n\t\t\tString key = iterator.next();\r\n\t\t\tArrayList<String> array = map.get(key);\t\r\n\t\t\tint stdId\t \t= Integer.parseInt(array.get(2));\r\n\t\t\t\r\n\t\t\tStudent student = null;\r\n\t\t\t\r\n\t\t\ttry{\r\n\t\t\t\tstudent = retrieve(stdId);\r\n\t\t\t}catch(Exception e){}\r\n\t\t\t\r\n\t\t\tstudents.add(student);\r\n\t\t}\r\n\t\t\r\n\t\treturn students;\r\n\t}", "public boolean exists(String id){\n return eventIdsList.contains(id);\n }", "public void setId(int studentId) \r\n {\r\n String strId = String.valueOf(studentId);\r\n if (studentId < 0 ) \r\n {\r\n throw new IllegalArgumentException(\"Student ID cannot be less than zero.\");\r\n } \r\n else if(strId == null || strId.trim().isBlank())\r\n {\r\n throw new IllegalArgumentException(\"Student id cannot be blank.\");\r\n }\r\n else \r\n {\r\n this.studentId = studentId;\r\n }\r\n\r\n }", "public static List<StudentInfo> searchStudentInfo(String firtname, String lastname) {\r\n \r\n List<StudentInfo> students = new ArrayList<>();\r\n \r\n // declare resultSet\r\n ResultSet rs = null;\r\n \r\n // declare prepared statement\r\n PreparedStatement preparedStatement = null;\r\n \r\n // declare connection\r\n Connection conn = null;\r\n try {\r\n // get connection\r\n conn = DBUtils.getConnection();\r\n\r\n // set prepared statement\r\n preparedStatement = conn\r\n .prepareStatement(\"SELECT instructor.FName, instructor.LName,\" +\r\n \" IF(EXISTS ( SELECT * FROM gra WHERE gra.StudentId = phdstudent.StudentId) , 'GRA', \" +\r\n \" IF(EXISTS ( SELECT * FROM gta WHERE gta.StudentId = phdstudent.StudentId) , 'GTA', \" +\r\n \" IF(EXISTS ( SELECT * FROM scholarshipsupport WHERE scholarshipsupport.StudentId = phdstudent.StudentId) , 'scholarship', \" +\r\n \" IF(EXISTS ( SELECT * FROM selfsupport WHERE selfsupport.StudentId = phdstudent.StudentId) , 'self', ''))\" +\r\n \" )) AS StudentType, \" +\r\n \" milestone.MName, milestonespassed.PassDate\" +\r\n \" FROM phdstudent left join instructor on instructor.InstructorId = phdstudent.Supervisor\"\r\n + \" left join milestonespassed on phdstudent.StudentId = milestonespassed.StudentId\"\r\n + \" left join milestone on milestonespassed.MID = milestone.MID\" +\r\n \" WHERE phdstudent.FName = ? AND phdstudent.LName = ?\");\r\n \r\n // execute query\r\n preparedStatement.setString(1, firtname);\r\n preparedStatement.setString(2, lastname); \r\n\r\n rs = preparedStatement.executeQuery();\r\n \r\n //iterate and create the StudentInfo objects\r\n while (rs.next()) {\r\n \r\n students.add(new StudentInfo(rs.getString(1)+ \" \" + rs.getString(2), rs.getString(3), rs.getString(4), \r\n utils.Utils.toDate(rs.getDate(5))));\r\n\r\n }\r\n }catch(Exception ex){\r\n ex.printStackTrace();\r\n }\r\n finally {\r\n DBUtils.closeResource(conn);\r\n DBUtils.closeResource(preparedStatement);\r\n DBUtils.closeResource(rs);\r\n } \r\n \r\n return students; \r\n }", "public student getstudent(Integer id);", "public java.util.List findStudentByStudentId(java.lang.Integer studentId) throws GenericBusinessException {\n sust.paperlessexm.hibernatehelper.HibernateQueryHelper hibernateTemplate = new sust.paperlessexm.hibernatehelper.HibernateQueryHelper();\n try {\n String queryString = \"from \" + Student.class.getName() + \" e where e.studentId like :studentId \";\n // Add a an order by on all primary keys to assure reproducable results.\n String orderByPart = \"\";\n orderByPart += \" order by e.studentId\";\n queryString += orderByPart;\n Query query = hibernateTemplate.createQuery(queryString);\n hibernateTemplate.setQueryParameter(query, \"studentId\", studentId);\n List list = hibernateTemplate.list(query);\n return list;\n } finally {\n log.debug(\"finished findStudentByStudentId(java.lang.Integer studentId)\");\n }\n }", "private int searchId(String id){\n\t\tint index = -1; // -1(존재안함)\n\t\t\n\t\tfor(int i = 0; i < list.size(); i++){\n\t\t\tif(id.equals(list.get(i).getId())){\n\t\t\t\t//stu = list.get(i);\n\t\t\t\tindex = i;\n\t\t\t}\n\t\t}\t\t\t\t\n\t\treturn index;\n\t}", "public void enroll_Student(CourseOffering course, String studentID){\n\n StudentModel student = findStudent(course, studentID);\n if(student == null){\n System.out.println(\"\\n>>Enrollment denied: \" + studentID + \"<<\");\n\n return;\n }\n\n\n for(StudentModel stuList : course.getStudentsAllowedToEnroll()){\n if(stuList.getID().equals(studentID)){\n //there is no enrollment list\n if(course.getStudentsEnrolled().isEmpty()){\n\n this.enrollStuList = new ArrayList<>();\n this.enrollCourseList = new ArrayList<>();\n\n this.enrollStuList.add(course);\n stuList.setCoursesEnrolled(enrollStuList);\n\n this.enrollCourseList.add(stuList);\n course.setStudentsEnrolled(enrollCourseList);\n\n System.out.println(\"\\nEnrolling \" + stuList.getID() + \" in \" + course.getCourseID());\n }\n //there already is an enrollment list\n else{\n\n this.enrollStuList.add(course);\n stuList.setCoursesEnrolled(this.enrollStuList);\n\n this.enrollCourseList.add(stuList);\n course.setStudentsEnrolled(this.enrollCourseList);\n\n System.out.println(\"\\nEnrolling \" + stuList.getID() + \" in \" + course.getCourseID());\n }\n }\n }\n\n\n\n }", "public static boolean checkKeyMapping(HashMap<Integer, String> students, int key) {\n\t\treturn students.containsKey(key);\n\t}", "public static void editStudentInfo(){\n System.out.println(\"Enter the students ID\");\r\n System.out.println(\"=============================\");\r\n Scanner studentNameSearch = new Scanner(System.in);\r\n String idToSearch = studentNameSearch.nextLine();\r\n for (Student searchStudent : studentList){ //basic loop to search through the list of student by the ID\r\n if (searchStudent.getStudentID().equals(idToSearch)){\r\n searchStudent.printStudentInfo();\r\n System.out.println(\"What would you like to do?\");\r\n System.out.println(\"===========================\");\r\n System.out.println(\"1: Change a students name\");\r\n System.out.println(\"2: Add a course\");\r\n System.out.println(\"3: Remove a course\");\r\n System.out.println(\"4: Set course as completed\");\r\n System.out.println(\" \");\r\n Scanner editChoice = new Scanner(System.in);\r\n\r\n switch (editChoice.nextInt()){\r\n case 1 -> {\r\n //Edit first and last name\r\n Scanner newNameInput = new Scanner(System.in);\r\n System.out.println(\"Enter the students Last name\");\r\n String newName = newNameInput.nextLine();\r\n searchStudent.setLastName(newName);\r\n System.out.println(\"Enter the students First name\");\r\n String newName1 = newNameInput.nextLine();\r\n searchStudent.setFirstName(newName1);\r\n searchStudent.getFullName();\r\n mainMenu();\r\n }\r\n case 2 -> {\r\n //search for a course and add a course to the students schedule\r\n System.out.println(\"Enter the course ID\");\r\n Scanner courseToAdd = new Scanner(System.in);\r\n String courseIdToSearch = courseToAdd.nextLine();\r\n for (Course searchCourse : courseList){\r\n if (searchCourse.getCourseID().equals(courseIdToSearch)){\r\n searchStudent.addClasstoSchedule(searchCourse);\r\n }\r\n }\r\n mainMenu();\r\n }\r\n case 3 -> {\r\n //remove a course from the students schedule\r\n System.out.println(\"Enter the course ID\");\r\n Scanner courseToAdd = new Scanner(System.in);\r\n String courseIdToSearch = courseToAdd.nextLine();\r\n for (Course searchCourse : courseList){\r\n if (searchCourse.getCourseID().equals(courseIdToSearch)){\r\n searchStudent.removeClassFromSchedule(searchCourse);\r\n }\r\n }\r\n mainMenu();\r\n }\r\n case 4 ->{\r\n //Set a course as completed\r\n System.out.println(\"Enter the course ID\");\r\n Scanner courseToAdd = new Scanner(System.in);\r\n String courseIdToSearch = courseToAdd.nextLine();\r\n for (Course searchCourse : courseList){\r\n if (searchCourse.getCourseID().equals(courseIdToSearch)){\r\n searchStudent.setCourseComplete(courseIdToSearch);\r\n }\r\n }\r\n mainMenu();\r\n }\r\n default -> {\r\n //does nothing\r\n }\r\n\r\n }\r\n\r\n }\r\n else{\r\n System.err.println(\"Could not find student based on that ID\");\r\n mainMenu();\r\n }\r\n }\r\n }", "public Student find(int id) {\n\n\t\tfor (int i = 0; i < studentList.size(); i++) {\n\t\t\tif (studentList.get(i).getId() == id) {\n\t\t\t\treturn studentList.get(i);\n\n\t\t\t}\n\n\t\t}\n\t\treturn null;\n\n\t}", "private boolean checkUserNameExists(ArrayList<Member> members) throws Exception {\nfor(Member member:members) {\nif(this.userName.equals(member.userName)){\nreturn true;\n}\n}\nreturn false;\n}", "synchronized public boolean addToEveningRoster(Student student){\n if(getWaitlist().contains(student)) {\n getWaitlist().remove(student);\n }\n if(getTotalEnrolledEvening() < MAXROSTER) {\n getEveningRoster().add(student);\n return true;\n }\n else if(getTotalEnrolledMorning() <MAXROSTER) {\n getMorningRoster().add(student);\n return true;\n }\n else {\n getWaitlist().add(student);\n }\n return false;\n }", "@Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n listStudents((Map<String, Object>) dataSnapshot.getValue());\n Log.d(TAG, sStud);\n if (sStud.contains(isStudent)) {\n startActivity(new Intent(SignInActivity.this.getApplicationContext(), StudentHomeActivity.class));\n } else {\n startActivity(new Intent(SignInActivity.this.getApplicationContext(), HomeActivity.class));\n }\n }", "private void loardSid() throws IOException{\n StudentController studentController = new StudentController();\n \n List<StudentDTO>list;\n \n try {\n list = studentController.getAllStudent();\n for (StudentDTO studentDTO : list) {\n cmbStudentID.addItem(studentDTO.getId());\n }\n } catch (Exception ex) {\n Logger.getLogger(Registation.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public int checkIndex(String identifier) {\n\t\tint aimedIndex = -1;\n\t\tfor(Train train: trainlist){\n\t\t\tif(train.toString().equals(identifier))\n\t\t\t\taimedIndex = trainlist.indexOf(train);\n\t\t}\n\t\treturn aimedIndex;\t\n\t}", "public boolean containsPersonWithId(int id) {\n\t\tif(id == teacherId) {\n\t\t\treturn true;\n\t\t}\n\t\tfor(Team team : this.schoolClass.getTeams()) {\n\t\t\tif(team.containsStudentWithId(id)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "private void addStudent() throws FileNotFoundException, ValidatorException {\n //Lesen wir die Daten\n Scanner sc = new Scanner(System.in);\n System.out.println(\"Read student information\");\n System.out.print(\"ID: \");\n long studentId = sc.nextLong();\n System.out.print(\"First name: \");\n String firstName = sc.next();\n System.out.print(\"Last Name: \");\n String lastName = sc.next();\n\n //Wir rufen die addStudent Funktion vom dem Controller mit den gelesenen Daten auf\n if (ctrl.addStudent(studentId, firstName, lastName)) {\n System.out.println(\"Please add the courses later from the Registration System menu!\");\n System.out.println(\"Student saved with success!\");\n } else\n System.out.println(\"Student with this ID already exists!\");\n }", "public static boolean isValidStudentId(String test) {\n return test.matches(STUDENT_ID_VALIDATION_REGEX);\n }", "public static ArrayList<Student> addStudents() {\n System.out.println(\"\\nAdd a student!\");\n do {\n listOfStudents.add(createStudent());\n System.out.print(\"\\nWould you like to add a new student?(yes or no): \");\n boolean yesOrNo = yesOrNoValidation();\n if (yesOrNo) {\n } else if (!yesOrNo) {\n break;\n }\n } while (true);\n return listOfStudents;\n }", "public boolean isExistant(Noeud noeud)\t{\r\n \treturn noeud != null && noeuds.containsValue(noeud);\r\n }", "@Override\n\tpublic Student selectStudentById(int stuId) {\n\t\tString sql=\"SELECT * FROM tb_student where stu_id=?\";\n\t\tObject[] stuid={stuId};\n\t\tList<Student> stu=ORMUtil.ormutil().selectList(sql, stuid, Student.class);\n\t\treturn stu.size()>0?stu.get(0):null;\n\t}", "boolean contains(int idx);", "@Test(timeout=1000)\n\tpublic void testSimpleAdd() {\n\t\thashmap.add(s1);\n\t\tStudent[] array = hashmap.getArray();\n\t\tboolean success = false;\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\tStudent s = array[i];\n\t\t\tif (s1.equals(s)){\n\t\t\t\tsuccess = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tassertTrue(\"add() failed. Element not found in array\", success);\n\t}", "public void editStudentList(int stuNumber){\n for(int i = 0; i<studList.size();i++){\n if(stuNumber == studList.get(i).getStuNumber()){\n \n System.out.println(\"Student Name: \" + studList.get(i).getFullName() + \", Student Number: \" + \n studList.get(i).getStuNumber() + \", Student GPA: \" + studList.get(i).getGPA());\n\n Scanner input = new Scanner(System.in);\n String newName = \"\";\n double newGPA;\n\n System.out.print(\"Student name: \");\n newName = input.nextLine();\n\n System.out.print(\"Student GPA: \");\n newGPA = input.nextDouble();\n\n Student temp = new Student(newName, studList.get(i).getStuNumber(), newGPA);\n studList.set(i, temp);\n }\n }\n }", "public void addEmployee(int noOfEmployee) {\r\n\t\tint id = 0;\r\n\t\tString name = null;\r\n\t\tString address = null;\r\n\t\t\r\n\t\tfor (int index = 0; index < noOfEmployee; index++) {\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Enter employee id :\");\r\n\t\t\tid = input.nextInt();\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Enter employee name : \");\r\n\t\t\tinput.nextLine();\r\n\t\t\tname = input.nextLine();\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Enter employee address :\");\r\n\t\t\taddress = input.nextLine();\r\n\t\t\t\r\n\t\t\tif (empId.contains(id)) {\r\n\t\t\t\tSystem.out.println(\"Emp ID : \"+ id +\" employee ID already exists !!!!!\");\r\n\t\t\t} else {\r\n\t\t\t\tempId.add(id);\r\n\t\t\t\temp.add(addEmployee(id, name, address));\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Test\n public void testAddEligibleStudents() {\n System.out.println(\"addEligibleStudents\");\n int[] IDs = new int[2];\n IDs[0] = 98;\n IDs[1] = 99;\n\n instance.addEligibleStudents(IDs);\n\n assertTrue(\"Students not added to eligibility lists\", instance.isStudentEligible(98)\n && instance.isStudentEligible(99));\n // TODO review the generated test code and remove the default call to fail.\n // fail(\"The test case is a prototype.\");\n }", "public boolean IDUsed(int id){\n for (int i = 0 ; i< IDList.size();i++){\n if (IDList.get(i) == id){\n return true;\n }\n }\n return false;\n }", "@Override\n public boolean equals(Object other) \n {\n Student s = (Student)other; \n return this.name.equals(s.getName()) && this.id.equals(s.getId()); \n }" ]
[ "0.70312166", "0.6921156", "0.6794819", "0.67293394", "0.663074", "0.65427685", "0.6410872", "0.6402492", "0.63679236", "0.62482786", "0.6225195", "0.61580735", "0.6132789", "0.61193013", "0.60594386", "0.6047009", "0.5990002", "0.5931231", "0.5930963", "0.59150916", "0.5911855", "0.590077", "0.58716387", "0.5837613", "0.5824196", "0.58125556", "0.5787319", "0.57815737", "0.5773008", "0.575025", "0.57289064", "0.5716786", "0.5699475", "0.56896025", "0.5676572", "0.5663578", "0.56568736", "0.5601091", "0.5598494", "0.55820024", "0.5581303", "0.55572563", "0.55572224", "0.55243987", "0.552265", "0.55175024", "0.5516232", "0.5486385", "0.5477478", "0.5465293", "0.54489636", "0.543606", "0.5430052", "0.54248804", "0.5422802", "0.54221207", "0.54145485", "0.5403301", "0.5396044", "0.5396044", "0.5374532", "0.5350717", "0.5325057", "0.5318907", "0.5314106", "0.53010744", "0.5283302", "0.52818954", "0.5276913", "0.5275641", "0.52685726", "0.525416", "0.524802", "0.5246561", "0.5237516", "0.52361035", "0.5236027", "0.5232304", "0.5217481", "0.5216348", "0.5212536", "0.5203684", "0.5198968", "0.5196271", "0.519414", "0.51838076", "0.5183573", "0.51800245", "0.51711464", "0.5162336", "0.51508516", "0.5149297", "0.5148377", "0.51469237", "0.5144933", "0.5130667", "0.51098096", "0.5107016", "0.5106213", "0.51032573" ]
0.80966836
0
/Adds a new student to the database
private static int addNewStudent(){ System.out.println("===Add New Student To Database==="); Scanner string_input = new Scanner(System.in); //gets String input from the user Scanner integer_input = new Scanner(System.in); //get integer input from the user StudentDetails new_student = new StudentDetails(); String firstname; do{ System.out.println("Enter new student's first name: "); firstname = string_input.next(); }while(!new_student.setFirstName(firstname)); //loop until name input is valid String middlename; do{ System.out.println("Enter new student's middle name (Type 'null' if author has no middle name): "); middlename = string_input.next(); }while(!new_student.setMiddleName(middlename)); //loop until name input is valid String lastname; do{ System.out.println("Enter new student's last name: "); lastname = string_input.next(); }while(!new_student.setLastName(lastname)); //loop until name input is valid int grade; do{ System.out.println("Enter new student's grade (9 - 12): "); grade = integer_input.nextInt(); }while(!new_student.setGrade(grade)); //loop until name input is valid ALL_STUDENTS.add(new_student); int new_studentId = ALL_STUDENTS.size() - 1; //since student was the most recently added element to the ALL_STUDENTS ArrayList, its index should be ALL_STUDENTS.size() - 1. Student's index in this ArrayList should be the new student's Id. new_student.setId(new_studentId); //set the new student's Id return new_student.getId(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void addStudent() {\n\t\t\n\t\tString lastName = sLastNameTF.getText();\n\t\tString firstName = sFirstNameTF.getText();\n\t\tString schoolName = sSchoolNameTF.getText();\n\t\tchar[] password = sPasswordPF1.getPassword();\n\t\tString sA1 = sSecurityQ1TF.getText();\n\t\tString sQ1 = (String)sSecurityList1.getSelectedItem();\n\t\tString sA2 = sSecurityQ2TF.getText();\n\t\tString sQ2 = (String)sSecurityList2.getSelectedItem();\n\t\tString grade = (String)sGradeList.getSelectedItem();\n\t\t\n\t\tstudent = new Student(lastName, firstName, schoolName, password, sA1, sQ1, sA2, sQ2, grade);\n\t\t\n\t\t//Add student to database\n\t\t\n\t}", "public static void addStudent(Student student) throws SQLException {\r\n\t String sql = \" INSERT INTO Studentspring VALUES (?,?,?,?,?)\";\r\n\t PreparedStatement pStmt = con.prepareStatement(sql);\r\n\r\n\t String Name=student.getName();\r\n\t int Age=student.getAge();\r\n\t String Course=student.getCourse();\r\n\t int Year=student.getYear();\r\n\t String Section=student.getSection();\r\n\t \r\n\t pStmt.setString(1, Name);\r\n\t pStmt.setInt(2,Age);\r\n\t pStmt.setString(3,Course);\r\n\t pStmt.setInt(4,Year );\r\n\t pStmt.setString(5,Section);\r\n\r\n\t pStmt.executeUpdate();\r\n\t \r\n\t }", "public void addStudents(Student theStudent) {\n\t\tConnection myConn=null;\n\t\tPreparedStatement myStmt=null;\n\t\ttry\n\t\t{\n\t\t//get db connection\n\t\tmyConn=dataSource.getConnection();\n\t\t\n\t\t// create sql for insert\n\t\tString sql=\"insert into student \"+\"(first_name, last_name, email) \"+\"values(?,?,?)\";\n\t\tmyStmt=myConn.prepareStatement(sql);\n\t\t\n\t\t//set the param values for the student\n\t\tmyStmt.setString(1, theStudent.getFirstName());\n\t\tmyStmt.setString(2, theStudent.getLastName());\n\t\tmyStmt.setString(3, theStudent.getEmail());\n\t\t\n\t\t//execute sql insert\n\t\tmyStmt.execute();\n\t\t}catch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\tclose(myConn,myStmt,null);\n\t\t}\n\t}", "public void insert(Student student) {\t\t\r\n\t\tdao.insertStudent(student); \r\n\t}", "public void addStudent(Student student) {\n\t\t\r\n\t}", "public void addStudent(Student student);", "@Override\n\tpublic void create(Student student) {\n\t\tString query=\"insert into student values('\"+student.getId()+\"','\"+student.getName()+\"','\"+student.getAge()+\"')\";\n\t//\tjdbcTemplate.update(query);\n\t\tint result=jdbcTemplate.update(query);\n\t\tSystem.out.println(result+\"Record Inserted\");\n\t}", "public void addStudents(Student student) {\r\n System.out.println(\"conectado con model ---> metodo addStudents\");\r\n //TODO\r\n }", "@GetMapping(\"/add\")\n\tpublic List<Students> addStudent() {\n\t\tStudents student = new Students();\n\t\tstudent.setRollno(04);\n\t\tstudent.setSname(\"Cyborg\");\n\t\tstudent.setStudent_role(\"Graduate\");\n\t\tstudentMapper.insert(student);\n\t\treturn studentMapper.findAll(); \n\t}", "private void saveStudent() {\n // Check that every required field has been filled in with valid parameters\n if (!checkUserInputValidity()) {\n return;\n }\n\n // Insert the new student info into the database\n if (isEditStudent) {\n updateStudentOnFirebaseDatabase();\n } else {\n // Make a unique id for the student\n String studentId = UUID.randomUUID().toString();\n saveNewStudentToFirebaseDatabase(studentId);\n }\n }", "private void addStudent(Student student) {\n\t\tSystem.out.println(\"Add Student\");\n\t\tsmb.saveStudent(student);\n\t}", "public Student addStudent(AddOrUpdateStudentDTO student) throws SQLException {\n\n\t\t// try with resources: used when we want for our applicaton to automatically\n\t\t// call the .close() method on whatever \"resource\"\n\t\t// we are using\n\t\t// The connection interface defines a close() method. This method, when invoked,\n\t\t// will disconnect from the database\n\t\t// Whenever we are done with our block of code inside with\n\t\ttry (Connection con = JDBCUtil.getConnection()) {\n\t\t\tString sql = \"INSERT INTO students (student_first_name, student_last_name, student_classification, student_age)\"\n\t\t\t\t\t+ \"VALUES (?,?,?,?)\";\n\n\t\t\tPreparedStatement pstmt = con.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);\n\n\t\t\tpstmt.setString(1, student.getFirstName());\n\t\t\tpstmt.setString(2, student.getFirstName());\n\t\t\tpstmt.setString(3, student.getClassification());\n\t\t\tpstmt.setInt(4, student.getAge());\n\n\t\t\tint numberOfRecordsInserted = pstmt.executeUpdate(); // Instead of execute query like we use for select\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// statement, INSERT, UPDATE, and DELETE will use\n\t\t\t// executeUpdate(). This method returns an integer representing the number of\n\t\t\t// rows that were modified.\n\n\t\t\t// if numbers of records that were inserted is NOT 1, then something went wrong\n\t\t\tif (numberOfRecordsInserted != 1) {\n\t\t\t\tthrow new SQLException(\"Adding a new Student was unsucessful\");\n\t\t\t}\n\n\t\t\tResultSet rs = pstmt.getGeneratedKeys();\n\t\t\trs.next(); // iterating to the first row\n\t\t\tint automaticallyGeneratedId = rs.getInt(1); // grabing the first column information from that \"row\"\n\n\t\t\t// When we return the Student that we created in the database\n\t\t\t// The missing data is the automatically generated ID\n\t\t\t// How do we obtain that id?\n\t\t\treturn new Student(automaticallyGeneratedId, student.getFirstName(), student.getLastName(),\n\t\t\t\t\tstudent.getClassification(), student.getAge());\n\t\t}\n\t}", "@Override\n\tpublic Student addStudent(Student std)\n\t {\n\t\t return studentrepo.save(std);\t\t \n\t }", "public void AddToStudent(){\n\n try {\n\n String addDataSQL = \"INSERT INTO \" + STUDENT_TABLE_NAME + \"(\" + STUDENT_FIRST_COLUMN + \", \" + STUDENT_LAST_COLUMN + \", \" + STUDENT_PHONE_COLUMN + \")\" + \" VALUES ('Margaret', 'Elkins', '555-555-1212')\";\n ConnectDB.statement.executeUpdate(addDataSQL);\n addDataSQL = \"INSERT INTO \" + STUDENT_TABLE_NAME + \"(\" + STUDENT_FIRST_COLUMN + \", \" + STUDENT_LAST_COLUMN +\", \" + STUDENT_PHONE_COLUMN + \")\" + \" VALUES ('Scott', 'Sivad', '555-555-1313')\";\n ConnectDB.statement.executeUpdate(addDataSQL);\n addDataSQL = \"INSERT INTO \" + STUDENT_TABLE_NAME + \"(\" + STUDENT_FIRST_COLUMN + \", \" + STUDENT_LAST_COLUMN +\", \" + STUDENT_PHONE_COLUMN + \")\" + \" VALUES ('Sarah', 'Kwabi', '555-555-1414')\";\n ConnectDB.statement.executeUpdate(addDataSQL);\n addDataSQL = \"INSERT INTO \" + STUDENT_TABLE_NAME + \"(\" + STUDENT_FIRST_COLUMN + \", \" + STUDENT_LAST_COLUMN +\", \" + STUDENT_PHONE_COLUMN + \")\" + \" VALUES ('Caleb', 'Mohammad', '555-555-1515')\";\n ConnectDB.statement.executeUpdate(addDataSQL);\n }\n catch (SQLException se){\n System.out.println(se);\n se.printStackTrace();\n }\n }", "public sust.paperlessexm.entity.Student addStudent(sust.paperlessexm.entity.Student model) throws GenericBusinessException {\n sust.paperlessexm.hibernatehelper.HibernateQueryHelper hibernateTemplate = new sust.paperlessexm.hibernatehelper.HibernateQueryHelper();\n try {\n hibernateTemplate.save(model);\n return getStudent(model.getPrimaryKey());\n } finally {\n log.debug(\"finished addStudent(sust.paperlessexm.entity.Student model)\");\n }\n }", "public void createStudent(String name, String ID){}", "@Override\r\n\tpublic Student createOrUpdateStudentRecord(Student student) {\r\n\t\t\tstudentDAO.addStudent(student);\r\n\t\treturn student;\r\n\t}", "int insert(Student record);", "int insert(Student record);", "int insert(Student record);", "public boolean addStudent(Student student) throws Exception {\n\t\tint collegeid = 0;\n\t\tString courseid = null;\n\t\tint i = 0;\n\t\tConnection con = null;\n\t\tcon = DBConnector.dbConnection();\n\t\ttry {\n\t\t\tSystem.out.println(student.getCoursename());\n\t\t\tPreparedStatement st = con.prepareStatement(\"select course_id from course where course_name=?\");\n\t\t\tst.setString(1, student.getCoursename());\n\t\t\tResultSet rs = st.executeQuery();\n\t\t\twhile (rs.next()) {\n\t\t\t\tcourseid = rs.getString(1);\n\t\t\t}\n\t\t\tSystem.out.println(student.getCollegename());\n\t\t\tPreparedStatement st1 = con.prepareStatement(\"select college_id from college where college_name=?\");\n\t\t\tst1.setString(1, student.getCollegename());\n\t\t\tResultSet rs1 = st1.executeQuery();\n\t\t\twhile (rs1.next()) {\n\t\t\t\tcollegeid = rs1.getInt(1);\n\t\t\t}\n\t\t\tPreparedStatement st2 = con.prepareStatement(\n\t\t\t\t\t\"insert into student(student_name, college_id, course_id, phn_no, address) values(?,?,?,?,?)\");\n\t\t\tst2.setString(1, student.getStudentname());\n\t\t\tst2.setInt(2, collegeid);\n\t\t\tst2.setString(3, courseid);\n\t\t\tst2.setString(4, student.getPhno());\n\t\t\tst2.setString(5, student.getAddress());\n\t\t\ti = st2.executeUpdate();\n\t\t\tcon.close();\n\t\t} catch (SQLSyntaxErrorException e) {\n\t\t\tthrow new SQLSyntaxErrorException(\"Error in SQL syntax\");\n\t\t} catch (SQLException e) {\n\t\t\tthrow new SQLException(\"Connection with database failed\");\n\t\t} catch (Exception e) {\n\t\t\tthrow new Exception(\"Some error occured\");\n\t\t}\n\t\tif (i != 0)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "public void addStudent(Student InStudent)\n\t{\n\t\tclassRoll.add (InStudent);\n\t\tthis.saveNeed = true;\n\n\t\t\n\t}", "int insert(StudentInfo record);", "public void addStudent(User user) {\n\t\t\r\n\t}", "@Override\n public void addStudent(Student student) {}", "@Override\r\n public void enroll(Student student, String courseId) throws SQLException {\n\r\n courseDAO.insert(student.getId(), courseId);\r\n\r\n }", "int insert(StudentEntity record);", "public long addStudent(String studentname, String rollno, String ssg) {\n ContentValues initialValues=new ContentValues();\n initialValues.put(KEY_STUDENT_NAME,studentname);\n initialValues.put(KEY_STUDENT_ROLL,rollno);\n initialValues.put(KEY_FOREIGN,ssg);\n return liteDatabase.insert(DATABASE_TABLE2,null,initialValues);\n }", "public void addStu(Student stu) {\n\t\tSessionFactory sessionFactory = null;\n\t\tStandardServiceRegistry registry = new StandardServiceRegistryBuilder()\n\t\t\t\t.configure()\t\t\t\t\t\t\t\n\t\t\t\t.build();\n\t\ttry {\n\t\t\tsessionFactory = new MetadataSources(registry).buildMetadata().buildSessionFactory();\n\t\t} catch (Exception ex) {\n\t\t\tStandardServiceRegistryBuilder.destroy(registry);\n\t\t\tSystem.out.println(\"Setup Failed:\" + ex.getMessage());\n\t\t}\n\t\t// Session sessionObj = null; \n\t\tSession sessionObj = sessionFactory.openSession();\n\t\ttry {\n\t\t\t// Creating Hibernate SessionFactory Instance\n\t\t\t// sessionObj = configObj.buildSessionFactory(serviceRegistryObj).openSession();\n\t\t\tsessionObj.beginTransaction();\n\t\t\tsessionObj.save(stu);\n\t\t\tSystem.out.println(\"\\n.......Records Saved Successfully To The Database.......\\n\");\n\t\t\t// Committing The Transactions To The Database\n\t\t\tsessionObj.getTransaction().commit();\n\t\t} catch (Exception sqlException) {\n\t\t\tif (null != sessionObj.getTransaction()) {\n\t\t\t\tSystem.out.println(\"\\n.......Transaction Is Being Rolled Back.......\");\n\t\t\t\tsessionObj.getTransaction().rollback();\n\t\t\t}\n\t\t\tsqlException.printStackTrace();\n\t\t} finally {\n\t\t\tif (sessionObj != null) {\n\t\t\t\tsessionObj.close();\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic void createStudent(Student student) {\n\t\tem.persist(student);\n\t}", "private void ADDStudents(Student s) {\n\t\t\tint exist = 0;\n\n\t\t\tif(data.size() > 0) {\n\t\t\t\tfor(Student st: data) {\n\t\t\t\t\tif(s.id == st.id) {\n\t\t\t\t\t\texist = 1;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tthrow new Exception(\"This student already in the table.\");\n\t\t\t\t\t\t\t}catch(Exception ex){\n\t\t\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"This student already in the table.\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tIDField.setText(\"\");\n\t\t\t\t\t\tfirstNameField.setText(\"\");\n\t\t\t\t\t\tlastNameField.setText(\"\");\n\t\t\t\t\t\tgenderField.setText(\"\");\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t\t}\n\t\t\t\tdata.add(s);\n\t\t\t\tObject[] row = new Object[4];\n\t\t\t\trow[0] = \"\" + s.id;\n\t\t\t\trow[1] = s.firstName;\n\t\t\t\trow[2] = s.lastName;\n\t\t\t\trow[3] = s.gender;\n\t\t\t\tmodel.addRow(row);\n\t\t\t if(exist ==1) {\n\t\t\t\t data.remove(s);\n\t\t\t\t model.removeRow(data.size());\n\t\t\t }\n\t\t\t\t\n\t\t\t}", "public void registerDB(Course curs, Student stud) throws SQLException {\r\n Connection con = DriverManager.getConnection(\"jdbc:postgresql://localhost:5432/Hogwarts\",\"postgres\" , \"admin\");\r\n Statement st = con.createStatement();\r\n\r\n st.executeUpdate(\"INSERT INTO public.enrolled(\\n\" +\r\n \"\\t\\\"studentID\\\", \\\"courseID\\\")\\n\" +\r\n \"\\tVALUES (\" + stud.getId() + \", \" + curs.getId() + \")\");\r\n\r\n st.close();\r\n }", "public void addStudent(Student student) {\n students.add(student);\n }", "public Student addStudent(Student student){\r\n Student.assignId(student);\r\n Student response = repo.save(student);\r\n if(response == null){\r\n StudentChangeEvent event = new StudentChangeEvent(EventType.ADD, student);\r\n notifyObservers(event);\r\n }\r\n return response;\r\n }", "@POST\n\t@Path(\"add\")\n\tpublic String addStudent(Representation entity) {\n\t\tForm form = new Form(entity);\n\t\tString name = form.getFirstValue(\"name\");\n\t\tint grade = Integer.parseInt(form.getFirstValue(\"grade\"));\n\t\tint sex = Integer.parseInt(form.getFirstValue(\"sex\"));\n\t\tint age = Integer.parseInt(form.getFirstValue(\"age\"));\n\n\t\tStudent student = new Student();\n\t\tstudent.setGrade(grade);\n\t\tstudent.setName(name);\n\t\tstudent.setSex(sex);\n\t\tstudent.setAge(age);\n\n\t\tint id = StorageOperator.studentID + 1;\n\t\tstudent.setId(id);\n\t\treturn String.valueOf(StorageOperator.addStudent(student));\n\t}", "Student createStudent();", "@Override\n\t//插入数据\n\tpublic void insertStudent(Student student) {\n\t\tConnection conn = null;\n\t\tPreparedStatement pStatement = null;\t\t\n\t\ttry {\n\t\t\tconn = MySQLConnectUtil.getMySQLConnection();\n\t\t\tpStatement = conn.prepareStatement(INSERT);\n\t\t\t\n\t\t\tpStatement.setString(1, student.getId());\n\t\t\tpStatement.setString(2, student.getName());\n\t\t\tpStatement.setInt(3, student.getAge());\n\t\t\tint i =pStatement.executeUpdate();\n\t\t\tSystem.out.println(\"影响行数\"+i);\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}finally {\n\t\t\tMySQLConnectUtil.closePreparestatement(pStatement);\n\t\t\tMySQLConnectUtil.closeConnection(conn);\n\t\t}\n\t}", "@FXML\n private void newStudent() {\n System.out.println(\"trying to insert new student to database\");\n DBhandler db = new DBhandler();\n Student s = new Student(\n txfID.getText(),\n txfFirstName.getText(),\n txfLastName.getText(),\n txfAddress.getText(),\n txfZIP.getText(),\n txfZIPloc.getText(),\n txfEmail.getText(),\n txfPhone.getText()\n );\n System.out.println(s.toString());\n db.insertStudent(s);\n Cancel(new ActionEvent());\n }", "@RequestMapping(value = \"/student\")\r\n\tpublic String addstudent(Student student) {\r\n\t\tStudentdaoimpl impl = new Studentdaoimpl();\r\n\t\timpl.addstudent(student);\r\n\t\treturn \"redirect:/findallstudent\";\r\n\r\n\t}", "public void add(Student s)\r\n {\r\n students.add(s);\r\n }", "@Override\n public void addStudent(String firstName, String lastName, int age, Set<Course> courses) {}", "int insert(SalGrade record);", "public boolean addStudent(Student student) throws DocumentException, IOException {\n String name = student.getName();\n if(getUser(name)==null){//hasn't got a user called the same name\n String password = student.getPassword();\n Student.Speciality speciality = student.getSpeciality();\n String mail = student.getMail();\n root = document.getRootElement();\n Element root2 = root.addElement(\"student\");\n int nb = root.elements().size()-1;\n root2.addAttribute(\"id\", String.valueOf(nb));\n Element usernameElement = root2.addElement(\"username\");\n Element passwordElement = root2.addElement(\"password\");\n Element mailElement = root2.addElement(\"mail\");\n Element specialityElement = root2.addElement(\"speciality\");\n usernameElement.setText(name);\n passwordElement.setText(password);\n mailElement.setText(mail);\n specialityElement.setText(speciality.name());\n writeXML();\n return true;\n }\n else{//the same name already in the list\n return false;\n }\n }", "@RequestMapping(value = \"insert\", method = RequestMethod.POST)\r\n\tpublic String insert(HttpServletRequest request) {\n\t\tint id = Integer.parseInt(request.getParameter(\"id\"));\r\n\t\tString name = request.getParameter(\"name\");\r\n\t\tint marks = Integer.parseInt(request.getParameter(\"marks\"));\r\n\t\t// Create the student\r\n\t\tStudent student = new Student(id, name,marks);\r\n\t\tSystem.out.println(student);\r\n\t\t// insert student to db\r\n\r\n\t\tString res = studentService.insert(student);\r\n\r\n\t\tif (res.equals(\"SUCCESS\"))\r\n\t\t\trequest.setAttribute(\"msg\", \"Record Inserted\");\r\n\t\telse\r\n\t\t\trequest.setAttribute(\"msg\", \"Record Not Inserted\");\r\n\t\treturn \"insert\";\r\n\t}", "private void addStudent() throws FileNotFoundException, ValidatorException {\n //Lesen wir die Daten\n Scanner sc = new Scanner(System.in);\n System.out.println(\"Read student information\");\n System.out.print(\"ID: \");\n long studentId = sc.nextLong();\n System.out.print(\"First name: \");\n String firstName = sc.next();\n System.out.print(\"Last Name: \");\n String lastName = sc.next();\n\n //Wir rufen die addStudent Funktion vom dem Controller mit den gelesenen Daten auf\n if (ctrl.addStudent(studentId, firstName, lastName)) {\n System.out.println(\"Please add the courses later from the Registration System menu!\");\n System.out.println(\"Student saved with success!\");\n } else\n System.out.println(\"Student with this ID already exists!\");\n }", "public Student saveStudent(Student student) {\n\t\tlog.info(\"Add Student Name = \" + student.getFirstname() + \" \"\n\t\t\t\t+ student.getLastname());\n\t\tlog.debug(\"Initialise SQL Parameters\");\n\t\tfinal Object[] param = new Object[] { student.getMatnr(),\n\t\t\t\tstudent.getFirstname(), student.getLastname(), student.getEmail() };\n\t\tlog.debug(\"Initialise Transaction Manager\");\n\t\tTransactionTemplate tt = new TransactionTemplate(transactionManager);\n\t\tObject result = tt.execute(new TransactionCallback() {\n\t\t\tpublic Object doInTransaction(TransactionStatus status) {\n\t\t\t\t// The transaction is run from here\n\t\t\t\tlog.debug(\"Start Transaction\");\n\t\t\t\tquery_insertStudent.update(param);\n\n\t\t\t\t/*\n\t\t\t\t * activate the following error line to create an Error which\n\t\t\t\t * terminates this method. One will see, that the complete\n\t\t\t\t * transaction is rolled back, hence the insert statement above\n\t\t\t\t * is not executed, alternatively the second rollback statement\n\t\t\t\t * can be activated with the same result which in that case is a\n\t\t\t\t * manual rollback of the transaction\n\t\t\t\t */\n\n\t\t\t\t// if (true) throw new Error(\"Test Exception\");\n\t\t\t\t// or\n\t\t\t\t// status.setRollbackOnly();\n\t\t\t\t/*\n\t\t\t\t * result from query is a list, actually containing only one row\n\t\t\t\t * and one column\n\t\t\t\t */\n\t\t\t\tList<?> results = query_getStudentId.execute();\n\t\t\t\tInteger id = (Integer) results.get(0);\n\t\t\t\tlog.debug(\"End Transaction\");\n\t\t\t\treturn id;\n\t\t\t\t/*\n\t\t\t\t * and the transaction ends here! if no error occurs the\n\t\t\t\t * transaction is committed by Spring otherwise it is rolled\n\t\t\t\t * back\n\t\t\t\t */\n\t\t\t}\n\t\t});\n\t\tInteger id = (Integer) result;\n\t\tstudent.setId(id);\n\t\tlog.info(\"Return ID from inserted dataset = \" + id);\n\t\treturn id!=0 ? student : null;\n\t}", "@Override\n\tpublic int insertOne(StudentVO vo) {\n\t\treturn 0;\n\t}", "public void insertCourse(){\n \n }", "@Override\n\tpublic boolean saveStudentByPst(final Student s) {\n\t\tString query=\"insert into student values(?,?,?)\";\n\t\treturn jdbcTemplate.execute(query,new PreparedStatementCallback<Boolean>() {\n\t\tpublic Boolean doInPreparedStatement(PreparedStatement ps) throws SQLException ,DataAccessException\n\t\t{\n\t\t\tps.setInt(1,s.getId());\n\t\t\tps.setString(2,s.getName());\n\t\t\tps.setInt(3,s.getAge());\n\t\t\treturn ps.execute();\n\t\t}\n\t\t});\n\t\n\t}", "@GetMapping(\"/save\")\n\tpublic @ResponseBody String addNewStudent(@RequestParam int rollno, @RequestParam String name, @RequestParam String role) {\n\t\tStudents student = new Students();\n\t\tstudent.setRollno(rollno);\n\t\tstudent.setSname(name);\n\t\tstudent.setStudent_role(role);\n\t\tstudentMapper.insert(student);\n\t\treturn \"Saved New User\";\n\t}", "void create(Student entity);", "int insert(StudentGuardian record);", "@Override\n\tpublic void gstudentAdd(Gstudent gstudent) {\n\t\tGstudentMapper.gstudentAdd(gstudent);\n\t}", "@Override\n public void createStudent(Student student) throws ClassRosterDuplicateIdException, ClassRosterDataValidationException, ClassRosterPersistenceException {\n if (dao.getStudent(student.getStudentId()) != null) {\n throw new ClassRosterDuplicateIdException(\"ERROR: Could not create student. Student Id \" + student.getStudentId() + \" already exists\");\n }\n \n // RULE TWO: is the student valid\n validateStudentData(student);\n \n // RULE THREE: Pass data to DAO\n dao.addStudent(student.getStudentId(), student);\n auditDao.writeAuditEntry(\"Student \" + student.getStudentId() + \" CREATED.\");\n }", "public Query_InsertStudent(DataSource ds) {\n\t\t\tsuper.setDataSource(ds);\n\t\t\tsetSql(sql_insertStudent);\n\t\t\tdeclareParameter(new SqlParameter(\"matnr\", Types.VARCHAR));\n\t\t\tdeclareParameter(new SqlParameter(\"firstname\", Types.VARCHAR));\n\t\t\tdeclareParameter(new SqlParameter(\"lastname\", Types.VARCHAR));\n\t\t\tdeclareParameter(new SqlParameter(\"email\", Types.VARCHAR));\n\t\t}", "private void insertEntry() {\n String desiredId = idField.getText();\n String desiredName = nameField.getText();\n String desiredMajor = majorField.getText();\n\n if (studentHashMap.containsKey(desiredId)) {\n this.displayStatusPanel(\n \"Error: A student with this information already exists.\",\n \"Error\",\n JOptionPane.WARNING_MESSAGE\n );\n } else {\n studentHashMap.put(desiredId, new Student(desiredName, desiredMajor));\n\n this.displayStatusPanel(\n \"Success: \" + desiredName + \" has been added.\",\n \"Success\",\n JOptionPane.INFORMATION_MESSAGE\n );\n }\n }", "public Student insertStudent() {\n\t\tSystem.out.print(\"\\n--- 학생 정보 등록 ---\\n\");\n\t\tSystem.out.print(\"학생 이름 입력 \");\n\t\tString name = sc.next();\n\t\tSystem.out.print(\"학생 나이 입력 \");\n\t\tint age = sc.nextInt();\n\t\tSystem.out.print(\"학생 주소 입력 \");\n\t\tString addr= sc.next();\n\t\tStudent st = new Student(name, age, addr);\n\t\treturn st;\n\t}", "public long add(String name, String discipline, String grade) {\n SQLiteDatabase db = _openHelper.getWritableDatabase();\n if (db == null) {\n return 0;\n }\n ContentValues row = new ContentValues();\n row.put(\"name\", name);\n row.put(\"discipline\", discipline);\n row.put(\"grade\", grade);\n long id = db.insert(\"Exams\", null, row);\n db.close();\n return id;\n }", "void save(Student student);", "@POST\r\n\t@Path(\"/student\")\r\n\tpublic void enrollStudentToCourse(@FormParam(\"studentID\") String studentID,\r\n\t\t\t@FormParam(\"courseID\") String courseID) {\r\n\r\n\t\tStudent student = InMemoryDataStore.getStudent(studentID);\r\n\t\tCourse course = InMemoryDataStore.getCourse(courseID);\r\n\r\n\t\tif (student == null || course == null) {\r\n\t\t\tthrow new WebApplicationException(Response.Status.BAD_REQUEST);\r\n\t\t}\r\n\r\n\t\tstudent.addCourse(courseID);\r\n\t\tcourse.addStudent(studentID);\r\n\t}", "public int add(Users student) {\n\t\treturn this.userDao.add(student);\n\t}", "public static boolean addStudent(String Name, String Password, String Email, Calendar dob, String MatricNo,\n\t\t\tString SchoolID, String Degree) {\n\n\t\tif (StudentList.size() == 0) {\n\t\t\tStudent newStudent = new Student(Name, Password, Email, dob, MatricNo, SchoolID, Degree);\n\t\t\tList<Object> student = new ArrayList<Object>();\n\t\t\tstudent.add((Object) newStudent);\n\t\t\tSystem.out.println(\"Succesfully Added Student\");\n\t\t\tFileManager.writeObjectToFile(\"student.dat\", student);\n\t\t\treturn true;\n\t\t}\n\t\tif (checkIfStudentExists(MatricNo)) {\n\t\t\tSystem.out.println(\"Matriculation Number already exists\");\n\t\t\treturn false;\n\t\t}\n\n\t\tStudent newStudent = new Student(Name, Password, Email, dob, MatricNo, SchoolID, Degree);\n\t\tStudentList.add(newStudent);\n\t\tSystem.out.println(\"Succesfully Added Student\");\n\t\tFileManager.addObjectToFile(newStudent);\n\t\treturn true;\n\t}", "int insert(TrainingCourse record);", "@Override\n\t\tpublic void saveStudent(Student stu) {\n\t\t\tsessionFactory.getCurrentSession().save(stu);\n\t\t\tSystem.out.println(\"DATA HAS BEEN SAVED.........\");\n\t\t}", "public boolean addStudent(Student student)\r\n {\r\n int new_student_ID = student.getStudent_ID();\r\n checkID(new_student_ID);\r\n student_IDs.add(new_student_ID);\r\n updateAcademicLevels(\"add\", student.getAcademic_year());\r\n\r\n Node new_node = new Node(student, first_node);\r\n first_node = new_node;\r\n\r\n number_of_entries++;\r\n return true; \r\n }", "int insert(Course record);", "int insert(Course record);", "@Override\r\n\t@Transactional\r\n\tpublic void createStudent(Bookmodel s1) {\n\t\tdao.createStudent(s1);\r\n\t}", "public static void createRecord() throws IOException {\r\n\t\tstudRecs.add(new Student());\r\n\t\tint i = studRecs.size() - 1;\r\n\t\tStudent tempRecord = studRecs.get(i);\r\n\t\tSystem.out.println(\"Creating Student \" + i + \" (\" + tempRecord.getStudentID() + \")\");\r\n\t\ttempRecord.setFirstName(StudentInput.firstName());\r\n\t\ttempRecord.setLastName(StudentInput.lastName());\r\n\t\ttempRecord.setStreetAddress(StudentInput.streetAddress());\r\n\t\ttempRecord.setCity(StudentInput.city());\r\n\t\ttempRecord.setProvince(StudentInput.province());\r\n\t\ttempRecord.setPostalCode(StudentInput.postalCode());\r\n\t\ttempRecord.setPhoneNumber(StudentInput.phoneNumber());\r\n\t\ttempRecord.setBirthDate(StudentInput.birthDate());\r\n\t\tSystem.out.println(\"Student \" + i + \" (\" + tempRecord.getStudentID() + \")\" + \" Created!\");\r\n\t}", "public int save(Student stud) {\r\n\t\tint status = 0;\r\n\t\ttry {\r\n\t\t\tConnection con = DatabaseUtility.getCon(inputStream);\r\n\t\t\tPreparedStatement ps = con.prepareStatement(\r\n\t\t\t\t\t\"insert into student(first_name,last_name,email,gender,date_of_birth,address,contact_no) values(?,?,?,?,?,?,?)\");\r\n\t\t\tps.setString(1, stud.getFname());\r\n\t\t\tps.setString(2, stud.getLname());\r\n\t\t\tps.setString(3, stud.getEmail());\r\n\t\t\tps.setString(4, stud.getGender());\r\n\t\t\tps.setString(5, stud.getDOB());\r\n\t\t\tps.setString(6, stud.getAddress());\r\n\t\t\tps.setString(7, stud.getContact());\r\n\r\n\t\t\tstatus = ps.executeUpdate();\r\n\t\t\tcon.close();\r\n\t\t} catch (Exception ex) {\r\n\t\t\tSystem.out.println(ex);\r\n\t\t}\r\n\t\treturn status;\r\n\t}", "public void add(Student student) {\n\t\tstudentList.add(student);\n\t}", "private void saveNewStudentToFirebaseDatabase(String studentId) {\n // Extract Student information from the edit text views\n String studentName = mStudentNameEditText.getText().toString().toLowerCase().trim();\n int studentSex = mStudentSex;\n long studentBirthdate = mStudentBirthdate;\n int studentGrade = Integer.parseInt(mStudentGradeEditText.getText().toString());\n\n if (mViewModel.studentPicBitmap != null) {\n // Save photo to Firebase Storage using AsyncTask\n saveStudentPhotoToFirebaseStorage(studentId);\n } else {\n Student newStudent = new Student(studentName, studentSex, studentBirthdate, studentGrade,\n mChosenClassesList, null, studentId);\n\n mStudentsDatabaseReference.child(studentId).setValue(newStudent);\n }\n\n // Close activity\n finish();\n }", "@RequestMapping( value = \"/{id}/student\", method = RequestMethod.POST )\n public Set<StudentDTO> addStudents\n (@PathVariable(value=\"id\") long id, @RequestBody StudentDTO student) {\n\n return classService.addStudent(id, student);\n\n }", "public int insertStudent(Student aStudent) {\n\t\tint updateCount = 0;\n\t\t\n\t\tint aId = aStudent.getId();\n\t\tString afName = aStudent.getfName();\n\t\tString alName = aStudent.getlName();\n\t\tdouble aGpa = aStudent.getGpa();\n\t\tint aSat = aStudent.getSat();\n\t\tint aMajor = aStudent.getMajor();\n\t\t\n\t\tString sql = \"insert into student values \" +\n\t\t\t\tString.format(\"(%4d, '%s', '%s', %4d, %4.2f , %4d)\", aId, afName, alName, aSat, aGpa, aMajor);\n\n\t\ttry {\n\t\t\tupdateCount = myDB.execSQLUpdate(sql);\n\t\t} catch (SQLException e) { e.printStackTrace(); }\n\t\t\n\t\treturn updateCount;\n\t}", "@PostMapping(\"/students\")\n @Timed\n @RegionBasedInsert\n public ResponseEntity<Student> createStudent(@RequestBody Student student) throws URISyntaxException {\n log.debug(\"REST request to save Student : {}\", student);\n if (student.getId() != null) {\n return ResponseEntity.badRequest().headers(HeaderUtil.createFailureAlert(ENTITY_NAME, \"idexists\", \"A new student cannot already have an ID\")).body(null);\n }\n Student result = studentService.save(student);\n return ResponseEntity.created(new URI(\"/api/students/\" + result.getId()))\n .headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString()))\n .body(result);\n }", "public void addStudentInCourse(Course course, Student student){\n \n String statement = ADD_STUDENT_IN_COURSE;\n data.makeUpdateStatement(statement,new Object[]{(Object)course.getId(),(Object)student.getId()});\n data.closeConnections(data.ps, data.conn);\n }", "int insert(courses record);", "@Override\n\tpublic boolean insert(Student student) {\n\t\treturn sDao.insert(student) > 0;\n\t}", "public void actionPerformed(ActionEvent e){\n \t\t \tstudentsController.addStudent();\n \t\t }", "public void createGrade(String name,int year, String subject, String assessment, String achievement,String knowledge,String skill){\n try{\n String query = \"INSERT INTO `coitdatabase`.`grade` (`studentName`, `stuYear`, `subjectName`, `asseName`, `grade`, `knowledge`, `skill`) VALUES ('\"+name+\"', '\"+year+\"', '\"+subject+\"', '\"+assessment+\"', '\"+achievement+\"', '\"+knowledge+\"', '\"+skill+\"');\";\n st.executeUpdate(query);\n }catch(Exception ex){\n System.out.println(\"Error in create grade \"+ ex);\n }\n }", "public String addStudent (String name,String admin){\n Document doc = new Document(\"name\", name);\n doc.put(\"skills\",Arrays.asList());\n studentSkills.insertOne(doc);\n this.createNewToken(doc.get(\"_id\").toString(),admin);\n return doc.get(\"_id\").toString();\n}", "private void saveData() {\n try {\n Student student = new Student(firstName.getText(), lastName.getText(),\n form.getText(), stream.getText(), birth.getText(),\n gender.getText(), Integer.parseInt(admission.getText()),\n Integer.parseInt(age.getText()));\n\n\n if (action.equalsIgnoreCase(\"new\") && !assist.checkIfNull(student)) {\n\n dao.insertNew(student);\n JOptionPane.showMessageDialog(null, \"Student saved !\", \"Success\", JOptionPane.INFORMATION_MESSAGE);\n\n } else if (action.equalsIgnoreCase(\"update\") && !assist.checkIfNull(student)) {\n dao.updateStudent(student, getSelected());\n JOptionPane.showMessageDialog(null, \"Student Updated !\", \"Success\", JOptionPane.INFORMATION_MESSAGE);\n }\n\n prepareTable();\n prepareHistory();\n buttonSave.setVisible(false);\n admission.setEditable(true);\n }catch (Exception e)\n {}\n }", "public void addStaff(String name, String dob, String email, String number, String address, String password) throws SQLException { //code for add-operation \n st.executeUpdate(\"INSERT INTO IOTBAY.STAFF \" + \"VALUES ('\" \n + name + \"', '\" + dob + \"', '\" \n + email + \"', '\" + number+ \"', '\" \n + address + \"', '\" + password + \"')\");\n\n }", "public static void creaStudente(Student stud) {\n\t\ttry {\n\t\t\tRequestContent rp = new RequestContent();\n\t\t\trp.type = RequestType.CREATE_USER;\n\t\t\trp.userType = UserType.STUDENT;\n\t\t\trp.parameters = new Object[] { stud };\n\t\t\tsend(rp);\n\t\t} catch (Exception e) {\n\n\t\t}\n\t}", "@PostMapping(\"student-create\")\n\tpublic String createStudentDetails(@RequestBody Student student) throws SQLException {\n\n\t\treturn studentSerivce.createStudentDetails(student);\n\t}", "private void insert() {\n\t\tConfiguration conf = new Configuration();\n\t\tconf.configure(\"hibernate.cfg.xml\");\n\t\tSessionFactory sf = conf.buildSessionFactory();\n\t\tSession s = sf.openSession();\n\t\ts.beginTransaction();\n\n\t\tQuery query = s.createQuery(\"insert into OldStudent(id,name,grade) select s.id,s.name,s.grade from Student s\");\n\t\tint count = query.executeUpdate();\n\t\tSystem.out.println(\"Number of Rows inserted in the oldstudent table=\" + count);\n\n\t\ts.getTransaction().commit();\n\t\ts.clear();// s.evict() on all student objects in session\n\t\tsf.close();\n\t}", "public void testAddMinimalStudent()\r\n throws Exception\r\n {\r\n Student student1 = new Student();\r\n student1.setGender( Gender.MALE );\r\n studentId1 = StudentIdGen.getInstance().nextStudentId();\r\n student1.setId( studentId1 );\r\n\r\n try\r\n {\r\n Session session = SessionUtil.begin();\r\n session.save( student1 );\r\n SessionUtil.end();\r\n }\r\n catch ( Exception e )\r\n {\r\n SessionUtil.rollback( e );\r\n }\r\n }", "private void saveStudent(){\n StudentGroupThrift group = mainWindow.getStudentClient().getStudentGroupByName\n (this.group.getSelectedItem().toString());\n SimpleDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd\");\n String birthDate = format.format(jDateChooser.getDate());\n StudentThrift studentThrift = new StudentThrift(\n id,\n getTextID(FIRST_NAME),\n getTextID(LAST_NAME),\n getTextID(MIDDLE_NAME),\n birthDate,\n getTextID(ADDRESS),\n group\n );\n mainWindow.getStudentClient().saveStudent(studentThrift);\n closeDialog();\n }", "public static void Add_students() throws SQLException \n\t {\n\t\ttry\n\t\t{\n\t\t\t//Declarations \n\t\t\tFloat gpa=0.0f;\n\t\t\tString fname=\"\",lname=\"\",status=\"\";\n\t\t\tString email=\"\";\n\t\t\tString sid=\"\";\n\t\t\tSystem.out.println(\"Please enter the students sid (starting with 'B')\\n\"); \n\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in ) ); \n\t\t\tsid = br.readLine(); \n\t\t\t\t\t \t\t\t\n\t\t\tSystem.out.println(\"Please enter the students First name \\n\");\n\t\t\tfname=br.readLine();\n\n\t\t\t System.out.println(\"Please enter the students Last name \\n\"); \n lname=br.readLine();\n\t\t\t\n\t\t\t\tSystem.out.println(\"Please enter the students status (('freshman', 'sophomore', 'junior', 'senior', 'graduate'))\\n\"); \n\t\t\t\tstatus = br.readLine();\n\t\t\n\t\t\tdo{\n\t\t\t\tSystem.out.println(\"Please enter the students GPA ((gpa >= 0 and gpa <= 4.0))\\n\"); \n\t\t\t\tgpa = Float.parseFloat(br.readLine());\n\t\t\t}while(gpa<0.0 && gpa>4.0);\n\n\t\t\t\t\t\t \n\t\t\tSystem.out.println(\"Please enter the students email address\\n\"); \n\t\t\temail = br.readLine();\n //Connection to Oracle server\n OracleDataSource ds = new oracle.jdbc.pool.OracleDataSource();\n ds.setURL(\"jdbc:oracle:thin:@grouchoIII.cc.binghamton.edu:1521:ACAD111\");\n Connection conn = ds.getConnection(\"vbobhat1\", \"BingData\");\n\tCallableStatement cs = conn.prepareCall (\"begin StudRegSys.add_student(:1,:2,:3,:4,:5,:6); end;\");\n\t\t\tcs.setString(1,sid);\t\t \t \n\t\t \tcs.setString(2,fname);\n\t\t\tcs.setString(3,lname);\n\t\t \tcs.setString(4,status);\n\t\t \tcs.setFloat(5,gpa);\n\t\t \tcs.setString(6,email);\n\t\t\tcs.executeQuery();\n\t \n\t \tSystem.out.println(\"Student Succesfully Added!\");\n\t \n\t \t// close the result set, statement, and the connection\n\t\t \tcs.close();\n\t\t \tconn.close();\n\t\t }\n\tcatch (SQLException ex) { System.out.println (\"\\n*** SQLException caught ***\\n\" + ex.getMessage());}\n catch (Exception e) {System.out.println (\"\\n*** other Exception caught ***\\n\");}\n\t }", "int insert(TrainCourse record);", "@PostMapping(\"/api/students\")\n public ResponseEntity createOrUpdateStudent(@RequestBody StudentDto studentRequest) {\n this.studentService.createOrUpdateStudent(studentRequest);\n return ResponseEntity.ok().build();\n }", "public void insertStudent(Student newStudent)\n\t{\n\t\tif (numStudents < students.length) {\n\t\t\tstudents[numStudents] = newStudent;\n\t\t\tnumStudents++;\n\t\t}\n\t}", "public void registerStudent(String firstName, String lastName, String bcsYear,\n String email, String accountID) throws SQLException {\n Statement myStatement = studentConn.createStatement();\n\n myStatement.executeUpdate(\"INSERT INTO student(firstName, lastName, bcsYear, email, accountID) \"\n + \"VALUES(\\\"\" + firstName + \"\\\", \\\"\" + lastName + \"\\\", \\\"\"\n + bcsYear + \"\\\", \\\"\" + email + \"\\\", \\\"\" + accountID + \"\\\");\");\n }", "public void registerStudent(String webID, Student student) {\n if (students.getStudent(webID) != null)\n throw new IllegalArgumentException();\n\n //add student to database\n students.addStudent(webID, student);\n }", "public int insert(String sname, String sex, String age, String birthday,\n\t\t\tString card) throws Exception {\n\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\tConnection con = DriverManager.getConnection(\"jdbc:mysql:///stuu\",\n\t\t\t\t\"root\", \"root\");\n\t\tPreparedStatement ps = con\n\t\t\t\t.prepareStatement(\"insert into student values(null,?,?,?,?,?)\");\n\t\tps.setString(1, sname);\n\t\tps.setString(2, sex);\n\t\tps.setString(3, age);\n\t\tps.setString(4, birthday);\n\t\tps.setString(5, card);\n\t\tint i = ps.executeUpdate();\n\t\tps.close();\n\t\tcon.close();\n\t\treturn i;\n\t}", "@Override\n\tpublic boolean insert() {\n\t\tif(num==null||name==null||email==null||phone==null||project==0||school==0)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tString format=\"INSERT INTO tc_student(num,name,email,phone,degree,project,school,is_cap) values ('%s','%s','%s','%s',%d,%d,%d,%d)\";\n\t\tString sql=String.format(format, num,name,email,phone,degree,project,school,is_cap);\n\t\t//System.out.println(sql);\n\t\treturn mysql.execute(sql);\n\t\t}", "@Override\n\tpublic void insert(Student student) {\n\t\tString sql = \"INSERT INTO Student VALUES(?,?,?,?)\";\n Object[] objects= {student.getId(),student.getName(),student.getBranch(),student.getPhone()};\n int no_rows_inserted =\tjdbcTemplate.update(sql,objects);\n\t\tSystem.out.println(\"no of rows inserted is:\"+ no_rows_inserted);\n \n\t}", "int insert(Teacher record);", "@Override\r\n\tpublic void addStudentInCourse(Course course, User user) {\n\t\t\r\n\t}", "protected void addStuInfo(HttpServletRequest request, HttpServletResponse response)\n\tthrows ServletException, IOException {\n\t\tStudent stu = new Student();\n\t\tstu.setStudentNo(request.getParameter(\"studentNo\"));\n\t\tstu.setStudentName(request.getParameter(\"studentName\"));\n\t\tstu.setSex(request.getParameter(\"sex\"));\n\t\tstu.setGradeId(Integer.parseInt(request.getParameter(\"gradeId\")));\n\t\tstu.setBorndate(request.getParameter(\"borndate\"));\n\t\tstu.setEmail(request.getParameter(\"email\"));\n\t\tint count = biz.addStuInfo(stu);\n\t\tif(count > 0){\n\t\t\tout.print(\"<script>alert('新增成功!!!');window.location.href='StudentServlet.do';</script>\");\n\t\t}else{\n\t\t\tout.print(\"<script>alert('新增失败!!!');window.location.href='StudentServlet.do';</script>\");\n\t\t}\n\t}" ]
[ "0.85666144", "0.7964575", "0.7868018", "0.77313673", "0.7726279", "0.7614218", "0.75444686", "0.7520111", "0.75200075", "0.7503696", "0.7475667", "0.74096686", "0.74031836", "0.7385443", "0.7369924", "0.73363346", "0.731454", "0.7261588", "0.7261588", "0.7261588", "0.7261112", "0.7234473", "0.72189003", "0.7174247", "0.7169259", "0.7162043", "0.7147231", "0.7142922", "0.70992696", "0.70907706", "0.7021641", "0.70120513", "0.7007264", "0.7000405", "0.69975954", "0.69892573", "0.69675523", "0.6949551", "0.69469184", "0.6928586", "0.6894436", "0.6890898", "0.68811756", "0.6879407", "0.6876458", "0.68381166", "0.6831157", "0.68191296", "0.6816554", "0.681627", "0.68076104", "0.67809665", "0.6776903", "0.67679393", "0.67670715", "0.676524", "0.67592", "0.67560095", "0.67283845", "0.67220753", "0.67165977", "0.67106986", "0.6705781", "0.66846377", "0.66840124", "0.6673999", "0.6673999", "0.66490626", "0.664629", "0.6627231", "0.6625897", "0.6616302", "0.6604288", "0.6603563", "0.6599114", "0.6594365", "0.65907454", "0.6579272", "0.6579126", "0.6578277", "0.6572719", "0.65631044", "0.6562818", "0.65617794", "0.6551292", "0.65434295", "0.65383554", "0.65356356", "0.64853936", "0.64818543", "0.6477693", "0.64765054", "0.6475545", "0.6474455", "0.64734435", "0.6450888", "0.6447881", "0.64399993", "0.6429866", "0.64217734" ]
0.72516996
21
/This method asks the user to enter the Id of the book being returned. If the records indicate that the given book was borrowed then it allows the user to enter the Id of the student doing the return. If the student Id matches the Id of the student who borrowed the book, then the method calculates how much the student should be fined and completes the return.
private static void returnBook(){ System.out.println("===Book Return==="); Scanner integer_input = new Scanner(System.in); System.out.println("Enter Id of book being returned: "); int bookId = getIntegerInput();//ensures user input is an integer value //if bookId entered does not exist then continually ask user to enter bookId until a bookId that exists is entered while(!ALL_BOOKS.containsKey(bookId)){ System.out.println("Book Id entered does not exist! Enter BookId: "); bookId = integer_input.nextInt(); } /*Print statements to notify book has been found, the book's details, and its availabilty*/ System.out.println("Book Found!"); System.out.println(ALL_BOOKS.get(bookId).getBookTitle() + " | Written By: " + ALL_BOOKS.get(bookId).getAuthor().toString() + "| Published By: " + ALL_BOOKS.get(bookId).getPublisher()); String availabilty = !ALL_BOOKS.get(bookId).getBorrowed() ? "Available" : "Currently Borrowed"; //stores whether book is currently borrowed or not. System.out.println(availabilty); if(ALL_BOOKS.get(bookId).getBorrowed()){//if book was borrowed then validate student doing the book return, change the book's status, and calculate how much student should be fined BookDetails book = ALL_BOOKS.get(bookId); System.out.println(); System.out.println("Enter Id of student returning the book: "); int studentId = getIntegerInput();//ensures user input is an integer value /*Verify student Id entered matches the Id of the student who borrowed the book*/ if(studentId == book.getStudentBorrowed()){ FineResult fine = calculateFine(book.getDateToReturn()); //calculate how many days overdue the book was returned and how much student should be fined. //If book was returned on time then this method will return 0 for both the number of days overdue and the student's fine. book.setBorrowed(false); //indicates book has been returned and is now available to be borrowed by someone else book.resetDateToReturn();; //reset book's return date book.setStudentBorrowed(0); //reset to default value, indicating no student is current borrowing this book /*Display Statements to user indicating book was successfully returned, and how much student was fined*/ System.out.println("You Are All Set!"); System.out.println("Book Id: " + book.getBookId() + " | " + book.getBookTitle() + " has been returned"); System.out.println(ALL_STUDENTS.get(studentId).getFullName() + " returned the book " + fine.days_overdue + " days overdue" + " | Fine Amount Charged: " + fine.days_overdue + " * " + FINE_RATE + " = GHc" + fine.fine); ALL_STUDENTS.get(studentId).setBookIdBorrowed(0); //reset to default value, indicating no book is currently borrowed by this student ALL_STUDENTS.get(studentId).addFine(fine.fine); //add the respective fine to this students fine total. If student accrued no fine on this return, fine value added will be 0. System.out.println("Total Fine on account: GHc" + ALL_STUDENTS.get(studentId).getTotalFine()); /*If Student's total fine is greater than 0 then add student to the FINED_STUDENTS Hashtable*/ addFinedStudentsToTable(ALL_STUDENTS.get(studentId)); } else{ System.out.println("ERROR Verifying Student Id: Only Student who borrowed the book can return this book"); } } else System.out.println("ERROR: Can't return book that was not borrowed!"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void checkoutBook(){\n\t\tSystem.out.println(\"===Book Checkout===\");\n\t\tScanner string_input = new Scanner(System.in); //gets String values entered by the user\n\t\tScanner integer_input = new Scanner(System.in); //gets integer values entered by the user\n\t\tboolean exit = false; //indicates whether method should be exited\n\t\t\n\t\tSystem.out.println(\"Enter Id of book to be checked out: \");\n\t\tint bookId = getIntegerInput();//ensures user input is an integer value\n\t\t//if bookId entered does not exist then continually ask user to enter bookId until a bookId that exists is entered\n\t\twhile(!ALL_BOOKS.containsKey(bookId)){\n\t\t\tSystem.out.println(\"Book Id entered does not exist! Enter BookId: \");\n\t\t\tbookId = integer_input.nextInt();\n\t\t}\n\t\t\n\t\t/*Print statements to notify book has been found, the book's details, and its availabilty*/\n\t\tSystem.out.println(\"Book Found!\");\n\t\tSystem.out.println(ALL_BOOKS.get(bookId).getBookTitle() + \" | Written By: \" + ALL_BOOKS.get(bookId).getAuthor().toString() + \" | Published By: \" + ALL_BOOKS.get(bookId).getPublisher());\n\t\tString availabilty = !ALL_BOOKS.get(bookId).getBorrowed() ? \"Available\" : \"Currently Borrowed\"; //stores whether book is currently borrowed or not.\n\t\tSystem.out.println(availabilty);\n\t\t\n\t\tif(!ALL_BOOKS.get(bookId).getBorrowed()){//if book is available to be borrowed then change it's status and set the date it should be returned (Next Month From Date of Borrowing)\n\t\t\tSystem.out.println(\"Enter Id of student borrowing the book: \");\n\t\t\tint studentId = getIntegerInput();//ensures user input is an integer value\n\t\t\tif(!studentExists(studentId)){ //if student Id entered does not exists\n\t\t\t\tSystem.out.println(\"Student Id entered does not exist. Do you want to add a new student? (Y --> Yes/ Any other button --> No): \");\n\t\t\t\tString user_option = string_input.next();\n\t\t\t\tif(user_option.equalsIgnoreCase(\"Y\"))\n\t\t\t\t\tstudentId = addNewStudent(); //adds a new student to the ALL_STUDENTS ArrayList and returns this new student's Id \n\t\t\t\telse\n\t\t\t\t\texit = true; //exit to main menu\n\t\t\t}\n\t\t\t\n\t\t\t/*Students cannot borrow more than one book at a time. Thus if the student's bookIdBorrowed is greater than 0 then\n\t\t\t * it implies the student currently has a book borrowed.*/\n\t\t\telse if(ALL_STUDENTS.get(studentId).getBookIdBorrowed() > 0){ \n\t\t\t\tStudentDetails student = ALL_STUDENTS.get(studentId); //stores student trying to checkout the book\n\t\t\t\tBookDetails bookBorrowed = ALL_BOOKS.get(student.getBookIdBorrowed()); //stores book currently borrowed by the student\n\t\t\t\tSystem.out.println(\"Sorry! Only one book can be borrowed at a time.\");\n\t\t\t\tSystem.out.println(student.getFullName() + \" currently has borrowed \" + bookBorrowed.getBookTitle());\n\t\t\t\tSystem.out.println(\"Please come back later when \" + bookBorrowed.getBookTitle() + \" is returned\");\n\t\t\t\texit = true; //exit to main menu\n\t\t\t}\n\t\t\t\n\t\t\t/*If the method has not been exited at this point then it implies the student can be borrow the book.*/\n\t\t\tif(!exit){\n\t\t\t\tBookDetails book = ALL_BOOKS.get(bookId);\n\t\t\t\tCalendar return_date = new GregorianCalendar(); //get the current date\n\t\t\t\treturn_date.add(Calendar.MONTH, 1); //set the return date to the next month from the current date\n\t\t\t\tbook.setBorrowed(true); //indicates book has been borrowed\n\t\t\t\tbook.setDateToReturn(return_date); //set book's return date\n\t\t\t\n\t\t\t\tALL_STUDENTS.get(studentId).setBookIdBorrowed(book.getBookId()); //indicate that the student has borrowed this book\n\t\t\t\tbook.setStudentBorrowed(studentId); //indicates book has been borrowed by the student with the given ID\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"You Are All Set!\");\n\t\t\t\tSystem.out.println(book.getBookId() + \" | \" + book.getBookTitle() + \" is due \" + SDF.format(return_date.getTime()));\n\t\t\t}\n\t\t}\n\t\t\n\t\telse\n\t\t\tSystem.out.println(\"Sorry check back later to borrow this book\");\t\n\t}", "void returnBook(int bookId) {\n\t\t\n\t\t// check if the book id is not valid \n\t\tif (!this.isBookIdValid(bookId)){\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// checks if that book was never taken out\n\t\tif (this.isBookAvailable(bookId))\n\t\t{\n\t\t\treturn; \n\t\t}\n\t\t\t\t\n\t\t// sets the counter on that patron as one less \n\t\tthis.patronBookCount[this.bookShelf[bookId].getCurrentBorrowerId()]--;\n\t\t\n\t\t// sets the current borrower to none\n\t\tthis.bookShelf[bookId].returnBook();\n\t}", "public void getBookScanned(int bookId) {\n\t\tif (!state.equals(ControlState.READY)) {\r\n\t\t\tthrow new RuntimeException(\"ReturnBookControl: cannot call bookScanned except in READY state\");\r\n\t\t}\t\r\n\t\tBook curBook = library.Book(bookId); //Changed instance lIbRaRy to library and changed variable name BOOK_ID to bookId and class name book to Book\r\n\t\t\r\n\t\tif (curBook == null) { //Changed instance CUR_book to curBook\r\n\t\t\tuserInterface.display(\"Invalid Book Id\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (!curBook.onLoan()) { //Changed method name to verb starting with lowercase and in camelBack\r\n\t\t\tuserInterface.display(\"Book has not been borrowed\");\r\n\t\t\treturn;\r\n\t\t}\t\t\r\n\t\tcurrentLoan = library.getLoanByBookId(bookId);\t//Changed method name to verb starting with lowercase and in camelBack\r\n\t\tdouble overDueFine = 0.0; //Changed variable name to a meaningful word\r\n\t\tif (currentLoan.isOverDue()) { //Changed method name to verb starting with lowercase and in camelBack\r\n\t\t\toverDueFine = library.calculateOverDueFine(currentLoan); //Changed method name to verb starting with lowercase and in camelBack\r\n\t\t}\r\n\t\tuserInterface.display(\"Inspecting\");\r\n\t\tuserInterface.display(CUR_book.toString());\r\n\t\tuserInterface.display(currentLoan.toString());\r\n\t\t\r\n\t\tif (currentLoan.overDue()) { //Changed method name to verb starting with lowercase and in camelBack\r\n\t\t\tuserInterface.display(String.format(\"\\nOverdue fine : $%.2f\", overDueFine));\r\n\t\t}\r\n\t\tuserInterface.setState(ReturnBookUI.UI_STATE.INSPECTING);\r\n\t\tstate = ControlState.INSPECTING;\t\t\r\n\t}", "@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\tString message=\"\";\n\t\tboolean isError=false;\n\t\tString userId=jtfUser.getText().trim();\n Matcher m=Pattern.compile(\"(\\\\d{\"+userId.length()+\"})\").matcher(userId);\n if(m.matches()){\n// System.out.println(\"输入的是数字 \"+m.group(1));\n List list=new Dao().getUserBorrowInfo(userId);\n if(list.size()==0){\n \tmessage=\"此用户不存在!\"+\"\\n\";\n \tJOptionPane.showMessageDialog(null, message, \"提示\", JOptionPane.WARNING_MESSAGE);\n \treturn;\n }else{\n \tbookNum=(Integer)list.get(1);\n \tbookTime=(Integer)list.get(2);\n \tmessage=\"用户名:\"+list.get(0)+\"\\n\";\n }\n } else {\n \tmessage=\"用户号含有字母:\"+userId+\"\\n\";\n \tJOptionPane.showMessageDialog(null, message, \"提示\", JOptionPane.WARNING_MESSAGE);\n return;\n }\n int borrowingNum=new Dao().getBorrowNum(userId);\n boolean isOverTime=new Dao().isOvertime(userId);\n if(isOverTime){\n \t//有超期的书\n \tmessage+=\"有超期的书,不能借阅!\";\n \tJOptionPane.showMessageDialog(null, message, \"提示\", JOptionPane.WARNING_MESSAGE);\n return;\n }\n\t\tString bookId=jtfBook.getText().trim();\n\t\tMatcher book=Pattern.compile(\"(\\\\d{\"+bookId.length()+\"})\").matcher(bookId);\n if(book.matches()){\n// System.out.println(\"输入的是数字 \"+book.group(1)); \n List list=new Dao().getbookBorrowInfo(Integer.parseInt(bookId));\n if(list.size()==0){\n \tJOptionPane.showMessageDialog(null, \"没有此书,您输入的书编号可能有误!\");\n \treturn;\n }\n message+=\"书名:\"+list.get(0)+\"\\n\";\n if((list.get(1).equals(\"借出\"))){\n \t//此书已经借出,输入的书号有误\n \tmessage+=\"此书已借出,您输入的书号有误吧!\\n\";\n \tJOptionPane.showMessageDialog(null, message, \"提示\", JOptionPane.WARNING_MESSAGE);\n return;\n }else if(list.get(1).equals(\"被预约\")){\n \tmessage+=\"此书被预约,还未到馆\";\n \tJOptionPane.showMessageDialog(null, message, \"提示\", JOptionPane.WARNING_MESSAGE);\n return;\n }else if(list.get(1).equals(\"预约到馆\")){\n \t//此书被预约,若不是此用户预约的,不能借\n \tint id=Integer.parseInt(bookId);\n \tif(!new Dao().isUserOrdered(userId, id)){\n \t\t//不是此用户预约的,不能借\n \t\tmessage+=\"此书已被预约,不能借\";\n \tJOptionPane.showMessageDialog(null, message, \"提示\", JOptionPane.WARNING_MESSAGE);\n return;\n \t}else{\n \t\t//此书是此用户预约的 ,可以借\n \t\tint response=JOptionPane.showConfirmDialog(null, message, \"图书借阅确认\", JOptionPane.YES_NO_OPTION);\n \t if(response==0){\n \t \t//按下yes按钮\n \t \tSystem.out.println(\"预约yes\");\n \t \tnew Dao().clearOrdered(userId, id);\n \t\tnew Dao().borrow(userId, id, bookTime);\n \t\treturn;\n \t }else{\n \t \tSystem.out.println(\"预约no\");\n \t \t//按下no按钮\n \t \treturn;\n \t }\n \t\t\n \t}\n }else if(borrowingNum>=bookNum){\n \t//已经借满,不能再借\n \tmessage+=\"已经借满不能再借!\";\n \tJOptionPane.showMessageDialog(null, message, \"提示\", JOptionPane.WARNING_MESSAGE);\n return;\n }\n }else{\n// System.out.println(\"输入的含有字母\" + bookId+\"\\n\");\n message+=\"书编号含有字母:\"+bookId;\n \tJOptionPane.showMessageDialog(null, message, \"提示\", JOptionPane.WARNING_MESSAGE);\n return;\n }\n //满足借阅的所有条件,且此书在馆(不是此用户预约的),可以借阅图书\n\t\tint response=JOptionPane.showConfirmDialog(null, message, \"图书借阅确认\", JOptionPane.YES_NO_OPTION);\n\t if(response==0){\n//\t \tSystem.out.println(\"按下了yes按钮\");\n\t \tnew Dao().borrow(userId, Integer.parseInt(bookId), bookTime);\n\t }else if(response==1){\n//\t \tSystem.out.println(\"按下了no按钮\");\n\t }\n\t}", "public static void printAddBook(int result, Integer memId, String bookID) {\n if (result > 0) {\n System.out.println(\"The book added successfully to member \" + memId + \".\\n\");\n } else {\n if (result == -1) {\n System.out.println(\"The book \" + bookID + \" is already taken \\n\");\n }\n if (result == -2) {\n System.out.println(\"The member \" + memId + \" doesn`t exist \\n\");\n }\n if (result == -3) {\n System.out.println(\"The member \" + memId + \" already have 10 books \\n\");\n }\n }\n }", "private void returnBookButtonMouseClicked(java.awt.event.MouseEvent evt) {\n if (checkList() == true) {\n if (checkReturn().equalsIgnoreCase(\"null\")) {\n try {\n String uQuery = \"update student set day_of_return='\"+ getReturnDateSTR() +\"', fee='\" + getFee() +\"' where book_id=\" + bookIDTextField.getText() + \" and rb_id=\" + studentIDField.getText();\n Connection conn = DBConnector.connectDB();\n PreparedStatement pst = conn.prepareStatement(uQuery);\n pst.execute();\n pst.close();\n System.out.println(\"Return Completed!\");\n\n Connection myConn = DBConnector.connectDB();\n String u2Query = \"update book set availability='Yes' where book_id=\" + bookIDTextField.getText() ;\n PreparedStatement mypststmt = myConn.prepareStatement(u2Query);\n mypststmt.execute();\n System.out.println(\"Update Completed!\");\n\n jLabel_overDue.setText(\"Over Due by \" + Long.toString(getDiffDays()) + \" day(s)\");\n jLabel_totalFee.setText(\"Total Fee: $\" + String.valueOf(getFee()));\n\n JOptionPane.showMessageDialog(null, \"Book Returned Successfully\");\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n } else {\n JOptionPane.showMessageDialog(null, \"Book Already Returned\");\n }\n } else {\n JOptionPane.showMessageDialog(null, \"Book ID or Student ID is Incorrect\");\n }\n }", "private static void addNewBook(){\n\t\tSystem.out.println(\"===Add New Book===\");\n\t\tBookDetails new_book = new BookDetails();\n\t\tScanner string_input = new Scanner(System.in); //takes string input from user\n\t\tScanner integer_input = new Scanner(System.in); //takes integer input from user\n\t\t\n\t\tSystem.out.println(\"Enter BookId: \");\n\t\tint bookId = getIntegerInput(); //ensures user input is an integer value\n\t\t/*if bookId entered already exists then continually ask user to enter bookId until a bookId that does not exist is entered. \n\t\t * Do the same if bookId is less than 1 because book's in the library will not have Id's less than 1.*/\n\t\twhile(ALL_BOOKS.containsKey(bookId) || bookId < 1){\n\t\t\tSystem.out.println(\"Book Id entered already exists! Enter BookId: \");\n\t\t\tbookId = integer_input.nextInt();\n\t\t}\n\t\tnew_book.setBookId(bookId);\n\t\t\n\t\tSystem.out.println(\"Enter Book Title: \");\n\t\tString bookTitle = string_input.nextLine();\n\t\tnew_book.setBookTitle(bookTitle);\n\t\t\n\t\tString author_firstname;\n\t\tdo{\n\t\t\tSystem.out.println(\"Enter Author's First Name: \");\n\t\t\tauthor_firstname = string_input.next();\n\t\t}while(!new_book.setAuthorFirstName(author_firstname)); //loop until name input is valid (contains only letters) \n\t\t\n\t\tString author_middlename;\n\t\tdo{\n\t\t\tSystem.out.println(\"Enter Author's Middle Name (Type 'null' if author has no middle name): \");\n\t\t\tauthor_middlename = string_input.next();\n\t\t}while(!new_book.setAuthorMiddleName(author_middlename)); //loop until name input is valid (contains only letters) \n\t\t\n\t\tString author_lastname;\n\t\tdo{\n\t\t\tSystem.out.println(\"Enter Author's Last Name: \");\n\t\t\tauthor_lastname = string_input.next();\n\t\t}while(!new_book.setAuthorLastName(author_lastname)); //loop until name input is valid (contains only letters) \n\t\t\n\t\tstring_input = new Scanner(System.in);\n\t\tSystem.out.println(\"Enter Book's Publisher: \");\n\t\tString publisher = string_input.nextLine();\n\t\tnew_book.setPublisher(publisher);\n\t\t\n\t\t\n\t\t/*Set book's genre. Valid values for a book's Genre are Biology, Mathematics, Chemistry, Physics,\n\t\t * Science_Fiction, Fantasy, Action, Drama, Romance, Horror, History, Autobiography, Biography.*/\n\t\tString genre;\n\t\tdo{\n\t\t\tSystem.out.println(\"Enter Book's Genre: \");\n\t\t\tgenre = string_input.next();\n\t\t}while(!new_book.setGenre(genre)); //loop until valid genre value is entered\n\t\t\n\t\t/*Set book's condition. Valid values for a book's Condition are New, Good, Worn, Damaged.*/\n\t\tString condition;\n\t\tdo{\n\t\t\tSystem.out.println(\"Enter Book's Condition: \");\n\t\t\tcondition = string_input.next();\n\t\t}while(!new_book.setCondition(condition)); //loop until valid value for condition is entered\n\t\t\n\t\tALL_BOOKS.put(new_book.getBookId(), new_book);\n\t\taddToPublisherTable(new_book.getPublisher(), new_book.getBookTitle()); //add book's title to the ALL_PUBLISHERS Hashtable\n\t\taddToGenreTable(new_book, new_book.getBookTitle()); //add book's title to the ALL_GENRES ArrayList\n\t\taddToAuthorTable(new_book.getAuthor().toString(), new_book.getBookTitle()); //add book's title to the ALL_AUTHORS Hashtable\n\t\tSystem.out.println(\"Book Successfully Added!\");\n\t}", "private void btnTakeBookActionPerformed(java.awt.event.ActionEvent evt) {\n DefaultTableModel model = (DefaultTableModel) tblStudentsBookList.getModel();\n lblTakeBookLimit.setText(new texts().takeBookLimit() + takeBookLimit + \" )\");\n if (model.getRowCount() < takeBookLimit) {\n String BookID = txtID.getText().trim();\n int bookID = Integer.parseInt(BookID);\n String bookName = txtBookName.getText().trim();\n String ISBN_NO = txtISBN_No.getText().trim();\n int ISBN_No = Integer.parseInt(ISBN_NO);\n String BookStatus = txtBookStatus.getText().trim();\n String StudentID = lblStudentID.getText().trim();\n int studentID = sNum.studentID;\n int bookGenreIndex = comboBxBookGenre.getSelectedIndex();\n if (bookGenreIndex <= 0) {\n JOptionPane.showMessageDialog(null, new texts().selectLine());\n return;\n }\n bookGenre bookGenre = bookGenreList.get(bookGenreIndex - 1);\n\n int authorIndex = comboBxAuthor.getSelectedIndex();\n if (authorIndex <= 0) {\n JOptionPane.showMessageDialog(null, new texts().selectLine());\n return;\n }\n DAL.author valueOfAuthor = authorList.get(authorIndex - 1);\n\n int publisherIndex = comboBxPublisher.getSelectedIndex();\n if (publisherIndex <= 0) {\n JOptionPane.showMessageDialog(null, new texts().selectLine());\n return;\n }\n DAL.publisher valueOfPublisher = publisherList.get(publisherIndex - 1);\n\n String takeDate = (bas.format(today));\n String with = new texts().withStudent();\n new servicesBooks().vtUpdateStudent(bookID, with);\n servicesStudentsBook book = new servicesStudentsBook();\n book.vtAdd(studentID, bookID, bookName, bookGenre.getBookGenreID(), valueOfAuthor.getAuthorID(), ISBN_No, BookStatus, valueOfPublisher.getPublisherID(), takeDate);\n new servicesStudentsBook().vtUpdateStudent(bookID, with);\n takeBookLimit -= 1;\n } else {\n lblTakeBookLimit.setText(\"alınabilir kitap limti dolduğu için kitap alamazsınız\");\n }\n List();\n Clean();\n }", "public double borrow(String memberId) throws BorrowException, IdException\r\n\t{\r\n\t\tif(memberId.length() != 3 )\r\n\t\t{\r\n\t\t\tthrow new IdException(\"Error -- member Id is not correct length of 3\");\r\n\t\t}\r\n\t\tif(!borrowed())\r\n\t\t{\r\n\t\t\tfor(int x = hireHistory.length - 1; x > 0; x--)\r\n\t\t\t{\r\n\t\t\t\thireHistory[x] = hireHistory[x - 1];\r\n\t\t\t}\r\n\t\t\tcurrentlyBorrowed = new HiringRecord(id + \"_\"+memberId + \"_\", fee, new DateTime());\r\n\t\t\thireHistory[0] = currentlyBorrowed;\r\n\t\t\treturn fee;\r\n\t\t}\r\n\t\telse //is on loan\r\n\t\t{\r\n\t\t\tthrow new BorrowException(\"Item \"+ title + \"is already on loan!\");\r\n\t\t}\r\n\t}", "public synchronized void checkIn(int bookTaken, int id){\n \tint returnBook = bookTaken;\n \t\n \t//if else clause to return the correct book\n \tif(returnBook == 0){\n \t\tA.setAvailable(true);\n \t}\n \telse if(returnBook == 1){\n \t\tB.setAvailable(true);\n \t}\n \telse if(returnBook == 2){\n \t\tC.setAvailable(true);\n \t}\n \telse if(returnBook == 3){\n \t\tD.setAvailable(true);\n \t}\n \telse if(returnBook == 4){\n \t\tE.setAvailable(true);\n \t}\n \t\n \t\n \t//notify the waiting clients that a book as been returned\n \tnotifyAll();\n }", "public void onActivityResult(int requestCode, int resultCode, Intent data) {\n\n super.onActivityResult(requestCode, resultCode, data);\n if (requestCode == 325) {\n if (resultCode == Activity.RESULT_OK) {\n String result = data.getStringExtra(\"RESULT_ISBN\");\n if (result.equals(clickedBook.getISBN())){\n //owner confirm receive returned book\n Toast.makeText(getActivity(), \"You successfully received this book\", Toast.LENGTH_SHORT).show();\n currentBookDocRef.update(\"returnDenoted\",\"false\");\n currentBookDocRef.update(\"status\",\"Available\");\n currentBookDocRef.update(\"borrowerID\", FieldValue.delete());\n currentBookDocRef.update(\"borrowerUname\", FieldValue.delete());\n currentBookDocRef.update(\"lat\", FieldValue.delete());\n currentBookDocRef.update(\"lng\", FieldValue.delete());\n borrowerSideBorrowedBookRef.update(\"returnDenoted\",\"false\");\n\n // for borrower,remove book from BorrowedBook\n borrowerSideBorrowedBookRef.delete();\n\n }\n else {\n Toast.makeText(getActivity(), \"The ISBN you scaned does not match the ISBN of the book\", Toast.LENGTH_SHORT).show();\n\n }\n }\n }\n }", "public void confirmBooking(){\n double ticketPrice = 56.0;\n double mealPrice = 30.0;\n if (student || child )\n ticketPrice = ticketPrice/2;\n else\n ticketPrice = ticketPrice*0.8;\n \n if (child )\n mealPrice = mealPrice/2;\n else\n mealPrice = mealPrice*0.9;\n double totalPrice = ticketPrice + mealPrice;\n System.out.println(getName()+\"\\nTicket price:$\"+ticketPrice+\"\\nMeal Price:$\"+mealPrice+\"\\nTotal price:$\"+totalPrice+\"\\nConfirm booking for \"+getName()+\" (Y/N)\");\n setBooked();\n System.out.println(getBooked()+\"\\n\\n\");\n }", "private void butCheckActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_butCheckActionPerformed\n\n Borrower bor = createBorrower();\n String date = tfDate.getText();\n\n if (driver.dateFormatValid(date)) {\n //valid date format, perform check out/in\n if (radBorrow.isSelected()) {\n //check out\n\n Book book = createBook();//create book\n\n if (!book.isOnLoan()) {\n //book is not on loan, can be loaned out\n\n //perform loan, inform user of success\n if (bor.borrow(book, date)) {\n driver.infoMessageNormal(\"\\\"\" + book.getTitle() + \"\\\" loaned successfully to \" + bor.getName());\n\n } else {\n driver.errorMessageNormal(\"Book could not be loaned\");\n }\n\n } else {\n //is on loan\n driver.errorMessageNormal(\"\\\"\" + book.getTitle() + \"\\\" is already on loan.\");\n\n }\n\n } else if (radReturn.isSelected()) {\n //check in / returning\n\n Book book = createBook();\n\n if (book.isOnLoan()) {\n //book is on loan, and can be returned\n\n if (bor.returnBook(book, date)) {\n driver.infoMessageNormal(\"\\\"\" + book.getTitle() + \"\\\" has been returned.\");\n\n } else {\n driver.infoMessageNormal(\"The book could not be returned.\");\n }\n\n } else {\n //not on loan\n driver.infoMessageNormal(\"\\\"\" + book.getTitle() + \"\\\" is not on loan.\");\n }\n\n } else {\n driver.errorMessageNormal(\"Please select whether the book is being checked in or being returned.\");\n }\n\n } else {\n //invalid format\n driver.errorMessageNormal(\"Please ensure the date is in the format DD/MM/YYY\");\n }\n\n\n }", "@PostMapping(\"/transaction/issue_book\")\n public String issueBook(@RequestParam(\"book_id\") int bookId) throws Exception {\n\n Authentication authentication = SecurityContextHolder.getContext().getAuthentication();\n User user = (User) authentication.getPrincipal();\n\n if(!user.isStudent()){\n throw new AuthorizationServiceException(\"Admins can not issue book\");\n }\n\n int studentId = user.getUserTypeId();\n\n return transactionService.issueBook(bookId, studentId);\n }", "@Override\n\tpublic Book findBooknum(int id) {\n\t\treturn this.borrowrecordMapper.findBooknum(id);\n\t}", "private void onOK() {\n String borrowDateString = Borrowed.getSelectID();\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\");\n try {\n Date borrowDate = sdf.parse(borrowDateString);\n Calendar calendar = Calendar.getInstance();\n calendar.setTime(borrowDate);\n calendar.add(Calendar.MONTH, 3);\n long shouldReturn = calendar.getTimeInMillis();\n long returnDate = System.currentTimeMillis();\n long betweenDays = (returnDate - shouldReturn) / (1000 * 60 * 60 * 24);\n if (betweenDays > 0) {\n JOptionPane.showMessageDialog(this, \"请缴费\" + betweenDays * 0.2f + \"元\", \"提示\", JOptionPane.WARNING_MESSAGE);\n BorrowedDao borrowedDao = new BorrowedDao();\n try {\n borrowedDao.returnBook(Reader.getSelectID(), Book.getSelectID(), Borrowed.getSelectID(), true);\n JOptionPane.showMessageDialog(this, \"还书成功\", \"提示\", JOptionPane.WARNING_MESSAGE);\n dispose();\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n JOptionPane.showMessageDialog(this, \"还书失败\", \"提示\", JOptionPane.WARNING_MESSAGE);\n } catch (SQLException e) {\n e.printStackTrace();\n JOptionPane.showMessageDialog(this, \"还书失败\", \"提示\", JOptionPane.WARNING_MESSAGE);\n }\n } else {\n BorrowedDao borrowedDao = new BorrowedDao();\n try {\n borrowedDao.returnBook(Reader.getSelectID(), Book.getSelectID(), Borrowed.getSelectID(), true);\n JOptionPane.showMessageDialog(this, \"还书成功\", \"提示\", JOptionPane.WARNING_MESSAGE);\n dispose();\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n JOptionPane.showMessageDialog(this, \"还书失败\", \"提示\", JOptionPane.WARNING_MESSAGE);\n } catch (SQLException e) {\n e.printStackTrace();\n JOptionPane.showMessageDialog(this, \"还书失败\", \"提示\", JOptionPane.WARNING_MESSAGE);\n }\n }\n } catch (ParseException e) {\n e.printStackTrace();\n }\n }", "boolean borrowBook(int bookId, int patronId) {\n\t\t\n\t\t// checks if the book and patron id are not valid or the book is not available \n\t\tif (!this.isBookIdValid(bookId) || !this.isPatronIdValid(patronId) ||\n\t\t\t\t!this.isBookAvailable(bookId)) {\n\t\t\treturn false; \n\t\t}\n\t\t\n\t\t// checks if the patron took out too many books or wont like that book \n\t\tif (this.patronBookCount[patronId] > this.maxBorrowedBooks ||\n\t\t!this.patronlist[patronId].willEnjoyBook(this.bookShelf[bookId])) {\n\t\t\treturn false; \n\t\t}\n\t\t\n\t\t// sets that book to taken \n\t\tthis.bookShelf[bookId].setBorrowerId(patronId);\n\t\t\n\t\t// adds one to the patrons counter\n\t\tthis.patronBookCount[patronId]++; \n\t\t\n\t\t// it was a successful borrow\n\t\treturn true; \n\t}", "void showBookResult(Book book);", "public void book(long bookRecordId) {\n book(bookRecordId, false);\n }", "@Override\n\tpublic int findBookBorrow(int id) {\n\t\treturn this.borrowrecordMapper.findBookBorrow(id);\n\t}", "public void borrowBook()\r\n {\r\n noOfBooks = noOfBooks + 1;\r\n System.out.println(\"Books on loan: \" + noOfBooks); \r\n }", "public void issueBook() {\n\t\t JTextField callno = new JTextField();\r\n\t\t JTextField name = new JTextField();\r\n\t\t JTextField id = new JTextField(); \r\n\t\t JTextField contact = new JTextField(); \r\n\t\t Object[] issued = {\r\n\t\t\t\t \"Bookcallno:\",callno,\r\n\t\t\t\t \"Student ID:\",id,\r\n\t\t\t\t \"Name:\",name,\r\n\t\t\t\t \"Contact:\",contact\r\n\t\t\t\t\r\n\t\t };\r\n\t\t int option = JOptionPane.showConfirmDialog(null, issued, \"New issued book\", JOptionPane.OK_CANCEL_OPTION);\r\n\t\t if(option==JOptionPane.OK_OPTION) {\r\n\t\t\tint check = checkBook(callno.getText());\r\n\t\t\tif(check==-1) {\r\n\t\t\t\t JOptionPane.showMessageDialog(null, \"Wrong book call number\", null, JOptionPane.ERROR_MESSAGE);\r\n\t\t\t\t return;\r\n\t\t\t}\r\n\t\t\telse if(check == 0) {\r\n\t\t\t\t JOptionPane.showMessageDialog(null, \"Book is not available right now\", null, JOptionPane.ERROR_MESSAGE);\r\n\t\t\t\t return;\r\n\t\t\t}\r\n // add to the Book database\r\n\t\t try {\r\n\t\t\t \r\n\t\t String query = \"insert into Issued(bookcallno,studentId,studentName,studentContact,issued_date)\"\r\n\t\t\t\t +\" values(?,?,?,?,GETDATE())\";\r\n\t\t \r\n\t\t PreparedStatement s = SimpleLibraryMangement.connector.prepareStatement(query);\r\n\t\t s.setString(1, callno.getText());\r\n\t\t s.setInt(2, Integer.parseInt(id.getText()));\r\n\t\t s.setString(3, name.getText());\r\n\t\t s.setString(4, contact.getText());\r\n\t\t \r\n\t\t s.executeUpdate();\r\n\t\t updateIssuedBook(callno.getText());\r\n\t\t JOptionPane.showMessageDialog(null, \"Issue book successfully\", null, JOptionPane.INFORMATION_MESSAGE);\r\n\r\n\t\t } catch(Exception e) {\r\n\t\t\t JOptionPane.showMessageDialog(null, \"Issue book failed\", null, JOptionPane.ERROR_MESSAGE);\r\n\t\t\t e.printStackTrace();\r\n\t\t }\r\n\t\t } \r\n\t }", "public void accountantSection() throws NumberFormatException, IOException, ClassNotFoundException, SQLException, DocumentException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tStudentDetailsDao std = new StudentDetailsDao();\n\t\tFeeDetailsDao fdd = new FeeDetailsDao();\n\t\tValidation val = new Validation();\n\t\tStudentPojo st = new StudentPojo();\n\t\t\n\t\twhile(true) {\n\t\t\tSystem.out.println(\"------ACCOUNTANT SECTION------\");\n\t\t\tSystem.out.println(\" 1: Add Student \");\n\t\t\tSystem.out.println(\" 2: view Student \");\n\t\t\tSystem.out.println(\" 3: Delete Student \");\n\t\t\tSystem.out.println(\" 4: Update Student \");\n\t\t\tSystem.out.println(\" 5: Export Student Fee Report pdf\");\n\t\t\tSystem.out.println(\" 6: Logout \");\n\t\t\tint opt = 0;\n\t\t\ttry {\n\t\t\t\topt = Integer.parseInt(br.readLine());\n\t\t\t}\n\t\t\tcatch(Exception e) {\n\t\t\t\tSystem.out.println(\" \\nSelect from above given respective inputs.\\n\");\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t//------------------ADD STUDENT-----------------------------------------------------\n\t\t\tif(opt == 1) {\n\t\t\t\tSystem.out.println(\"------ADD STUDENT-------\");\n\t\t\t\t\n\t\t\t\twhile(true) {\n\t\t\t\t\tSystem.out.println(\" Enter Student Roll NO. : \");\n\t\t\t\t\tint id = 0;\n\t\t\t\t\ttry {\n\t\t\t\t\t id = Integer.parseInt(br.readLine());\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception e) {\n\t\t\t\t\t\tSystem.out.println(\"You have entered wrong input only numbers will allow.\");\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\tst.setId(id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\twhile(true) {\n\t\t\t\t\tSystem.out.println(\" Enter Student Name : \");\n\t\t\t\t\tString name = br.readLine();\n\t\t\t\t\tboolean check = val.name(name);\n\t\t\t\t\tif(check == true) {\n\t\t\t\t\t\tst.setName(name);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tSystem.out.println(\"You have entered wrong input only Alphabets will allow.\");\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\twhile(true) {\n\t\t\t\t\tSystem.out.println(\" Enter Student DOB(ex:25-10-1990) : \");\n\t\t\t\t\tString dob = br.readLine();\n\t\t\t\t\tboolean check = val.dob(dob);\n\t\t\t\t\tif(check == true) {\n\t\t\t\t\t\tst.setDob(dob);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tSystem.out.println(\" Not a valid DOB see example\");\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tSystem.out.println(\" Enter Student Address : \");\n\t\t\t\tString address = br.readLine();\n\t\t\t\tst.setAddress(address);\n\t\t\t\t\n\t\t\t\twhile(true) {\n\t\t\t\t\tSystem.out.println(\" Enter Student Branch : \");\n\t\t\t\t\tString branch = br.readLine();\n\t\t\t\t\tboolean check = val.name(branch);\n\t\t\t\t\tif(check == true) {\n\t\t\t\t\t\tst.setBranch(branch);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tSystem.out.println(\" Invalid input \");\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tSystem.out.println(\" Enter Student Batch year(ex:1990) : \");\n\t\t\t\tint year = 0;\n\t\t\t\twhile(true) {\n\t\t\t\t\ttry {\n\t\t\t\t\tyear = Integer.parseInt(br.readLine());\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception e) {\n\t\t\t\t\t\tSystem.out.println(\" Not a valid input only numbers will allow.\");\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tString reg = \"^\\\\d{4}$\";\n\t\t\t\t\tboolean e = Pattern.compile(reg).matcher(Integer.toString(year)).matches();\n\t\t\t\t\tif(e == true) {\n\t\t\t\t\t\tst.setYear(year);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tSystem.out.println(\" Please Enter valid input, see example.\");\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\twhile(true) {\n\t\t\t\t\tSystem.out.println(\" Enter Student Gender : \");\n\t\t\t\t\tString gender = br.readLine();\n\t\t\t\t\tboolean check = val.gender(gender);\n\t\t\t\t\tif(check == true) {\n\t\t\t\t\t\tst.setGender(gender);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tSystem.out.println(\" Invalid input \");\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\twhile(true) {\n\t\t\t\tSystem.out.println(\" Enter Student contact(ex: +91 (789){1} (947982384){9}) : \");\n\t\t\t\tString contact = br.readLine();\n\t\t\t\tboolean check = val.contact(contact);\n\t\t\t\tif(check == true) {\n\t\t\t\t\tst.setContact(contact);\n\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tSystem.out.println(\" Invalid input,see example \");\n\t\t\t\t\tcontinue;\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t}\n\t\t\t\tstd.addStudent(st);\n\t\t\t\t\n\t\t\t\t//-----------------ADD STUDENT FEE DETAILS--------------------------\n\t\t\t\t\n\t\t\t\tSystem.out.println(\" ---ADD STUDENT FEE DETAILS---\");\n\t\t\t\tSystem.out.println(\" Total fees is : 40,000 .\");\n\t\t\t\twhile(true) {\n\t\t\t\t\tint paidfees =0;\n\t\t\t\t\tSystem.out.println(\" Enter Student paid fees : \");\n\t\t\t\t\ttry {\n\t\t\t\t\t\tpaidfees = Integer.parseInt(br.readLine());\n\t\t\t\t\t\tif(paidfees>40000) {\n\t\t\t\t\t\t\tSystem.out.println(\" You just have to pay 40,000.\");\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception e) {\n\t\t\t\t\t\tSystem.out.println(\" Not a valid input only numbers will allow.\");\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tst.setPaidfees(paidfees);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tfdd.addStudentFeeDetails(st);\n\t\t\t}\n\t\t\telse if(opt ==2) {\n\t\t\t\twhile(true) {\n\t\t\t\t\tSystem.out.println(\"\\n---------View Student Details----------\\n \");\n\t\t\t\t\tSystem.out.println(\" 1. : View Student personal Details \");\n\t\t\t\t\tSystem.out.println(\" 2. : View Student Fee Details \");\n\t\t\t\t\tSystem.out.println(\" 3. : Exit\");\n\t\t\t\t\t\n\t\t\t\t\tint ch=0;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tch= Integer.parseInt(br.readLine());\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception e){\n\t\t\t\t\t\tSystem.out.println(\" Select from above given respective inputs.\");\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif(ch == 1) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tstd.viewStudent();\n\t\t\t\t\t}\n\t\t\t\t\telse if(ch ==2) {\n\t\t\t\t\t\tfdd.viewFeeDetails();\n\t\t\t\t\t}\n\t\t\t\t\telse if(ch ==3) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tSystem.out.println(\"\\n please enter above listed valid inputs\\n\");\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t//------------------DELETE STUDENT-----------------------------------------------------\n\t\t\telse if(opt ==3) {\n\t\t\t\twhile(true) {\n\t\t\t\t\tSystem.out.println(\"\\n---------Delete Student Details----------\\n \");\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(\" Enter Student ID : \");\n\t\t\t\t\tint id = 0;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tid = Integer.parseInt(br.readLine());\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception e) {\n\t\t\t\t\t\tSystem.out.println(\" Please enter a valid input..\");\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tstd.deleteStudent(id);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//------------------UPDATE STUDENT-----------------------------------------------------\n\t\t\telse if(opt ==4) {\n\t\t\t\t\n\t\t\t\twhile(true) {\n\t\t\t\t\tSystem.out.println(\"\\n---------Update Student Details----------\\n \");\n\t\t\t\t\tSystem.out.println(\" ==Update Student Fee Details== \");\n\t\t\t\t\tSystem.out.println(\" Enter Student Roll NO. : \");\n\t\t\t\t\tint id = 0;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tid = Integer.parseInt(br.readLine());\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception e) {\n\t\t\t\t\t\tSystem.out.println(\" Please enter a valid input..\");\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tfdd.updateFeeDetails(id);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//------------------Export STUDENT Fee Details-----------------------------------------------------\n\t\t\telse if(opt ==5) {\n\t\t\t\t\n\t\t\t\twhile(true) {\n\t\t\t\t\tSystem.out.println(\"\\n---------Export STUDENT Fee Details----------\\n \");\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(\" Enter Student Roll NO. : \");\n\t\t\t\t\tint id = 0;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tid = Integer.parseInt(br.readLine());\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception e) {\n\t\t\t\t\t\tSystem.out.println(\" Please enter a valid input..\");\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tExportPdf epd = new ExportPdf();\n\t\t\t\t\tepd.ExportPdf(id);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(opt ==6) {\n\t\t\t\tSystem.out.println(\"\\n\\t.....Successfully Accountant Logging Out......\\n\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"\\n....You have entered a wrong input...\\n\");\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\t\n\t}", "public void returnBook()\n\t{\n\t\tavailableBooks++;\n\t}", "public synchronized int borrow(String student, String name) {\n\t\tfor (Book b : inventory) {\n\t\t\tif (b.name.equals(name)) {\n\t\t\t\tif (b.quantity == 0) {\n\t\t\t\t\treturn 0;\n\t\t\t\t} else {\n\t\t\t\t\tb.quantity--;\n\t\t\t\t\trecord_id++;\n\t\t\t\t\trecord.add(new Record(student, name, record_id));\n\t\t\t\t\treturn record_id;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}", "private static int addNewStudent(){\n\t\tSystem.out.println(\"===Add New Student To Database===\");\n\t\tScanner string_input = new Scanner(System.in); //gets String input from the user\n\t\tScanner integer_input = new Scanner(System.in); //get integer input from the user\n\t\tStudentDetails new_student = new StudentDetails();\n\t\t\n\t\tString firstname;\n\t\tdo{\n\t\t\tSystem.out.println(\"Enter new student's first name: \");\n\t\t\tfirstname = string_input.next();\n\t\t}while(!new_student.setFirstName(firstname)); //loop until name input is valid\n\t\t\n\t\tString middlename;\n\t\tdo{\n\t\t\tSystem.out.println(\"Enter new student's middle name (Type 'null' if author has no middle name): \");\n\t\t\tmiddlename = string_input.next();\n\t\t}while(!new_student.setMiddleName(middlename)); //loop until name input is valid\n\t\t\n\t\tString lastname;\n\t\tdo{\n\t\t\tSystem.out.println(\"Enter new student's last name: \");\n\t\t\tlastname = string_input.next();\n\t\t}while(!new_student.setLastName(lastname)); //loop until name input is valid\n\t\t\n\t\tint grade;\n\t\tdo{\n\t\t\tSystem.out.println(\"Enter new student's grade (9 - 12): \");\n\t\t\tgrade = integer_input.nextInt();\n\t\t}while(!new_student.setGrade(grade)); //loop until name input is valid\n\t\t\n\t\tALL_STUDENTS.add(new_student);\n\t\tint new_studentId = ALL_STUDENTS.size() - 1; //since student was the most recently added element to the ALL_STUDENTS ArrayList, its index should be ALL_STUDENTS.size() - 1. Student's index in this ArrayList should be the new student's Id.\n\t\tnew_student.setId(new_studentId); //set the new student's Id\n\t\t\n\t\treturn new_student.getId();\n\t}", "public static void printRemoveBook(int result, Integer memId, String bookID) {\n if (result > 0) {\n System.out.println(\"The book removed successfully from member \" + memId + \".\\n\");\n } else {\n if (result == -1) {\n System.out.println(\"The book \" + bookID + \" wasn`t taken \\n\");\n }\n if (result == -2) {\n System.out.println(\"The member \" + memId + \" doesn`t own this book \\n\");\n }\n }\n }", "public void readBook()\n\t{\n\t\tb.input();\n\t\tSystem.out.print(\"Enter number of available books:\");\n\t\tavailableBooks=sc.nextInt();\n\t}", "private void handleBooking() {\n\t\tString customerID;\n\t\tint recNo = table.getSelectedRow();\n\t\tif(recNo == -1){\n\t\t\treturn;\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tcustomerID = JOptionPane.showInputDialog(mainPanel,\n\t\t\t\t\t\"Enter Customer ID (8 Digits)\");\n\t\t\tif (customerID != null) {\t\n\t\t\t\tcontroller.reserveRoom(recNo, customerID);\n\t\n\t\t\t\tupdateTable(nameSearchBar.getText(),\n\t\t\t\t\t\tlocationSearchBar.getText());\n\t\t\t}\n\t\t} catch (final InvalidCustomerIDException icide) {\n\t\t\tJOptionPane.showMessageDialog(mainPanel, \"Invalid format!\");\n\t\t} catch (final BookingServiceException bse) {\n\t\t\tJOptionPane.showMessageDialog(mainPanel, bse.getMessage());\n\t\t} catch (final ServiceUnavailableException sue) {\n\t\t\tJOptionPane.showMessageDialog(null, sue.getMessage());\n\t\t\tSystem.exit(0);\n\t\t}\n\t}", "public boolean checkoutBooking() {\r\n\t\tScanner scan = new Scanner(System.in);\r\n\t\tboolean bookUpdateSuccess = false;\r\n\r\n\t\t/**\r\n\t\t*\tSet the endTime as now\r\n\t\t*/\r\n\t\t/**\r\n\t\t*\tGet the number of milliSeconds from the system time and set it to the java.sql.Date\r\n\t\t*\tobject to create a booking number and also to set the start time.\r\n\t\t*/\r\n\t\tlong dateTimeMillis = System.currentTimeMillis();\r\n\t\t/**\r\n\t\t*\tThis date is for generating String bookingNo using the date and time values\r\n\t\t*/\r\n\t\tjava.util.Date date = new java.util.Date(dateTimeMillis);\r\n\t\t/**\r\n\t\t*\tPass the current date in sql.Timestamp object.\r\n\t\t*/\r\n\t\tendTime = new java.sql.Timestamp(date.getTime());\r\n\r\n\t\t/**\r\n\t\t*\tCalculate the cost base on the time elapsed between the start time and end time\r\n\t\t*\tdurationMinutes = (difference b/w end and start time) / 1000 to convert millis to seconds / 60 to convert seconds to minutes\r\n\t\t*/\r\n\t\tlong start = startTime.getTime();\r\n\t\tlong end = endTime.getTime();\r\n\t\tlong durationMinutes = (end - start)/60000;\r\n\r\n\t\t/**\r\n\t\t*\tThe cost is set as Rs. 1.27 per minuteand hence will be calulated using durationMinutes\r\n\t\t* The cost will be calculated according to absolute minutes and no decimals will be considered there\r\n\t\t*/\r\n\t\tcost = durationMinutes * 1.27;\r\n\r\n\t\t/**\r\n\t\t*\tShow the cost and confirm to checkout.\r\n\t\t*/\r\n\t\tSystem.out.print(\"\\n\\tTotal cost calculated: \" + cost + \"\\n\\n\\t1. Confirm Checkout\\n\\t2. Cancel\\n\\t\\t>> \");\r\n\t\tint opt = scan.nextInt();\r\n\r\n\t\tswitch (opt) {\r\n\t\t\tcase 1: {\t//confirm checkout\r\n\t\t\t\t//do nothing and move ahead towards the checkout procedure\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tcase 2: {\t//Cancel\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tdefault: {\r\n\t\t\t\tSystem.out.println(\"Invalid Option\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t/**\r\n\t\t*\tSince connecting to database (DbConnection()) and updating data (executeUpdateParklot())\r\n\t\t* throw SQLException and throwing an exception from multiple levels again and again is not\r\n\t\t*\ta good way, so its is needed to catch the exception here.\r\n\t\t*/\r\n\t\ttry {\r\n\t\t\t/**\r\n\t\t\t*\tCreate a connection to the database\r\n\t\t\t*/\r\n\t\t\tDbConnection checkoutBookingConn = new DbConnection();\r\n\r\n\r\n\t\t\t/**\r\n\t\t\t*\tupdate the data in table\r\n\t\t\t*/\r\n\t\t\tbookUpdateSuccess = checkoutBookingConn.executeUpdateBooking(endTime, cost, bookingNo);\r\n\r\n\r\n\t\t} catch(SQLException SqlExcep) {\r\n\t\t\tSystem.out.println(\"No booking with the given booking number found.\");\r\n\t\t\t//SqlExcep.printStackTrace();\r\n\t\t} catch (ClassNotFoundException cnfExecp) {\r\n\t\t\tcnfExecp.printStackTrace();\r\n\t\t} finally {\r\n\t\t\t/*try {\r\n\t\t\t\t//validateConn.closeDbConnection();\r\n\t\t\t} catch(SQLException SqlExcep) {\r\n\t\t\t\tSqlExcep.printStackTrace();\r\n\t\t\t}*/\r\n\t\t}\r\n\t\treturn bookUpdateSuccess;\r\n\t}", "public void showMemberBookings()\n {\n try\n {\n System.out.println(\"Please enter the memeber ID\");\n int memberId =sc.nextInt();\n Member mem = sportsClub.searchMember(memberId); \n \n if(mem==null || mem.getBookings()==null)\n {\n System.out.println(\"Sorry! Member is not found.\");\n }\n else\n {\n for(Booking bookingObj : mem.getBookings())\n {\n System.out.println(\"Booking made by \"+mem.getMemberName() +\" for \" + bookingObj.getBookingDate() + \" at \" + bookingObj.getBookingTime() + \" for \" + bookingObj.getBookingEndTime() + \" minutes on Court number \" + bookingObj.getCourt().getCourtId());\n\n }\n if(mem.getBookings().size()==0)\n System.out.println(\"Sorry! Currebtly no bookings done by the member \");\n }\n }\n catch(Exception e)\n {\n System.out.println(\"Error\"+e);\n }\n\n }", "@Override\r\n\tpublic int returnBooks(int userId, BookBean books) {\n\t\t\r\n\t\t\r\n\t\treturn jdbcTemplate.update(\r\n \"update libtrx set,trx_date=?,trx_status=? values(?,?) where bookid=? and userid=?;\"+\r\n \t\t\"update libbook set bookcount=(bookcount+1) where bookid=?;\",\r\n LocalDate.now(),\"RN\",books.getBookId(),userId,books.getBookId());\r\n\t}", "void approveStudent(String studentId);", "boolean isBookAvailable(int bookId) {\n\t\t\n\t\t// checks if the books id is valid\n\t\tif (!this.isBookIdValid(bookId)) {\n\t\t\treturn false; \n\t\t}\n\t\t\n\t\t// checks if the book is not taken \n\t\tif(this.bookShelf[bookId].currentBorrowerId == -1) {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// the book is taken \n\t\treturn false;\n\t}", "public int saveLoan(String ISBN10, int borrower_id) throws SQLException {\n\t\tmySQLJDBC.setPreparedSql(\"select flag from borrower where borrower_id=?;\", borrower_id);\n\t\tResultSet res = mySQLJDBC.excuteQuery();\n\t\tint s = 90;\n\t\tif(res.next())\n\t\t\ts = res.getInt(\"flag\");\n\t\t//check if borrower is NOT flagged\n\t\tif (s == 0) {\n\t\t\tmySQLJDBC.setPreparedSql(\"select isAvailable from book where ISBN10=?;\", ISBN10);\n\t\t\tres = mySQLJDBC.excuteQuery();\n\t\t\tif(res.next())\n\t\t\t\ts = res.getInt(\"isAvailable\");\n\t\t\t//check if book is available\n\t\t\tif(s != 0) {\n\t\t\t\tmySQLJDBC.setPreparedSql(\"insert into book_loan (ISBN10, borrower_id, date_out, due_date) values (?, ?, SYSDATE(), DATE_ADD(SYSDATE(), INTERVAL 14 DAY));\", ISBN10,borrower_id);\n\t\t\t\tint resupdate = mySQLJDBC.executeUpdate();\n\t\t\t\t//if insert was successful, change book availability\n\t\t\t\tif (resupdate != -1) {\n\t\t\t\t\tmySQLJDBC.setPreparedSql(\"update book set isAvailable=0 where ISBN10=?;\", ISBN10);\n\t\t\t\t\tresupdate = mySQLJDBC.executeUpdate();\n\t\t\t\t\t//if update availability was successful, count no. of loans\n\t\t\t\t\tif(resupdate == 1) {\n\t\t\t\t\t\tmySQLJDBC.setPreparedSql(\"select borrower_id, count(*) from book_loan where date_in is null and borrower_id=?;\", borrower_id);\n\t\t\t\t\t\tres = mySQLJDBC.excuteQuery();\n\t\t\t\t\t\tif(res.next())\n\t\t\t\t\t\t\ts = res.getInt(\"count(*)\");\n\t\t\t\t\t\t//if count >= 3, change flag to 1\n\t\t\t\t\t\tif(s >= 3) {\n\t\t\t\t\t\t\tmySQLJDBC.setPreparedSql(\"update borrower set flag = 1 where borrower_id=?;\", borrower_id);\n\t\t\t\t\t\t\tresupdate = mySQLJDBC.executeUpdate();\n\t\t\t\t\t\t\t//if update was successful, return success\n\t\t\t\t\t\t\tif (resupdate != -1) {\n\t\t\t\t\t\t\t\tmySQLJDBC.close();\n\t\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//update flag was not successful\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tmySQLJDBC.close();\n\t\t\t\t\t\t\t\treturn -1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//i count < 3, just return success\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tmySQLJDBC.close();\n\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//update availability was not successful\n\t\t\t\t\telse {\n\t\t\t\t\t\tmySQLJDBC.close();\n\t\t\t\t\t\treturn -1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//insert loan was not successful\n\t\t\t\telse {\n\t\t\t\t\tmySQLJDBC.close();\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//book is checked out\n\t\t\telse {\n\t\t\t\tmySQLJDBC.close();\n\t\t\t\treturn -2;\n\t\t\t}\n\t\t}\n\t\t//borrower is flagged, return reason\n\t\telse {\n\t\t\t//borrower has more than 3 books checked out\n\t\t\t//mySQLJDBC.setPreparedSql(\"select flag from borrower where borrower_id=?;\", borrower_id);\n\t\t\t//res = mySQLJDBC.excuteQuery();\n\t\t\t//if(res.next()) {\n\t\t\t\t//s = res.getInt(\"flag\");\n\t\t\t\t//mySQLJDBC.close();\n\t\t\t//}\n\t\t\tmySQLJDBC.close();\n\t\t\tif(s == 1) { //s=1 --> more than 3 books checked out\n\t\t\t\treturn -3; \n\t\t\t}\n\t\t\telse if(s == 2){ //s=2 --> more than $5 owed\n\t\t\t\treturn -4;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn -5;\n\t\t\t}\n\t\t}\n\t}", "private void displayByID() { \n\t\tint sic_idHolder; // declares sic_idHolder\n\t\t\n\t\tSystem.out.println(\"Please enter the SIC-ID of the book you would like displayed:\");\n\t\tsic_idHolder = scan.nextInt();\n\t\tscan.nextLine();\n\t\tSystem.out.println(inventoryObject.displayBySICID(sic_idHolder));\n\t\tgetUserInfo();\n\t}", "@Override\n\tpublic int findBooklose(int id) {\n\t\treturn this.borrowrecordMapper.findBooklose(id);\n\t}", "public void setBookId(String bookId) {\n this.bookId = bookId;\n }", "public void availableBookings(int bID){\n int index=0;\n String n = null;\n Services s = new Services();\n\n System.out.println(\"\\n\"+ Login.businessList.get(bID).getName()+ \" [opening hours]\");\n System.out.println(\"-----------------------------\");\n workday.printFile(Login.businessList.get(bID).getUsername());\n System.out.println(\"-----------------------------\");\n System.out.println(\"\\nSelect a Service.\");\n s.printService(Login.businessList.get(bID).getUsername());\n\n Scanner reader = new Scanner(System.in);\n do {\n System.out.print(\"Enter Service ID: \");\n n = reader.nextLine();\n index = s.checkID(n);\n }while(index==0);\n\n }", "public void edit(int id, String name, String author, int issueDate, int returnDate) {\n\tListIterator<Book> listItr = list.listIterator();\n\twhile(listItr.hasNext()) {\n\t\tBook book2 = listItr.next();\n\t\tif(book2.id == id) {\n\t\t\tbook2.name = name;\n\t\t\tbook2.author = author;\n\t\t\tbook2.issueDate = issueDate;\n\t\t\tbook2.returnDate = returnDate;\n\t\t\tSystem.out.println(\"Successfully edited: \"+id);\n\t\t\treturn;\n\t\t}\n\t}\n\tSystem.out.println(\"No such Book ID exists\");\n\t\n}", "private boolean book() throws Exception {\n\t\tSystem.out.println(\"Enter date car required: \");\n\t\tSystem.out.println(\"format DD/MM/YYYY)\");\n\t\tString dateEntered = console.nextLine();\n\t\tDateRegex dateChecker = new DateRegex(dateEntered);\n\t\tint day = Integer.parseInt(dateEntered.substring(0, 2));\n\t\tint month = Integer.parseInt(dateEntered.substring(3, 5));\n\t\tint year = Integer.parseInt(dateEntered.substring(6));\n\t\tDateTime dateRequired = new DateTime(day, month, year);\n\t\t\n\t\tif (!DateUtilities.dateIsNotInPast(dateRequired) || !DateUtilities.dateIsNotMoreThan7Days(dateRequired)) {\n\t\t\tthrow new InvalidBookingDateException(\"Error: Date is invalid, must be within the coming week.\");\n//\t\t\tSystem.out.println(\"Date is invalid, must be within the coming week.\");\n//\t\t\treturn false;\n\t\t}\n\t\t\n\t\tString[] availableCars = application.book(dateRequired);\n\t\t\n\t\tfor (int i = 0; i < availableCars.length; i++) {\n\t\t\tSystem.out.println(availableCars[i]);\n\t\t}\n\t\t\n\t\tif (availableCars.length != 0) {\n\t\t\tSystem.out.println(\"Please enter a number from the list:\");\n\t\t\tString itemSelectedInString = console.nextLine();\n\t\t\t\n\t\t\ttry {\n\t\t\t\tint numberStringChecker = Integer.parseInt(itemSelectedInString);\n\t\t\t}\n\t\t\t\n\t\t\tcatch (NumberFormatException e) {\n\t\t\t\tSystem.out.println(\"Error: Please enter a numeric value.\");\n\t\t\t}\n\t\t\t\n//\t\t\tif (itemSelectedInString.contains(\"[a-zA-Z]+\")) {\n//\t\t\t\tthrow new InvalidCharacterException(\"Error: Input must be a numeric value.\");\n//\t\t\t}\n\t\t\t\n\t\t\tint itemSelected = Integer.parseInt(itemSelectedInString);\n\t\t\t\n\t\t\tif (itemSelected == 0) {\n\t\t\t\tthrow new InvalidZeroUserInputException(\"Error: Number cannot be 0.\");\n\t\t\t}\n\t\t\t\n\t\t\tString regNo = availableCars[itemSelected - 1];\n\t\t\tregNo = regNo.substring(regNo.length() - 6);\n\t\t\tSystem.out.println(\"Please enter your first name:\");\n\t\t\tString firstName = console.nextLine();\n\t\t\tSystem.out.println(\"Please enter your last name:\");\n\t\t\tString lastName = console.nextLine();\n\t\t\tSystem.out.println(\"Please enter the number of passengers:\");\n\t\t\t\n\t\t\ttry {\n\t\t\t\tint numPassengers = Integer.parseInt(console.nextLine());\n\t\t\t\tString result = application.book(firstName, lastName, dateRequired, numPassengers, regNo);\n\t\t\t\tSystem.out.println(result);\n\t\t\t}\n\t\t\t\n\t\t\tcatch (NumberFormatException e) {\n\t\t\t\tSystem.out.println(\"Error: The number of passengers should be in numeric input.\");\n\t\t\t}\n\t\t} \n\t\t\n\t\telse {\n\t\t\tSystem.out.println(\"There are no available cars on this date.\");\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "@Then(\"book information must match the api for {}\")\n public void book_information_must_match_the_api_for_The_kite_runner(String book) {\n String query = \"SELECT id FROM books WHERE name = '\" + book + \"'\";\n String id = DBUtils.getCellValue(query).toString();\n // get the token\n AuthenticationUtility authenticationUtility = new LibrarianAuthenticationUtility();\n String token = authenticationUtility.getToken();\n // use the id to make the call to api\n Response response = given().\n log().all().\n header(\"x-library-token\", token).\n pathParam(\"id\", id).\n when().\n get(Endpoints.GET_BOOK_BY_ID).\n prettyPeek();\n // verify response vs ui\n response.then().statusCode(200).contentType(ContentType.JSON);\n Book bookPojo = response.as(Book.class);\n\n assertThat(bookPojo.getName(), is(booksPage.bookName.getAttribute(\"value\")));\n assertThat(bookPojo.getAuthor(), is(booksPage.author.getAttribute(\"value\")));\n assertThat(bookPojo.getIsbn(), is(booksPage.isbn.getAttribute(\"value\")));\n assertThat(bookPojo.getDescription(), is(booksPage.description.getAttribute(\"value\")));\n\n }", "public void updateStudentById(int id)\r\n {\r\n if(this.ID!=id){\r\n return;\r\n }\r\n Scanner input=new Scanner(System.in);\r\n if(ID==-1){\r\n System.out.println(\"Enter student name: \");\r\n Name=input.nextLine();\r\n System.out.println(\"Enter id: \");\r\n ID=input.nextInt();\r\n System.out.println(\"Enter University: \");\r\n \r\n University=input.nextLine();\r\n University=input.nextLine();\r\n \r\n \r\n System.out.println(\"Enter Department: \");\r\n Department=input.nextLine();\r\n \r\n }\r\n \r\n }", "public static int books(int choice) {\r\n\r\n\t\tswitch (choice) {\r\n\t\tcase 1: // Mech dept books\r\n\t\t\tSystem.out.println(\"1 :SOLID MECHANICS\");\r\n\r\n\t\t\tSystem.out.println(\"2 :FLUID MECHANICS\");\r\n\r\n\t\t\treturn 1;\r\n\r\n\t\tcase 2: // civil debt books\r\n\t\t\tSystem.out.println(\"3 :BRICKS\");\r\n\r\n\t\t\tSystem.out.println(\"4 :SURVEY\");\r\n\r\n\t\t\treturn 1;\r\n\r\n\t\tcase 3: // cse debt books\r\n\t\t\tSystem.out.println(\"5 :DBMS\");\r\n\r\n\t\t\tSystem.out.println(\"6 :JAVA\");\r\n\r\n\t\t\treturn 1;\r\n\t\tdefault:\r\n\t\t\tSystem.out.println(\"ENTER THE DETAILS CORRECTLY\");\r\n\t\t}\r\n\t\treturn 0;\r\n\r\n\t}", "private void viewStudent() {\n //Lesen wir die ID\n Scanner sc = new Scanner(System.in);\n System.out.print(\"ID of the student to be viewed: \");\n long ID = sc.nextLong();\n\n Student s = ctrl.getStudent(ID);\n if (s != null)\n System.out.println(s.toString()); //wir zeigen die Student\n else\n System.out.println(\"Student with this ID doesn't exist!\");\n }", "private boolean renterMenu() {\n System.out.println(\"BOOKING TESTING!!!!!!!!!!!!!!\");\n try {\n\n User user = UserRepository.getUser(\"testrsin\");\n\n System.out.println(\"USERRRRRRRRRR!!!!!!!!!!!!!!\");\n System.out.println(user.toString());\n\n BookingRepository\n .booking(\"testlisting\", \"2018-12-01\", \"2018-12-10\", user);\n Booking booking = BookingRepository\n .getBooking(\"testlisting\", \"2018-12-01\", \"2018-12-10\", user);\n\n System.out.println(\"BOOKING!!!!!!!!!!!!!!\");\n System.out.println(booking.toString());\n\n //BookingRepository\n // .deleteBooking(\"testlisting\", \"2018-12-01\", \"2018-12-10\", user);\n\n\n /*\n THE LISITING TESTS\n */\n ReviewRepository.createListingReview(\"testlisting\", \"testrsin\", \"l \"\n + \"review\", 1);\n\n //DID NOT STAY AT LISTING\n //ReviewRepository.createListingReview(\"testlisting\", \"rentersin\", \"l \"\n // + \"review\", 1);\n\n\n /*\n THE HOST REVIEWS\n */\n //Proper Test\n ReviewRepository.createHostReview(\"testhsin\", \"testrsin\", \"PROPER TEST \"\n + \"HOST REVIEW\", 1);\n\n //Bad Dates Test but booked\n\n\n //BOOKING CANCELLING\n BookingRepository\n .cancelBooking(\"testlisting\", \"2018-12-01\", \"2018-12-10\", user);\n booking = BookingRepository\n .getBooking(\"testlisting\", \"2018-12-01\", \"2018-12-10\", user);\n\n System.out.println(\"CANCELLED TESTING!!!!!!!!!!!!!!\");\n System.out.println(booking.toString());\n\n //Not booked at all GOOD\n //ReviewRepository.createHostReview(\"testhsin\", \"rentersin\", \"USER NOT \"\n // + \"BOOKED\", 1);\n\n //cancelled GOOD\n //ReviewRepository.createHostReview(\"testhsin\", \"testrsin\", \"CANCELLED \"\n // + \"TESTING SHOULD NOT APPEAR\", 1);\n\n System.out.println(\"DELETE TESTING!!!!!!!!!!!!!!\");\n\n } catch (Exception exception) {\n System.out.println(\"OH NO\");\n exception.printStackTrace();\n return true;\n }\n return true;\n }", "public void setBookId(Integer bookId) {\n this.bookId = bookId;\n }", "public void setBookId(Integer bookId) {\n this.bookId = bookId;\n }", "public void setBookId(Integer bookId) {\n this.bookId = bookId;\n }", "public com.huqiwen.demo.book.model.Books fetchByPrimaryKey(long bookId)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;", "private void findEntry() {\n String desiredId = idField.getText();\n Student student = studentHashMap.get(desiredId);\n\n try {\n if (student == null) {\n throw new NoMatchFoundException();\n } else if (this.checkInput(student) == false) {\n throw new InputMismatchException();\n } else if (studentHashMap.containsKey(desiredId)) {\n this.displayStatusPanel(\n \"EMPLID: \" + desiredId + \"\\n\" + student.toString(),\n \"Find\",\n JOptionPane.INFORMATION_MESSAGE\n );\n } else {\n throw new NoMatchFoundException();\n }\n } catch(NoMatchFoundException ex) {\n this.displayStatusPanel(\n \"Error: Entry not found.\",\n \"Error\",\n JOptionPane.WARNING_MESSAGE\n );\n } catch(InputMismatchException e) {\n this.displayStatusPanel(\n \"Error: Information does not match data on file.\",\n \"Error\",\n JOptionPane.WARNING_MESSAGE\n );\n }\n }", "private void updateEntry() {\n String desiredId = idField.getText();\n Student student = studentHashMap.get(desiredId);\n\n try {\n if (student == null) {\n throw new NoMatchFoundException();\n } else if (this.checkInput(student) == false) {\n throw new InputMismatchException();\n }\n } catch(NoMatchFoundException ex) {\n this.displayStatusPanel(\n \"Error: Entry not found.\",\n \"Error\",\n JOptionPane.WARNING_MESSAGE\n );\n return;\n } catch(InputMismatchException e) {\n this.displayStatusPanel(\n \"Error: Information does not match data on file.\",\n \"Error\",\n JOptionPane.WARNING_MESSAGE\n );\n return;\n }\n\n String grade = this.updateGrade(letterGrades);\n Integer credit = this.updateCredits(credits);\n\n if (grade == null || credit == null) {\n this.displayStatusPanel(\n \"Success: Update cancelled.\",\n \"Success\",\n JOptionPane.INFORMATION_MESSAGE\n );\n } else {\n // Inspired by gpacalculator.net/college-gpa-calculator\n Integer numericGrade = Arrays.asList(\"F\", \"D\", \"C\", \"B\", \"A\").indexOf(grade);\n\n student.courseCompleted(numericGrade, credit);\n\n this.displayStatusPanel(\n \"Success: Grade has been updated.\\nGrade: \" + grade + \"\\nCredits: \" + credit,\n \"Success\",\n JOptionPane.INFORMATION_MESSAGE\n );\n }\n }", "private void retrieveStudentsEnrolledForACourse() {\n Scanner sc = new Scanner(System.in);\n Course c;\n while (true) {//Der Kursname sollte existieren\n System.out.print(\"Course ID: \");\n Long id = Long.parseLong(sc.next());\n c = ctrl.getCourse(id);\n if (c == null)\n System.out.println(\"Course with this ID doesn't exist! Please try again!\");\n else\n break;\n }\n\n //Wir rufen die eingeschriebenen Studenten Funktion von dem Controller\n System.out.println(\"Students enrolled for the course: \");\n ctrl.retrieveStudentsEnrolledForACourse(c);\n }", "public void actionPerformed(ActionEvent e) {\r\n JTextField ownerTf;\r\n String mes;\r\n\r\n String record[] = getRecordOnPan();\r\n\r\n try {\r\n int match[] = data.find(record);\r\n \r\n if (match.length > 1) {\r\n updateStatus(\"More than one match record.\");\r\n return;\r\n } else if (match.length == 0) {\r\n updateStatus(\"Record not found.\");\r\n return;\r\n }\r\n \r\n ownerTf = new JTextField();\r\n ownerTf.setText(record[5]);\r\n mes = \"Enter customer id\";\r\n \r\n int result = JOptionPane.showOptionDialog(\r\n frame, new Object[] {mes, ownerTf},\r\n \"Booking\", JOptionPane.OK_CANCEL_OPTION,\r\n JOptionPane.PLAIN_MESSAGE,\r\n null, null, null);\r\n\r\n if (result == JOptionPane.OK_OPTION) {\r\n record[5] = ownerTf.getText();\r\n bc.handleUpdateGesture(match[0], record);\r\n updateStatus(\"Subcontractor booked.\");\r\n }\r\n } catch (Exception ex) {\r\n updateStatus(ex.getMessage());\r\n }\r\n }", "public boolean enter (Student me)\r\n {\r\n boolean studentHasBook = false;\r\n \r\n if ((me.myLocker) == null)\r\n {\r\n me.sentToOffice (\"does not have a locker.\");\r\n me.myLocker = new Locker (me);\r\n me.myLocker.putJacket (new Jacket (me));\r\n return false;\r\n }\r\n else if (me.myJacket != null)\r\n {\r\n me.myLocker.putJacket (me.myJacket);\r\n return false;\r\n }\r\n for (int i = 0; i < me.books.length; i++)\r\n {\r\n if (me.books[i] != null)\r\n { \r\n if (me.books[i].course.equals (\"ICS4U0\"))\r\n return true;\r\n }\r\n }\r\n me.sentToOffice (\"does not have the correct book.\");\r\n for (int i = 0; i < me.books.length; i++)\r\n {\r\n if (me.books[i] == null)\r\n me.books[i] = me.myLocker.getABook (\"ICS4U0\");\r\n }\r\n for (int i = 0; i < me.books.length; i++)\r\n {\r\n if (me.books[i] != null)\r\n {\r\n if (me.books[i].course.equals (\"ICS4U0\"))\r\n studentHasBook = true;\r\n }\r\n }\r\n if (!studentHasBook)\r\n {\r\n me.books [0] = new Book ();\r\n me.books [0].course = \"ICS4U0\";\r\n me.books[0].title = \"AP Prep - Computer Science A\";\r\n }\r\n return false;\r\n }", "private static boolean setStudentInput(int i, String value, StudentDetails student){\n\t\tswitch (i){\n\t\tcase 0:\n\t\t\tif(Integer.parseInt(value) < 1){//checks if value for student Id is < 1. Students cannot have Id numbers less than 1.\n\t\t\t\tSystem.out.println(\"ERROR: Invalid Student Id! Student Id cannot be less than 1.\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tstudent.setId(Integer.parseInt(value));\n\t\t\treturn true;\n\t\tcase 1:\n\t\t\treturn student.setFirstName(value); //returns false if name input was invalid\n\t\tcase 2:\n\t\t\treturn student.setMiddleName(value); //returns false if name input was invalid\n\t\tcase 3:\n\t\t\treturn student.setLastName(value); //returns false if name input was invalid\n\t\tcase 4:\n\t\t\treturn student.setGrade(Integer.parseInt(value)); //returns false if grade input was invalid\t\t\t\n\t\tcase 5:\n\t\t\t/*check if bookId exists. If bookId exists set student's bookIdBorrowed property to bookId. If student has\n\t\t\tnot borrowed a book, then bookId borrowed should be 0.*/\n\t\t\tif(ALL_BOOKS.containsKey(Integer.parseInt(value)) || Integer.parseInt(value) == 0){\n\t\t\t\tstudent.setBookIdBorrowed(Integer.parseInt(value));\n\t\t\t\treturn true; //indicates no error was encountered when setting bookIdBorrowed\n\t\t\t}\n\t\t\telse{\n\t\t\t\tSystem.out.println(\"ERROR: BookId does not exist!\");\n\t\t\t\treturn false; //indicates error setting bookIdBorrowed\n\t\t\t}\n\t\tcase 6:\n\t\t\tstudent.setTotalFine(Double.parseDouble(value));\n\t\t\treturn true;\n\t\tdefault: //error input, a student can only have up to 7 fields\n\t\t\tSystem.out.println(\"Invalid Property\");\n\t\t\treturn false;\n\t\t}\t\n\t}", "@Test\n public void testBorrowBook() throws Exception {\n Friend friend = friendManager.getFriend(\"pp\");\n PaperBook paperBook = homeLibrary.getPaperBookByISBN(1234567890L);\n Borrowable borrowable = paperBook.getBorrowable();\n friend.getAccount().addBorrowable(borrowable);\n BorrowRecord borrowRecord = friend.getAccount().borrowBook(borrowable);\n //Reading for a while\n Thread.sleep(500);\n friend.getAccount().returnBook(borrowRecord);\n }", "@Override\n public MyBook findById(final int bookshelfId,\n final int userId, final int bookId) {\n System.err.println(\"MyBookRepositoryImpl:172 - not implement\");\n System.exit(1);\n return null;\n }", "static int getStudentID() {\n\t\twhile(true) {\n\t\t\ttry {\n\t\t\t\tScanner s = new Scanner(System.in);\n\t\t\t\tSystem.out.print(\"Enter in student ID: \");\n\t\t\t\tint sID = s.nextInt();\n\t\t\t\treturn sID;\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\tSystem.out.println(\"Please enter in an integer for student ID\");\n\t\t\t}\n\t\t}\n\t}", "@Override\n public Optional<BookDto> updateBook(Integer bookId, BookDto bookDto) {\n try {\n Optional<BookEntity> bookEntity = bookRepository.findByBookId(bookId);\n if (bookEntity.isPresent()) {\n BookEntity updatedBookEntity = bookRepository.save(new BookEntity(bookId,\n bookDto.getBookName(), bookDto.getBookAuthor()));\n LogUtils.getInfoLogger().info(\"Book Updated: {}\", updatedBookEntity.toString());\n return Optional.of(bookDtoBookEntityMapper.bookEntityToBookDto(updatedBookEntity));\n } else {\n LogUtils.getInfoLogger().info(\"Book Not updated\");\n return Optional.empty();\n }\n }catch (Exception exception){\n throw new BookException(exception.getMessage());\n }\n }", "@Override\n public Integer checkbookIssuance(Tbcheckbook tbcheckbook) {\n try {\n System.out.println(\"CHECK BOOK ACCOUNT NO : \"+tbcheckbook.getCheckbkaccountno());\n if(tbdepositJPARepository.countByAccountNo(tbcheckbook.getCheckbkaccountno()) > 0) {\n if (tbcheckbookJPARepository.countByCheckbkaccountnoAndCheckbookno(tbcheckbook.getCheckbkaccountno(),\n tbcheckbook.getCheckbookno()) > 0) {\n return 1;\n\n } else if(tbcheckbookJPARepository.findTopByCheckbkaccountnoAndEndchknoGreaterThanEqual(tbcheckbook.getCheckbkaccountno()\n ,tbcheckbook.getStartchkno())!=null){\n return 3;\n } else {\n tbcheckbookJPARepository.save(tbcheckbook);\n return 2;\n }\n }\n return 0;\n } catch (Exception e) {\n logger.error(\"Checkbook Issuance Error : \", e.getMessage(), e);\n }\n return null;\n }", "protected static Book goodBookValues(String bidField, String bnameField, String byearField, String bpriceField, String bauthorField, String bpublisherField) throws Exception{\n Book myBook;\n String [] ID,strPrice;\n String Name;\n int Year;\n double Price;\n \n try{\n ID = bidField.split(\"\\\\s+\"); // split using spaces\n if (ID.length > 1 || ID[0].equals(\"\")) // id should only be one word\n {\n throw new Exception (\"ERROR: The ID must be entered\\n\"); // if the id is empty, it must be conveyed to this user via this exception\n }\n if (ID[0].length() !=6) // id must be 6 digits\n throw new Exception (\"ERROR: ID must be 6 digits\\n\");\n if (!(ID[0].matches(\"[0-9]+\"))) // id must only be numbers\n throw new Exception (\"ERROR: ID must only contain numbers\");\n Name = bnameField;\n if (Name.equals(\"\")) // name must not be blank\n throw new Exception (\"ERROR: Name of product must be entered\\n\");\n if (byearField.equals(\"\") || byearField.length() != 4) // year field cannot be blank\n {\n throw new Exception (\"ERROR: Year of product must be 4 numbers\\n\");\n } else {\n Year = Integer.parseInt(byearField);\n if (Year > 9999 || Year < 1000)\n {\n throw new Exception (\"Error: Year must be between 1000 and 9999 years\");\n }\n }\n \n strPrice = bpriceField.split(\"\\\\s+\");\n if (strPrice.length > 1 || strPrice[0].equals(\"\"))\n Price = 0;\n else\n Price = Double.parseDouble(strPrice[0]);\n \n myBook = new Book(ID[0],Name,Year,Price,bauthorField,bpublisherField);\n ProductGUI.Display(\"Book fields are good\\n\");\n return myBook;\n } catch (Exception e){\n throw new Exception (e.getMessage());\n }\n \n }", "private void btnGetReceiptActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGetReceiptActionPerformed\n String stringID = textReceiptID.getText();\n if(textReceiptID.getText().isEmpty()){\n JOptionPane.showMessageDialog(rootPane, \"Please Enter a valid ID\");\n return;\n }\n int ID = Integer.parseInt(stringID);\n newHandler.getReceipt(ID);\n \n if(newHandler.getReceiptErrorMsg() != null){\n JOptionPane.showMessageDialog(rootPane, newHandler.getReceiptErrorMsg());\n }\n textReceiptID.setText(Integer.toString(newHandler.getReceiptID()));\n textReceiptDate.setText(newHandler.getReceiptDate());\n textReceiptAmmount.setText(Double.toString(newHandler.getReceiptAmmount()));\n textReceiptType.setText(newHandler.getReceiptType());\n textReceiptDescription.setText(newHandler.getReceiptDescription());\n searched = true;\n }", "private void borrowBookGenre() throws IOException\n {\n librarian();\n int flag = 0;\n boolean repeat = false;\n char iRepeat='a';\n int choice = 13;//int choice is set as 13 because if somehow an integer is not entered properly, it will repeat due to the do while loop.\n int selectedCode = 0;\n do\n {System.out.println(\"\\fWelcome. Here, you can borrow a book based on its genre.\");\n System.out.println(\"No of genres: \"+genre.length);\n for (int i = 0; i<genre.length; i++)\n {\n System.out.println((i+1)+\": \"+genre[i]); //Displays Genres\n }\n System.out.println(\"\");\n System.out.println(\"Enter your choice in an integer form.\");\n\n while(flag == 0)\n {\n flag = 1;\n try\n {\n do\n {\n choice = Integer.parseInt(br.readLine());\n }while(choice>=12 || choice == 0);\n }\n catch(Exception e)\n {\n System.out.println(\"Error: \"+e.getMessage());\n System.out.println(\"Please enter the number as an integer from 1 to 11.\");\n flag = 0;\n\n }\n }\n flag = 0;\n switch (choice)\n {\n case 1: displayBookChoice(0);\n break;\n case 2: displayBookChoice(1);\n break;\n case 3: displayBookChoice(2);\n break;\n case 4: displayBookChoice(3);\n break;\n case 5: displayBookChoice(4);\n break;\n case 6: displayBookChoice(5);\n break;\n case 7: displayBookChoice(6);\n break;\n case 8: displayBookChoice(7);\n break;\n case 9: displayBookChoice(8);\n break;\n case 10: displayBookChoice(9);\n break;\n case 11: displayBookChoice(10);\n break;\n default: System.out.println(\"Error: You inputed a wrong number.\");\n }\n\n System.out.println(\"Enter the code of the book you'd like to borrow.\");\n\n while(flag == 0)\n {\n flag = 1;\n try\n {\n do\n {\n selectedCode = Integer.parseInt(br.readLine());\n }while(selectedCode > linecount || selectedCode == 0);\n }\n catch(Exception e)\n {\n System.out.println(\"Error: \"+e.getMessage());\n System.out.println(\"Please enter the valid integer code on the left.\");\n flag = 0;\n\n }\n }\n flag = 0;\n System.out.println(\"\\fYou have selected \"+book[selectedCode-1].name.trim()+ \" by \"+book[selectedCode-1].author.trim());\n System.out.println(\"Y or y: If this is the book you want.\");\n System.out.println(\"N or n: If this is NOT the book you wanted.\");\n while(flag == 0)\n {\n flag = 1;\n try\n {\n\n do\n { \n iRepeat = (char)br.readLine().charAt(0);\n //System.out.println(\"You entered: \"+iRepeat);\n }while(iRepeat != 'y' && iRepeat != 'n' && iRepeat != 'N' && iRepeat != 'Y' );\n }\n catch(Exception e)\n {\n System.out.println(\"Error: \"+e.getMessage());\n System.out.println(\"Please enter either y or n.\");\n flag = 0;\n\n }\n }\n flag = 0;\n if (iRepeat == 'n' || iRepeat == 'N')\n {\n System.out.println(\"Okay. Press Enter to go back.\");\n br.readLine();\n repeat = true;\n }\n else\n repeat = false;\n }while(repeat == true);\n System.out.println(\"\");\n System.out.println(\"1: YES I am a member, and I possess a Library Card.\");\n System.out.println(\"2: NO I do not possess a Library Card.\");\n while(flag == 0)\n {\n flag = 1;\n try\n {\n do\n {\n choice = Integer.parseInt(br.readLine());\n }while(choice<1 || choice>2);\n }\n catch(Exception e)\n {\n System.out.println(\"Error: \"+e.getMessage());\n System.out.println(\"Please enter your choice, 1 or 2.\");\n flag = 0;\n\n }\n }\n flag = 0;\n\n if (choice == 2)\n {\n System.out.println(\"\\fYou will now enter the Library Card Creation Area. Press Enter to continue.\");\n br.readLine();\n createCard();\n }\n\n if (choice == 1)\n {\n System.out.println(\"Enter the name on your library card.\");\n String n = br.readLine();\n\n if(Checkfile.fileExist(n) == true) //calling function from class Checkfile to check whether the file with the name inputed exists.\n {\n System.out.println(\"Yes, you appear to have a Library Card!\");\n if(selectedCode <= linecount)\n {\n\n String d = book[selectedCode-1].name;\n bookPrinter(n,d);\n\n System.out.println(\"Here is your book! You borrowed \"+book[selectedCode-1].name.trim()+\".\");\n\n Art.display6();\n System.out.println(\"\");\n }\n }\n else\n {\n System.out.println(\"The name you mentioned doesn't seem to exist in our registry.\");\n System.out.println(\"You will now be guided to the main menu\");\n br.readLine();\n menu();\n }\n }\n System.out.println(\"You will now return to the main menu. \\nPRESS ENTER.\");\n br.readLine();\n menu();\n }", "@Override\n public Optional<BookDto> getBook(Integer bookId) {\n try {\n Optional<BookEntity> bookEntity = bookRepository.findByBookId(bookId);\n if (bookEntity.isPresent()) {\n LogUtils.getInfoLogger().info(\"Found the book: {}\", bookEntity.get());\n return Optional.of(bookDtoBookEntityMapper.bookEntityToBookDto(bookEntity.get()));\n } else {\n LogUtils.getInfoLogger().info(\"Book not found\");\n return Optional.empty();\n }\n }catch (Exception exception){\n throw new BookException(exception.getMessage());\n }\n }", "public User saveBook(String id, SavedBook savebook){\n User user = getById(id);\n if(user!=null){\n for(SavedBook book : user.getSavedBooks()){\n if(book.getBookId() ==(savebook.getBookId())){\n return user;\n }\n }\n System.out.println(user.getSavedBooks().add((SavedBook) savebook));\n userRepo.save(user);\n return user;\n }\n throw new UserNotFoundException(\"\");\n }", "public User markfinished(String id,int bookId){\n User user = getById(id);\n for(SavedBook book : user.getSavedBooks()){\n if((bookId) == book.getBookId()){\n book.setIsFinished(\"True\");\n\n }\n }\n userRepo.save(user);\n return user;\n }", "public static void editStudentInfo(){\n System.out.println(\"Enter the students ID\");\r\n System.out.println(\"=============================\");\r\n Scanner studentNameSearch = new Scanner(System.in);\r\n String idToSearch = studentNameSearch.nextLine();\r\n for (Student searchStudent : studentList){ //basic loop to search through the list of student by the ID\r\n if (searchStudent.getStudentID().equals(idToSearch)){\r\n searchStudent.printStudentInfo();\r\n System.out.println(\"What would you like to do?\");\r\n System.out.println(\"===========================\");\r\n System.out.println(\"1: Change a students name\");\r\n System.out.println(\"2: Add a course\");\r\n System.out.println(\"3: Remove a course\");\r\n System.out.println(\"4: Set course as completed\");\r\n System.out.println(\" \");\r\n Scanner editChoice = new Scanner(System.in);\r\n\r\n switch (editChoice.nextInt()){\r\n case 1 -> {\r\n //Edit first and last name\r\n Scanner newNameInput = new Scanner(System.in);\r\n System.out.println(\"Enter the students Last name\");\r\n String newName = newNameInput.nextLine();\r\n searchStudent.setLastName(newName);\r\n System.out.println(\"Enter the students First name\");\r\n String newName1 = newNameInput.nextLine();\r\n searchStudent.setFirstName(newName1);\r\n searchStudent.getFullName();\r\n mainMenu();\r\n }\r\n case 2 -> {\r\n //search for a course and add a course to the students schedule\r\n System.out.println(\"Enter the course ID\");\r\n Scanner courseToAdd = new Scanner(System.in);\r\n String courseIdToSearch = courseToAdd.nextLine();\r\n for (Course searchCourse : courseList){\r\n if (searchCourse.getCourseID().equals(courseIdToSearch)){\r\n searchStudent.addClasstoSchedule(searchCourse);\r\n }\r\n }\r\n mainMenu();\r\n }\r\n case 3 -> {\r\n //remove a course from the students schedule\r\n System.out.println(\"Enter the course ID\");\r\n Scanner courseToAdd = new Scanner(System.in);\r\n String courseIdToSearch = courseToAdd.nextLine();\r\n for (Course searchCourse : courseList){\r\n if (searchCourse.getCourseID().equals(courseIdToSearch)){\r\n searchStudent.removeClassFromSchedule(searchCourse);\r\n }\r\n }\r\n mainMenu();\r\n }\r\n case 4 ->{\r\n //Set a course as completed\r\n System.out.println(\"Enter the course ID\");\r\n Scanner courseToAdd = new Scanner(System.in);\r\n String courseIdToSearch = courseToAdd.nextLine();\r\n for (Course searchCourse : courseList){\r\n if (searchCourse.getCourseID().equals(courseIdToSearch)){\r\n searchStudent.setCourseComplete(courseIdToSearch);\r\n }\r\n }\r\n mainMenu();\r\n }\r\n default -> {\r\n //does nothing\r\n }\r\n\r\n }\r\n\r\n }\r\n else{\r\n System.err.println(\"Could not find student based on that ID\");\r\n mainMenu();\r\n }\r\n }\r\n }", "public void findById() {\n String answer = view.input(message_get_id);\n if (answer != null){\n try{\n long id = Long.parseLong(answer);\n Customer c = model.findById(id);\n if(c!=null)\n view.showCustomerForm(c);\n else\n view.showMessage(not_found_error);\n }catch(NumberFormatException nfe){\n view.showMessage(\"ID must be number\");\n }\n }\n }", "public void borrowBooks(int number)\r\n {\r\n noOfBooks = noOfBooks + number;\r\n System.out.println(\"Books on loan: \" + noOfBooks); \r\n }", "@Override\r\n\tpublic boolean updateByBookId(Book book) {\n\t\tboolean flag=false;\r\n\t\tString sql=\"update books set title=?,author=?,publisherId=?,publishDate=?,isbn=?,wordsCount=?,unitPrice=?,contentDescription=?,aurhorDescription=?,editorComment=?,TOC=?,categoryId=?,booksImages=?,quantity=?,address=?,baoyou=? \"\r\n\t\t\t\t+ \"where id=?\";\r\n\t\tList<Object> list=new ArrayList<Object>();\r\n\t\tif(book!=null){\r\n\t\t\tlist.add(book.getTitle());\r\n\t\t\tlist.add(book.getAuthor());\r\n\t\t\tlist.add(book.getPublisherId());\r\n\t\t\tlist.add(book.getPublishDate());\r\n\t\t\tlist.add(book.getIsbn());\r\n\t\t\tlist.add(book.getWordsCount());\r\n\t\t\tlist.add(book.getUnitPrice());\r\n\t\t\tlist.add(book.getContentDescription());\r\n\t\t\tlist.add(book.getAurhorDescription());\r\n\t\t\tlist.add(book.getEditorComment());\r\n\t\t\tlist.add(book.getTOC());\r\n\t\t\tlist.add(book.getCategoryId());\r\n\t\t\t\r\n\t\t\tlist.add(book.getBooksImages());\r\n\t\t\tlist.add(book.getQuantity());\r\n\t\t\t\r\n\t\t\tlist.add(book.getAddress());\r\n\t\t\tif(book.getBaoyou()==\"0\"){\r\n\t\t\t\tbook.setBaoyou(\"不包邮\");\r\n\t\t\t}else{\r\n\t\t\t\tbook.setBaoyou(\"包邮\");\r\n\t\t\t}\r\n\t\t\tlist.add(book.getBaoyou());\r\n\t\t\tlist.add(book.getId());\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\ttry {\r\n\t\t\tint update = runner.update(sql, list.toArray());\r\n\t\t\tif(update>0){\r\n\t\t\t\tflag=true;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn flag;\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn flag;\r\n\t}", "@Override\n public void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n if (requestCode == 0) {\n// Log.e(\"scanned isbn in task\", result);\n\n if (resultCode == Activity.RESULT_OK || resultCode == RESULT_INCOMPLETE) {\n String result = data.getStringExtra(\"isbn\");\n\n if (selectedISBN.equals(result)) {\n Intent intent = new Intent(ReturningTaskActivity.this, SuccessExchangeActivity.class);\n intent.putExtra(\"RETURNER\", result);\n intent.putExtra(\"OTHER_UID\", otherUID);\n startActivity(intent);\n } else {\n Toast.makeText(ReturningTaskActivity.this, \"ISBN did not match selected book!\",\n Toast.LENGTH_SHORT).show();\n }\n } else if (resultCode == RESULT_INVALID) {\n Toast.makeText(ReturningTaskActivity.this, \"ISBN is not valid\",\n Toast.LENGTH_SHORT).show();\n }\n }\n }", "public void setBookid(Integer bookid) {\n this.bookid = bookid;\n }", "public void setBookid(Integer bookid) {\n this.bookid = bookid;\n }", "public Book search(String bookId) {\r\n for (Iterator iterator = books.iterator(); iterator.hasNext();) {\r\n Book book = (Book) iterator.next();\r\n if (book.getId().equals(bookId)) {\r\n return book;\r\n }\r\n }\r\n return null;\r\n }", "private static void queryBook(){\n\t\tSystem.out.println(\"===Book Queries Menu===\");\n\t\t\n\t\t/*Display menu options*/\n\t\tSystem.out.println(\"1--> Query Books by Author\");\n\t\tSystem.out.println(\"2--> Query Books by Genre\");\n\t\tSystem.out.println(\"3--> Query Books by Publisher\");\n\t\tSystem.out.println(\"Any other number --> Exit To Main Menu\");\n\t\tSystem.out.println(\"Enter menu option: \");\n\t\tint menu_option = getIntegerInput(); //ensures user input is an integer value\n\t\t\n\t\tswitch(menu_option){\n\t\t\tcase 1:\n\t\t\t\tSystem.out.println();\n\t\t\t\tqueryBooksByAuthor();\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tSystem.out.println();\n\t\t\t\tqueryBooksByGenre();\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tSystem.out.println();\n\t\t\t\tqueryBooksByPublisher();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t}", "private void reserveBook ( String bookName, String authorName ) throws IOException {\r\n\t\t\r\n\t\tboolean result = false ;\t\t// Initially false\r\n\t\tBook demandedBook = new Book ( bookName, authorName ) ;\r\n\t\t// returns null if the book is not available\r\n\t\tBook availableBook = lib.getBookDatabase().get(demandedBook) ;\r\n\t\t\r\n\t\t// order the book if it is available\r\n\t\tif ( availableBook != null ) {\r\n\t\t\t// the book is shared among all students of library. Hence, Synchronization is mandatory\r\n\t\t\tsynchronized ( availableBook ) {\r\n\t\t\t\tif ( availableBook.order() ) {\r\n\t\t\t\t\t// return true if order successful\r\n\t\t\t\t\tresult = true ;\r\n\t\t\t\t} \r\n\t\t\t}\r\n\t\t} \r\n\r\n\t\tString resultString = Integer.toString( result ? 1 : 0 ) ; // result string\r\n\t\tbyte[] replyData = resultString.getBytes() ; // result byte either 1 or 0\r\n\t\t\r\n\t\t// get client address and port from the UDP message client sended initially\r\n\t\tDatagramPacket sendPack = new DatagramPacket ( replyData, replyData.length, control.getAddress(),\r\n\t\t\tcontrol.getPort() ) ;\r\n\t\tsendData.send(sendPack);\r\n\t\t\r\n\t\tString message ;\r\n\t\t// Generate appropriate message and write it to log\r\n\t\tif ( result ) {\r\n\t\t\tmessage = \"A book named \" + bookName + \" by \" + authorName + \r\n\t\t\t\t\t\" was reserved at \" + Calendar.getInstance().getTime() + \" (Copies Left: \" + availableBook.getCopies() + \")\" ;\t\r\n\t\t} else {\r\n\t\t\tmessage = \"An unsucessful attempt to reserve \" + bookName + \" by \" +\r\n\t\t\t\t\tauthorName + \" was made at \" + Calendar.getInstance().getTime() ;\r\n\t\t}\r\n\t\t\r\n\t\tlib.writeLog ( message ) ;\r\n\t\treturn ;\r\n\t\t\r\n\t}", "public List<Books> searchBook(int book_id){\n String sql=\"select * from Book where id=?\";\n BaseDao baseDao =dao.executeQuery(sql,new Object[]{book_id});\n return resultSetToBook(baseDao);\n }", "public void actionPerformed(ActionEvent arg0) {//YABDA\n\t\t\t\t\t\t\t\n\t\t\t\tif (prenomE.getText().equals(\"\")){\n\t\t\t\t\t\n\t\t\t\t\tJOptionPane.showMessageDialog(frame, \"Vous devez être un adherant pour emprunter\",\"Inscrivez-Vous !\",JOptionPane.ERROR_MESSAGE);\n\t\t\t\t\t\n\t\t\t\t\tidetudiant.setText(\"\");\n\t\t prenomE.setText(\"\");\n\t\t idL.setText(\"\");\n\t\t dispo.setText(\"\");\n\t\t nomL.setText(\"\");\n\t\t typeL.setText(\"\");\n\t\t dateE.setText(\"\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse{\n\t\t\t\t\ttry {\n\t\t\t\t\t\t\n\t\t\t\t\t\t//get all books have same id as inserted\n\t\t\t query=\"select * from books where BookId='\"+idL.getText()+\"';\"; \n\t\t\t stmt=con.createStatement(); //Statement is an interface that represent query result in a table\n\t\t\t \t\t\t\t\t\t\t//and in order to create statement you need connection\n\t\t\t rs=stmt.executeQuery(query); \n\t\t\t if (rs.next()) {\n\t\t\t \t \n\t\t\t \t if(dispo.getText().equals(\"YES\")){//if available\n\t\t\t \t\t \n\t\t\t \t\t //Insert his details to issue table\n\t\t\t \t\t query=\"insert into issue values('\"+idetudiant.getText()+\"','\"+prenomE.getText()+\"','\"+typeL.getText()+\"','\"+idL.getText()+\"','\"+nomL.getText()+\"','\"+Address+\"','\"+dateE.getText()+\"');\";\n\t\t\t \t\t stmt.executeUpdate(query); \n\t\t\t \t\t \n\t\t\t \t\t //Show msg that is is beend issue.\n\t\t\t \t\t JOptionPane.showMessageDialog(frame,\"Document Titulaire id = \"+idL.getText()+\" est emprunter à \"+prenomE.getText());\n\t\t\t \n\t\t\t \t\t //update availabilty of book0\n\t\t\t \n\t\t\t \t\t query=\"update books set Available= 'NO' where BookId='\"+idL.getText()+\"'; \";\n\t\t\t \t\t stmt.executeUpdate(query); \n\n\t\t\t\t\t\t\n\t\t\t \t}\n\n\t\t\t \t //If not available\n\t\t\t \t if(dispo.getText().equals(\"NO\")) {\n\t\t\t \t\t JOptionPane.showMessageDialog(frame,\"Ce Document Selectionné n'est pas disponible \");\n\t\t\t \t }\n\t\t\t \t // if there isn't any availability then show there is no book\n\t\t\t \t if(dispo.getText().equals(\"\"))\n\t\t\t \t {\n\t\t\t \t\t JOptionPane.showMessageDialog(frame,\"On n'as pas ce Document dans notre Bibliothéque\");\n\t\t\t \t }\n\t\t\t \n\t\t\t\t // reset to vide\n\t\t\t\t idetudiant.setText(\"\");\n\t\t\t\t prenomE.setText(\"\");\n\t\t\t\t idL.setText(\"\");\n\t\t\t\t dispo.setText(\"\");\n\t\t\t\t nomL.setText(\"\");\n\t\t\t\t typeL.setText(\"\");\n\t\t\t\t dateE.setText(\"\");\n\t\t\t \n\t\t\t }\n\t\t\t\t\t}\n\t\t\t\t\tcatch(SQLException e) {\n\t\t\t\t\t\tSystem.out.println(e.getMessage());\n\t\t\t\t\t\t//Maw bech y9olek duplicate primary key ==>Duplicate entry 'AHED26' for key 'PRIMARY'\n\t\t\t\t\t//\tSystem.out.println(e.getErrorCode());\n\t\t\t\t\t\t if(e.getErrorCode()==1062)\n\t\t\t\t\t\t\t JOptionPane.showMessageDialog(frame,\"L'etudiant doit Emprunter qu'un seul Document à la fois\",\"Désoler\",JOptionPane.ERROR_MESSAGE);\n\t\t\t\t\t}/*Fin catch*/\n\t\t\t\t}/*Fin else*/\n\t\t\t}", "public abstract boolean verifyIdAnswers(String firstName, String lastName, String address, String city, String state, String zip, String ssn, String yob);", "public int makeBooking(BookingEventModel booking) {\n\n\t\tConnection connection = null;\n\t\tStatement statement = null;\n\t\ttry {\n\t\t\tconnection = DriverManager.getConnection(databaseName);\n\t\t\tconnection.setAutoCommit(false);\n\t\t\tstatement = connection.createStatement();\n\n\t\t\tString sql = \"insert into bookings (email, checkin, checkout, price) \" +\n\t\t\t\t\tString.format(\"values ('%s', '%s', '%s', %d);\", booking.userEmail, formatter.format(booking.checkIn),\n\t\t\t\t\t\t\tformatter.format(booking.checkOut), booking.payment);\n\t\t\tstatement.executeUpdate(sql);\n\t\t\t//\t\t System.out.println(\"Inserted records into the table...\"+sql);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tstatement.close();\n\t\t\t} catch (SQLException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t//\t\t\ttry {\n\t\t\t//\t\t\t\tconnection.close();\n\t\t\t//\t\t\t} catch (SQLException e) {\n\t\t\t//\t\t\t\te.printStackTrace();\n\t\t\t//\t\t\t}\n\t\t}\n\n\t\tResultSet lastId = null;\n\t\tint bookingNumber = 0;\n\t\tStatement statement2 = null;\n\t\ttry {\n\t\t\t//\t\t\tconnection = DriverManager.getConnection(databaseName);\n\t\t\t//\t\t\tconnection.setAutoCommit(false);\n\t\t\tstatement2 = connection.createStatement();\n\t\t\tString sql = \"SELECT last_insert_rowid() FROM bookings\";\n\t\t\tlastId = statement2.executeQuery(sql);\n\n\t\t\tlastId.next();\n\t\t\tbookingNumber = lastId.getInt(1);\n\t\t\t//\t\t System.out.println(\"last id...\"+sql+\" \"+bookingNumber);\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tlastId.close();\n\t\t\t} catch (SQLException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tstatement2.close();\n\t\t\t} catch (SQLException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconnection.commit();\n\t\t\t\tconnection.close();\n\t\t\t} catch (SQLException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t\tStatement statement3 = null;\n\t\tfor (Room r: booking.rooms) {\n\t\t\ttry {\n\t\t\t\tconnection = DriverManager.getConnection(databaseName);\n\t\t\t\tconnection.setAutoCommit(false);\n\t\t\t\tstatement3 = connection.createStatement();\n\n\t\t\t\tString sql = String.format(\"insert into room_booking_junction (room_id, booking_id) values (%d, %d)\",\n\t\t\t\t\t\tr.getId(), bookingNumber);\n\t\t\t\tstatement3.executeUpdate(sql);\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} finally {\n\t\t\t\ttry {\n\t\t\t\t\tstatement3.close();\n\t\t\t\t} catch (SQLException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tconnection.commit();\n\t\t\t\t\tconnection.close();\n\t\t\t\t} catch (SQLException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\tStatement statement4 = null;\n\t\tfor (HashMap.Entry<ExtraService, Integer> entry : booking.services.entrySet()){\n\t\t\ttry {\n\t\t\t\tconnection = DriverManager.getConnection(databaseName);\n\t\t\t\tconnection.setAutoCommit(false);\n\t\t\t\tstatement4 = connection.createStatement();\n\n\t\t\t\tString sql = String.format(\"insert into service_booking_junction (service_id, booking_id, amount) values (%d, %d, %d)\",\n\t\t\t\t\t\tentry.getKey().getId(), bookingNumber, entry.getValue());\n\t\t\t\tstatement4.executeUpdate(sql);\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} finally {\n\t\t\t\ttry {\n\t\t\t\t\tstatement4.close();\n\t\t\t\t} catch (SQLException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tconnection.commit();\n\t\t\t\t\tconnection.close();\n\t\t\t\t} catch (SQLException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn bookingNumber;\n\t}", "public static void main(String[] args) {\n\t\tint choice;\n\t\tScanner s=new Scanner(System.in);\n\t\tdatabase db=new database();\n\t\tchar c;\n\t\t\n\t\tdo {\n\t\t\n\t\tSystem.out.println(\"press 1 to view all books\");\n\t\tSystem.out.println(\"press 2 to search book by title\");\n\t\tSystem.out.println(\"press 3 to insert a book\");\n\t\tSystem.out.println(\"press 4 to delete book\");\n\t\tSystem.out.println(\"press 5 to update the book\");\n\t\tSystem.out.println(\"press 6 to exit\");\n\t\t\n\t\tchoice=s.nextInt();\n\t\tswitch(choice)\n\t\t{\n\t\tcase 1:\n\t\t\t\n\t\t\tdb.showDetails();\n\t\t\t break;\n\t\tcase 2:\n\t\t\tSystem.out.println(\"enter the title of book\");\n\t\t\tString name=s.next();\n\t\t\tdb.viewByname(name);\n\t\t\tbreak;\n\t\t\t\n\t\tcase 3:\n\t\t System.out.println(\"enter the book id\");\n\t\t int id1=s.nextInt();\n\t\t System.out.println(\"enter the book name\");\n\t\t String name1=s.next();\n\t\t System.out.println(\"enter the author name\");\n\t\t String author=s.next();\n\t\t System.out.println(\"enter the book price\");\n\t\t double price=s.nextDouble();\n\t\t Book ib=new Book(id1,name1,author,price);\n\t\t db.insert(ib);\n\t\t \n\t\t break;\n\t\t \n\t\tcase 4:\n\t\t\tSystem.out.println(\"enter the id of the book you want to delete\");\n\t\t\tint id9=s.nextInt();\n\t\t\tdb.delete(id9);\n\t\t\t\n\t\t\tbreak;\n\t\t\t\n\t\t\t\n\t\t\t\n\t\tcase 5:\tSystem.out.println(\"enter the id of the book you want to update\");\n\t\t int id5=s.nextInt();\n\t\t System.out.println(\"enter the new price\");\n\t\t double price1=s.nextDouble();\n\t\t \n\t\t db.update(id5,price1);\n\t\t System.out.println(\"updated successfully\");\n\t\t\t\n\t\tcase 6:\n\t\t\tdefault:\n\t\t\t \n\t\t\tbreak;\n\t\t\t\n\t\t\t\n\t\t}\n\t\tSystem.out.println(\"press y for menu:\");\n\t\tc=s.next().charAt(0);\n\t\t\n\t\t\n\t\t\n\n\t}while(c=='Y' || c=='y');\n\n}", "public String transaction_pay(int reservationId) {\r\n\t\ttry {\r\n\t\t\tif (username == null){\r\n\t\t\t\treturn \"Cannot pay, not logged in\\n\";\r\n\t\t\t}\r\n\t\t\tbeginTransaction();\r\n\t\t\t\r\n\t\t\t//query for the user balance \r\n\t\t\tcheckBalanceStatement.clearParameters();\r\n\t\t\tcheckBalanceStatement.setString(1, username);\r\n\t\t\tResultSet b = checkBalanceStatement.executeQuery();\r\n\t\t\tb.next();\r\n\t\t\tint user_balance = b.getInt(\"balance\");\r\n\t\t\t\r\n\t\t\t//get the price of the first flight\r\n\t\t\tunpaidReservationStatement.clearParameters();\r\n\t\t\tunpaidReservationStatement.setString(1, username);\r\n\t\t\tunpaidReservationStatement.setInt(2, reservationId);\r\n\t\t\tResultSet unpaid = unpaidReservationStatement.executeQuery();\r\n\t\t\t\r\n\t\t\tint total_price = 0;\r\n\t\t\tif (!unpaid.next()){\r\n\t\t\t\trollbackTransaction();\r\n\t\t\t\treturn \"Cannot find unpaid reservation \"+reservationId+\" under user: \"+username+\"\\n\";\r\n\t\t\t} else {\r\n\t\t\t\t//unpaid.next() ?? maybe not sure\r\n\r\n\t\t\t\tint fid1 = unpaid.getInt(\"fid1\");\r\n\t\t\t\tint fid2 = unpaid.getInt(\"fid2\");\r\n\t\t\t\tcheckPriceStatement.clearParameters();\r\n\t\t\t\tcheckPriceStatement.setInt(1, fid1);\r\n\t\t\t\tResultSet p1 = checkPriceStatement.executeQuery();\r\n\t\t\t\tp1.next();\r\n\t\t\t\ttotal_price += p1.getInt(\"price\");\r\n\t\t\t\tp1.close();\r\n\t\t\t\t\r\n\t\t\t\t//unpaidReservationStatement2.clearParameters();\r\n\t\t\t\t//unpaidReservationStatement2.setString(1, username);\r\n\t\t\t\t//unpaidReservationStatement2.setInt(2, reservationId);\r\n\t\t\t\t//ResultSet second = unpaidReservationStatement2.executeQuery();\r\n\t\t\t\tif (fid2 != 0){\r\n\t\t\t\t\t//second fid is not null\r\n\t\t\t\t\tcheckPriceStatement.clearParameters();\r\n\t\t\t\t\tcheckPriceStatement.setInt(1, fid2);\r\n\t\t\t\t\tResultSet p2 = checkPriceStatement.executeQuery();\r\n\t\t\t\t\tp2.next();\r\n\t\t\t\t\ttotal_price += p2.getInt(\"price\");\r\n\t\t\t\t\tp2.close();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif (total_price > user_balance){\r\n\t\t\t\t\trollbackTransaction();\r\n\t\t\t\t\treturn \"User has only \"+user_balance+\" in account but itinerary costs \"+total_price+\"\\n\";\r\n\t\t\t\t} else {\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tupdatePaidStatement.clearParameters();\r\n\t\t\t\t\tupdatePaidStatement.setString(1, \"true\");\r\n\t\t\t\t\tupdatePaidStatement.setInt(2, reservationId);\r\n\t\t\t\t\tupdatePaidStatement.executeUpdate();\r\n\t\t\t\t\t\r\n\t\t\t\t\tupdateBalanceStatement.clearParameters();\r\n\t\t\t\t\tupdateBalanceStatement.setInt(1, (user_balance-total_price));\r\n\t\t\t\t\tupdateBalanceStatement.setString(2, username);\r\n\t\t\t\t\tupdateBalanceStatement.executeUpdate();\r\n\t\t\t\t\t\r\n\t\t\t\t\tcommitTransaction();\r\n\t\t\t\t\treturn \"Paid reservation: \"+reservationId+\" remaining balance: \"+(user_balance-total_price)+\"\\n\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (SQLException e){\r\n\t\t\te.printStackTrace();\r\n\t\t\t//rollbackTransaction();\r\n\t\t\treturn \"Failed to pay for reservation \" + reservationId + \"\\n\";\r\n\t\t}\r\n }", "@RequestMapping(value=\"/{bookId}\",method = RequestMethod.GET)\n\tpublic @ResponseBody\n\tBook getBook(@PathVariable(\"bookId\")Integer bookId){\n\t\tBook book = null;\n\t\ttry{\n\t\t\tSystem.out.println(\"entering into try\");\n\t\t\tbook = bookService.getBookById(bookId);\n\t\t\tSystem.out.println(\"got book by id\");\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t\tSystem.out.println(\"book returned\");\n\t\tSystem.out.println(book.getBookName());\n\t\tObjectMapper mapper = new ObjectMapper();\n\t\tStringWriter sw= new StringWriter();\n\t\ttry {\n\t\t\tSystem.out.println(\"1\");\n\t\t\tmapper.writeValue(sw, book);\n\t\t\tSystem.out.println(\"1.5\" + sw.toString());\n\t\t\tSystem.out.println(\"2\");\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn book;\n\t}", "public void addBorrow(int book_id, int user_id, String return_date, String remarks) {\n\t\ttry (Connection conn = DriverManager.getConnection(this.hostUrl,this.username,this.password)) {\n\t\t System.out.println(\"Database connected!\");\n\t\t // Statement stmt = conn.createStatement();\n\t\t PreparedStatement stmt=conn.prepareStatement(\"insert into borrows(book_id,user_id,issue_date,return_date,remarks) values(?,?,now(),?,?)\"); \n\t\t stmt.setInt(1,book_id);//1 specifies the first parameter in the query \n\t\t stmt.setInt(2,user_id);\n\t\t stmt.setString(3,return_date);\n\t\t stmt.setString(4,remarks);\n\t\t \n\t\t stmt.executeUpdate(); \n\t\t conn.close(); \n\n\t\t} catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t}", "public String transaction_cancel(int reservationId) {\r\n // only implement this if you are interested in earning extra credit for the HW!\r\n\t\ttry {\r\n\t\t\tif (username == null){\r\n\t\t\t\treturn \"Cannot pay, not logged in\\n\";\r\n\t\t\t}\r\n\t\t\tbeginTransaction();\r\n\r\n\t\t\tsearchFirstFidStatement.clearParameters();\r\n\t\t\tsearchFirstFidStatement.setString(1, username);\r\n\t\t\tsearchFirstFidStatement.setInt(2, reservationId);\r\n\t\t\tResultSet cancel = searchFirstFidStatement.executeQuery();\r\n\t\t\t\r\n\t\t\tsearchSecondFidStatement.clearParameters();\r\n\t\t\tsearchSecondFidStatement.setString(1, username);\r\n\t\t\tsearchSecondFidStatement.setInt(2, reservationId);\r\n\t\t\tResultSet cancel2 = searchSecondFidStatement.executeQuery();\r\n\t\t\t\r\n\t\t\tif (cancel.isBeforeFirst()){\r\n\t\t\t\tcancel.next();\r\n\t\t\t\tcancelReservationStatement.setString(1, username);\r\n\t\t\t\tcancelReservationStatement.setInt(2, reservationId);\r\n\t\t\t\tcancelReservationStatement.executeUpdate();\r\n\t\t\t\t\r\n\t\t\t\tint firstFID = cancel.getInt(\"fid1\");\r\n\t\t\t\tcheckBookingStatement.clearParameters();\r\n\t\t\t\tcheckBookingStatement.setInt(1, firstFID);\r\n\t\t\t\tResultSet f1 = checkBookingStatement.executeQuery();\r\n\t\t\t\tint current1 = f1.getInt(\"count\");\r\n\t\t\t\tupdateBookingStatement.clearParameters();\r\n\t\t\t\tupdateBookingStatement.setInt(1, current1-1);\r\n\t\t\t\tupdateBookingStatement.setInt(2, firstFID);\r\n\t\t\t\tupdateBookingStatement.executeQuery();\r\n\t\t\t} else {\r\n\t\t\t\trollbackTransaction();\r\n\t\t\t}\r\n\t\t\tif (cancel2.next()){\r\n\t\t\t\tint secondFID = cancel2.getInt(\"fid2\");\r\n\t\t\t\tcheckBookingStatement.clearParameters();\r\n\t\t\t\tcheckBookingStatement.setInt(1, secondFID);\r\n\t\t\t\tResultSet f2 = checkBookingStatement.executeQuery();\r\n\t\t\t\tint current2 = f2.getInt(\"count\");\r\n\t\t\t\tupdateBookingStatement.clearParameters();\r\n\t\t\t\tupdateBookingStatement.setInt(1, current2-1);\r\n\t\t\t\tupdateBookingStatement.setInt(2, secondFID);\r\n\t\t\t\tupdateBookingStatement.executeQuery();\r\n\t\t\t}\r\n\t\t\tcommitTransaction();\r\n\t\t\treturn \"Canceled reservation \" + reservationId + \"\\n\";\r\n\r\n\t\t} catch (SQLException e){\r\n\t\t\t//rollbackTransaction();\r\n\t\t\treturn \"Failed to cancel reservation \" + reservationId;\r\n\t\t}\r\n }", "private void userHasBooking() throws SQLException {\n BookingModel bookingModel2 = new BookingModel();\n if (bookingModel2.checkUserBooking(employeeID)) {\n hasBooking = true;\n } else {\n hasBooking = false;\n }\n\n }", "@Override\n\tpublic List<Businessrecord> findBusinessrecordbyBookid(String bookid) {\n\t\treturn businessrecordDao.findBusinessrecordbyBookid(bookid);\n\t}", "public static void main(String[] argv) {\n //main handle loop and program flow\n Scanner read = new Scanner(System.in);\n // default mem -to be added in function.checklistlength()\n Student[] list = new Student[0];\n UndergraduateStudent[] Ulist = new UndergraduateStudent[0];\n PostGraduateStudent[] Plist = new PostGraduateStudent[0];//not used\n double average = 0; // hold average value\n int input = 0;\n\n Student.StudentInfo();\n function.promptinput();\n while (true) {\n try {\n input = read.nextInt();//menu input\n } catch (Exception ex) {// input is not integer\n System.out.println(ex);//display err\n System.out.println(\"wrong input\");\n System.exit(1);//exit program\n } finally {\n if (input == 1) {// quit when 1 is entered\n System.out.println(\"sys exit.\");\n System.exit(0);\n function.addbreakline();// ============================================\n } else if (input == 2) {// add from file to Objects\n list = function.addTolistfromfile(list);// file to Student list\n Ulist = function.addToUlistfromfile(Ulist);// file to UnderGrad list\n list = function.calcMarkAndGrade(list, Ulist);// overall mark + grade\n average = function.aveoverallmark(list);// calc average for all student\n System.out.println(function.getmessage());// input status\n boolean condition =Student.equals(list,Ulist);//check input for any repetition\n System.out.println(\"repititive student status: \"+condition);\n \n function.addbreakline();// ============================================\n } else if (input == 3) {// output\n function.outputList(list, Ulist);\n function.addbreakline();// ============================================\n } else if (input == 4) {\n System.out.println(\"ave mark of all: \" + average);\n function.addbreakline();// ============================================\n } else if (input == 5) {\n // input= read.nextInt();\n function.aboveAveMark(average, list);\n System.out.println(function.getmessage());\n function.addbreakline();// ============================================\n } else if (input == 6) {\n // search by Student ID\n System.out.print(\"enter a student ID: \");\n long searchid = read.nextLong();\n function.searchByID(searchid, list, Ulist);\n System.out.println(function.getmessage());\n function.addbreakline();// ============================================\n } else if (input == 7) {\n // input lower UPPERcase, search check name entered with space \n System.out.print(\"enter a student name: \");\n String searchname = read.nextLine();\n searchname = read.nextLine();\n function.searchbyName(searchname, list, Ulist);\n System.out.println(function.getmessage());\n function.addbreakline();// ============================================\n } else if (input == 8) {\n Student.sortID(list, Ulist);//sort by ID number \n function.addbreakline();// ============================================\n } else if (input == 9) {\n //can only sort by first letter of Surname -- sort whole Surname will be wrong\n int[][] Ascore= new int[list.length][5];\n Ascore=Student.indexValue(list);//scoring name system to sort\n \n //score list before sort -- for checking list value\n /*for (int i = 0; i < list.length; i++) {\n for (int j = 0; j < 5; j++) {\n System.out.print(\" acore \"+i+\" \"+j+\": \"+Ascore[i][j]);\n }\n System.out.println();\n }*/\n for (int index =0;index<1;index++){\n list =function.sortName(list, Ulist, Ascore, index);\n\n /*System.out.println(\"Score list after swap\"+index+\"index:\");// for checking list value\n for (int i = 0; i < list.length; i++) {\n for (int j = 0; j < 5; j++) {\n System.out.print(\" acore \" + i + \" \" + j + \": \" + Ascore[i][j]);\n }\n System.out.println();\n }*/\n }\n function.outputList(list, Ulist);\n function.addbreakline();// ============================================\n } else {\n System.out.println(\"enter only from 1-9\");\n }\n }\n }\n\n }", "boolean isBookIdValid(int bookId) {\n\t\t\n\t\t// checks if the id is to big for the book case or if that location is not taken \n\t\tif (bookId >= this.maxBookCapacity || this.bookShelf[bookId] == null || bookId < 0) {\n\t\t\treturn false; \n\t\t}\n\t\t\n\t\treturn true; \n\t}", "private void updateStudent() throws ValidatorException, FileNotFoundException {\n //Lesen wir die Daten\n Scanner sc = new Scanner(System.in);\n System.out.print(\"ID of the student to be updated: \");\n long ID = sc.nextLong();\n System.out.print(\"New First Name: \");\n String newFirstName = sc.next();\n System.out.print(\"New Last Name: \");\n String newLastName = sc.next();\n\n //Wir rufen die updateStudent Funktion vom dem Controller mit den gelesenen Daten auf\n if (ctrl.updateStudent(ID, newFirstName, newLastName)) {\n System.out.println(\"Courses can be updated only from the Registration System menu!\");\n System.out.println(\"Student updated with success!\");\n } else\n System.out.println(\"Student with this ID doesn't exist!\");\n }", "void returnbook(String book){\n\t\tthis.books[no_of_books]=book;\n\t\tno_of_books++;\n\t\tSystem.out.println(book+\" ...return\");\n\n\t}", "@Override\n\tpublic int findUserborrownum(int id) {\n\t\treturn this.borrowrecordMapper.findUserborrownum(id);\n\t}", "public int getBusiness(){\n int count = 0;\n Scanner reader = new Scanner(System.in);\n\n System.out.println(\"\\n\\nWhich business would you like to view/book for?\");\n\n //gets all the names of all business's registered to the system\n for(int i = 1; i< Login.businessList.size(); i++){\n System.out.println(i+\". \"+ Login.businessList.get(i).getName());\n count++;\n }\n System.out.print(\"Choose option: \");\n\n //checks for non integer input\n while(!reader.hasNextInt()) {\n System.out.println(\"Error: entered a non integer. Enter a number between 1-8.\");\n reader.next();\n }\n\n //stores input\n int id = reader.nextInt();\n\n //check whether validity of option\n while(!verifyBusinessID(id, count)){\n System.out.println(\"Error: Invalid choice. Choose a number between 1-\"+count);\n System.out.print(\"Choose option: \");\n\n //checks again for non-integer input\n while(!reader.hasNextInt()) {\n System.out.println(\"Error: entered a non integer. Try again.\");\n System.out.print(\"Choose option: \");\n reader.next();\n }\n\n\n id = reader.nextInt();\n\n }\n\n\n return id -1;\n }", "public void returnBook(int id) {\n\t\ttry (Connection conn = DriverManager.getConnection(this.hostUrl,this.username,this.password)) {\n\t\t System.out.println(\"Database connected!\");\n\t\t // Statement stmt = conn.createStatement();\n\t\t String sql = \"update borrows set return_on=now() where id=?\";\n\t\t PreparedStatement stmt=conn.prepareStatement(sql); \n\t\t stmt.setInt(1,id);//1 specifies the first parameter in the query \n\t\t stmt.executeUpdate();\n\t\t conn.close(); \n\n\t\t} catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t}", "private void verifyStudent() {\n\t\t\n\t\tchar[] newPassword1 = sPasswordPF1.getPassword();\n\t\tchar[] newPassword2 = sPasswordPF2.getPassword();\n\t\t\n\t\tif (newStudent || sUpdateProfile) {\n\t\t\t\n\t\t\t//Student: FirstName\n\t\t\tif (sFirstNameTF.getText().isEmpty()) { \n\t\t\t\tJOptionPane.showMessageDialog(this,\"Blank Field: First\",\"Error\",JOptionPane.ERROR_MESSAGE);\n\t\t\t\tsFirstNameTF.setBackground(Color.LIGHT_GRAY);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse if (!sFirstNameTF.getText().isEmpty() && sFirstNameTF.getBackground() == Color.LIGHT_GRAY) { \n\t\t\t\tsFirstNameTF.setBackground(Color.WHITE);\n\t\t\t}\n\t\t\t\n\t\t\t//Student: LastName\n\t\t\tif (sLastNameTF.getText().isEmpty()) {\n\t\t\t\tJOptionPane.showMessageDialog(this,\"Blank Field: Last\",\"Error\",JOptionPane.ERROR_MESSAGE);\n\t\t\t\tsLastNameTF.setBackground(Color.LIGHT_GRAY);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse if (!sLastNameTF.getText().isEmpty() && sLastNameTF.getBackground() == Color.LIGHT_GRAY) { \n\t\t\t\tsLastNameTF.setBackground(Color.WHITE);\n\t\t\t}\n\t\t\t\n\t\t\t//Student: SchoolName\n\t\t\tif (sSchoolNameTF.getText().isEmpty()) {\n\t\t\t\tJOptionPane.showMessageDialog(this,\"Blank Field: School\",\"Error\",JOptionPane.ERROR_MESSAGE);\n\t\t\t\tsSchoolNameTF.setBackground(Color.LIGHT_GRAY);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse if (!sSchoolNameTF.getText().isEmpty() && sSchoolNameTF.getBackground() == Color.LIGHT_GRAY) { \n\t\t\t\tsSchoolNameTF.setBackground(Color.WHITE);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (newStudent || sUpdateSecurity) {\n\t\t\t\n\t\t\t//Student: Password\n\t\t\tif (sPasswordPF1.getPassword().length == 0) {\n\t\t\t\tif (newStudent) {\n\t\t\t\t\tJOptionPane.showMessageDialog(this,\"Blank Field: Password\",\"Error\",JOptionPane.ERROR_MESSAGE);\n\t\t\t\t\tsPasswordPF1.setBackground(Color.LIGHT_GRAY);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t//Student: New Password\n\t\t\t\telse if (sUpdateSecurity) {\n\t\t\t\t\tJOptionPane.showMessageDialog(this,\"Blank Field: New Password\",\"Error\",JOptionPane.ERROR_MESSAGE);\n\t\t\t\t\tsPasswordPF1.setBackground(Color.LIGHT_GRAY);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (sPasswordPF1.getPassword().length != 0 && sPasswordPF1.getBackground() == Color.LIGHT_GRAY) { \n\t\t\t\tsPasswordPF1.setBackground(Color.WHITE);\n\t\t\t}\n\t\t\t\n\t\t\t//Student: Re-enter Password\n\t\t\tif (sPasswordPF2.getPassword().length == 0) {\n\t\t\t\tif (newStudent) {\n\t\t\t\t\tJOptionPane.showMessageDialog(this,\"Blank Field: Re-enter Password\",\"Error\",JOptionPane.ERROR_MESSAGE);\n\t\t\t\t\tsPasswordPF2.setBackground(Color.LIGHT_GRAY);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t//Student: Re-enter New Password\n\t\t\t\telse if (sUpdateSecurity){\n\t\t\t\t\tJOptionPane.showMessageDialog(this,\"Blank Field: Re-enter New Password\",\"Error\",JOptionPane.ERROR_MESSAGE);\n\t\t\t\t\tsPasswordPF2.setBackground(Color.LIGHT_GRAY);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (sPasswordPF2.getPassword().length != 0 && sPasswordPF2.getBackground() == Color.LIGHT_GRAY) { \n\t\t\t\tsPasswordPF2.setBackground(Color.WHITE);\n\t\t\t}\n\t\t\t\n\t\t\t//Student: Security Question 1\n\t\t\tif (sSecurityQ1TF.getText().isEmpty()) {\n\t\t\t\tJOptionPane.showMessageDialog(this,\"Blank Field: Security Question 1\",\"Error\",JOptionPane.ERROR_MESSAGE);\n\t\t\t\tsSecurityQ1TF.setBackground(Color.LIGHT_GRAY);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse if (!sSecurityQ1TF.getText().isEmpty() && sSecurityQ1TF.getBackground() == Color.LIGHT_GRAY) { \n\t\t\t\tsSecurityQ1TF.setBackground(Color.WHITE);\n\t\t\t}\n\t\t\t\n\t\t\t//Student: Security Question 2\n\t\t\tif (sSecurityQ2TF.getText().isEmpty()) {\n\t\t\t\tJOptionPane.showMessageDialog(this,\"Blank Field: Security Question 2\",\"Error\",JOptionPane.ERROR_MESSAGE);\n\t\t\t\tsSecurityQ2TF.setBackground(Color.LIGHT_GRAY);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse if (!sSecurityQ2TF.getText().isEmpty() && sSecurityQ2TF.getBackground() == Color.LIGHT_GRAY) { \n\t\t\t\tsSecurityQ2TF.setBackground(Color.WHITE);\n\t\t\t}\n\t\t\t\n\t\t\t//Student: Password Equivalency \n\t\t\telse if (isPasswordCorrect(newPassword1, newPassword2) != true) {\n\t\t\t\tif (newStudent) {\n\t\t\t\t\tJOptionPane.showMessageDialog(this,\"Passwords do not match!\",\"Error\",JOptionPane.ERROR_MESSAGE);\n\t\t\t\t\tsPasswordPF1.setText(\"\");\n\t\t\t\t\tsPasswordPF2.setText(\"\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t//Student: New Password Equivalency \n\t\t\t\telse if (sUpdateSecurity) {\n\t\t\t\t\tJOptionPane.showMessageDialog(this,\"New passwords do not match!\",\"Error\",JOptionPane.ERROR_MESSAGE);\n\t\t\t\t\tsPasswordPF1.setText(\"\");\n\t\t\t\t\tsPasswordPF2.setText(\"\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//Student: Old Password Equivalency \n\t\t\tif (sUpdateSecurity) {\n\t\t\t\t\n\t\t\t\tchar[] oldPassword1 = student.getPassword();\n\t\t\t\tchar[] oldPassword2 = sOldPasswordPF.getPassword();\n\t\t\t\t\n\t\t\t\tif (isPasswordCorrect(oldPassword1, oldPassword2) != true) {\n\t\t\t\t\tJOptionPane.showMessageDialog(this,\"Old passwords do not match!\",\"Error\",JOptionPane.ERROR_MESSAGE);\n\t\t\t\t\tsOldPasswordPF.setText(\"\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\telse if (sOldPasswordPF.getPassword().length != 0 && sOldPasswordPF.getBackground() == Color.LIGHT_GRAY) { \n\t\t\t\t\tsOldPasswordPF.setBackground(Color.WHITE);\n\t\t\t\t} \n\t\t\t}\n\t\t}\n\t\t//Student: Update Profile Actions \n\t\tif (sUpdateProfile) {\n\t\t\tsUpdateProfile = false;\n\t\t\tupdateStudentProfileInfo();\n\t\t\tupdateStudentPWindow.dispose();\n\t\t\tsPortalWindow.dispose();\n\t\t\tstudentPortalScreen();\n\t\t\tSystem.out.println(\"Updated student profile\");\n\t\t}\n\t\t//Student: Update Security Actions\n\t\telse if (sUpdateSecurity) {\n\t\t\tsUpdateSecurity = false;\n\t\t\tupdateStudentSecurityInfo();\n\t\t\tupdateStudentSWindow.dispose();\n\t\t\tsPortalWindow.dispose();\n\t\t\tstudentPortalScreen();\n\t\t}\n\t\t//Student: New Student Actions\n\t\telse {\n\t\t\tnewStudent = false;\n\t\t\tnewStudentWindow.dispose();\n\t\t\taddStudent();\n\t\t\tcreateTempData();\n\t\t\tstudentPortalScreen();\n\t\t}\n\t}", "@Override\n public MyBook findByUserAndBookShelfAndBookId(final String userid,\n final String shelfName, final String bookId) {\n // TODO Auto-generated method stub\n return null;\n }", "boolean hasInBookNo();", "public boolean returns(Book book) {\n int index = find(book);\n if (index == NOT_FOUND){ return false; }\n if (!books[index].isCheckedOut()){ return false; }\n books[index].setCheckedOut(false);\n return true;\n }", "static void presentBookingHistory(User booker) {\r\n\t\tBooking bookings = new Booking();\r\n\t\tResultSet historyRs = null;\r\n\r\n\t\tSystem.out.printf(\"*%14s%10s%18s%28s%28s%15s%11s\\n\", \"Booking No\", \"Lot No\", \"Car No\", \"Start Time\", \"End Time\", \"Cost\", \"*\");\r\n\t\tSystem.out.println(\"*****************************************************************************************************************************\");\r\n\t\ttry {\r\n\t\t\tDbConnection historyConn = new DbConnection();\r\n\t\t\thistoryRs = historyConn.fetchSelectUserByUNameBookings(booker.getUName());\r\n\t\t\twhile (historyRs.next()) {\r\n\t\t\t\tjava.sql.Timestamp endTime = historyRs.getTimestamp(6);\r\n\t\t\t\t/**\r\n\t\t\t\t*\tTo show only the ones which are not checked out yet\r\n\t\t\t\t*\tIf a record with end time as 0 is found, it will be considered as not booked and shown\r\n\t\t\t\t*/\r\n\t\t\t\tif (endTime.getTime() != 0) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tString bookingNo = historyRs.getString(1);\r\n\t\t\t\tint lotNo = historyRs.getInt(3);\r\n\t\t\t\tString carNo = historyRs.getString(4);\r\n\t\t\t\tjava.sql.Timestamp startTime = historyRs.getTimestamp(5);\r\n\t\t\t\tint cost = historyRs.getInt(7);\r\n\t\t\t\tbookings.setAllValues(bookingNo, lotNo, carNo, startTime, endTime, cost);\r\n\r\n\t\t\t\tbookings.showBookHistory();\r\n\t\t\t}\r\n\t\t} catch(SQLException SqlExcep) {\r\n\t\t\tSystem.out.println(\"No records with the given booking number found\");\r\n\t\t\t//SqlExcep.printStackTrace();\r\n\t\t} catch (ClassNotFoundException cnfExecp) {\r\n\t\t\tcnfExecp.printStackTrace();\r\n\t\t} catch (NullPointerException npExcep) {\r\n\t\t\tnpExcep.printStackTrace();\r\n\t\t} finally {\r\n\t\t\t/*try {\r\n\t\t\t\t//validateConn.closeDbConnection();\r\n\t\t\t} catch(SQLException SqlExcep) {\r\n\t\t\t\tSqlExcep.printStackTrace();\r\n\t\t\t}*/\r\n\t\t}\r\n\t}" ]
[ "0.7085599", "0.68965083", "0.6487921", "0.6185171", "0.61142683", "0.6081007", "0.60607415", "0.5939412", "0.5919821", "0.5855117", "0.5787162", "0.5769353", "0.5745347", "0.5737697", "0.5736327", "0.5723016", "0.5714072", "0.571081", "0.56899613", "0.5689568", "0.56578594", "0.56391823", "0.5602199", "0.55687046", "0.5558002", "0.55255425", "0.5518326", "0.5463302", "0.54402477", "0.543953", "0.5432321", "0.54307145", "0.54262346", "0.5419546", "0.54071563", "0.5398686", "0.5388429", "0.53874975", "0.5366053", "0.5364534", "0.53475785", "0.53292274", "0.5324062", "0.5320439", "0.5299732", "0.5290801", "0.52790034", "0.52790034", "0.52790034", "0.52755344", "0.525898", "0.5253571", "0.5236136", "0.52358085", "0.5231585", "0.5201763", "0.51942414", "0.5189782", "0.5186595", "0.5182778", "0.51815194", "0.51761264", "0.5160739", "0.5157494", "0.51556396", "0.5152769", "0.5147481", "0.5132732", "0.5122242", "0.51158535", "0.511362", "0.509503", "0.50874186", "0.50874186", "0.5084717", "0.5083079", "0.5071879", "0.505544", "0.50549644", "0.5051354", "0.50487554", "0.50453573", "0.5044299", "0.50401133", "0.50366545", "0.50255144", "0.50238943", "0.50225097", "0.5016113", "0.50130564", "0.50079095", "0.5006124", "0.4993962", "0.4989534", "0.49890932", "0.4977", "0.49746767", "0.49721664", "0.4971432", "0.497108" ]
0.8086229
0
/Checks if book was returned past the return date. And if it was overdue, then calculate how much the student should be fined. If book was returned on time then this method will return 0 for both the number of days overdue and the student's fine.
private static FineResult calculateFine(Calendar book_return_date){ Calendar today = new GregorianCalendar(); int elapsedDays = 0; //default value for number of days overdue the book was returned double fine = 0; //default value for the fine accrued by the student FineResult result = new FineResult(); //will store the number of days overdue book was returned and how much student will be fined as a result long return_in_millisecs = book_return_date.getTimeInMillis(); //book's return date in milliseconds long today_in_millisecs = today.getTimeInMillis(); //today's date in milliseconds long difference = today_in_millisecs - return_in_millisecs; if(difference > 0){//if today's date is past the return date elapsedDays = (int) (difference / MILLISECS_IN_DAY); //get the number of days elapsed from book's correct return date to today fine = FINE_RATE * elapsedDays; } result.days_overdue = elapsedDays; result.fine = fine; return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) {\r\n\t Scanner in = new Scanner(System.in);\r\n\t int d1 = in.nextInt();\r\n\t int m1 = in.nextInt();\r\n\t int y1 = in.nextInt();\r\n\t int d2 = in.nextInt();\r\n\t int m2 = in.nextInt();\r\n\t int y2 = in.nextInt();\r\n\t LocalDate returnDate=LocalDate.of(y1,m1,d1);\r\n\t LocalDate dueDate=LocalDate.of(y2,m2,d2);\r\n\t long fine=0;\r\n\t if(returnDate.isBefore(dueDate)||returnDate.equals(dueDate))fine=0;\r\n\t else if(returnDate.isAfter(dueDate)){\r\n\t \tif(returnDate.getYear()==dueDate.getYear()){\r\n\t \t\tif(returnDate.getMonth()==dueDate.getMonth()){\r\n\t \t\t\tfine=(returnDate.getDayOfYear()-dueDate.getDayOfYear())*15;\r\n\t \t\t}else{\r\n\t \t\t\t\tfine=(returnDate.getMonthValue()-dueDate.getMonthValue())*500;\r\n\t \t\t\r\n\t \t}\r\n\t \t\t\r\n\t \t\t\r\n\t } else fine=10000;\r\n\t }else fine=10000;\r\n\t System.out.println(fine);\r\n\t }", "private double computeFine(Transaction transaction){\n //initialize the totalFine as 0\n double totalFine = 0;\n //if the transactions status is true meaning it is still issued\n if (transaction.isStatus()==true) {\n //make a new LocalDate current and set it to now() (the current date)\n LocalDate current = LocalDate.now();\n //using the period class and its methods for manipulating LocalDates, make two new period objects\n //the first uses the .between method which returns the period between the transaction issueDate and the current time\n Period p1 = Period.between(transaction.getIssueDate(), current);\n //the second returns the period between the due date (use getDueDate method with the transaction issue date passed in) and current time\n Period p2 = Period.between(getDueDate(transaction.getIssueDate()), current);\n //use .getDays method to get the number of days from the first period and if that is greater than\n //the max amount of loan days then the book is overdue and a fine needs to be calculated since its been more\n //than 14 days since the issue date\n if (p1.getDays() > MAX_LOAN_DAYS) {\n //set the totalFine equal to $1 times each day past the due date, which we get from p2.getDays()\n //since p2 is the period between the due date and now (it will be positive since we know its past the due date because of the if condition)\n totalFine = 1 * p2.getDays();\n }\n }\n //return totalFine, if the status was false meaning it was returned it should still be 0\n return totalFine;\n }", "public int daysOverdue(int today);", "public int remainingFees()\r\n\t{\r\n\t\treturn feesTotal-feesPaid;\t\t\r\n\t}", "public static int countDaysLeft(String currentDate, String dueDate){\n // Part 1. In the case where the current date has passed the due date, the dueDateHasPassed method is called with the currentDate and dueDate arguments \n // as inputs. \n if(dueDateHasPassed(currentDate, dueDate)){\n return 0;\n }\n // Part 2. In the case where the current date and the due date share the same month and year, the remaining days is calculated.\n else if((getMonth(currentDate) == getMonth(dueDate)) && (getYear(currentDate) == getYear(dueDate))){\n int numofDays = getDay(dueDate) - getDay(currentDate);\n return numofDays;\n }\n // Part 3. In the case where the current date and the due date share only the same year, the remaining days is calculated. \n else if(getYear(currentDate) == getYear(dueDate)){\n int i = getMonth(currentDate);\n int j = getMonth(dueDate);\n int totalDaysFromMonths = 0;\n while(i<j){\n totalDaysFromMonths += getDaysInAMonth(i,getYear(currentDate));\n i++;\n }\n int totalDaysOfSameYear = totalDaysFromMonths - getDay(currentDate) + getDay(dueDate);\n return totalDaysOfSameYear;\n }\n // Part 4. All other cases will result in the due date being in the futre of a different year, that of the current date. The remaining days will be \n // calculated. \n else{\n int b = getYear(dueDate);\n int a = getYear(currentDate);\n int totalDaysFromYears = 0;\n while(a<b){\n if(isLeapYear(a)){\n totalDaysFromYears += 366;\n }\n else{ \n totalDaysFromYears += 365;\n }\n a++;\n }\n int i = 1;\n int totalDaysFromMonthsOfcurrentDateYear = 0;\n while(i<getMonth(currentDate)){\n totalDaysFromMonthsOfcurrentDateYear += getDaysInAMonth(i, getYear(currentDate));\n i++;\n }\n int j = 1;\n int totalDaysFromMonthsOfdueDateYear = 0;\n while(j<getMonth(dueDate)){\n totalDaysFromMonthsOfdueDateYear +=getDaysInAMonth(j, getYear(dueDate));\n j++;\n }\n int totalDays = totalDaysFromYears - totalDaysFromMonthsOfcurrentDateYear - getDay(currentDate) + totalDaysFromMonthsOfdueDateYear + getDay(dueDate);\n return totalDays;\n }\n }", "public double fineAsToHours(int numOfDays,int h1,int h2,int m1, int m2){\n double fine=0.0;\n int y=0;\n\n //if overdue is minus there is no need to calculate a fine\n if(numOfDays<0){\n fine=0.0;\n }\n\n //if it is 0 if the reader returns book on or before the due hour, again no fine\n //if reader returns book after due hour minutes will be taken in to count\n else if(numOfDays==0){\n if(h2<=h1){\n fine=0.0;\n }\n else{\n //ex:if due=10.30, returnTime=12.20, fine will be charged only for 10.30 to 11.30 period\n //which is returnTime-1-due\n if(m2<m1){\n y=(h2-h1)-1;\n fine=y*0.2;\n }\n //if returnTime=12.45 fine will be charged for 10.30 to 12.45 period\n //which is returnTime-due\n else if(m2>=m1){\n y=h2-h1;\n fine=y*0.2;\n }\n }\n }\n\n //if over due is 3days or less\n else if(numOfDays<=3){\n //ex: due=7th 10.30, returned=9th 9.30\n //finr will be charged for 24h and the extra hours from 8th, and extra hours from 9th\n if(h2<=h1){\n y=((numOfDays-1)*24)+((24-h1)+h2);\n fine=y*0.2;\n }\n else{\n //ex: due=7th 10.30, returned= 9th 12.15\n //total 2*24h will be added. plus, time period frm 9th 10.30 to 11.30\n if(m2<m1){\n y=(numOfDays*24)+((h2-h1)-1);\n fine=y*0.2;\n }\n else if(m2>=m1){\n //returned=9th 12.45\n //total 2*24h, plus 2hours difference from 10.30 to 12.30\n y=(numOfDays*24)+(h2-h1);\n fine=y*0.2;\n }\n }\n\n }\n\n\n //same logic and will multiply the 1st 3 days form 0.2 as to the requirement\n\n else if(numOfDays>3){\n if(h2<=h1){\n y=((numOfDays-4)*24)+((24-h1)+h2);\n fine=(y*0.5)+(24*3*0.2);\n }\n\n else{\n if(m2<m1){\n y=((numOfDays-3)*24)+((h2-h1)-1);\n fine=(y*0.5)+(3*24*0.2);\n }\n\n else if(m2>m1){\n y=((numOfDays-3)*24)+(h2-h1);\n fine=(y*0.5)+(3*24*0.2);\n }\n }\n\n\n }\n\n return fine;\n\n }", "@Override\r\n\tpublic int yearsTillRetirement() //calculate years until retirement\r\n\t{\n\t\tint retire = (int)Math.round((35 - (super.getYears() + (double)(usedUnpaidVacation + usedVacation* 2 + usedSickDays)/260)));\r\n\t\t\r\n\t\treturn retire;\r\n\t\t\r\n\t\t\r\n\t}", "public long calcRemaining(){\n return getGrandTotal() - getTotalPaid();\n }", "public int computeFine(int today);", "public void checkOverDue() {\n\t\tif (state == loanState.current && //changed 'StAtE' to 'state' and ' lOaN_sTaTe.CURRENT to loanState.current\r\n\t\t\tCalendar.getInstance().getDate().after(date)) { //changed Calendar.gEtInStAnCe to Calender.getInstance and gEt_DaTe to getDate and DaTe to date\r\n\t\t\tthis.state = loanState.overDue; //changed 'StAtE' to 'state' and lOaN_sTaTe.OVER_DUE to loanState.overDue\t\t\t\r\n\t\t} //added curly brackets\r\n\t}", "public boolean isOverdue(int today);", "public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int returnDay = scanner.nextInt();\n int returnMonth = scanner.nextInt();\n int returnYear = scanner.nextInt();\n int dueDay = scanner.nextInt();\n int dueMonth = scanner.nextInt();\n int dueYear = scanner.nextInt();\n int fine = 0;\n if(returnYear > dueYear) fine = 10000;\n else if(returnYear < dueYear) fine = 0;\n else if(returnMonth == dueMonth && returnDay > dueDay) {\n fine = 15 * (returnDay - dueDay);\n }\n else if(returnMonth > dueMonth){\n fine = 500 * (returnMonth - dueMonth);\n }\n\n System.out.println(fine);\n\n }", "protected boolean isOverdue() {\n\t\t// this might be backwards, go back and check later\n\t\t/*int i = todaysDate.compareTo(returnDate);// returns 0, a positive num, or a negative num\n\t\tif (i == 0) { return false;}\t\t// the dates are equal, not overdue\n\t\telse if (i > 0) { return true; }\t// positive value if the invoking object is later than date\n\t\telse { return false; } */\t\t\t// negative value if the invoking object is earlier than date\n\t\t\n\t\t// can also do\n\t\tif (todaysDate.getTime() > returnDate.getTime() ) { return true; }\n\t\telse { return false; }\t// if the difference in time is less than or equal\n\t}", "ScaleTwoDecimal calculateApplicableFandARate(Award award);", "public int computeStatus() {\n\t\tif(isOutcomeExceeded()) return 0;\r\n\t\t\r\n\t\t//the new loan is too expensive\r\n\t\tif(isOutcomeExceeded(mMonthlyLoan)) return 0;\r\n\t\t\r\n\t\tint domainCoeff = DBOperations.getDomainCoeffById(mDomainId); // (0, 10] \r\n\t\tint expCoeff = DBOperations.getExperienceCoeffById(mExperienceId); // (0, 5]\r\n\t\t\r\n\t\tint backgroundCoeff = domainCoeff * expCoeff; // (0, 50]\r\n\t\tif(isIncomeRaising) backgroundCoeff *= 2; // (0, 100]\r\n\t\t\r\n\t\tint incomeCoeff = getIncomeWeight(mMonthlyIncome); // (0, 100]\r\n\t\t\r\n\t\tint coeff = (int) ((backgroundCoeff * 0.20) + (incomeCoeff * 0.55)); // (0, 75]\r\n\t\tif(mHadOtherLoans) coeff += 5; // (0, 80]\r\n\t\tif(mHasDelayedPays) coeff -= 10; // (0, 80]\r\n\t\t\r\n\t\tif((mMonthlyIncome - mMonthlyOutcome) * MAXIMUM_SURE_OUTCOME_PERCENTAGE / 100 >= mMonthlyLoan) {\r\n\t\t\tcoeff += 20; // (0, 100]\r\n\t\t}\r\n\t\t\r\n\t\tif(coeff <= 25) return 0;\r\n\t\treturn coeff < 55 ? 1 : 2;\r\n\t}", "protected int getTotalEnrolled() {\n return getTotalEnrolledEvening() + getTotalEnrolledMorning();\n }", "public int calculateBackDatedVouchers(Optional<LocalDate> expectedDueDate,\n List<LocalDate> newChildrenDateOfBirths,\n LocalDate cycleStartDate,\n QualifyingReason qualifyingReason) {\n List<LocalDate> backDatedEntitlementDates = getBackDatedEntitlementDates(newChildrenDateOfBirths, cycleStartDate);\n int vouchersForChildren = calculateNumberOfVouchers(Optional.empty(), newChildrenDateOfBirths, backDatedEntitlementDates, qualifyingReason);\n int vouchersFromPregnancy = calculateNumberOfVouchers(expectedDueDate, emptyList(), backDatedEntitlementDates, qualifyingReason);\n\n int backDatedVouchers = vouchersForChildren - vouchersFromPregnancy;\n // do not return negative vouchers\n return Math.max(backDatedVouchers, 0);\n }", "public String determineLateFee(){\n\n\t\t/*\n\t\t * Initialize an empty String for the message\n\t\t */\n\t\tString cost = \"\";\n\n\t\t/*\n\t\t * If the DVD is late\n\t\t */\n\t\tif(getReturnDate().compareTo(getBoughtReturn()) > 0){\n\n\t\t\tcost = \"$2.00\";\n\n\t\t}\n\n\t\t/*\n\t\t * If the DVD is early or on time\n\t\t */\n\t\telse if(getReturnDate().compareTo(getBoughtReturn()) <= 0){\n\n\t\t\tcost = \"$1.20\";\n\n\t\t}\n\n\t\t/*\n\t\t * Returns a String message to be displayed on a JDialog from\n\t\t * the GUIRentalStore class\n\t\t */\n\t\treturn \"Thanks, \" + getNameofRenter() +\", for returning \"\n\t\t+ getTitle() + \". You owe \" + cost;\n\n\t}", "private static void returnBook(){\n\t\tSystem.out.println(\"===Book Return===\");\n\t\tScanner integer_input = new Scanner(System.in);\n\t\t\n\t\tSystem.out.println(\"Enter Id of book being returned: \");\n\t\tint bookId = getIntegerInput();//ensures user input is an integer value\n\t\t//if bookId entered does not exist then continually ask user to enter bookId until a bookId that exists is entered\n\t\t\t\twhile(!ALL_BOOKS.containsKey(bookId)){\n\t\t\t\t\tSystem.out.println(\"Book Id entered does not exist! Enter BookId: \");\n\t\t\t\t\tbookId = integer_input.nextInt();\n\t\t\t\t}\n\t\t\n\t\t/*Print statements to notify book has been found, the book's details, and its availabilty*/\n\t\tSystem.out.println(\"Book Found!\");\n\t\tSystem.out.println(ALL_BOOKS.get(bookId).getBookTitle() + \" | Written By: \" + ALL_BOOKS.get(bookId).getAuthor().toString() + \"| Published By: \" + ALL_BOOKS.get(bookId).getPublisher());\n\t\tString availabilty = !ALL_BOOKS.get(bookId).getBorrowed() ? \"Available\" : \"Currently Borrowed\"; //stores whether book is currently borrowed or not.\n\t\tSystem.out.println(availabilty);\n\t\t\n\t\t\n\t\t\n\t\tif(ALL_BOOKS.get(bookId).getBorrowed()){//if book was borrowed then validate student doing the book return, change the book's status, and calculate how much student should be fined \t\n\t\t\tBookDetails book = ALL_BOOKS.get(bookId);\n\t\t\t\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println(\"Enter Id of student returning the book: \");\n\t\t\tint studentId = getIntegerInput();//ensures user input is an integer value\n\t\t\t\n\t\t\t/*Verify student Id entered matches the Id of the student who borrowed the book*/\n\t\t\tif(studentId == book.getStudentBorrowed()){\n\t\t\t\tFineResult fine = calculateFine(book.getDateToReturn()); //calculate how many days overdue the book was returned and how much student should be fined.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//If book was returned on time then this method will return 0 for both the number of days overdue and the student's fine.\n\t\t\t\tbook.setBorrowed(false); //indicates book has been returned and is now available to be borrowed by someone else\n\t\t\t\tbook.resetDateToReturn();; //reset book's return date\n\t\t\t\tbook.setStudentBorrowed(0); //reset to default value, indicating no student is current borrowing this book\n\t\t\t\t\n\t\t\t\t/*Display Statements to user indicating book was successfully returned, and how much student was fined*/\n\t\t\t\tSystem.out.println(\"You Are All Set!\");\n\t\t\t\tSystem.out.println(\"Book Id: \" + book.getBookId() + \" | \" + book.getBookTitle() + \" has been returned\");\n\t\t\t\tSystem.out.println(ALL_STUDENTS.get(studentId).getFullName() + \" returned the book \" + fine.days_overdue + \" days overdue\" + \" | Fine Amount Charged: \" + fine.days_overdue + \" * \" + FINE_RATE + \" = GHc\" + fine.fine);\n\t\t\t\t\n\t\t\t\tALL_STUDENTS.get(studentId).setBookIdBorrowed(0); //reset to default value, indicating no book is currently borrowed by this student\n\t\t\t\tALL_STUDENTS.get(studentId).addFine(fine.fine); //add the respective fine to this students fine total. If student accrued no fine on this return, fine value added will be 0.\n\t\t\t\tSystem.out.println(\"Total Fine on account: GHc\" + ALL_STUDENTS.get(studentId).getTotalFine());\n\t\t\t\t/*If Student's total fine is greater than 0 then add student to the FINED_STUDENTS Hashtable*/\n\t\t\t\taddFinedStudentsToTable(ALL_STUDENTS.get(studentId));\n\t\t\t}\n\t\t\telse{\n\t\t\t\tSystem.out.println(\"ERROR Verifying Student Id: Only Student who borrowed the book can return this book\");\n\t\t\t}\n\t\t}\n\t\telse\n\t\t\tSystem.out.println(\"ERROR: Can't return book that was not borrowed!\");\n\t}", "public static double calculateEmployeePension(int employeeSalaryForBenefits) {\n double total = 0;\n try {\n Scanner stdin = new Scanner(System.in);\n\n System.out.println(\"Please enter start date in format (example: May,2015): \");\n String joiningDate = stdin.nextLine();\n System.out.println(\"Please enter today's date in format (example: August,2017): \");\n String todayDate = stdin.nextLine();\n String convertedJoiningDate = DateConversion.convertDate(joiningDate);\n String convertedTodayDate = DateConversion.convertDate(todayDate);\n stdin.close();\n String[] actualDateToday = convertedTodayDate.split(\"/\");\n String[] actualJoiningDate = convertedJoiningDate.split(\"/\");\n\n Integer yearsEmployed = Integer.valueOf(actualDateToday[1]) - Integer.valueOf(actualJoiningDate[1]);\n\n if ( Integer.valueOf(actualJoiningDate[0]) > Integer.valueOf(actualDateToday[0]) ) {\n yearsEmployed--;\n }\n\n total = (((employeeSalaryForBenefits * 12) * 0.05) * yearsEmployed);\n\n\n\n\n System.out.println(\"Total pension to receive by employee based on \" + yearsEmployed + \" years with the company \" +\n \"(5% of yearly salary for each year, based on employee's monthly salary of $\" + employeeSalaryForBenefits + \"): \" + total);\n\n }\n catch (NumberFormatException e) {\n e.printStackTrace();\n }\n return total;\n }", "public double calculateWIP() {\n\t\tdouble totalDeliveryRate = 0.0;\n\t\tdouble totalLeadTime = 0.0;\n LinkedList<Card> completedCards = BoardManager.get().getCurrentBoard().getCardsOf(Role.COMPLETED_WORK);\n for (Card card : completedCards) {\n totalLeadTime += (int) DAYS.between(card.getCreationDate(versions), card.getCompletionDate(versions));\n\t\t\ttotalDeliveryRate += card.getStoryPoints();\t\n\n }\n\t\ttotalDeliveryRate = totalDeliveryRate/ (BoardManager.get().getCurrentBoard().getAge()); // avrage of cards delivered per time unit\n\t\ttotalLeadTime = totalLeadTime / completedCards.size(); // avarage time it takes to finish a card\n return Math.round(totalDeliveryRate * totalLeadTime * 100D) / 100D;\n }", "public double calculateChangeToGive() {\r\n\t\treturn amountPaid - amountToPay;\r\n\t}", "public int checkExpiryDate(LocalDate today) {\n\n final int limit = 100;\n long expirationDate = Duration.between(\n this.food.getCreateDate().atTime(0, 0), this.food.getExpiryDate().atTime(0, 0)\n ).toDays();\n long goneDate = Duration.between(\n this.food.getCreateDate().atTime(0, 0), today.atTime(0, 0)\n ).toDays();\n\n return (int) (limit * goneDate / expirationDate);\n\n }", "@Override\n public double calculatePayDay()\n {\n double perWeekEarned = hourlyRate * hoursPerWeek;\n return (double)Math.round(perWeekEarned * 100) / 100;\n }", "private int calculateDaysLeftOnLicense(Date pNowDate, Date pExpiryDate)\n{\n \n //milliseconds since 1/1/1970, 00:00:00 GMT\n long nowTime = pNowDate.getTime(); \n long expiryTime = pExpiryDate.getTime();\n\n long daysRemaining = expiryTime - nowTime; //time left in milliseconds\n \n daysRemaining /= 1000; //convert to seconds\n daysRemaining /= 60; //convert to minutes\n daysRemaining /= 60; //convert to hours\n daysRemaining /= 24; //convert to days\n \n if (daysRemaining > Integer.MAX_VALUE) {daysRemaining = Integer.MAX_VALUE;}\n if (daysRemaining < Integer.MIN_VALUE) {daysRemaining = Integer.MIN_VALUE;}\n \n return((int)daysRemaining);\n \n}", "public abstract double getLateFee(int daysLate);", "public int getNoPaymentsUpToDate(){\n\t\t// payment_ratio will check how many payments the client needs to do on average\n\t\tdouble payment_ratio = no_payments_yearly * 1.0 / 12;\n\t\t\n\t\t// Calculate no. of Payments up to date\n\t\tint counter = (int)Math.floor((getMonthsPast()) * payment_ratio);\n\t\treturn counter;\n\t}", "public static String apply_for_leave(int empId,String start_date, String end_date, int no_ldays,String leave_type, String leave_reason)\r\n throws ParseException {\r\n String s=null;\r\n Employee e = Employee.listById(empId);\r\n if (e != null) {\r\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\");\r\n Date leave_from = sdf.parse(start_date);\r\n Date leave_to = sdf.parse(end_date);\r\n Calendar start = Calendar.getInstance();\r\n start.setTime(leave_from);\r\n Calendar end = Calendar.getInstance();\r\n end.setTime(leave_to);\r\n int count = 0;\r\n for (Date date = start.getTime(); start.before(end); start.add(Calendar.DATE, 1), date = start.getTime()) {\r\n Calendar c = Calendar.getInstance();\r\n c.setTime(date);\r\n int dayOfWeek = c.get(Calendar.DAY_OF_WEEK);\r\n if (dayOfWeek == 1 || dayOfWeek == 7) {\r\n count++;\r\n }\r\n }\r\n System.out.println(count);\r\n long diff = leave_to.getTime() - leave_from.getTime();\r\n System.out.println(diff);\r\n long days = diff / (1000 * 60 * 60 * 24);\r\n Date today = new Date();\r\n String appliedOn = sdf.format(today);\r\n days = days + 1;\r\n long availBal = 0;\r\n long dif = 0;\r\n long updLeave = 0;\r\n String leaveStatus = null;\r\n // int overl = Leave.countNo(empId, start_date, end_date);\r\n availBal = e.getavailleaves();\r\n dif = availBal - days;\r\n updLeave = days - count;\r\n int bal = (int) updLeave;\r\n if (days <= 0) {\r\n s=\"Start Date Must be Greater than EndDate...\";\r\n } else if (dif < 0) {\r\n s=\"insufficient leav balance\";\r\n } else if (no_ldays != days) {\r\n s=\"NO Of Days Should be right\";\r\n } else if (leave_from.compareTo(sdf.parse(appliedOn)) < 0) {\r\n s=\"Start should be greater or equal to current date\";\r\n // } else if (overl > 0) {\r\n // s=\"already applied on given date\";\r\n } else {\r\n if (e.getMgr_id() == 0) {\r\n leaveStatus = \"APPROVED\";\r\n dao().apply_for_leave(empId, start_date, end_date, bal, leave_type, leaveStatus, leave_reason, appliedOn);\r\n s=\"Leave Applied Successfully...\";\r\n } else {\r\n leaveStatus = \"PENDING\";\r\n dao().apply_for_leave(empId, start_date, end_date, bal,\r\n leave_type, leaveStatus, leave_reason, appliedOn);\r\n edao().decrement(empId, bal);\r\n s = \"Leave Applied Successfully For \" + (days - count) + \" Days.\";\r\n }\r\n }\r\n } else {\r\n s=\"invalid employee\";\r\n }\r\n return s;\r\n }", "public double calculateAvgLeadTime() {\n Double totalLeadTime = 0.0;\n LinkedList<Card> completedCards = BoardManager.get().getCurrentBoard().getCardsOf(Role.COMPLETED_WORK);\n for (Card card : completedCards) {\n totalLeadTime += (int) DAYS.between(card.getCreationDate(versions), card.getCompletionDate(versions));\n }\n if (totalLeadTime == 0.0){\n return 0.0;\n }\n return Math.round(totalLeadTime/completedCards.size() * 100D) / 100D;\n }", "@SuppressWarnings(\"static-access\")\r\n\tprivate int calculateAge()\r\n\t{\r\n\t\tGregorianCalendar now = new GregorianCalendar();\r\n\t\tnow = new GregorianCalendar(now.YEAR, now.MONTH, now.DATE);//simplifys the date so there is no problem with times\r\n\t\tGregorianCalendar birthDay = new GregorianCalendar(now.YEAR, bDate.MONTH, bDate.DATE);\r\n\t\tint age = 0;\r\n\t\tif(now.before(birthDay) || now.equals(birthDay))\r\n\t\t{\r\n\t\t\tage = now.YEAR - bDate.YEAR;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tage = now.YEAR - bDate.YEAR;\r\n\t\t\tage--;\r\n\t\t}\r\n\t\treturn age;\r\n\t}", "public int getRemainingFees() {\n\t\treturn totalFees - feesPayed;\n\t}", "public int calculatingDailyWage() {\n\t\tsalary = workingHrs * wagePerHr;\n\t\treturn salary;\n\t}", "public boolean calcAge() {\n int age;\n boolean oldEnough = false;\n Calendar c = Calendar.getInstance();\n \n //getting todays date\n int thisYear = c.get(Calendar.YEAR);\n int thisMonth = c.get(Calendar.MONTH) + 1;\n int thisDay = c.get(Calendar.DAY_OF_MONTH);\n\n age = thisYear - yearDOB;\n if (age == 18 && thisMonth == monthDOB && thisDay < dayDOB) {\n age = 17;\n oldEnough = true;\n } else if (age < 18) {\n oldEnough = false;\n }\n return oldEnough;\n }", "public double getPaymentDue()\n\t{\n\t\tif(this.inProgress())\n\t\t{\n\t\t\tdouble start = ParkingRateUtil.calculateCost(this.clock.getTime()-this.currentTicket.getStartTime());\n\t\t\tdouble payed = ParkingRateUtil.calculateCost(this.currentTicket.getPaymentTime()-this.currentTicket.getStartTime());\n\t\t\tif(this.currentTicket.getPaymentTime() != 0)\n\t\t\t{\n\t\t\t\tif (this.clock.getTime()-this.currentTicket.getPaymentTime()>ParkingRateUtil.EXIT_TIME_LIMIT)\n\t\t\t\t{return start-payed;}\n\t\t\t\treturn payed;\n\t\t\t}\n\t\t\treturn start;\n\t\t}\n\t\treturn 0.0;\n\t}", "private void modifyDepositDue(PrintItinerary itinerary, String xslFormat) {\n\t\tif (xslFormat.equalsIgnoreCase(\"CUSTOMERFORMATBOOKING\")) {\n\t\t\t// long datediff = DateUtils.dateDifferenceInDays(itinerary\n\t\t\t// .getBookingHeader().getBookingDate(), itinerary\n\t\t\t// .getBookingHeader().getDepartureDate());\n\t\t\t// if (datediff <= 45) { //CQ#8927 - Condition added for equal to 45\n\n\t\t\t// for Holiday period 60 days and non holdiday persion 45 scenarion\n\t\t\t// both opt date and finalpayment date will be same\n\t\t\t// according to kim\n\t\t\tlong datediff = DateUtils.dateDifferenceInDays(itinerary\n\t\t\t\t\t.getBookingHeader().getOptionDate(), itinerary\n\t\t\t\t\t.getBookingHeader().getFinalDueDate());\n\t\t\tif (datediff == 0) { // CQ#8927 - Condition added for equal to 45\n\t\t\t\titinerary.getBookingHeader().setMinimumAmount(\n\t\t\t\t\t\titinerary.getBookingHeader().getTourPrice()\n\t\t\t\t\t\t\t\t- itinerary.getBookingHeader().getAmountPaid());\n\t\t\t}\n\t\t\t// CQ#8955 - Added for displaying Gross balance Due in Agent\n\t\t} else if (xslFormat.equalsIgnoreCase(\"AGENTFORMATBOOKING\")) {\n\t\t\tlong datediff = DateUtils.dateDifferenceInDays(itinerary\n\t\t\t\t\t.getBookingHeader().getBookingDate(), itinerary\n\t\t\t\t\t.getBookingHeader().getDepartureDate());\n\t\t\t// if (datediff > 45) {\n\t\t\titinerary.getBookingHeader().setGrossBalanceDue(\n\t\t\t\t\titinerary.getBookingHeader().getTourPrice()\n\t\t\t\t\t\t\t- itinerary.getBookingHeader().getAmountPaid());\n\t\t\t// }\n\n\t\t}\n\t}", "private double calculateYearlyLoyaltyPoints(int year){\n \tLoyalty txnLoyalty = compositePOSTransaction.getLoyaltyCard();\n\t\tif (txnLoyalty == null){\n\t\t\treturn 0.0;\n\t\t}else if(!txnLoyalty.isYearlyComputed()){\n\t\t\treturn 0.0;\n\t\t}\n\t\t\n\t\tif(com.chelseasystems.cr.swing.CMSApplet.theAppMgr!=null &&\n \t\t\tcom.chelseasystems.cr.swing.CMSApplet.theAppMgr.getStateObject(\"THE_TXN\") != null){\n \t\t// this is an inquiry\n\t\t\tif (year == 0) {\n\t\t\t\treturn txnLoyalty.getCurrYearBalance();\n\t\t\t} else {\n\t\t\t\treturn txnLoyalty.getLastYearBalance();\n\t\t\t}\n\t\t}\n\t\t\n\t\tdouble loyaltyUsed = compositePOSTransaction.getUsedLoyaltyPoints();\n\t\tdouble points = compositePOSTransaction.getLoyaltyPoints();\n\n\t\tdouble currBal = txnLoyalty.getCurrBalance();\n\t\tdouble currYearBal = txnLoyalty.getCurrYearBalance();\n\t\tdouble lastYearBal = txnLoyalty.getLastYearBalance();\n\t\tif (loyaltyUsed > 0) {\n\t\t\tif (txnLoyalty.getLastYearBalance() < loyaltyUsed) {\n\t\t\t\tcurrYearBal = currYearBal - (loyaltyUsed - lastYearBal);\n\t\t\t\tlastYearBal = 0.0;\n\t\t\t} else {\n\t\t\t\tlastYearBal -= loyaltyUsed;\n\t\t\t}\n\t\t\tcurrBal -= loyaltyUsed;\n\t\t} else {\n\t\t\tcurrBal -= loyaltyUsed;\n\t\t\tcurrYearBal -= loyaltyUsed;\n\t\t}\n\n\t\tif (txnLoyalty.isYearlyComputed()) {\n\t\t\tcurrYearBal += points;\n\t\t} else {\n\t\t\tcurrYearBal = 0.0;\n\t\t\tlastYearBal = 0.0;\n\t\t}\n\n\t\tif (year == 0) {\n\t\t\treturn currYearBal;\n\t\t} else {\n\t\t\treturn lastYearBal;\n\t\t}\n }", "public double getEarnings() {\n//\t\tif (hoursWorked > 40) {\n//\t\t\treturn (40 * hoursWorked) + \n//\t\t\t\t\t((hoursWorked - 40) * wagePerHour * 1.5);\n//\t\t} else {\n//\t\t\treturn hoursWorked * wagePerHour;\n//\t\t}\n\t\t\t\t// condition \n\t\treturn hoursWorked > 40 ? \n\t\t\t\t// condition true \n\t\t\t(40 * wagePerHour) + ((hoursWorked - 40) * wagePerHour * 1.5) \n\t\t\t\t// condition false\n\t\t\t: hoursWorked * wagePerHour;\t\n\t}", "public float calculateTotalFee(){\n int endD = parseInt(endDay);\n int startD = parseInt(startDay);\n int endM = parseInt(convertMonthToDigit(endMonth));\n int startM = parseInt(convertMonthToDigit(startMonth));\n int monthDiff = 0;\n float totalFee = 0;\n //get the stay duration in months\n monthDiff = endM - startM;\n \n System.out.println(\"CALCULATING TOTAL FEE:\");\n \n stayDuration = 1;\n if(monthDiff == 0){ //on the same month\n if(startD == endD){\n stayDuration = 1;\n }else if(startD < endD){ //Same month, diff days\n stayDuration = 1 + (parseInt(endDay) - parseInt(startDay));\n }\n }else if(monthDiff > 0){ //1 month difference\n \n if(startD > endD){ // End day is next month\n switch(startMonth){\n case \"January\": case \"March\": case \"May\": case \"July\": case \"August\": \n case \"October\": case \"December\":\n stayDuration = 1 + ( (31+ parseInt(endDay)) - parseInt(startDay));\n break;\n\n case \"April\": case \"June\": case \"September\": case \"November\":\n stayDuration = 1 + ((30+ parseInt(endDay)) - parseInt(startDay));\n break; \n \n case \"February\": \n stayDuration = 1 + ((29+ parseInt(endDay)) - parseInt(startDay));\n break; \n default:\n break;\n }\n }else if(startD <= endD){ //if end day is greater than start day\n switch(startMonth){\n case \"January\": case \"March\": case \"May\": case \"July\": case \"August\": \n case \"October\": case \"December\":\n stayDuration = 1 + ((parseInt(endDay)) - parseInt(startDay));\n stayDuration += 31;\n break;\n\n case \"April\": case \"June\": case \"September\": case \"November\":\n stayDuration = 1 + ( (parseInt(endDay)) - parseInt(startDay));\n stayDuration += 30;\n break; \n \n case \"February\": \n stayDuration = 1 + ( (parseInt(endDay)) - parseInt(startDay));\n stayDuration += 29;\n break; \n \n default:\n break;\n }\n }\n }else if(monthDiff < 0){\n if(startMonth == \"December\" && endMonth == \"January\"){\n if(startD > endD){ // End day is next month\n switch(startMonth){\n case \"January\": case \"March\": case \"May\": case \"July\": case \"August\": \n case \"October\": case \"December\":\n stayDuration = 1 + ( (31+ parseInt(endDay)) - parseInt(startDay));\n break;\n\n case \"April\": case \"June\": case \"September\": case \"November\":\n stayDuration = 1 + ((30+ parseInt(endDay)) - parseInt(startDay));\n break; \n\n case \"February\": \n stayDuration = 1 + ((29+ parseInt(endDay)) - parseInt(startDay));\n break; \n default:\n break;\n }\n }else{\n stayDuration = 1 + ((parseInt(endDay)) - parseInt(startDay));\n stayDuration += 31;\n }\n }\n }\n \n totalFee = (int) (getSelectedRoomsCounter() * getSelectedRoomPrice());\n totalFee *= stayDuration;\n \n //console log\n System.out.println(\"stayDuration: \"+ stayDuration);\n System.out.println(\"Total Fee: \" + totalFee +\"php\");\n return totalFee;\n }", "public double calculateSeverancePay() {\r\n severancePay = (2020 - yearOfStart) * 20 * 0.8;\r\n return severancePay;\r\n }", "int getStatus(){\n\t\tif(!daysUntilStarts.equals(0)){\n\t\t\treturn -1 * daysUntilStarts;\n\t\t}\n\t\treturn daysToRun;\n\t}", "public java.lang.Double getTotalOverdueAmount() {\n return totalOverdueAmount;\n }", "private Amount calculateDiscountAmount(SaleDTO saleAfterDiscount) {\n Amount runningTotalBeforeDiscount = saleState.getRunningTotal();\n Amount runningTotalAfterDiscount = saleAfterDiscount.getRunningTotal();\n Amount discountAmount = \n runningTotalBeforeDiscount.minus(runningTotalAfterDiscount);\n return discountAmount;\n }", "public void calculateEmpWage(int empHrs){\n \tint totalWorkingDays = 1;\n\tint totalWorkingHours = 0;\n\t/*\n\t*varable empAttendance tells if emp is present '0' or absent '1' on that day of the month\n\t*/\n\tint empAttendance;\n\t/*\n\t*variable monthlyWage stores the monthly wage of the employee\n\t*/\n int monthlyWage = 0;\n\t/*\n\t*variable daysPresent keeps count of the no of days present for a month\n\t*/\n\t int daysPresent = 0;\n\t /*\n\t *variable hoursWorked keeps count of the no of hours worked in a month\n\t */\n\t int hoursWorked = 0;\n\n\t while(true){\n\t Random rand = new Random();\n empAttendance = rand.nextInt(2);\n if(empAttendance == 0){\n daysPresent += 1;\n System.out.println(\"Day \"+totalWorkingDays+\": Present\");\n monthlyWage += CompanyEmpWage.getempRate() * empHrs;\n hoursWorked += empHrs;\n }\n else{\n System.out.println(\"Day \"+totalWorkingDays+\": Absent\");\n monthlyWage += 0;\n hoursWorked += 0;\n }\n if(totalWorkingDays == CompanyEmpWage.getnumOfDays() || !(totalWorkingHours < CompanyEmpWage.getmaxHrs())){\n if(totalWorkingDays == CompanyEmpWage.getnumOfDays()){\n System.out.println(CompanyEmpWage.getnumOfDays()+\" days are over!\");\n break;\n }\n else{\n System.out.println(CompanyEmpWage.getmaxHrs()+\" hours reached!\");\n break;\n }\n }\n\ttotalWorkingDays++;\n \ttotalWorkingHours += empHrs;\n }\n System.out.println(\"Company: \"+CompanyEmpWage.getcompName()+\"\\nNo of days worked out of \"+CompanyEmpWage.getnumOfDays()+\" days: \"+daysPresent+\"\\nNo of hours worked out of \"+CompanyEmpWage.getmaxHrs()+\" hours: \"+hoursWorked+\"\\nSalary for the month: \"+monthlyWage);\n }", "public float assess(Card card) {\n int grade = 0;\n \n List<Review> reviewList = card.getReviews();\n \n if(reviewList.isEmpty()) {\n grade = Professor.HAS_NEVER_BEEN_REVIEWED;\n } else {\n // TODO : vérifier que les noeuds \"review\" sont bien classés par date croissante\n if(!isSorted(reviewList)) System.out.println(\"Unsorted card detected : \" + card);\n \n for(Review review : reviewList) {\n if(review.getResult().equals(Review.RIGHT_ANSWER_STRING)) {\n grade++;\n } else {\n grade = 0;\n }\n }\n }\n \n return grade;\n }", "public double getBalanceDue(double paymentMade){\n balanceDue -= paymentMade;\n return balanceDue;\n }", "public double calculateRecall() {\n final long divisor = truePositive + falseNegative;\n if(divisor == 0) {\n return 0.0;\n } else {\n return truePositive / (double)divisor;\n }\n }", "public boolean isOverDue() {\n\t\treturn state == loanState.overDue; //changed 'StAtE' to 'state' and lOaN_sTaTe.OVER_DUE to loanState.overDue\r\n\t}", "public static void calculateDailyEmpWage()\n {\n\t\tint salary = 0;\n\t\tif(isPresent()){\n\t\t\tint empRatePerHr = 20;\n int PartTimeHrs = 4;\n salary = PartTimeHrs * empRatePerHr;\n\t\t\tSystem.out.println(\"Daily Part time Wage:\" +salary);\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(\"Daily Wage:\" +salary);\n\t\t}\n }", "public void wagesTillCondition() {\n\t\twhile (true) {\n\t\t\tcheckAttendance();\n\t\t\tcalculatingDailyWage();\n\t\t\ttotalHrs = totalHrs + workingHrs;\n\t\t\ttotalDays = totalDays + 1;\n\t\t\ttotalSalary = totalSalary + salary;\n\t\t\tif (totalHrs == 100 || totalDays == 20) {\n\t\t\t\tSystem.out.println(totalSalary);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public double minimumDue(){\n return ((this.creditHours*this.feePerCreditHour)-this.scholarshipAmount+((this.healthInsurancePerAnnum*4)/12))/2;\n }", "public int getLBR_ProtestDays();", "private double checkCabProfitMargin(BookingRequest bookingRequest, Cab cabDetail) {\n\t\tInteger distanceFromCabToPickUpPoint = Utils.calculateDistance(cabDetail.getInitialLocation(), bookingRequest.getPickUpArea());\n\t\tInteger distanceFromPickUpToDropPoint = Utils.calculateDistance(bookingRequest.getPickUpArea(), bookingRequest.getDropArea());\n\t\tint totalCostIncurredByCompany = (distanceFromCabToPickUpPoint + distanceFromPickUpToDropPoint) * Constants.COMPANY_COST_PER_KM;\n\t\tint tripCostCharged = distanceFromPickUpToDropPoint * Constants.CHARGED_COST_PER_KM;\n\t\tdouble profitMargin = (tripCostCharged - totalCostIncurredByCompany)*100 / tripCostCharged ;\n\t\tif (profitMargin >= 20) {\n\t\t\treturn profitMargin;\n\t\t}\n\t\treturn -1;\n\t}", "boolean hasRemainDays();", "public double getStaySuccessRate() {\n if (total_stayed == 0)\n return 0;\n return (double) won_stayed / total_stayed * 100;\n }", "double calculateOvertime(double hoursWorked){\n\t\tif(hoursWorked<getNormalWorkweek()){\n\t\t\treturn(0.0);\n\t\t}else{\n\t\t\treturn((getHourlyRate()*2)*(hoursWorked-getNormalWorkweek()));\n\t\t}\n\t}", "public static double resolveBackOrders(BookData bookInfo){\n\n int currentStock = bookInfo.getBook().getStock();\n double newSales = 0;\n\n // If there are back orders resolve them in order\n // of oldest to most recent\n\n while (bookInfo.areThereBackOrders() ) {\n BackOrder oldestBKOD = bookInfo.getOldestBackOrder();\n\n boolean backOrderFilled = true;\n\n // If new stock is not enough to resolve back order,\n // send all new stock to customer\n if (currentStock - oldestBKOD.getNumOrders() < 0){\n oldestBKOD.changeNumOrders(currentStock);\n\n // Print notification to Screen about\n // oldest back order being partially satisfied\n System.out.print(\"Back order filled \");\n newSales += orderDescription(currentStock, bookInfo,\n oldestBKOD.getCustomerNum(), backOrderFilled);\n\n bookInfo.getBook().changeStock(-1*currentStock);\n break;\n\n // Otherwise resolve back order\n } else {\n // Update Stock of specified book\n int booksSent = oldestBKOD.getNumOrders();\n currentStock -= booksSent;\n bookInfo.getBook().changeStock(-1*booksSent);\n\n // Print notification to Screen\n // about oldest back order being satisfied\n System.out.print(\"Back order filled \");\n newSales += orderDescription(booksSent, bookInfo,\n oldestBKOD.getCustomerNum(), backOrderFilled);\n\n // Delete oldest back order\n bookInfo.terminateOldestBackOrder();\n }\n }\n // Return revenue from sales if any\n return newSales;\n }", "long getTotalDoExamTime();", "public int getLBR_LatePaymentPenaltyDays();", "public int getMonthsPast(){\n\t\tCalendar calendar = Calendar.getInstance();\n\t\tint c_month = calendar.get(Calendar.MONTH);\n\t\tint c_day = calendar.get(Calendar.DAY_OF_MONTH);\n\t\tString[] date = start_date.split(\"-\");\n\t\tint month = Integer.parseInt(date[1]);\n\t\tint day = Integer.parseInt(date[2]);\n\t\t\n\t\tint current_count = c_day;\n\t\tint client_count = day;\n\t\t\n\t\tswitch (c_month - 1){\n\t\tcase 11:\n\t\t\tcurrent_count += 31;\n\t\tcase 10: \n\t\t\tcurrent_count += 30;\n\t\tcase 9:\n\t\t\tcurrent_count += 31;\n\t\tcase 8:\n\t\t\tcurrent_count += 30;\n\t\tcase 7:\n\t\t\tcurrent_count += 31;\n\t\tcase 6:\n\t\t\tcurrent_count += 31;\n\t\tcase 5: \n\t\t\tcurrent_count += 30;\n\t\tcase 4: \n\t\t\tcurrent_count += 31;\n\t\tcase 3:\n\t\t\tcurrent_count += 30;\n\t\tcase 2: \n\t\t\tcurrent_count += 31;\n\t\tcase 1: \n\t\t\tcurrent_count += 28;\n\t\tcase 0: \n\t\t\tcurrent_count += 31;\n\t\t\tbreak;\n\t\t\t\n\t}\n\t\n\t\tswitch (month - 2){\n\t\tcase 11:\n\t\t\tclient_count += 31;\n\t\tcase 10: \n\t\t\tclient_count += 30;\n\t\tcase 9:\n\t\t\tclient_count += 31;\n\t\tcase 8:\n\t\t\tclient_count += 30;\n\t\tcase 7:\n\t\t\tclient_count += 31;\n\t\tcase 6:\n\t\t\tclient_count += 31;\n\t\tcase 5: \n\t\t\tclient_count += 30;\n\t\tcase 4: \n\t\t\tclient_count += 31;\n\t\tcase 3:\n\t\t\tclient_count += 30;\n\t\tcase 2: \n\t\t\tclient_count += 31;\n\t\tcase 1: \n\t\t\tclient_count += 28;\n\t\tcase 0: \n\t\t\tclient_count += 31;\n\t\t\tbreak;\n\t}\n\t\t\n\treturn current_count-client_count;\n\t}", "public void confirmBooking(){\n double ticketPrice = 56.0;\n double mealPrice = 30.0;\n if (student || child )\n ticketPrice = ticketPrice/2;\n else\n ticketPrice = ticketPrice*0.8;\n \n if (child )\n mealPrice = mealPrice/2;\n else\n mealPrice = mealPrice*0.9;\n double totalPrice = ticketPrice + mealPrice;\n System.out.println(getName()+\"\\nTicket price:$\"+ticketPrice+\"\\nMeal Price:$\"+mealPrice+\"\\nTotal price:$\"+totalPrice+\"\\nConfirm booking for \"+getName()+\" (Y/N)\");\n setBooked();\n System.out.println(getBooked()+\"\\n\\n\");\n }", "public Integer getOverdueDays() {\n return overdueDays;\n }", "public static int dailyEmpWage()\n {\n\tif(IS_FULL_TIME()){\n\t\twage = WagePerHrs * FullDayHrs;\n\t}\n wage = WagePerHrs * FullDayHrs/2;\n return wage;\n }", "public static int getPointsEarned(int numberOfBooksPurchased) {\r\n if (numberOfBooksPurchased < 1) {\r\n return 0;\r\n } else if (numberOfBooksPurchased == 1) {\r\n return 5;\r\n } else if (numberOfBooksPurchased == 2) {\r\n return 15;\r\n } else if (numberOfBooksPurchased == 3) {\r\n return 30;\r\n } else {\r\n return 60;\r\n }\r\n }", "public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n int[] dueDate = new int[3];\n int[] returned = new int[3];\n \n for(int ii = 0; ii < 3; ii++)\n returned[ii] = in.nextInt();\n \n for(int ii = 0; ii < 3; ii++)\n dueDate[ii] = in.nextInt();\n \n System.out.println(calculateFine(dueDate, returned));\n }", "void aDayPasses(){\n\t\t\n\t\t/**\n\t\t * Modify wait time if still exists\n\t\t */\n\t\tif(!daysUntilStarts.equals(0)){\n\t\t\tdaysUntilStarts--;\n\t\t\tif((!hasInstructor() || getSize() == 0) && daysUntilStarts.equals(0)){\n\t\t\t\tif(hasInstructor())\n\t\t\t\t\tinstructor.unassignCourse();\n\t\t\t\tfor(Student student : enrolled){\n\t\t\t\t\tstudent.dropCourse();\n\t\t\t\t}\n\t\t\t\tsubject.unassign();\n\t\t\t\tinstructor = null;\n\t\t\t\tenrolled = new ArrayList<Student>();\n\t\t\t\tcancelled = true;\n\t\t\t} else if (daysUntilStarts.equals(0)) {\n\t\t\t\tsubject.unassign();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t/**\n\t\t * Modify run time if still exists\n\t\t */\n\t\tif(!daysToRun.equals(0)){\n\t\t\tdaysToRun--;\n\t\t}\n\t\t/**\n\t\t * If couse finished un-assigned people from it\n\t\t */\n\t\tif(daysToRun.equals(0) && !finished){\n\t\t\tfor(Student student : enrolled){\n\t\t\t\tstudent.graduate(subject);\n\n\t\t\t}\n\t\t\tinstructor.unassignCourse();\n\t\t\tinstructor = null;\n\t\t\tfinished = true;\n\t\t}\n\t}", "@Override\n public Integer checkbookIssuance(Tbcheckbook tbcheckbook) {\n try {\n System.out.println(\"CHECK BOOK ACCOUNT NO : \"+tbcheckbook.getCheckbkaccountno());\n if(tbdepositJPARepository.countByAccountNo(tbcheckbook.getCheckbkaccountno()) > 0) {\n if (tbcheckbookJPARepository.countByCheckbkaccountnoAndCheckbookno(tbcheckbook.getCheckbkaccountno(),\n tbcheckbook.getCheckbookno()) > 0) {\n return 1;\n\n } else if(tbcheckbookJPARepository.findTopByCheckbkaccountnoAndEndchknoGreaterThanEqual(tbcheckbook.getCheckbkaccountno()\n ,tbcheckbook.getStartchkno())!=null){\n return 3;\n } else {\n tbcheckbookJPARepository.save(tbcheckbook);\n return 2;\n }\n }\n return 0;\n } catch (Exception e) {\n logger.error(\"Checkbook Issuance Error : \", e.getMessage(), e);\n }\n return null;\n }", "public double earnings() {\r\n double earnings;\r\n double overtime;\r\n double overtimeRate = hourlyRate * 1.5;\r\n\r\n // if hours, hourlyRate, or salary is negative (default numerical values are -1) earnings is -1\r\n if (hours < 0 || hourlyRate < 0 || salary < 0) {\r\n earnings = -1;\r\n }\r\n else if (hours > 40) {\r\n overtime = (hours - 40) * overtimeRate;\r\n earnings = overtime + salary;\r\n }\r\n else {\r\n earnings = salary;\r\n }\r\n\r\n return earnings;\r\n }", "public boolean checkPastDate(boolean said)\n {\n try\n {\n if( date==null ){\n if(this.getDateString()!=null) date = DateHelper.stringToDate(this.getDateString());\n if(super.isMandatory() && date==null)\n {\n message = FacesHelper.getBundleMessage(\"validator_dateformat\", new Object[]{Constants.CommonFormat.DATE_FORMAT_TIP});\n return false;\n } }\n\n }\n catch (Exception e)\n {\n message = FacesHelper.getBundleMessage(\"validator_dateformat\", new Object[]{Constants.CommonFormat.DATE_FORMAT_TIP});\n return false;\n }\n\n if(date==null)\n {\n if(said)\n {\n super.setMessage(\"Date is no correct\");\n }\n return false;\n }\n if(!date.before(currentDate))\n {\n if(said)\n {\n super.setMessage(\"Date is no correct\");\n }\n return false;\n\n }\n else\n {\n return true;\n }\n }", "private Boolean calculateTotalEmission() {\n\t\ttry {\n\n\t\t\tfoodCO2E = Double.valueOf(JTFFood.getText().isEmpty() ? \"0.0\" : JTFFood.getText())\n\t\t\t\t\t* energySourceDetail.get(FoodIntake).get(JCBFoodUnit.getSelectedItem().toString());\n\n\t\t\tlandfillingFoodWasteCO2E = Double\n\t\t\t\t\t.valueOf(JTFLandfillingFoodWaste.getText().isEmpty() ? \"0.0\" : JTFLandfillingFoodWaste.getText())\n\t\t\t\t\t* energySourceDetail.get(LandfillingFoodWaste)\n\t\t\t\t\t\t\t.get(JCBLandfillingFoodWasteUnit.getSelectedItem().toString());\n\n\t\t\tcompostingFoodWasteCO2E = Double\n\t\t\t\t\t.valueOf(JTFCompostingFoodWaste.getText().isEmpty() ? \"0.0\" : JTFCompostingFoodWaste.getText())\n\t\t\t\t\t* energySourceDetail.get(CompostingFoodWaste)\n\t\t\t\t\t\t\t.get(JCBCompostingFoodWasteUnit.getSelectedItem().toString());\n\n\t\t} catch (NumberFormatException ne) {\n\t\t\tSystem.out.println(\"Number Format Exception while calculating House Hold Emission\" + ne);\n\t\t\treturn false;\n\t\t}\n\t\t//\n\t\ttotalFoodCO2E = foodCO2E + landfillingFoodWasteCO2E + compostingFoodWasteCO2E;\n\t\ttotalFoodCO2E = Math.round(totalFoodCO2E * 100D) / 100D;\n\t\treturn true;\n\t}", "private void onOK() {\n String borrowDateString = Borrowed.getSelectID();\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\");\n try {\n Date borrowDate = sdf.parse(borrowDateString);\n Calendar calendar = Calendar.getInstance();\n calendar.setTime(borrowDate);\n calendar.add(Calendar.MONTH, 3);\n long shouldReturn = calendar.getTimeInMillis();\n long returnDate = System.currentTimeMillis();\n long betweenDays = (returnDate - shouldReturn) / (1000 * 60 * 60 * 24);\n if (betweenDays > 0) {\n JOptionPane.showMessageDialog(this, \"请缴费\" + betweenDays * 0.2f + \"元\", \"提示\", JOptionPane.WARNING_MESSAGE);\n BorrowedDao borrowedDao = new BorrowedDao();\n try {\n borrowedDao.returnBook(Reader.getSelectID(), Book.getSelectID(), Borrowed.getSelectID(), true);\n JOptionPane.showMessageDialog(this, \"还书成功\", \"提示\", JOptionPane.WARNING_MESSAGE);\n dispose();\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n JOptionPane.showMessageDialog(this, \"还书失败\", \"提示\", JOptionPane.WARNING_MESSAGE);\n } catch (SQLException e) {\n e.printStackTrace();\n JOptionPane.showMessageDialog(this, \"还书失败\", \"提示\", JOptionPane.WARNING_MESSAGE);\n }\n } else {\n BorrowedDao borrowedDao = new BorrowedDao();\n try {\n borrowedDao.returnBook(Reader.getSelectID(), Book.getSelectID(), Borrowed.getSelectID(), true);\n JOptionPane.showMessageDialog(this, \"还书成功\", \"提示\", JOptionPane.WARNING_MESSAGE);\n dispose();\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n JOptionPane.showMessageDialog(this, \"还书失败\", \"提示\", JOptionPane.WARNING_MESSAGE);\n } catch (SQLException e) {\n e.printStackTrace();\n JOptionPane.showMessageDialog(this, \"还书失败\", \"提示\", JOptionPane.WARNING_MESSAGE);\n }\n }\n } catch (ParseException e) {\n e.printStackTrace();\n }\n }", "private void calcBills() {\n\t\tint changeDueRemaining = (int) this.changeDue;\n\n\t\tif (changeDueRemaining >= 20) {\n\t\t\tthis.twenty += changeDueRemaining / 20;\n\t\t\tchangeDueRemaining = changeDueRemaining % 20;\n\t\t}\n\t\tif (changeDueRemaining >= 10) {\n\t\t\tthis.ten += changeDueRemaining / 10;\n\t\t\tchangeDueRemaining = changeDueRemaining % 10;\n\t\t}\n\t\tif (changeDueRemaining >= 5) {\n\t\t\tthis.five += changeDueRemaining / 5;\n\t\t\tchangeDueRemaining = changeDueRemaining % 5;\n\t\t}\n\t\tif (changeDueRemaining >= 1) {\n\t\t\tthis.one += changeDueRemaining;\n\t\t}\n\t}", "public static int diasParaFecha(Date fechafin) {\n try {\n System.out.println(\"Fecha = \" + fechafin + \" / \");\n GregorianCalendar fin = new GregorianCalendar();\n fin.setTime(fechafin);\n System.out.println(\"fin=\" + CalendarToString(fin, \"dd/MM/yyyy\"));\n GregorianCalendar hoy = new GregorianCalendar();\n System.out.println(\"hoy=\" + CalendarToString(hoy, \"dd/MM/yyyy\"));\n\n if (fin.get(Calendar.YEAR) == hoy.get(Calendar.YEAR)) {\n System.out.println(\"Valor de Resta simple: \"\n + String.valueOf(fin.get(Calendar.DAY_OF_YEAR)\n - hoy.get(Calendar.DAY_OF_YEAR)));\n return fin.get(Calendar.DAY_OF_YEAR)\n - hoy.get(Calendar.DAY_OF_YEAR);\n } else {\n int diasAnyo = hoy.isLeapYear(hoy.get(Calendar.YEAR)) ? 366\n : 365;\n int rangoAnyos = fin.get(Calendar.YEAR)\n - hoy.get(Calendar.YEAR);\n int rango = (rangoAnyos * diasAnyo)\n + (fin.get(Calendar.DAY_OF_YEAR) - hoy\n .get(Calendar.DAY_OF_YEAR));\n System.out.println(\"dias restantes: \" + rango);\n return rango;\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n return 0;\n }", "public long differenceBetweenDates(Date uno, Date due) {\r\n Calendar c1 = Calendar.getInstance();\r\n Calendar c2 = Calendar.getInstance();\r\n c1.setTime(uno);\r\n c2.setTime(due);\r\n\r\n long giorni = (c2.getTime().getTime() - c1.getTime().getTime()) / (24 * 3600 * 1000);\r\n\r\n return giorni;\r\n }", "public long getScoreEssay(Essay essay, String answer)\n {\n return 0;\n }", "private static String waitingForTheYear(String userAnswer)\n {\n int year;\n try {\n year = Integer.parseInt(userAnswer);\n }catch(NumberFormatException nfe) {\n return String.format(fWRONG_INTEGER + fONCE_MORE, fYEAR);\n }\n State.setConversation(false);\n\n int thisYear = LocalDate.now().getYear();\n int countedAge = thisYear - year;\n if (Math.abs(age - countedAge) > 1) {\n return String.format(fDOES_NOT_MATCH + fNOT_ALLOWED,\n age, year, drink.getName());\n }\n State.setMajor(true);\n Apartment.getInstance().getCurrentSpace().removeItem(drink);\n Hands .getInstance().tryAddItem(drink);\n return mBELIEVE + mTAKEN_FROM_IB + drink.getName() + mDO_NOT_FORGET;\n }", "double getTotalProfit();", "public int getTotalEarnings() {\r\n\t\tint total = 0;\r\n\t\tfor (int i = 0; i < this.receiptissued.size(); i++) {\r\n\t\t\ttotal = total + this.receiptissued.get(i).getPrice();\r\n\t\t}\r\n\t\treturn total;\r\n\r\n\t}", "public double calculateExpectedDisagreement();", "public java.lang.Integer getTotalOverdueCount12M() {\n return totalOverdueCount12M;\n }", "public void calculateVacationDays(){\n }", "Double getTotalSpent();", "@Override\n public double calculatePay(double nmHrs) {\n //52 weeks in a year and 40 hours per week\n double hrRate = getSalary() / (40*52);\n //calculate their weekly pay\n double paycheck = 40 * hrRate;\n //determine if they worked overtime and calculate it\n if (nmHrs > 40) {\n double OT = nmHrs - 40;\n double OTMoney = OT * (hrRate*1.5);\n return OTMoney + paycheck;\n }\n //else return their normal weekly paycheck\n else {\n return paycheck;\n }\n\n }", "public double calculatePay() {\n\t\treturn 0;\r\n\t}", "public boolean isDeviceOverdue() throws DateFormatException {\r\n \tString today = Helper.getCurrentDate();\r\n \tString due = this.rentSettings.getDueDate();\r\n \tSystem.out.println(\"Duedate \" + due);\r\n \tboolean good = Helper.isValidDate(due);\r\n \tif(good) {\r\n \t\tif(Helper.timeDifference(today, due) < 0) {\r\n \t\t\tSystem.out.println(\"Device \" + this + \" is Overdue\");\r\n \t\t\treturn true;\r\n \t\t}\r\n \t\telse \r\n \t\t\tSystem.out.println(\"Device \" + this + \" is NOT overdue yet\");\r\n \t}\r\n return false;\r\n }", "float getVacationAccrualRate();", "Date getDueDate();", "Date getDueDate();", "public interface IBook {\n\n // Returns the number of days that the book is overdue\n public int daysOverdue(int today);\n\n // Is the book overdue?\n public boolean isOverdue(int today);\n\n // returns the price of the fine for an overdue book in cents\n public int computeFine(int today);\n\n}", "public int calculateantiquity() {\r\n\t\tint calculateantiquity = this.getHiring_date().substractdatesystem();\r\n\t\treturn calculateantiquity;\r\n\t}", "private void calcCoins() {\n\t\tint changeDueRemaining = (int) Math.round((this.changeDue - (int) this.changeDue) * 100);\n\n\t\tif (changeDueRemaining >= 25) {\n\t\t\tthis.quarter += changeDueRemaining / 25;\n\t\t\tchangeDueRemaining = changeDueRemaining % 25;\n\t\t}\n\t\tif (changeDueRemaining >= 10) {\n\t\t\tthis.dime += changeDueRemaining / 10;\n\t\t\tchangeDueRemaining = changeDueRemaining % 10;\n\t\t}\n\t\tif (changeDueRemaining >= 5) {\n\t\t\tthis.nickel += changeDueRemaining / 5;\n\t\t\tchangeDueRemaining = changeDueRemaining % 5;\n\t\t}\n\t\tif (changeDueRemaining >= 1) {\n\t\t\tthis.penny += changeDueRemaining / 1;\n\t\t}\n\t}", "public double usageCost() {\r\n double totalCost = 0;\r\n for (Booking aBooking: getBookings()) {\r\n long diff = (aBooking.getDateTo().getTime() \r\n - aBooking.getDateFrom().getTime());\r\n int noOfDays = (int) ((diff / (1000 * 60 * 60 * 24)) + 1);\r\n totalCost += noOfDays * 50;\r\n }\r\n return totalCost;\r\n }", "public java.lang.Integer getTotalOverdueCount12M30D() {\n return totalOverdueCount12M30D;\n }", "public static double calculateEmployeeBonus(int employeeSalaryForBenefits, int numberOfYearsWithCompany, String employeePerformance) {\n double total = 0;\n\n try {\n Scanner stdin = new Scanner(System.in);\n System.out.println(\"Please enter start date in format (example: May,2015): \");\n String joiningDate = stdin.nextLine();\n System.out.println(\"Please enter today's date in format (example: August,2017): \");\n String todayDate = stdin.nextLine();\n String convertedJoiningDate = DateConversion.convertDate(joiningDate);\n String convertedTodayDate = DateConversion.convertDate(todayDate);\n\n String[] actualDateToday = convertedTodayDate.split(\"/\");\n String[] actualJoiningDate = convertedJoiningDate.split(\"/\");\n\n numberOfYearsWithCompany = Integer.valueOf(actualDateToday[1]) - Integer.valueOf(actualJoiningDate[1]);\n\n if (Integer.valueOf(actualJoiningDate[0]) > Integer.valueOf(actualDateToday[0])) {\n numberOfYearsWithCompany--;\n }\n\n System.out.println(\"Please enter this year's performance, as indicated by HR: \");\n employeePerformance = stdin.nextLine();\n stdin.close();\n\n if (numberOfYearsWithCompany >= 1) {\n if (employeePerformance.equals(\"Excellent\")) {\n total = (employeeSalaryForBenefits * 0.15);\n } else if (employeePerformance.equals(\"Good\")) {\n total = (employeeSalaryForBenefits * 0.10);\n } else if (employeePerformance.equals(\"Average\")) {\n total = (employeeSalaryForBenefits * 0.05);\n } else if (employeePerformance.equals(\"Bad\")) {\n total = 0;\n }\n }\n }\n catch (Exception e) {\n e.printStackTrace();\n }\n System.out.println(\"This will be the yearly bonus for this Employee's performance: \" + total);\n return total;\n }", "public long calculateNumberOfDaysAbsentInclusive(LocalDate startDate, LocalDate endDate) {\n\t\tlong businessDays = 0;\n\t\tlong numDaysBetween = ChronoUnit.DAYS.between(startDate, endDate);\n\t\t\t\t\n\t\tif(numDaysBetween > 0) {\n\t\t\tbusinessDays = IntStream.iterate(0, i -> i + 1).limit(numDaysBetween).mapToObj(startDate::plusDays)\n\t\t\t\t.filter(d -> Stream.of(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY)\n\t\t\t\t.anyMatch(d.getDayOfWeek()::equals)).count() + 1;\n\t\t}\n\t\treturn businessDays;\n\t}", "double getTodaysExpenditureAmount() {\n Long time = new Date().getTime();\n Date date = new Date(time - time % (DAY_DURATION));\n return getExpenditureAmount(date.getTime(), date.getTime() + (DAY_DURATION));\n }", "public double calculateWeeklyPay(){\r\n double weeklyPay = salary / 52.0;\r\n return weeklyPay;\r\n }", "private double getTimeRemainingInUTCDay(){\n\t\tdouble daysLeftInDay;\n\n\t\tInstant origin = Instant.ofEpochMilli (cur_mainshock.getOriginTime());\n\t\tZonedDateTime zdt = ZonedDateTime.ofInstant (origin, ZoneOffset.UTC);\n\t\tZonedDateTime zdt2 = zdt.toLocalDate().atStartOfDay (ZoneOffset.UTC);\n\t\tInstant daybreak = zdt2.toInstant();\n\n//\t\tSimpleDateFormat formatter=new SimpleDateFormat(\"d MMM yyyy, HH:mm:ss\");\n//\t\tformatter.setTimeZone(utc); //utc=TimeZone.getTimeZone(\"UTC\"));\n//\t\tSystem.out.println(formatter.format(Date.from (origin)));\n//\t\tSystem.out.println(formatter.format(Date.from (daybreak)));\n\t\t\n\t\tdaysLeftInDay = 1.0 - ((double)(origin.toEpochMilli() - daybreak.toEpochMilli()))/ComcatOAFAccessor.day_millis;\n\t\tif (daysLeftInDay == 1.0) {\n\t\t\tdaysLeftInDay = 0.0;\n\t\t}\n\t\treturn daysLeftInDay;\n\t}", "float getVacationAccrued();", "public Double amountDueForPayment() {\n DecimalFormat df = new DecimalFormat(\"#.##\");\n int numGroupMembers = AppVariables.currentUser.getGroup().getGroupMembers().size();\n\n // if payment made by current user, should be amount owed\n // which is the payment amount - (payment amount) / #groupmembers\n if (username.equals(AppVariables.currentUser.getUsername())) {\n return Double.valueOf(df.format(amountSpent- amountSpent/numGroupMembers));\n }\n\n return Double.valueOf(df.format(amountSpent/numGroupMembers));\n\n\n }", "public Event validateBooking(RequestContext context) {\n\tBooking booking = (Booking) context.getFlowScope().get(\"booking\");\n\tCalendar calendar = Calendar.getInstance();\n\tcalendar.add(Calendar.DAY_OF_MONTH, -1);\n\tif (booking.getCheckinDate().before(calendar.getTime())) {\n\t context.getMessageContext().addMessage(\n\t\t Messages.text(\"checkinDate\", \"Check in date must be a future date\", Severity.ERROR));\n\t return error();\n\t} else if (!booking.getCheckinDate().before(booking.getCheckoutDate())) {\n\t context.getMessageContext().addMessage(\n\t\t Messages.text(\"checkoutDate\", \"Check out date must be later than check in date\", Severity.ERROR));\n\t return error();\n\t}\n\treturn success();\n }" ]
[ "0.666968", "0.65092456", "0.65043056", "0.6349197", "0.623443", "0.6213834", "0.6101497", "0.6049595", "0.60315436", "0.6022928", "0.59393203", "0.5922744", "0.5918265", "0.5872377", "0.5862315", "0.58087456", "0.5780274", "0.56260926", "0.5619487", "0.5612162", "0.56078887", "0.5606358", "0.5549158", "0.5540977", "0.5509122", "0.5464185", "0.54271483", "0.5423266", "0.54153395", "0.54039747", "0.5395869", "0.5395454", "0.53922176", "0.5359708", "0.5358549", "0.5357351", "0.53528607", "0.5350831", "0.5305411", "0.5296656", "0.52925605", "0.5289991", "0.5289349", "0.5285892", "0.5277736", "0.52738595", "0.5260612", "0.5256893", "0.5255941", "0.52534", "0.5253373", "0.52473205", "0.5237607", "0.52270174", "0.52059287", "0.5204907", "0.5204369", "0.5201306", "0.5192265", "0.51891506", "0.5183036", "0.5178815", "0.51784223", "0.5175379", "0.5175161", "0.51646084", "0.51583904", "0.5155738", "0.5151109", "0.51447034", "0.51381373", "0.5133761", "0.51320505", "0.5131544", "0.512558", "0.51242906", "0.51188475", "0.5111235", "0.51010793", "0.5097813", "0.5091861", "0.50914764", "0.50865763", "0.50817555", "0.5074076", "0.5066546", "0.5066546", "0.5060204", "0.5050809", "0.504629", "0.50462306", "0.5032346", "0.5024404", "0.5021653", "0.5017568", "0.50120765", "0.50085217", "0.50048894", "0.49980232", "0.49870056" ]
0.782119
0
/Authenticates if username and password combination entered is correct
private static boolean authenticateUser(String username_input, String password_input){ if(!username_input.equals(USERNAME) || !password_input.equals(PASSWORD)){ System.out.println("Invalid Credentials Entered!"); return false; } else //username and password entered were correct System.out.println("User Credentials Authenticated! Please wait while books and students are being loaded."); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean authenticate(String userName, String password);", "@Override\n\tpublic boolean isUserAuthenticate(String username, String password) {\n\t\t// validate username and pwd with predefined credentials\n\t\tif (username.equals(Utility.USERNAME) && password.equals(Utility.PASSWORD)) {\n\t\t\treturn true;\n\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public abstract boolean checkCredentials (String username, String password);", "boolean validateUserAndPassword(String username, String password);", "public static boolean authenticate(String username, String password) {\n\t\tif (username.equals(\"admin\") && password.equals(\"secret\"))\r\n\t\t\treturn true;\r\n\t\telse if (username.equals(\"user1\") && password.equals(\"1111\"))\r\n\t\t\treturn true;\r\n\t\treturn false;\r\n\t}", "public Boolean authentication(String username, String password) \n\t{\n\t\n\t switch (username) {\n\t case \"FS_UTO_CoE_Sreenivas\":\n\t \t\t\tif (year<=2018)\n\t \t\t\tpassorfail=password.equals(\"q2m!x:dCk6FaG$Ec\");\n\t \t\t\t\tbreak;\n\t// case \"FS_BAN_ANZ_DIGITAL_GANESH\": \n\t//\t\t \t\t\tpassorfail=password.equals(\"q`r^8{De,Sn*!KU_\");\n\t//\t\t \t\t\t\tbreak;\t\t \t\t\t\t\n\t default: \n\t\t\t\t\t\t\tpassorfail = false; \n\t\t\t\t\t\t\tbreak; \t\t \n\t\t}\n\t\treturn passorfail;\n\n\t}", "boolean isValidCredential(String username, String password);", "public boolean authenticate(String username, String password, HttpServletRequest request){\n try {\n MySQLService sql = new MySQLService();\n String digest = DigestUtils.md5Hex(password);\n boolean isMatched = sql.checkMatch(username, digest);\n System.out.println(isMatched);\n if (isMatched) {\n request.getSession().setAttribute(\"username\", username);\n return true;\n } else {\n return false;\n }\n }catch (Exception e){\n System.out.println(e);\n\n }\n return false;\n }", "boolean isAuthenticate(String username, String password) throws UserDaoException;", "private static boolean authenticate(String username, String password) {\r\n\t\tFile file = new File(\"auth.txt\");\r\n\t\tScanner scanner;\r\n\t\tString user = null;\r\n\t\tString pwd = null;\r\n\t\ttry {\r\n\t\t\tscanner = new Scanner(file);\r\n\t\t\tString nextLine = scanner.nextLine();\r\n\t\t\tString[] parts = nextLine.split(\"=\");\r\n\t\t\tuser = parts[0];\r\n\t\t\tpwd = parts[1];\r\n\t\t\tscanner.close();\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn (username.equals(user) && password.equals(pwd));\r\n\t\t\r\n\t}", "private boolean authenticatedUser(String uName, String pass) {\n\t\treturn true;\n\t}", "private void authenticate(String user, String pass) {\n }", "Boolean isValidUserPassword(String username, String password);", "public boolean ValidCredentials() { \n\t\tif(!isEmptyFieldData()){\n\t\t\tSystemUserQuery sq = new SystemUserQuery();\n\t\t\tUser user = sq.loginQuery(getUsername(), getPassword());\n\t\t\t\n\t\t\tif(user != null){\n\t\t\t\tMain.setCurrentUser(user);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t\treturn false;\n\t}", "public static boolean login(Context ctx) {\n\t\t\n\t\tString username = ctx.formParam(\"username\");\n\t\tString password = ctx.formParam(\"password\");\n\t\t\n\t\tSystem.out.println(username);\n\t\tSystem.out.println(password);\n\t\t\n\t\tif(username.equals(\"user\") && password.equals(\"pass\")) {\n\t\t\tctx.res.setStatus(204);\n\t\t\tctx.sessionAttribute(\"user\", new User(\"McBobby\",true));\n\t\t\treturn true;\n\t\t}else {\n\t\t\t\n\t\t\tctx.res.setStatus(400);\n\t\t\tctx.sessionAttribute(\"user\", new User(\"fake\",false));\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t\n//\t\tctx.queryParam(password); /authenticate?password=value\n//\t\tctx.pathParam(password); /authenticate/{password}\n\t}", "private void authenticateAction() {\n if (requestModel.getUsername().equals(\"superuser\")\n && requestModel.getPassword().equals(\"\")) {\n Collection<Webres> webres = getAllWebres();\n proceedWhenAuthenticated(new User(null, null, null, \"superuser\", \"\", null) {\n @Override\n public Collection<Webres> getAllowedResources() {\n return webres;\n }\n @Override\n public ActionController getDefaultController() {\n return ActionController.EMPLOYEES_SERVLET;\n }\n });\n return;\n }\n \n // try to authenticate against other credentials from the database\n Optional<User> u = getUserByCredentials(requestModel.getUsername(), requestModel.getPassword()); \n if (u.isPresent()) {\n proceedWhenAuthenticated(u.get());\n return;\n }\n \n // report authentication failed\n LOG.log(Level.INFO, \"{0} Authentication failed. Login: {1}, Password: {2}\", new Object[]{httpSession.getId(), requestModel.getUsername(), requestModel.getPassword()});\n SignInViewModel viewModel = new SignInViewModel(true);\n renderSignInView(viewModel);\n }", "private boolean verifyCredentials() {\n\n boolean bCredentialsValid = false;\n strUserMailID = strUserName = \"\";\n\n // Get the account information, if existing\n DatabaseHandler dbHandler = new DatabaseHandler(getApplicationContext());\n AccountInformation accInfo = dbHandler.getAccountInfo(m_tfUserEmailID.getText().toString());\n\n if(accInfo != null) {\n\n // Compute the hash for the user entered password\n OperationsHelper helper = new OperationsHelper();\n String strHashPwd = helper.getHashedPassword(m_tfUserPassword.getText().toString(), accInfo.getSaltValue());\n if(strHashPwd.equals(accInfo.getPassword())) {\n\n bCredentialsValid = true;\n strUserMailID = accInfo.getEmail();\n strUserName = accInfo.getName();\n\n // If Always login option is checked, update the value in the database\n if( ! (m_cbAutoLogon.isChecked() == accInfo.getIfAlwaysSignIn()) ) {\n\n accInfo.setAlwaysSignIn(m_cbAutoLogon.isChecked());\n dbHandler.updateAlwaysSignOnOption(accInfo);\n }\n } else {\n Toast.makeText(getApplicationContext(), \"Incorrect Password\", Toast.LENGTH_LONG).show();\n }\n } else {\n Toast.makeText(getApplicationContext(), \"No such account exists. \\n\" +\n \" Create one to login\", Toast.LENGTH_LONG).show();\n }\n\n return bCredentialsValid;\n }", "User authenticate(String username, String password);", "@Test\n public void existingUserOK_PW() {\n boolean result = auth.authenticateUser(\"Ole\", \"secret\", 0); \n //Then\n assertThat(result, is(true));\n }", "private Boolean authorize() {\n\n return Session.getInstance().login(user.getText(), password.getText());\n }", "@Override\n\tpublic boolean verifyUser(String username,String password )\n\t{\n\t\tboolean b;\n\t\tString sql = \"select username,password from f_loginTable where username=? and password=?\";\n\t\tint noOfRows=template.update(sql, new Object[] {username,password});\n\t\tif(noOfRows==1)\n\t\t{b=true;}\n\t\telse \n\t\t{b=false;}\n\t\treturn b;\t\t\n\t}", "public static boolean authenticateUser(String username, String password){\n\t\tboolean login = false;\t\n\t\tMongoCollection<Document> collection = getDatabase().getCollection(\"LoginInformation\");\n\t\tDocument cursorName = collection.find(eq(\"username\", username)).first();\n\t\t\n\t\t// If the username is not found, create a new account in the database\n\t\tif(cursorName == null){\n\t\t\tDocument user = new Document(\"username\", username);\n\t\t\tuser.append(\"password\", password);\n\t\t\tuser.append(\"points\", 0.0);\n\t\t\tcollection.insertOne(user);\n\t\t\tlogin = true;\n\t\t}\n\t\t\n\t\t// if the username is found, check the password\n\t\tif(cursorName != null && cursorName.getString(\"password\").equals(password)){\n\t\t\tlogin = true;\n\t\t}\n\t\t\t\n\t\treturn login;\n\t}", "Boolean checkCredentials(String username, String password) throws\n SQLException, UserNotFoundException;", "public boolean validateUserCredentials(String login, String password) throws SQLException;", "static boolean logIn(String username, String password) {\r\n if (accounts.containsKey(username)) {\r\n if (accounts.get(username).getPassword().equals(password)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "boolean authNeeded();", "public boolean authenticateUser(String username, String password) {\n if (isNullOrEmpty(username) || isNullOrEmpty(password)) {\n return false;\n }\n final Optional<User> maybeUser = userRepository.getUserByUserName(username);\n\n return maybeUser.isPresent() && validatePassword(password, maybeUser.get());\n }", "private void authenticate(String username, String password) throws Exception {\n\t\tboolean autenticated = false;\n\t\tEntityManagerFactory factory = Persistence.createEntityManagerFactory(\"ForumApp\");\n\t\tEntityManager em = factory.createEntityManager();\n\n\t\tTypedQuery<User> q = em.createQuery(\"SELECT u FROM User u WHERE u.username = '\" + username + \"'\", User.class);\n\t\tUser user = q.getSingleResult();\n\n\t\tif (user != null) {\n\n\t\t\tif (user.getPassword().equals(password)) {\n\t\t\t\tautenticated = true;\n\t\t\t}\n\t\t}\n\n\t\t// Close the entity manager\n\t\tem.close();\n\t\tfactory.close();\n\n\t\t// Throw an Exception if the credentials are invalid\n\t\tif (!autenticated) {\n\t\t\tthrow new Exception();\n\t\t}\n\t}", "int authenticateUser(IDAOSession session, String userName, String password);", "private boolean validate(String username, String password) {\n\t\tif(username.equals(\"Venkat\") && password.equals(\"kumar\")) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public boolean verifyUser(String username, String password) throws SQLException {\n\n // update sql\n String pwGot = getPassword(username);\n\n if (pwGot.equals(password)) {\n return true;\n }\n\n return false;\n }", "private boolean authenticate (HttpRequest request, HttpResponse response) throws UnsupportedEncodingException\n\t{\n\t\tString[] requestSplit=request.getPath().split(\"/\",3);\n\t\tif(requestSplit.length<2)\n\t\t\treturn false;\n\t\tString serviceName=requestSplit[1];\n\t\tfinal int BASIC_PREFIX_LENGTH=\"BASIC \".length();\n\t\tString userPass=\"\";\n\t\tString username=\"\";\n\t\tString password=\"\";\n\t\t\n\t\t//Check for authentication information in header\n\t\tif(request.hasHeaderField(AUTHENTICATION_FIELD)\n\t\t\t\t&&(request.getHeaderField(AUTHENTICATION_FIELD).length()>BASIC_PREFIX_LENGTH))\n\t\t{\n\t\t\tuserPass=request.getHeaderField(AUTHENTICATION_FIELD).substring(BASIC_PREFIX_LENGTH);\n\t\t\tuserPass=new String(Base64.decode(userPass), \"UTF-8\");\n\t\t\tint separatorPos=userPass.indexOf(':');\n\t\t\t//get username and password\n\t\t\tusername=userPass.substring(0,separatorPos);\n\t\t\tpassword=userPass.substring(separatorPos+1);\n\t\t\t\n\t\t\t\n\t\t\ttry\n\t\t\t{\n\t\t\t\t\n\t\t\t\tlong userId;\n\t\t\t\tAgent userAgent;\n\t\t\t\t\n\t\t\t\tif ( username.matches (\"-?[0-9].*\") ) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tuserId = Long.valueOf(username);\n\t\t\t\t\t} catch ( NumberFormatException e ) {\n\t\t\t\t\t\tthrow new L2pSecurityException (\"The given user does not contain a valid agent id!\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tuserId = l2pNode.getAgentIdForLogin(username);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tuserAgent = l2pNode.getAgent(userId);\n\t\t\t\t\n\t\t\t\tif ( ! (userAgent instanceof PassphraseAgent ))\n\t\t\t\t\tthrow new L2pSecurityException (\"Agent is not passphrase protected!\");\n\t\t\t\t((PassphraseAgent)userAgent).unlockPrivateKey(password);\n\t\t\t\t_currentUserId=userId;\n\t\t\t\t\n\t\t\t\tif(!_userSessions.containsKey(userId))//if user not registered\n\t\t\t\t{\t\t\t\t\n\t\t\t\t\tMediator mediator = l2pNode.getOrRegisterLocalMediator(userAgent);\n\t\t\t\t\t_userSessions.put(userId, new UserSession(mediator));\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t_userSessions.get(userId).updateServiceTime(serviceName,new Date().getTime());//update last access time for service\n\t\t\t\t\n\t\t\t\tconnector.logMessage(\"Login: \"+username);\n\t\t\t\tconnector.logMessage(\"Sessions: \"+Integer.toString(_userSessions.size()));\n\t\t\t\t\n\t\t\t\treturn true;\n\t\t\t\t\n\t\t\t}catch (AgentNotKnownException e) {\n\t\t\t\tsendUnauthorizedResponse(response, null, request.getRemoteAddress() + \": login denied for user \" + username);\n\t\t\t} catch (L2pSecurityException e) {\n\t\t\t\tsendUnauthorizedResponse( response, null, request.getRemoteAddress() + \": unauth access - prob. login problems\");\n\t\t\t} catch (Exception e) {\n\t\t\t\t\n\t\t\t\tsendInternalErrorResponse(\n\t\t\t\t\t\tresponse, \n\t\t\t\t\t\t\"The server was unable to process your request because of an internal exception!\", \n\t\t\t\t\t\t\"Exception in processing create session request: \" + e);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tresponse.setStatus ( HttpResponse.STATUS_BAD_REQUEST );\n\t\t\tresponse.setContentType( \"text/plain\" );\n\t\t\tresponse.print ( \"No authentication provided!\" );\n\t\t\tconnector.logError( \"No authentication provided!\" );\n\t\t}\n\t\treturn false;\n\t}", "public boolean authenticateUser(String userName,String password) throws ToDoListDAOException{\r\n\t\t\r\n\t\t User user = getUserByUserName(userName); \r\n\t\t System.out.println(userName + \" \" + password);\r\n\t if(user!=null && user.getUserName().equals(userName) && user.getPassword().equals(password)){\r\n\t return true;\r\n\t }else{\r\n\t return false;\r\n\t }\r\n\t\t\r\n\t}", "@Override\n public boolean userLogin(String username, String password) \n {\n User tmpUser = null;\n tmpUser = getUser(username);\n if(tmpUser == null) return false;\n if(tmpUser.getPassword().equals(password)) return true;\n return false;\n }", "public static boolean authenticate(String username, String attemptedPassword){\n \t\tSaltHash sh = LoginDao.validate(username);\n \t\t\n \t\tString salt = sh.getsaltObject();\n String storedEncryptedPassword = sh.getpasswordObject();\n \n \n byte[] computePBKDF2AttemptedPassword = null ;\n try {\n computePBKDF2AttemptedPassword = pwdMgmtUtils.generateEncryptedPassword(attemptedPassword, pwdMgmtUtils.returnByteArray(salt)) ;\n } catch(GeneralSecurityException genSecExc) {System.out.println(genSecExc.getMessage() + \" \" + genSecExc.getCause() ) ; System.exit(1) ; } \n \n boolean successful_authentication = Arrays.equals(computePBKDF2AttemptedPassword, pwdMgmtUtils.returnByteArray(storedEncryptedPassword)) ;\n \n System.out.println(\"User authenticated ? \" + successful_authentication);\n return successful_authentication;\n }", "private void checkValidLogin(String username, String password) {\r\n //The check username will check to see if a password was returned. That means the user\r\n //exists. If a void is returned, then the user does not exist.\r\n String actualPassword = checkUsername(username);\r\n\r\n //If a null was passed back, then the username does not exist. We signal the user.\r\n if (actualPassword == null) {\r\n signalInvalidUser();\r\n return;\r\n }\r\n\r\n //We check to see if the password that was type is equal to the 1 we got from the DB. If\r\n //not we signal the user.\r\n if (!checkPassword(password, actualPassword)){\r\n signalInvalidPassword();\r\n return;\r\n }\r\n\r\n //If everything worked, we go to the landing page.\r\n goToLandingPage();\r\n }", "private boolean checkCredentials(final String userid, final String password)\n {\n if(userid == null || password == null || userid.trim().length() < 1 || password.trim().length() < 1)\n {\n return false;\n }\n this.loadPasswordFile();\n if(LoginServlet.passwords.containsKey(userid))\n {\n final String expectedPassword = LoginServlet.passwords.getProperty(userid);\n if(expectedPassword.equals(password))\n {\n return true;\n }\n }\n \n return false;\n }", "List<String> authenticateUser(String userName, String password);", "public boolean isAuthRequired() {\n return !AfUtil.anyEmpty(_username);\n }", "@Test\n public void existingUserNOT_OK_PW() {\n boolean result = auth.authenticateUser(\"Ole\", \"fido\", 0); \n //Then\n assertThat(result, is(false));\n }", "@Override\n\tpublic boolean authenticate(final String name, final String password) {\n\t\treturn StringUtils.isNotBlank(name) && StringUtils.isNotBlank(password) && findByIdNoCache(name) != null;\n\t}", "public void authenticateUser() {\n\n String username = viewUsername.getText().toString();\n String password = viewPassword.getText().toString();\n\n Timber.v(\"authenticateUser called username: \" + username);\n activity.getOnboardingViewModel().authenticateUser(username, password);\n }", "private Authentication tryToAuthenticateWithUsernameAndPassword(String username, String password) {\n\t\tUsernamePasswordAuthenticationToken requestAuthentication = new UsernamePasswordAuthenticationToken(username, password);\n\t\treturn tryToAuthenticate(requestAuthentication);\n \n\t}", "private void handlePass(String password) {\n // User has entered a valid username and password is correct\n if (currentUserStatus == userStatus.ENTEREDUSERNAME && password.equals(validPassword)) {\n currentUserStatus = userStatus.LOGGEDIN;\n sendMsgToClient(\"230-Welcome to HKUST\");\n sendMsgToClient(\"230 User logged in successfully\");\n }\n\n // User is already logged in\n else if (currentUserStatus == userStatus.LOGGEDIN) {\n sendMsgToClient(\"530 User already logged in\");\n }\n\n // Wrong password\n else {\n sendMsgToClient(\"530 Not logged in\");\n }\n }", "private void login()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\t//Get the connection to the database\r\n\t\t\tDatabase db = new Database();\r\n\r\n\t\t\t//Get the data and format it correctly\r\n\t\t\tString username = txtUsername.getText().trim().toLowerCase();\r\n\t\t\tString password = new String(txtPassword.getPassword()).trim();\r\n\r\n\t\t\t//Verify that user information has been inserted into the username/password fields\r\n\t\t\tif (username.length() == 0)\r\n\t\t\t{\r\n\t\t\t\tJOptionPane.showMessageDialog(\r\n\t\t\t\t\tthis,\r\n\t\t\t\t\t\"Please enter your username.\",\r\n\t\t\t\t\tApplication.NAME,\r\n\t\t\t\t\tJOptionPane.WARNING_MESSAGE\r\n\t\t\t\t);\r\n\r\n\t\t\t\ttxtUsername.requestFocus();\r\n\t\t\t}//End of if\r\n\t\t\telse if (password.length() == 0)\r\n\t\t\t{\r\n\t\t\t\tJOptionPane.showMessageDialog(\r\n\t\t\t\t\tthis,\r\n\t\t\t\t\t\"Please enter your password.\",\r\n\t\t\t\t\tApplication.NAME,\r\n\t\t\t\t\tJOptionPane.WARNING_MESSAGE\r\n\t\t\t\t);\r\n\r\n\t\t\t\ttxtPassword.requestFocus();\r\n\t\t\t}//End of else if\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tif (!db.usernameExists(username))\r\n\t\t\t\t{\r\n\t\t\t\t\tJOptionPane.showMessageDialog(\r\n\t\t\t\t\t\tthis,\r\n\t\t\t\t\t\t\"The username/password combination you provided does not exist.\",\r\n\t\t\t\t\t\tApplication.NAME,\r\n\t\t\t\t\t\tJOptionPane.WARNING_MESSAGE\r\n\t\t\t\t\t);\r\n\r\n\t\t\t\t\ttxtPassword.setText(\"\");\r\n\t\t\t\t\ttxtPassword.requestFocus();\r\n\t\t\t\t}//End of if\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tUser user = db.loadUser(username);\r\n\t\t\t\t\tbyte [] bPassword = PasswordEncryption.hashPassword(username, password);\r\n\r\n\t\t\t\t\tif (bPassword.length != user.getPassword().length)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\tJOptionPane.showMessageDialog(\r\n\t\t\t\t\t\t\t\tthis,\r\n\t\t\t\t\t\t\t\t\"The username/password combination you provided does not exist.\",\r\n\t\t\t\t\t\t\t\tApplication.NAME,\r\n\t\t\t\t\t\t\t\tJOptionPane.WARNING_MESSAGE\r\n\t\t\t\t\t\t\t);\r\n\r\n\t\t\t\t\t\t\ttxtPassword.setText(\"\");\r\n\t\t\t\t\t\t\ttxtPassword.requestFocus();\r\n\t\t\t\t\t}//End of if\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tboolean same = true;\r\n\r\n\t\t\t\t\t\t//Check the passwords for equality\r\n\t\t\t\t\t\tfor (int x = 0; x < bPassword.length; x++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif (bPassword[x] != user.getPassword()[x])\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tsame = false;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}//End of if\r\n\t\t\t\t\t\t}//End of for\r\n\r\n\t\t\t\t\t\tif (same)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif (user.getAccountLevel() < 10)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tJOptionPane.showMessageDialog(\r\n\t\t\t\t\t\t\t\t\tthis,\r\n\t\t\t\t\t\t\t\t\t\"You do not have sufficient rights to access this application.\",\r\n\t\t\t\t\t\t\t\t\tApplication.NAME,\r\n\t\t\t\t\t\t\t\t\tJOptionPane.WARNING_MESSAGE\r\n\t\t\t\t\t\t\t\t);\r\n\r\n\t\t\t\t\t\t\t\ttxtPassword.setText(\"\");\r\n\t\t\t\t\t\t\t\ttxtPassword.requestFocus();\r\n\t\t\t\t\t\t\t}//End of if\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t//Login the user\r\n\t\t\t\t\t\t\t\tSession.login(user);\r\n\r\n\t\t\t\t\t\t\t\t//Open the dashbard\r\n\t\t\t\t\t\t\t\tSession.openWindow(new Dashboard());\r\n\r\n\t\t\t\t\t\t\t\t//Close this window\r\n\t\t\t\t\t\t\t\tthis.dispose();\r\n\t\t\t\t\t\t\t}//End of else\r\n\t\t\t\t\t\t}//End of if\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tJOptionPane.showMessageDialog(\r\n\t\t\t\t\t\t\t\tthis,\r\n\t\t\t\t\t\t\t\t\"The username/password combination your provided does not exist.\",\r\n\t\t\t\t\t\t\t\tApplication.NAME,\r\n\t\t\t\t\t\t\t\tJOptionPane.WARNING_MESSAGE\r\n\t\t\t\t\t\t\t);\r\n\r\n\t\t\t\t\t\t\ttxtPassword.setText(\"\");\r\n\t\t\t\t\t\t\ttxtPassword.requestFocus();\r\n\t\t\t\t\t\t}//End of else\r\n\t\t\t\t\t}//End of else\r\n\t\t\t\t}//End of else\r\n\t\t\t}//End of else\r\n\t\t}//End of try\r\n\t\tcatch (Exception e)\r\n\t\t{\r\n\t\t\t//Inform the user that the application was unable to connect to the database.\r\n\t\t\tJOptionPane.showMessageDialog(\r\n\t\t\t\tthis,\r\n\t\t\t\t\"An error occured connecting to the database.\\n\\nIf this problem continues, please contact your system administrator.\",\r\n\t\t\t\tApplication.NAME,\r\n\t\t\t\tJOptionPane.ERROR_MESSAGE\r\n\t\t\t);\r\n\t\t}//End of catch\r\n\t}", "public void login() {\n if (!areFull()) {\n return;\n }\n\n // Get the user login info\n loginInfo = getDBQuery(nameField.getText());\n if (loginInfo.equals(\"\")) {\n return;\n }\n\n // Get password and check if the entered password is true\n infoArray = loginInfo.split(\" \");\n String password = infoArray[1];\n if (!passField.getText().equals(password)) {\n errorLabel.setText(\"Wrong Password!\");\n return;\n }\n\n continueToNextPage();\n }", "private boolean isValidUser(String userName, String password) {\n\t\tif (userName.equals(\"Admin\") && password.equals(\"Admin\")) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t}", "public void loginUser() {\n \tString username = usernameField.getText().toString();\n \tString password = passwordField.getText().toString();\n \n \t// Validation part.\n \tString empty = \"\";\n \t// Check if username is empty.\n \tif(username.isEmpty()) {\n \t\tToast toast = Toast.makeText(\n \t\t\tthis,\n \t\t\t\"Please enter a username.\",\n \t\t\tToast.LENGTH_LONG);\n \t\ttoast.show();\n \t\treturn;\n \t}\n \t// Check if username contains othe characters.\n \tif(! Pattern.matches(\"[a-zA-Z]+\", username)) {\n \t\tToast toast = Toast.makeText(\n \t\t\tthis,\n \t\t\t\"Username can only contain alphabets\",\n \t\t\tToast.LENGTH_LONG);\n \t\ttoast.show();\n \t\treturn;\n \t}\n \t\n \t// Check if password is empty.\n \tif(password.isEmpty()) {\n \t\tToast toast = Toast.makeText(\n \t\t\tthis,\n \t\t\t\"Please enter a password.\",\n \t\t\tToast.LENGTH_LONG);\n \t\ttoast.show();\n \t\treturn;\n \t}\n\n \t\n \tArrayList<NameValuePair> userData = new ArrayList<NameValuePair>();\n \tuserData.add(new BasicNameValuePair(\"username\", username));\n \tuserData.add(new BasicNameValuePair(\"password\", password));\n \t\n \t// Now send the data to the login user task to\n \t// check if they are correct.\n \tnew AuthenticateUserTask(this, userData).execute();\n \t\n }", "public final boolean validate(String username, String password) {\n\t\treturn authUser(userDao.findByUsername(username), password);\n\t}", "EmployeeMaster authenticateUser(int employeeId, String password);", "public static boolean authenticateUser(String username, String password)\n\t\t\tthrows IOException {\n\t\t// TODO (ejeadry): We need to store the state of the user here, and make\n\t\t// sure that he cannot login on different computers.\n\n\t\tBoolean foundMatch = false;\n\n\t\tFile f = new File(DB_FOLDER + DB_AUTH_FILE + DB_FILE_TYPE);\n\n\t\tFileReader fReader;\n\t\tfReader = new FileReader(f);\n\t\tBufferedReader bReader = new BufferedReader(fReader);\n\n\t\tString s = bReader.readLine();\n\n\t\twhile (s != null) {\n\t\t\tString[] pair = s.split(\"\\\\s+\");\n\t\t\tif (pair[0].equals(username) && pair[1].equals(password)) {\n\t\t\t\tfoundMatch = true;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\ts = bReader.readLine();\n\t\t}\n\n\t\tfReader.close();\n\t\tbReader.close();\n\n\t\treturn foundMatch;\n\t}", "User checkUser(String username, String password);", "private int checkAuthentication( SecureDirectory secureDirectory ) throws ServerException {\r\n\r\n\t\tif ( secureDirectory == null )\r\n\t\t\treturn NOT_SECURE_DIR;\r\n\r\n\t\tif ( !request.getHeaderFields().containsKey( HeaderFields.AUTHORIZATION ) )\r\n\t\t\treturn NEED_AUTHENTICATE;\r\n\r\n\t\tString auth = request.getHeaderFields().get( HeaderFields.AUTHORIZATION );\r\n\t\tString[] tokens = auth.split( \" \", 2 );\r\n\t\tif ( authenticate( secureDirectory, tokens[0], tokens[1] ) )\r\n\t\t\treturn AUTHENTICATED;\r\n\r\n\t\t// Password or username not correct\r\n\t\tthrow new ServerException( ResponseTable.FORBIDDEN );\r\n\t}", "private void logIn() throws IOException {\n\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n String line = reader.readLine();\n String[] a = line.split(\";\");\n\n String user = a[0];\n String password = a[1];\n boolean rez = service.checkPassword(user, password);\n if(rez == TRUE)\n System.out.println(\"Ok\");\n else\n System.out.println(\"Not ok\");\n }", "boolean isAuthenticated();", "protected boolean doAuthenticate(String password, String challenge)\r\n {\r\n return digest(MD5, challenge).equals(password);\r\n }", "public boolean autenticar(String userid, String pwd) throws SQLException {\r\n\r\n PreparedStatement ps = conn.prepareStatement(\"select * from usuario where login=? and senha=? and ativo=1\");\r\n ps.setString(1, userid);\r\n ps.setString(2, pwd);\r\n ResultSet rs = ps.executeQuery();\r\n\r\n if (rs.next()) {\r\n return true;\r\n } else {\r\n System.out.println(\"Senha e/ou Usuário incorreto! <a href='index.jsp'>Tente Novamente</a>\");\r\n }\r\n return false;\r\n }", "@Override\n\tpublic boolean login(String username, String password) {\n\t\treturn true;\n\t}", "public Boolean authenticate(String username, String password) {\n try {\n Authentication authentication = authenticationManager.authenticate(\n new UsernamePasswordAuthenticationToken(\n username,\n password\n )\n );\n\n SecurityContextHolder.getContext().setAuthentication(authentication);\n return true;\n } catch (BadCredentialsException e) {\n return false;\n }\n }", "public Boolean authenticateUser(String username, String password) throws SQLException{\n\t\tStatement stmt = conn.createStatement();\n\t\tString querystring = String.format(\n\t\t\t\t\"SELECT * FROM user where username='%s' AND password='%s';\", \n\t\t\t\tusername,\n\t\t\t\tpassword);\n\t\tResultSet rs = stmt.executeQuery(querystring);\n\t\tBoolean result = rs.first();\n\t\trs.close();\n\t\tstmt.close();\n\t\treturn result;\n\t}", "@Override\r\n\tpublic boolean validatePassword(String hash)\r\n\t{\r\n\r\n\t\tif (hm.containsKey(hash))\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Authentication OK.\");\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\telse\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Authentication fail.\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t}", "private void attemptUsernamePasswordLogin()\n {\n if (mAuthTask != null)\n {\n return;\n }\n\n if(mLogInButton.getText().equals(getResources().getString(R.string.logout)))\n {\n mAuthTask = new RestCallerPostLoginTask(this,mStoredToken,MagazzinoService.getAuthenticationHeader(this),true);\n mAuthTask.execute(MagazzinoService.getLogoutService(this));\n return;\n }\n // Reset errors.\n mUsernameView.setError(null);\n mPasswordView.setError(null);\n\n // Store values at the time of the login attempt.\n String email = mUsernameView.getText().toString();\n String password = mPasswordView.getText().toString();\n\n boolean cancel = false;\n View focusView = null;\n\n // Check for a valid password, if the user entered one.\n if (!TextUtils.isEmpty(password) && !isPasswordValid(password))\n {\n mPasswordView.setError(getString(R.string.error_invalid_password));\n focusView = mPasswordView;\n cancel = true;\n }\n\n // Check for a valid email address.\n if (TextUtils.isEmpty(email))\n {\n mUsernameView.setError(getString(R.string.error_field_required));\n focusView = mUsernameView;\n cancel = true;\n }\n else if (!isUsernameOrEmailValid(email))\n {\n mUsernameView.setError(getString(R.string.error_invalid_email));\n focusView = mUsernameView;\n cancel = true;\n }\n\n if (cancel)\n {\n // There was an error; don't attempt login and focus the first\n // form field with an error.\n focusView.requestFocus();\n return;\n }\n\n mAuthTask = new RestCallerPostLoginTask(this,email, password);\n mAuthTask.execute(MagazzinoService.getLoginService(this));\n\n }", "AuthenticationToken authenticate(String username, CharSequence password) throws Exception;", "public boolean login (String username, String password){\r\n /*If we encrypt the entered password then it means that the password never needs to \r\n be decrypted therefore making it more secure.*/\r\n password = encrypt(password);\r\n //Returns where the user is in the array, if the user is found, if not then index = -1.\r\n int index = f.searchForUsername(username);\r\n //If the user is not found then -1 is returned, and therefore the details are incorrect.\r\n if (index != -1){\r\n //Returns true if the passwords match.\r\n if (password.equals(f.user[index].getPassword())) {\r\n return true;\r\n } else {\r\n System.err.println(\"Username and Passwords do not match.\");\r\n return false;\r\n }\r\n } else {\r\n System.err.println(\"User not found.\");\r\n return false;\r\n }\r\n }", "public boolean authenticateUser(String username, String password) {\n\t\tboolean isAuthenticated = false;\n\t\tboolean db_error = true;\n\t\tLogger.logMessage(\"UserManager.authenticateUser(..) : authenticate user \"\n\t\t\t\t+ username);\n\t\tif (DatabaseUtil.checkDatabaseConnection() == Constants.DATABASE_CONNECTION_SUCCESS) {\n\t\t\tisAuthenticated = Service.getService().userAuthentication(username,\n\t\t\t\t\tpassword);\n\t\t\tif (userList.size() == 0) {\n\t\t\t\tpopulateUserListFromDatabase();\n\t\t\t}\n\t\t\tdb_error = false;\n\t\t} else {\n\t\t\tPopupWindow.popup.createInformationalPopup(\"Login Error\",\n\t\t\t\t\t\"Not connected to database, database server is down.\");\n\t\t\tLogger.logMessage(\"UserManager.authenticateUser(..) : database connection not alive authenticating from in memory cache \"\n\t\t\t\t\t+ username);\n/*\t\t\tUser user = userMap.get(username);\n\t\t\tif (user != null) {\n\t\t\t\tisAuthenticated = true;\n\t\t\t\tdb_error = false;\n\t\t\t}*/\n\t\t}\n\t\tif (!isAuthenticated && !db_error) {\n\t\t\tPopupWindow.popup.createInformationalPopup(\"Login Error\",\n\t\t\t\t\t\"Username/Password don not match\");\n\t\t}\n\t\treturn isAuthenticated;\n\t}", "public boolean login() throws Exception {\n\n\t\tif (LoginDataBase.getInstance().constainsUsername(username)) {\n\t\t\t// local memory has records of that\n\t\t\tif (hashedPassword == LoginDataBase.getInstance()\n\t\t\t\t\t.getHashedPassword(password)) {\n\t\t\t\tsessionID = UUID.randomUUID().toString();\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tPassExceptionToUI.passToUI(new PasswordMismatchError());\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\t// check with web server\n\t\t\tCertificateValidation.invalidate();\n\t\t\tURL url = new URL(\n\t\t\t\t\t\"https://mlite-demo.musoni.eu:8443/mifosng-provider/api/v1/authentication?username=\"\n\t\t\t\t\t\t\t+ username\n\t\t\t\t\t\t\t+ \"&password=\"\n\t\t\t\t\t\t\t+ password\n\t\t\t\t\t\t\t+ \"&tenantIdentifier=code4good\");\n\n\t\t\tHttpsURLConnection con = (HttpsURLConnection) url.openConnection();\n\t\t\tcon.setRequestMethod(\"POST\");\n\n\t\t\tif (con.getResponseCode() == HttpURLConnection.HTTP_OK) {\n\t\t\t\t// if the account is found in web server\n\t\t\t\tLoginDataBase.getInstance().updateDataBase(username, hashedPassword);\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\t// if web server does not have match\n\t\t\t\tPassExceptionToUI.passToUI(new UsernameMismatchError(username));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "@Override\n public boolean authenticated(final String username, final String password) {\n\n Claim claim;\n try {\n claim = credService.authenticate(new PasswordCredentialsWrapper(username, password));\n } catch (AuthenticationException e) {\n LOG.debug(\"Authentication failed for user '{}' : {}\", username, e);\n return false;\n }\n\n LOG.debug(\"Authentication result for user '{}' : {}\", username, claim.domain());\n return true;\n }", "private int logIn()\r\n\t{\r\n\t\tScanner input = new Scanner(System.in);\r\n\t\tString username;\r\n\t\tString password;\r\n\t\tint index;\r\n\t\t\r\n\t\t//prompt user for username and password\r\n\t\tSystem.out.println(\"Enter your username\");\r\n\t\tusername = input.nextLine();\r\n\t\tSystem.out.println(\"Enter your password\");\r\n\t\tpassword = input.nextLine();\r\n\t\t\r\n\t\tindex = checkUserExists(username);\t\t\t\t\t\t\t\t\t//get the index of the username so we can find the password\r\n\t\tif (index == -1 || !userAccounts[1][index].equals(password))\t\t//username or password is incorrect\r\n\t\t{\r\n\t\t\tSystem.out.println(\"\\nIncorrect Username/Password\");\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tSystem.out.println(\"Login Successful\");\r\n\t\treturn 1;\r\n\t}", "public String isValidAgentLogin(String userName, String password);", "@Override\n\tpublic boolean login(String username, String password) {\n\t\treturn false;\n\t}", "public boolean passwordCheck() {\n\t\tSystem.out.println(\"Password is: \"+LoggedUser.getPassword());\n\t\tMapSqlParameterSource params = new MapSqlParameterSource();\n\t\tparams.addValue(\"username\", LoggedUser.getUsername());\n\t\tparams.addValue(\"password\", LoggedUser.getPassword());\n\t\treturn jdbc.queryForObject(\"select count(*) from authors where username=:username and password=:password\", \n\t\t\t\tparams, Integer.class) > 0;\n\t}", "boolean checkUserCorrispondenceLogin(String emailLogin, String passwordLogin);", "public void Login()throws Exception{\r\n if(eMailField.getText().equals(\"user\") && PasswordField.getText().equals(\"pass\")){\r\n displayMainMenu();\r\n }\r\n else{\r\n System.out.println(\"Username or Password Does not match\");\r\n }\r\n }", "private boolean authenticate(String _uid, String _pwd) {\n\n Connection dbCon = null;\n ResultSet rs = null;\n try {\n dbCon = ds.getConnection();\n Statement s = dbCon.createStatement();\n rs = s.executeQuery(\"select * from user where id = '\"\n + _uid + \"' and pwd = '\" + _pwd + \"'\");\n return (rs.next());\n }\n catch (java.sql.SQLException e) {\n System.out.println(\"A problem occurred while accessing the database.\");\n System.out.println(e.toString());\n }\n finally {\n try {\n dbCon.close();\n }\n catch (SQLException e) {\n System.out.println(\"A problem occurred while closing the database.\");\n System.out.println(e.toString());\n }\n }\n \n return false;\n\n }", "private void login() {\n\t\t \tetUserName.addTextChangedListener(new TextWatcher() {\n\t\t public void afterTextChanged(Editable s) {\n\t\t Validation.hasText(etUserName);\n\t\t }\n\t\t public void beforeTextChanged(CharSequence s, int start, int count, int after){}\n\t\t public void onTextChanged(CharSequence s, int start, int before, int count){}\n\t\t });\n\t\t \t\n\t\t \t // TextWatcher would let us check validation error on the fly\n\t\t \tetPass.addTextChangedListener(new TextWatcher() {\n\t\t public void afterTextChanged(Editable s) {\n\t\t Validation.hasText(etPass);\n\t\t }\n\t\t public void beforeTextChanged(CharSequence s, int start, int count, int after){}\n\t\t public void onTextChanged(CharSequence s, int start, int before, int count){}\n\t\t });\n\t\t }", "public boolean loginUser();", "protected boolean authenticate() {\n \tif (mConfig == null) {\n \t\tmConfig = getConfig();\n \t}\n \tString keys[] = getKeys();\n \tif (keys != null) {\n\t mConfig = api.authenticateToken(keys[0], keys[1], mConfig);\n\t if (mConfig != null) {\n\t return true;\n\t }\n \t}\n \tshowToast(\"Failed user authentication for stored login tokens.\");\n \tclearKeys();\n \tsetLoggedIn(false);\n \treturn false;\n }", "public static boolean login() {\n\t\t// DB\n\t\tString[] usr = { \"NICOLAS\", \"CELESTE\" };\n\t\tString[] pass = { \"cerveza\", \"fernet\" };\n\t\tString usrAuth = \"\";\n\t\tboolean auth = false;\n\t\tint intentos = 1;\n\n\t\tdo {\n\t\t\tJTextField usuario = new JTextField();\n\t\t\tJTextField password = new JPasswordField();\n\t\t\tObject[] ingresarUsuarioPassword = { \"Usuario: \", usuario, \"Password\", password };\n\t\t\tint ingresarLogin = JOptionPane.showConfirmDialog(null, ingresarUsuarioPassword,\n\t\t\t\t\t\"Ingrese credenciales de usuario\", JOptionPane.OK_CANCEL_OPTION);\n\t\t\tif (ingresarLogin == JOptionPane.OK_OPTION) {\n\t\t\t\t// Busca el usuario en un bucle For\n\t\t\t\tfor (int i = 0; i < usr.length; i++) {\n\t\t\t\t\t// Si encuentra el usuario, verifica si el usuario y la contraseña coinciden\n\t\t\t\t\tif (usr[i].equals(usuario.getText().toUpperCase()) && pass[i].equals(password.getText())) {\n\t\t\t\t\t\tusrAuth = usr[i];\n\t\t\t\t\t\tauth = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Si no coincide, muestra los intentos restantes y vuelve a pedir credenciales\n\t\t\t\tif (!auth) {\n\t\t\t\t\tif (intentos < 3) {\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null,\n\t\t\t\t\t\t\t\t\"Usuario y/o Password incorrecto\\n\" + (3 - intentos) + \" Intentos restantes\",\n\t\t\t\t\t\t\t\t\"Usuario y/o Password incorrecto\", JOptionPane.WARNING_MESSAGE);\n\t\t\t\t\t\tintentos++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null,\n\t\t\t\t\t\t\t\t\"Usuario y/o Password incorrecto\\n\" + \"Se supero en numero de intentos\",\n\t\t\t\t\t\t\t\t\"Usuario y/o Password incorrecto\", JOptionPane.WARNING_MESSAGE);\n\t\t\t\t\t\tintentos++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Cierra si no se selecciona OK\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} while (!auth & (intentos <= 3));\n\t\t// Si autentica, muestra mensaje de bienvenida\n\t\tif (auth)\n\t\t\tJOptionPane.showMessageDialog(null, \"Bienvenido \" + usrAuth, \"Bienvenido\", JOptionPane.INFORMATION_MESSAGE);\n\t\treturn auth;\n\t}", "@Override\n public Authentication attemptAuthentication(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse)\n throws AuthenticationException, IOException, ServletException {\n AccountCredentials credentials = new ObjectMapper().readValue(httpServletRequest.getInputStream(), AccountCredentials.class);\n UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(credentials.getUsername(), credentials.getPassword());\n return getAuthenticationManager().authenticate(token);\n }", "private boolean checkAuthentication(String login, String passwd) {\n Connection connect;\n boolean result = false;\n try {\n // connect db\n Class.forName(DRIVER_NAME);\n connect = DriverManager.getConnection(SQLITE_DB);\n // looking for login && passwd in db\n Statement stmt = connect.createStatement();\n ResultSet rs = stmt.executeQuery(SQL_SELECT.replace(\"?\", login));\n while (rs.next())\n result = rs.getString(PASSWD_COL).equals(passwd);\n // close all\n rs.close();\n stmt.close();\n connect.close();\n } catch (Exception ex) {\n ex.printStackTrace();\n return false;\n }\n return result;\n }", "@RequestMapping(value = \"validate_user\", method = { RequestMethod.POST })\n\tpublic boolean validateUser(@RequestParam(\"username\") String username, @RequestParam(\"password\") String password)\n\t\t\tthrows IOException {\n\t\tSystem.out.println(username + \" \" + password);\n\t\tboolean result = false;\n\t\tMongoClient mongoClient = null;\n\t\ttry {\n\t\t\t// Create Mongo client\n\t\t\tmongoClient = new MongoClient(\"localhost\", 27017);\n\t\t\tMongoDatabase db = mongoClient.getDatabase(\"projectDB\");\n\n\t\t\t// Create Users collection and user document\n\t\t\tMongoCollection<Document> collection = db.getCollection(\"USERS\");\n\t\t\tDocument myDoc = collection.find(eq(\"username\", username)).first();\n\n\t\t\t// No user in the collection with the given username\n\t\t\tif (myDoc == null) {\n\t\t\t\tmongoClient.close();\n\t\t\t\treturn false;\n\t\t\t} else { // Check for password\n\t\t\t\tmongoClient.close();\n\t\t\t\tresult = myDoc.get(\"password\").equals(password);\n\t\t\t}\n\n\t\t\t//Close DB connection\n\t\t\tmongoClient.close();\n\n\t\t} catch (Exception e) {\n\t\t\tmongoClient.close();\n\t\t\tSystem.out.println(e);\n\t\t}\n\t\treturn result;\n\t}", "public boolean loginCheck() {\n\t\tif(allParametersGiven==true) {\n\t\t\treturn dtb.checkLoginDetais(username,password);\n\t\t}\n\t\treturn false;\n\t}", "public boolean authenticate(Connection con, String userid, String password)\n throws SQLException, NoSuchAlgorithmException{\n PreparedStatement ps = null;\n ResultSet rs = null;\n try {\n boolean userExist = true;\n // INPUT VALIDATION\n if (userid==null||password==null){\n // TIME RESISTANT ATTACK\n // Computation time is equal to the time needed by a legitimate user\n userExist = false;\n userid=\"\";\n password=\"\";\n }\n\n ps = con.prepareStatement(\"select password, extra FROM login where User_ID = ?\");\n ps.setString(1, userid);\n rs = ps.executeQuery();\n String digest, extra;\n if (rs.next()) {\n digest = rs.getString(\"password\");\n extra = rs.getString(\"extra\");\n // DATABASE VALIDATION\n if (digest == null || extra == null) {\n throw new SQLException(\"Database inconsistant Salt or Digested Password altered\");\n }\n if (rs.next()) { // Should not append, because login is the primary key\n throw new SQLException(\"Database inconsistent two CREDENTIALS with the same LOGIN\");\n }\n } else { // TIME RESISTANT ATTACK (Even if the user does not exist the\n // Computation time is equal to the time needed for a legitimate user\n digest = \"000000000000000000000000000=\";\n extra = \"00000000000=\";\n userExist = false;\n }\n\n byte[] bDigest = base64ToByte(digest);\n byte[] bExtra = base64ToByte(extra);\n\n // Compute the new DIGEST\n byte[] proposedDigest = getHash(ITERATION_NUMBER, password, bExtra);\n\n return Arrays.equals(proposedDigest, bDigest) && userExist;\n } catch (IOException ex){\n throw new SQLException(\"Database inconsistant Salt or Digested Password altered\");\n }\n finally{\n close(rs);\n close(ps);\n }\n }", "public User doAuthentication(String account, String password);", "private void authenticate( String loging, String sysLoging,String password,String sys_password) throws Exception {\n \n if(!loging.equals(sysLoging) || !(sys_password.equals(password) )){\n Exception e = new Exception();\n throw e;\n }\n\n }", "private boolean login()\n {\n System.out.print(\"Enter your username: \");\n String userName = keyboard.nextLine().toLowerCase();\n currentUser = fs.getUser(userName);\n System.out.println();\n\n return currentUser != null;\n }", "boolean isLogin(String username, String password)\n {\n String endURL = \"login/\" + username + \"/\" + password;\n return (request(\"GET\", \"\", endURL).equals(\"SUCCESSFUL\"));\n }", "public String signIn(String username, String password);", "boolean verifyUser(User user, char[] password);", "public boolean validateUser (String username, String password){\n Cursor cursor = dbHelper.getReadableDatabase().rawQuery(\n \"SELECT * FROM \" + dbHelper.TABLE_USERS + \" WHERE \" + dbHelper.COLUMN_USERNAME\n + \"='\" + username + \"' AND \" + dbHelper.COLUMN_PASSWORD + \"='\" + password + \"'\",null);\n if (cursor.getCount()>0){\n return true;\n }else {\n return false;\n }\n }", "public abstract boolean authenticate(String userid, String password) throws\n YAuthenticationException;", "protected boolean login() {\n\t\tString Id = id.getText();\n\t\tif (id.equals(\"\")){\n\t\t\tJOptionPane.showMessageDialog(null, \"请输入用户名!\",\"\", JOptionPane.ERROR_MESSAGE);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tUserVO user = bl.findUser(Id);\n\t\tif (user == null){\n\t\t\tJOptionPane.showMessageDialog(null, \"该用户不存在!\",\"\", JOptionPane.ERROR_MESSAGE);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (! user.getPassword().equals(String.valueOf(key.getPassword()))){\n\t\t\tSystem.out.println(user.getPassword());\n\t\t\tJOptionPane.showMessageDialog(null, \"密码错误!\",\"\", JOptionPane.ERROR_MESSAGE);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tsimpleLoginPanel.this.setVisible(false);\n\t\tUserblService user2 = new Userbl(Id);\n\t\tReceiptsblService bl = new Receiptsbl(user2);\n\t\tClient.frame.add(new simpleMainPanel(user2,bl));\n\t\tClient.frame.repaint();\n\t\t\n\t\treturn true;\n\t\t\n\t}", "private void logIn() {\n char[] password = jPasswordField1.getPassword();\n String userCode = jTextField1.getText();\n\n String txtpassword = \"\";\n for (char pw : password) {\n txtpassword += pw;\n }\n if (\"\".equals(txtpassword)) {\n JOptionPane.showMessageDialog(this, textBundle.getTextBundle().getString(\"enterPassword\"), \"No Password\", JOptionPane.WARNING_MESSAGE);\n } else if (txtpassword.equals(userData.get(0).toString())) {\n jPasswordField2.setEnabled(true);\n jPasswordField3.setEnabled(true);\n jPasswordField2.setEditable(true);\n jPasswordField3.setEditable(true);\n jPasswordField2.grabFocus();\n }\n }", "boolean hasPassword();", "boolean hasPassword();", "boolean hasPassword();", "boolean hasPassword();", "boolean hasPassword();", "boolean hasPassword();", "boolean hasPassword();" ]
[ "0.7732267", "0.76205546", "0.75487804", "0.7359203", "0.7354305", "0.7353586", "0.73380464", "0.7316682", "0.72348136", "0.72160125", "0.7130897", "0.7079874", "0.70777", "0.70673496", "0.7056782", "0.7018888", "0.6962732", "0.692946", "0.6915333", "0.69074494", "0.68837714", "0.6879622", "0.6850133", "0.68364936", "0.6829395", "0.6823398", "0.6802746", "0.67763066", "0.67753047", "0.67733437", "0.6769345", "0.6756053", "0.6752642", "0.67456126", "0.6703557", "0.66927505", "0.66904414", "0.66899693", "0.6669138", "0.6668919", "0.666054", "0.6656192", "0.66442424", "0.6642241", "0.6637616", "0.6629906", "0.65903693", "0.65902996", "0.65828645", "0.6582563", "0.6576099", "0.6575128", "0.6571457", "0.65711147", "0.6565997", "0.6560605", "0.65522414", "0.65436417", "0.65389067", "0.6533584", "0.6517666", "0.6510889", "0.6508235", "0.6503459", "0.6494285", "0.6492221", "0.64881504", "0.6477226", "0.6475491", "0.6474206", "0.6468964", "0.6466045", "0.64586866", "0.645623", "0.64486396", "0.64423907", "0.64416206", "0.6437046", "0.64308727", "0.6430361", "0.64258546", "0.64222807", "0.64170784", "0.64170486", "0.64127386", "0.6407052", "0.6403068", "0.64002407", "0.6398142", "0.63970155", "0.63883674", "0.63872266", "0.63832897", "0.6382252", "0.6382252", "0.6382252", "0.6382252", "0.6382252", "0.6382252", "0.6382252" ]
0.7703577
1
/This loads all books in the book.txt file and stores each BookDetails object in the ALL_BOOKS ArrayList
private static boolean loadBooks() throws IOException{ BufferedReader reader = new BufferedReader(new FileReader(BOOKS_FILE)); boolean error_loading = false; //stores whether there was an error loading a book String line = reader.readLine(); //read the properties of a book in the books.txt file /*read books.txt file, set the input for each BookDetails object and add each BookDetails object to the ALL_BOOKS Hashtable*/ while(line != null){ BookDetails book = new BookDetails(); String[] details = line.split("\t"); //the properties of each BookDetails object are separated by tab spaces in the books.txt file for(int i = 0; i < details.length; i ++){ if(!setBookInput(i, details[i], book)){ //checks if there was an error in setting the BookDetails object's properties with the values in the books.txt file System.out.println("ERROR Loading Books"); error_loading = true; break; } } if(error_loading) //if there was an error loading a book then stop the process of loading books break; ALL_BOOKS.put(book.getBookId(), book); //add BookDetails object to ALL_BOOKS addToPublisherTable(book.getPublisher(), book.getBookTitle()); //add book's title to the ALL_PUBLISHERS Hashtable addToGenreTable(book, book.getBookTitle()); //add book's title to the ALL_GENRES ArrayList addToAuthorTable(book.getAuthor().toString(), book.getBookTitle()); //add book's title to the ALL_AUTHORS Hashtable line = reader.readLine(); } reader.close(); if(!error_loading){ System.out.println("Loading Books - Complete!"); return true; } return false; //error encountered while loading books }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private ArrayList<Book> readBookCollection() {\n File file = new File(\"books.txt\");\n ArrayList<Book> collection = new ArrayList<Book>();\n try {\n FileReader fileReader = new FileReader(file);\n BufferedReader reader = new BufferedReader(fileReader);\n while (true) {\n String line = reader.readLine();\n if (line == null) break;\n line = line.trim();\n if (line.equals(\"\")) continue; // ignore possible blank lines\n String[] bookInfo = line.split(\" :: \");\n collection.add(new Book(bookInfo[0], bookInfo[1]));\n }\n }\n catch (IOException e) {\n System.out.println(e.getMessage());\n }\n return collection;\n }", "public void loadBooks() {\n\t\ttry {\n\t\t\tScanner load = new Scanner(new File(FILEPATH));\n\t\t\tSystem.out.println(\"Worked\");\n\n\t\t\twhile (load.hasNext()) {\n\t\t\t\tString[] entry = load.nextLine().split(\";\");\n\n\t\t\t\t// checks the type of book\n\t\t\t\tint type = bookType(entry[0]);\n\n\t\t\t\t// creates the appropriate book\n\t\t\t\tswitch (type) {\n\t\t\t\tcase 0:\n\t\t\t\t\tcreateChildrensBook(entry); // creates a Childrensbook and adds it to the array\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tcreateCookBook(entry);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tcreatePaperbackBook(entry);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tcreatePeriodical(entry);\n\t\t\t\t\tbreak;\n\t\t\t\tcase -1:\n\t\t\t\t\tSystem.out.println(\"No book created\");\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tSystem.out.println(\"Error\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tload.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"Did not read in file properly, restart the program, and check filepath of books.txt.\");\n\t\t}\n\t}", "public void loadBooks(){\n\t\tSystem.out.println(\"\\n\\tLoading books from CSV file\");\n\t\ttry{\n\t\t\tint iD=0, x;\n\t\t\tString current = null;\n\t\t\tRandom r = new Random();\n\t\t\tBufferedReader br = new BufferedReader(new FileReader(\"../bin/books.csv\"));\n\t\t\twhile((current = br.readLine()) != null){\n\t\t\t\tString[] data = current.split(\",\");\n\t\t\t\tx = r.nextInt(6) + 15;\n\t\t\t\tfor(int i =0;i<x;i++){\n\t\t\t\t\tBook b= new Book(Integer.toHexString(iD), data[0], data[1], data[2], data[3]);\n\t\t\t\t\tif(bookMap.containsKey(data[0]) != true){\n\t\t\t\t\t\tbookMap.put(data[0], new ArrayList<Book>());\n\t\t\t\t\t}\t\n\t\t\t\t\t\t\n\t\t\t\t\tbookMap.get(data[0]).add(b);\n\t\t\t\t\tiD += 1;\n\t\t\t\t}\t\n\t\t\t}\t\t\t\n\t\t\tbr.close();\n\t\t\tSystem.out.println(\"\\tBooks Added!\");\n\t\t}catch(FileNotFoundException e){\n\t\t\tSystem.out.println(\"\\tFile not found\");\n\t\t}catch(IOException e){\n System.out.println(e.toString());\n }\n\t}", "public BookList(String filename) throws IOException {\r\n bookList = new ArrayList<Book>();\r\n //use Chapter 5 in the book to create a File object and then a Scanner object with the File object.\r\n //Check if the file exists, if not, post a message to the console output.\r\n //Loop through the lines in the file and use a StringTokenizer (chapter 8) to tokenize the string on the comma.\r\n //Create a Book object with the title and price as parameters and add that Book object to the bookList attribute\r\n //in this class\r\n File file = new File(filename);\r\n if (file.exists()){\r\n Scanner fileScan = new Scanner(file);\r\n while(fileScan.hasNext()){\r\n StringTokenizer strTok = new StringTokenizer(fileScan.nextLine(), \",\");\r\n Book book = new Book(strTok.nextToken().trim(), Double.parseDouble(strTok.nextToken().trim()));\r\n bookList.add(book);\r\n }\r\n }else{\r\n System.out.println(\"File not found: \" + filename);\r\n }\r\n\r\n\r\n }", "private void loadFromFile(){\n try {\n FileInputStream fis = openFileInput(FILENAME);\n BufferedReader in = new BufferedReader(new InputStreamReader(fis));\n Gson gson = new Gson();\n Type listType = new TypeToken<ArrayList<Countbook>>() {}.getType();\n countbookList = gson.fromJson(in, listType);\n } catch (FileNotFoundException e) {\n countbookList = new ArrayList<Countbook>();\n }\n }", "public void loadBook() {\n List<Book> books = new ArrayList<>();\n for (int i = 0; i < 5; i++) {\n Book book = new Book(\"Book-\" + i, \"Test book \" + i);\n books.add(book);\n }\n this.setBooks(books);\n }", "private static ArrayList<String> readFile() throws ApplicationException {\r\n\r\n ArrayList<String> bookList = new ArrayList<>();\r\n\r\n File sourceFile = new File(FILE_TO_READ);\r\n try (BufferedReader input = new BufferedReader(new FileReader(sourceFile))) {\r\n\r\n if (sourceFile.exists()) {\r\n LOG.debug(\"Reading book data\");\r\n String oneLine = input.readLine();\r\n\r\n while ((oneLine = input.readLine()) != null) {\r\n\r\n bookList.add(oneLine);\r\n\r\n }\r\n input.close();\r\n } else {\r\n throw new ApplicationException(\"File \" + FILE_TO_READ + \" does not exsit\");\r\n }\r\n } catch (IOException e) {\r\n LOG.error(e.getStackTrace());\r\n }\r\n\r\n return bookList;\r\n\r\n }", "private ArrayList<Book> loadBooks(InputStream is) throws IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(is));\r\n\t\tStringBuilder jsonFileContent = new StringBuilder();\r\n\t\t//read line by line from file\r\n\t\tString nextLine = null;\r\n\t\twhile ((nextLine = br.readLine()) != null){\r\n\t\t\tjsonFileContent.append(nextLine);\r\n\t\t}\r\n\r\n\t\tGson gson = new Gson();\r\n\t\t//this is a require type definition by the Gson utility so Gson will \r\n\t\t//understand what kind of object representation should the json file match\r\n\t\tType type = new TypeToken<ArrayList<Book>>(){}.getType();\r\n\t\tArrayList<Book> books = gson.fromJson(jsonFileContent.toString(), type);\r\n\t\t//close\r\n\t\tbr.close();\t\r\n\t\treturn books;\r\n\t}", "public Book readBookFile()\n {\n\n String name=\"\";\n String author ;\n ArrayList<String> genre = new ArrayList<String>();\n float price=0;\n String bookId;\n String fields2[];\n String line;\n\n line = bookFile.getNextLine();\n if(line==null)\n {\n return null;\n }\n String fields[] = line.split(\" by \");\n if(fields.length>2)\n {\n int i=0;\n while (i<fields.length-1)\n {\n name+=fields[i];\n if(i<fields.length-2)\n {\n name+= \" by \";\n }\n i++;\n }\n fields2 = fields[fields.length-1].split(\"%\");\n }\n else\n {\n name = fields[0];\n fields2 = fields[1].split(\"%\");\n }\n\n author = fields2[0];\n price=Float.parseFloat(fields2[1]);\n bookId=fields2[2];\n genre.add(fields2[3]);\n genre.add(fields2[4]);\n return new Book(name,genre,author,price,bookId);\n\n\n }", "private void librarian()throws IOException\n {\n //File Handling starts here with reading into each of the different files to obtain set of books along with relevant data.\n FileReader fauthor = new FileReader(\"BookAuthorList.txt\"); \n BufferedReader bufferAuthor = new BufferedReader(fauthor);\n\n FileReader fgenre = new FileReader(\"BookGenreList.txt\"); \n BufferedReader bufferGenre = new BufferedReader(fgenre);\n\n FileReader fname = new FileReader(\"BookNameList.txt\"); \n BufferedReader bufferName = new BufferedReader(fname);\n\n FileReader fnumber = new FileReader(\"BookNumberList.txt\"); \n BufferedReader bufferNumber = new BufferedReader(fnumber);\n\n for(int i=0; i<linecount; i++) //instance variable linecount\n {\n book[i] = new Book(\"1000\", \"Book Name\", \"Author of Book\", \"Genre of Book\"); //instantiating array element to avoid NullPointerException\n book[i].code = bufferNumber.readLine();\n book[i].author = bufferAuthor.readLine();\n book[i].genre = bufferGenre.readLine();\n book[i].name = bufferName.readLine();\n }\n /*\n * The following for loop trims each of the lines obtained from the file, to remove spaces and help maintain equal number of characters.\n */\n for(int i=0; i<linecount; i++) //trimming\n {\n book[i].code = book[i].code.trim();\n book[i].author = book[i].author.trim();\n book[i].genre = book[i].genre.trim();\n book[i].name = book[i].name.trim();\n }\n\n for(int i=0; i<linecount; i++) //add set number of lines. this helps in making tabular forms\n {\n /*\n * Utilising concatenation from Library classes here. \n * Function spaces is called.\n */\n book[i].code = book[i].code.concat(Spacebar.spaces(5 - book[i].code.length()));\n book[i].author = book[i].author.concat(Spacebar.spaces(25 - book[i].author.length()));\n book[i].genre = book[i].genre.concat(Spacebar.spaces(15 - book[i].genre.length()));\n book[i].name = book[i].name.concat(Spacebar.spaces(70 - book[i].name.length()));\n }\n }", "public ArrayList<Book> getAllBooksArray(){\n ArrayList<Book> booksArray = new ArrayList<>();\n\n Connection con = null;\n Statement stmt = null;\n ResultSet rs = null;\n\n try{\n Class.forName(\"org.sqlite.JDBC\");\n con = DriverManager.getConnection(\"jdbc:sqlite:Library.db\");\n stmt = con.createStatement();\n String sql = \"SELECT * FROM BOOKS\";\n rs = stmt.executeQuery(sql);\n while(rs.next()){\n Book book = new Book(rs.getString(\"TITLE\"), rs.getString(\"AUTHOR\"), rs.getString(\"ILLUSTRATOR\"), rs.getString(\"ISBN\"), rs.getString(\"DECIMAL\"),\n rs.getString(\"DESCRIPTION\"), rs.getString(\"GENRE\"), rs.getBoolean(\"NON_FICTION\"));\n String tags = rs.getString(\"TAGS\");\n book.setID(rs.getInt(\"ID\"));\n book.deserializeTags(tags);\n booksArray.add(book);\n }\n rs.close();\n stmt.close();\n con.close();\n }catch(SQLException | ClassNotFoundException e){\n e.printStackTrace();\n }\n return booksArray;\n }", "private ArrayList<BookOfUser> loadBooksOfUser(InputStream is) throws IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(is));\r\n\t\tStringBuilder jsonFileContent = new StringBuilder();\r\n\t\t//read line by line from file\r\n\t\tString nextLine = null;\r\n\t\twhile ((nextLine = br.readLine()) != null){\r\n\t\t\tjsonFileContent.append(nextLine);\r\n\t\t}\r\n\r\n\t\tGson gson = new Gson();\r\n\t\t//this is a require type definition by the Gson utility so Gson will \r\n\t\t//understand what kind of object representation should the json file match\r\n\t\tType type = new TypeToken<ArrayList<BookOfUser>>(){}.getType();\r\n\t\tArrayList<BookOfUser> bookOfUser = gson.fromJson(jsonFileContent.toString(), type);\r\n\t\t//close\r\n\t\tbr.close();\t\r\n\t\treturn bookOfUser;\r\n\t}", "Collection<Book> readAll();", "public ArrayList load() {\n File savefile = new File(\"bookings.txt\");\r\n try {\r\n if (savefile.createNewFile()) {\r\n System.out.println(\"Save file doesnt exist, creating...\");\r\n\r\n try {\r\n FileWriter writer = new FileWriter(savefile);\r\n\r\n for (int x = 0; x <= 89; x = x + 1) {\r\n String stringbuild = (x + \",false,none\");\r\n writer.write(stringbuild + \"\\n\");\r\n }\r\n writer.flush();\r\n writer.close();\r\n } catch (IOException ex) {\r\n Logger.getLogger(ParseBookings.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n\r\n } else {\r\n System.out.println(\"Save file exists. Will load...\");\r\n }\r\n } catch (IOException ex) {\r\n Logger.getLogger(ParseBookings.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n\r\n System.out.println(\"Loading Started...\");\r\n\r\n ArrayList Seats = new ArrayList();\r\n ArrayList Seats_Bronze = new ArrayList();\r\n ArrayList Seats_Silver = new ArrayList();\r\n ArrayList Seats_Gold = new ArrayList();\r\n\r\n try {\r\n File file = new File(\"bookings.txt\");\r\n FileReader filereader = new FileReader(file);\r\n BufferedReader bufferedreader = new BufferedReader(filereader);\r\n\r\n String buffer;\r\n while ((buffer = bufferedreader.readLine()) != null) {\r\n String[] buffersplit = buffer.split(\",\", -1);\r\n int index = Integer.parseInt(buffersplit[0]);\r\n if (index < 30) {\r\n //System.out.println(\"Bronze @ \"+index);\r\n\r\n Seat_Bronze bseat_ = new Seat_Bronze();\r\n bseat_.setID(index);\r\n bseat_.setBooked(Boolean.parseBoolean(buffersplit[1]), buffersplit[2]);\r\n Seats_Bronze.add(bseat_);\r\n\r\n } else if (59 >= index && index > 29) {\r\n //System.out.println(\"Silver @ \"+index);\r\n\r\n Seat_Silver sseat_ = new Seat_Silver();\r\n sseat_.setID(index);\r\n sseat_.setBooked(Boolean.parseBoolean(buffersplit[1]), buffersplit[2]);\r\n Seats_Silver.add(sseat_);\r\n\r\n } else {\r\n //System.out.println(\"Gold @\"+index);\r\n\r\n Seat_Gold gseat_ = new Seat_Gold();\r\n gseat_.setID(index);\r\n gseat_.setBooked(Boolean.parseBoolean(buffersplit[1]), buffersplit[2]);\r\n Seats_Gold.add(gseat_);\r\n\r\n }\r\n\r\n }\r\n\r\n Seats.add(Seats_Bronze);\r\n Seats.add(Seats_Silver);\r\n Seats.add(Seats_Gold);\r\n System.out.println(\"Loading Complete.\");\r\n System.out.println(\"Loaded B/S/G: \" + Seats_Bronze.size() + \"/\" + Seats_Silver.size() + \"/\" + Seats_Gold.size());\r\n\r\n return Seats;\r\n\r\n } catch (FileNotFoundException ex) {\r\n Logger.getLogger(ParseBookings.class.getName()).log(Level.SEVERE, null, ex);\r\n } catch (IOException ex) {\r\n Logger.getLogger(ParseBookings.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n return null;\r\n }", "public static ArrayList readScifinder( String filename)\n {\n \t\tArrayList bibitems=new ArrayList();\n \t\tFile f = new File(filename);\n \n \t\tif(!f.exists() && !f.canRead() && !f.isFile()){\n \t\t\tSystem.err.println(\"Error \" + filename + \" is not a valid file and|or is not readable.\");\n \t\t\treturn null;\n \t\t}\n \t\tStringBuffer sb=new StringBuffer();\n \t\ttry{\n \t\t\tBufferedReader in = new BufferedReader(new FileReader( filename));\n \n \t\t\tString str;\n \t\t\twhile ((str = in.readLine()) != null) {\n \t\t\t\tsb.append(str);\n \t\t\t}\n \t\t\tin.close();\n \n \t\t}\n \t\tcatch(IOException e){return null;}\n \t\tString [] entries=sb.toString().split(\"START_RECORD\");\n \t\tHashMap hm=new HashMap();\n \t\tfor(int i=1; i<entries.length; i++){\n \t\t\tString[] fields = entries[i].split(\"FIELD \");\n \t\t\tString Type=\"\";\n \t\t\thm.clear(); // reset\n \t\t\tfor(int j=0; j<fields.length; j++) if (fields[j].indexOf(\":\") >= 0) {\n \t\t\t\tString tmp[]= new String[2];\n tmp[0] = fields[j].substring(0, fields[j].indexOf(\":\"));\n tmp[1] = fields[j].substring(fields[j].indexOf(\":\")+1);\n \t\t\t\tif(tmp.length > 1){//==2\n \t\t\t\t\tif(tmp[0].equals(\"Author\"))\n \t\t\t\t\t\thm.put( \"author\", tmp[1].replaceAll(\";\",\" and \") );\n \t\t\t\t\telse if(tmp[0].equals(\"Title\"))\n \t\t\t\t\t\thm.put(\"title\",tmp[1]);\n \n \t\t\t\t\telse if(tmp[0].equals(\"Journal Title\"))\n \t\t\t\t\t\thm.put(\"journal\",tmp[1]);\n \n \t\t\t\t\telse if(tmp[0].equals(\"Volume\"))\n \t\t\t\t\thm.put(\"volume\",tmp[1]);\n \t\t\t\telse if(tmp[0].equals(\"Page\"))\n \t\t\t\t\thm.put(\"pages\",tmp[1]);\n \t\t\t\telse if(tmp[0].equals(\"Publication Year\"))\n \t\t\t\t\thm.put(\"year\",tmp[1]);\n \t\t\t\telse if(tmp[0].equals(\"Abstract\"))\n \t\t\t\t\thm.put(\"abstract\",tmp[1]);\n \t\t\t\telse if(tmp[0].equals(\"Supplementary Terms\"))\n \t\t\t\t\thm.put(\"keywords\",tmp[1]);\n \t\t\t\telse if(tmp[0].equals(\"Document Type\"))\n \t\t\t\t\tType=tmp[1].replaceAll(\"Journal\",\"article\");\n \t\t\t}\n \t }\n \n \t BibtexEntry b=new BibtexEntry(Globals.DEFAULT_BIBTEXENTRY_ID,\n \t\t\t\t\t\t\t\t\t Globals.getEntryType(Type)); // id assumes an existing database so don't create one here\n \t b.setField( hm);\n \t bibitems.add( b );\n \n \t}\n \treturn bibitems;\n }", "private void loadCarListings() {\r\n try {\r\n cars = Reader.readCars(new File(CARLISTINGS_FILE));\r\n } catch (IOException e) {\r\n cars = new Cars();\r\n }\r\n }", "List<BookStoreElement> load(Reader reader);", "private static void readBooksInfo() {\n List<eGenre> arrBook = new ArrayList<>();\n\n // 1 //\n arrBook.add(eGenre.FANTASY);\n arrBook.add(eGenre.ADVENTURE);\n book.add(new Book(1200, arrBook, \"Верн Жюль\", \"Таинственный остров\", 1875));\n arrBook.clear();\n // 2 //\n arrBook.add(eGenre.FANTASY);\n arrBook.add(eGenre.MYSTIC);\n book.add(new Book(425, arrBook, \"Григоренко Виталий\", \"Иван-душитель\", 1953));\n arrBook.clear();\n // 3 //\n arrBook.add(eGenre.DETECTIVE);\n arrBook.add(eGenre.MYSTIC);\n book.add(new Book(360, arrBook, \"Сейгер Райли\", \"Последние Девушки\", 1992));\n arrBook.clear();\n // 4 //\n arrBook.add(eGenre.DETECTIVE);\n book.add(new Book(385, arrBook, \"Ольга Володарская\", \"То ли ангел, то ли бес\", 1995));\n arrBook.clear();\n // 5 //\n arrBook.add(eGenre.NOVEL);\n arrBook.add(eGenre.ACTION);\n book.add(new Book(180, arrBook, \"Лихэйн Деннис\", \"Закон ночи\", 1944));\n arrBook.clear();\n // 6 //\n arrBook.add(eGenre.NOVEL);\n book.add(new Book(224, arrBook, \"Мураками Харуки\", \"Страна Чудес без тормозов и Конец Света\", 1985));\n arrBook.clear();\n // 7 //\n arrBook.add(eGenre.STORY);\n book.add(new Book(1200, arrBook, \"Джон Хейвуд\", \"Люди Севера: История викингов, 793–1241\", 2017));\n arrBook.clear();\n // 8 //\n arrBook.add(eGenre.ACTION);\n arrBook.add(eGenre.MYSTIC);\n arrBook.add(eGenre.DETECTIVE);\n book.add(new Book(415, arrBook, \"Линдквист Юн\", \"Впусти меня\", 2017));\n arrBook.clear();\n // 9 //\n arrBook.add(eGenre.ACTION);\n book.add(new Book(202, arrBook, \"Сухов Евгений\", \"Таежная месть\", 2016));\n arrBook.clear();\n // 10 //\n arrBook.add(eGenre.DETECTIVE);\n arrBook.add(eGenre.MYSTIC);\n book.add(new Book(231, arrBook, \"Винд Кристиан\", \"Призраки глубин\", 2019));\n arrBook.clear();\n }", "public static Map<Long, Book> readToMap() throws ApplicationException {\r\n ArrayList<String> bookList = readFile();\r\n Map<Long, Book> books = new HashMap<>();\r\n\r\n for (int i = 0; i < bookList.size(); i++) {\r\n String[] rows = bookList.get(i).split(COMMA_DELIMITER, -1);\r\n Book book = readBookString(rows);\r\n books.put(book.getId(), book);\r\n LOG.debug(String.format(\"%s has been added to the Map\", book.getAuthor()));\r\n\r\n }\r\n\r\n return books;\r\n\r\n }", "public void populateListFromFile() \n\t{\n\t\tBufferedReader bufferedReader = null;\n\t\tallQuestions = new ArrayList<ArrayList<String>>();\n\t\tquestionAndAnswers = new ArrayList<String>();\n\n\t\ttry {\n\t\t bufferedReader = new BufferedReader(new FileReader(\"questions.txt\"));\n\t\t String line = \"\";\n\t\t \n\t\t while ((line = bufferedReader.readLine()) != null) \n\t\t {\t\t\t \t\n\t\t \tif(line.length() > 0)\n\t\t \t\tquestionAndAnswers.add(line);\n\t\t \telse if (line.length() == 0)\n\t\t \t{\n\t\t \t\tallQuestions.add(questionAndAnswers);\n\t\t \t\tquestionAndAnswers = new ArrayList<String>();\n\t\t \t}\n\t\t } \n\t\t} catch (IOException e) {\n\t\t e.printStackTrace();\n\t\t}\n\t}", "public void loadItems() {\n\t\tArrayList<String> lines = readData();\n\t\tfor (int i = 1; i < lines.size(); i++) {\n\t\t\tString line = lines.get(i);\n\t\t\t\n\t\t\tString[] parts = line.split(\",\");\n\t\t\t\n//\t\t\tSystem.out.println(\"Name: \" + parts[0]);\n//\t\t\tSystem.out.println(\"Amount: \" + parts[1]);\n//\t\t\tSystem.out.println(\"Price: \" + parts[2]);\n//\t\t\tSystem.out.println(\"-------\");\n\t\t\t\n\t\t\tString name = parts[0].trim();\n\t\t\tint amount = Integer.parseInt(parts[1].trim());\n\t\t\tdouble price = Double.parseDouble(parts[2].trim());\n\t\t\t\n\t\t\tItem item = new Item(name, amount, price);\n\t\t\titemsInStock.add(item);\n\t\t}\n\t}", "public void open(String fileName){\r\n \tString inStr = \"\";\r\n \tString[] parts;\r\n \tString title = \"\";\r\n \tString author = \"\";\r\n \tString year = \"\";\r\n \tString availability = \"\";\r\n \tString type = \"\";\r\n \tString temp = \"\";\r\n \t\r\n \titems.clear();\r\n \t\r\n \ttry{\r\n \t BufferedReader ir = new BufferedReader(new FileReader(fileName + \".txt\"));\r\n \t while((inStr = ir.readLine()) != null){\r\n \t \t\t//First we have to split the string\r\n \t \t\t//at every comma, since the file \r\n \t \t\t//contains a comma seperated list.\r\n\t\tparts = inStr.split(\", \");\r\n\t\tif(parts.length == 1)\r\n\t\t\tcontinue;\r\n\r\n\t\t \r\n\t\tfor(int i = 0; i < parts.length; i++){\r\n\t\t\tString[] pts = parts[i].split(\": \");\r\n\t\t\t\r\n\t\t\t //A switch statement makes it a little\r\n\t\t\t //easier and cleaner when splitting up\r\n\t\t\t //the elements for the second time,\r\n\t\t\t //by the :\r\n\t\t\tswitch(i) {\r\n \t\t\t\tcase 0:\r\n \t\t\t\t\ttitle = pts[1];\r\n\t \t\t\tbreak;\r\n \t\t\t\tcase 1:\r\n \t\t\t\t\ttemp = pts[1];\r\n \t\t\t\tbreak;\r\n\t \t\t\tcase 2:\r\n \t\t\t\t\tavailability = pts[1];\r\n \t\t\t\tbreak;\r\n \t\t\t\tcase 3:\r\n \t\t\t\t\ttype = pts[1];\r\n\t \t\t\tbreak;\r\n \t\t\t}\r\n \t \t}\t\r\n \t \t\r\n \t \t\t//Type and Title are common to all items,\r\n \t \t\t//so we dont have to check the itemType\r\n \t \t\t//before printing this part.\r\n\t\tSystem.out.println(\"Type: \" + type);\t\r\n\t\tSystem.out.println(\"Title: \" + title);\r\n\t\t\r\n\t\t\t//Now we have to check if the type is a book\r\n\t\t\t//or a magazine, since the two will have\r\n\t\t\t//different information attached to them.\r\n \t\tif(type.equalsIgnoreCase(\"BOOK\")) {\r\n\t\t\tSystem.out.println(\"Author: \" + temp);\r\n\t\t\tBook b = new Book(title, temp);\r\n\t\t\tif(availability.equalsIgnoreCase(\"true\"))\r\n\t\t\t\tb.setAvailability(true);\r\n\t\t\telse\r\n\t\t\t\tb.setAvailability(false);\r\n\t\t\titems.add(b);\r\n \t\t} else {\r\n\t\t\tSystem.out.println(\"Year: \" + temp);\r\n\t\t\tMagazine b = new Magazine(title, Integer.parseInt(temp));\r\n\t\t\tSystem.out.println(\"Control: \" + availability);\r\n\t\t\tif(availability.equalsIgnoreCase(\"true\"))\r\n\t\t\t\tb.setAvailability(true);\r\n\t\t\telse\r\n\t\t\t\tb.setAvailability(false);\r\n\t\t\titems.add(b);\r\n \t\t}\r\n \t\t\r\n \t\t\t//Since Availability is also common to all items,\r\n \t\t\t//it can be printed here without testing the\r\n \t\t\t//itemType. \r\n\t\tSystem.out.println(\"Availability: \" + availability);\r\n\t\tSystem.out.println(\"\");\r\n\t }\r\n\r\n ir.close();\t//Close file when done.\r\n \t } catch (FileNotFoundException e) {\r\n System.out.println(\"ERROR: file not found\");\r\n } catch (IOException e) {\r\n System.out.println(\"ERROR: file I/O problem\");\r\n } catch (NullPointerException e){\r\n \tSystem.out.println(\"ERROR: Null Pointer.\");\r\n }\r\n }", "public static void read(String fname){\r\n\t\t\t\r\n\t\t\tString line = \"\";\r\n\t\t\ttry {\r\n\t // FileReader reads text files in the default encoding.\r\n\t FileReader fileReader = new FileReader(fname);\r\n\t \r\n\t // Always wrap FileReader in BufferedReader.\r\n\t BufferedReader bufferedReader = new BufferedReader(fileReader);\r\n\t header=bufferedReader.readLine();\r\n\t \r\n\t data = new ArrayList<alldata>();\r\n\r\n\t while((line = bufferedReader.readLine()) != null) {\r\n\t \t\r\n\t //parse line and divide data by comma\r\n\t \r\n\t \t\r\n\t \tString[] lineStr = line.split(\",\");\r\n\t \t\r\n\t //create object row into which data from each line is stored and then added to array list\t\r\n\t \t\r\n\t if(lineStr.length >0) {\r\n\t \talldata row = new alldata();\r\n\t \trow.Name = lineStr[0]+ \",\" + lineStr[1];\r\n\t \trow.Num = lineStr[2];\r\n\t \trow.State = lineStr[3];\r\n\t \trow.Zip = lineStr[4];\r\n\t \trow.Age = Integer.parseInt(lineStr[6]);\r\n\t \trow.Sex = lineStr[7];\r\n\t \t\r\n\t \tdata.add(row);\r\n\t }\r\n\t \r\n\t \r\n\t } \r\n\t bufferedReader.close(); // Always close files. \r\n\t }catch(FileNotFoundException ex) {\r\n\t System.out.println(\"Unable to open file '\" + fname + \"'\"); \r\n\t }catch(IOException ex) {\r\n\t System.out.println(\"Error reading file '\" + fname + \"'\"); \r\n\t }\r\n\t\t\tSystem.out.println(\"Finish reading data from file \"+ fname);\r\n\t\t}", "private static void loadBooks() {\n\tbookmarks[2][0]=BookmarkManager.getInstance().createBook(4000,\"Walden\",\"\",1854,\"Wilder Publications\",new String[] {\"Henry David Thoreau\"},\"Philosophy\",4.3);\n\tbookmarks[2][1]=BookmarkManager.getInstance().createBook(4001,\"Self-Reliance and Other Essays\",\"\",1900,\"Dover Publications\",new String[] {\"Henry David Thoreau\"},\"Philosophy\",4.3);\n\tbookmarks[2][2]=BookmarkManager.getInstance().createBook(4002,\"Light From Many Lamps\",\"\",1960,\"Wilder Publications\",new String[] {\"Henry David Thoreau\"},\"Philosophy\",4.3);\n\tbookmarks[2][3]=BookmarkManager.getInstance().createBook(4003,\"Head First Design Patterns\",\"\",1944,\"Wilder Publications\",new String[] {\"Henry David Thoreau\"},\"Philosophy\",4.3);\n\tbookmarks[2][4]=BookmarkManager.getInstance().createBook(4004,\"Effective Java Programming Language Guide\",\"\",1990,\"Wilder Publications\",new String[] {\"Eric Freeman\",\"Bert Bates\",\"Kathy Sierra\",\"Elisabeth Robson\"},\"Philosophy\",4.3);\n}", "public void readFromBookingListFile()\r\n {\r\n try(ObjectInputStream fromBookingListFile = \r\n new ObjectInputStream(new FileInputStream(\"listfiles/bookinglist.dta\")))\r\n {\r\n bookingList = (BookingList) fromBookingListFile.readObject();\r\n bookingList.setSavedStaticBookingRunNr(fromBookingListFile);\r\n }\r\n catch(ClassNotFoundException cnfe)\r\n {\r\n bookingList = new BookingList();\r\n JOptionPane.showMessageDialog(null, \"Fant ikke definisjon av booking \"\r\n + \"objektene.\\nOppretter tomt bookingregister.\\n\" \r\n + cnfe.getMessage(), \"Feilmelding\", \r\n JOptionPane.ERROR_MESSAGE);\r\n }\r\n catch(FileNotFoundException fnfe)\r\n {\r\n bookingList = new BookingList();\r\n JOptionPane.showMessageDialog(null, \"Finner ikke angitt fil.\\n\"\r\n + \"Oppretter tomt bookingregister.\\n\" \r\n + fnfe.getMessage(), \"Feilmelding\", \r\n JOptionPane.ERROR_MESSAGE);\r\n }\r\n catch(IOException ioe)\r\n\t{\r\n bookingList = new BookingList();\r\n JOptionPane.showMessageDialog(null, \"Fikk ikke lest fra filen.\\n\"\r\n + \"Oppretter tomt bookingregister.\\n\"\r\n + ioe.getMessage(), \"Feilmelding\", \r\n JOptionPane.ERROR_MESSAGE);\r\n\t}\r\n }", "public static List readFromACsv(String addressbookname){\n final String COMMA_DELIMITER = \",\";\n String PATH=\"C:/Users/Sukrutha Manjunath/IdeaProjects/Parctice+\" + addressbookname;\n List<Person> personList=new ArrayList<Person>();\n BufferedReader br =null;\n try{\n br=new BufferedReader(new FileReader(PATH));\n String line = \"\";\n br.readLine();\n while ((line = br.readLine()) != null)\n {\n String[] personDetails = line.split(COMMA_DELIMITER);\n\n if(personDetails.length > 0 )\n {\n //Save the employee details in Employee object\n Person person = new Person(personDetails[0],personDetails[1],personDetails[2],\n personDetails[3],personDetails[4], personDetails[5],personDetails[6]);\n personList.add(person);\n }\n }\n\n }catch (Exception ex){\n ex.printStackTrace();\n }\n finally {\n try{\n br.close();\n }\n catch (IOException e){\n e.printStackTrace();\n }\n }\n return personList;\n }", "public static void loadArrayList() throws IOException\n\t{\n\t\tString usersXPFile = \"UsersXP.txt\";\n\t\t\n\t\tFile file = new File(usersXPFile);\n\t\t\n\t\tScanner fileReader;\n\t\t\n\t\tif(file.exists())\n\t\t{\n\t\t\tfileReader = new Scanner(file);\n\t\t\twhile(fileReader.hasNext())\n\t\t\t\tuserDetail1.add(userData.addNewuser(fileReader.nextLine().trim()));\n\t\t\tfileReader.close();\n\t\t}\n\t\telse overwriteFile(usersXPFile, \"\");\n\t\t\n\t\t\n\t}", "public void loadListFromCsv() {\n List<Publication> list = new ArrayList<>();\n String line;\n try(BufferedReader bufferedReader = new BufferedReader(new FileReader(\"saves/data.csv\"))){\n while ((line = bufferedReader.readLine()) != null){\n String[] attributes = line.split(\",(?=([^\\\"]*\\\"[^\\\"]*\\\")*[^\\\"]*$)\");\n String[] formattedAttributes = formatAttributes(attributes);\n Publication book = createPublicationFromAttributes(formattedAttributes);\n list.add(book);\n }\n } catch (IOException e){\n System.out.println(\"IOException occurred: \" + e.getMessage());\n }\n\n this.library = list;\n }", "static void createAuthorsFile () throws IOException {\n\t\tBufferedReader dataFile = new BufferedReader(new FileReader(DATAFILE));\n\t\tString inputLine;\n\t\t\n\t\tPrintWriter isbnLabeledDataFile = new PrintWriter(new FileWriter(ISBNLABELLEDDATAFILE));\n\t\t\n\t\tSet<String> books = new HashSet<String>();\n\t\twhile ((inputLine = dataFile.readLine()) != null) {\n\t\t\tif (inputLine.indexOf('\\t') == -1) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tString[] fields = inputLine.split(\"\\t\");\n\t\t\tif (fields.length != 4) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tfinal String bookId = fields[1];\n\t\t\tif (books.contains(bookId)) {\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\tbooks.add(bookId);\n\t\t\t\tString authorString = getAuthorString(bookId);\n\t\t\t\tisbnLabeledDataFile.println(bookId + \"\\t\" + authorString);\n\t\t\t\tout.println(bookId + \"\\t\" + authorString);\n\t\t\t}\n\t\t}\n\t\tdataFile.close();\n\t\tisbnLabeledDataFile.close();\n\t}", "private void readItems() {\n // open file\n File file = getFilesDir();\n File todoFile = new File(file, \"scores.txt\");\n // try to find items to add\n try {\n items = new ArrayList<>(FileUtils.readLines(todoFile));\n } catch (IOException e) {\n items = new ArrayList<>();\n }\n }", "private static void writeToBooksFile() throws IOException{\n\t\tFileWriter fw = new FileWriter(BOOKS_FILE, false); //overwrites the students.txt file\n\t\tBufferedWriter bw = new BufferedWriter(fw);\n\t\t\n\t\tSet<Integer> keys = ALL_BOOKS.keySet(); //returns list of all keys in ALL_BOOKS\n\t\tfor(int key : keys){\n\t\t\tbw.write(ALL_BOOKS.get(key).ParseForTextFile()); //writes the Parsed Form of the BookDetails object to the books.txt file\n\t\t}\n\t\tbw.close();\n\t}", "public void stockLoad() {\n try {\n File file = new File(stockPath);\n Scanner scanner = new Scanner(file);\n while (scanner.hasNextLine()) {\n String data = scanner.nextLine();\n String[] userData = data.split(separator);\n Stock stock = new Stock();\n stock.setProductName(userData[0]);\n int stockCountToInt = Integer.parseInt(userData[1]);\n stock.setStockCount(stockCountToInt);\n float priceToFloat = Float.parseFloat(userData[2]);\n stock.setPrice(priceToFloat);\n stock.setBarcode(userData[3]);\n\n stocks.add(stock);\n }\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n }", "private void loadFromFile() {\n try {\n FileInputStream fis = openFileInput(FILENAME);\n InputStreamReader isr = new InputStreamReader(fis);\n BufferedReader reader = new BufferedReader(isr);\n Gson gson = new Gson();\n Type listFeelingType = new TypeToken<ArrayList<Feeling>>(){}.getType();\n recordedFeelings.clear();\n ArrayList<Feeling> tmp = gson.fromJson(reader, listFeelingType);\n recordedFeelings.addAll(tmp);\n fis.close();\n\n } catch (FileNotFoundException e) {\n // TODO Auto-generated catch block\n recordedFeelings = new ArrayList<Feeling>();\n e.printStackTrace();\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }", "private ArrayList<String> saveText(){\n FileReader loadDetails = null;\n String record;\n record = null;\n\n //Create an ArrayList to store the lines from text file\n ArrayList<String> lineKeeper = new ArrayList<String>();\n\n try{\n loadDetails=new FileReader(\"employees.txt\");\n BufferedReader bin=new BufferedReader (loadDetails);\n record=new String();\n while (((record=bin.readLine()) != null)){//Read the file and store it into the ArrayList line by line*\n lineKeeper.add(record);\n }//end while\n bin.close();\n bin=null;\n }//end try\n catch (IOException ioe) {}//end catc\n\n return lineKeeper;\n\n }", "public ArrayList<Book> getBooks()\n {\n ArrayList<Book> books = new ArrayList<>();\n String sql = \"SELECT [book_id]\\n\" +\n \" ,[book_title]\\n \" +\n \" ,[book_author]\\n\" +\n \" ,[book_publish_year]\\n\" +\n \" ,[book_category]\\n\" +\n \" ,[book_keyword]\\n\" +\n \" ,[book_status]\\n \" +\n \" FROM [lib_book_master]\";\n try {\n PreparedStatement statement = connection.prepareStatement(sql);\n ResultSet rs = statement.executeQuery();\n //cursor\n while(rs.next()) \n { \n int book_id = rs.getInt(\"book_id\");\n String book_title = rs.getString(\"book_title\");\n String book_author = rs.getString(\"book_author\");\n String book_publish_year = rs.getString(\"book_publish_year\");\n String book_category = rs.getString(\"book_category\");\n String book_keyword = rs.getString(\"book_keyword\");\n String book_status = rs.getString(\"book_status\");\n \n Book s = new Book(book_id,book_title, book_author, book_publish_year,book_category,book_keyword,book_status);\n books.add(s);\n }\n \n } catch (SQLException ex) {\n Logger.getLogger(DBContext.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n return books;\n }", "public static ArrayList readOvid( String filename){\n \tArrayList bibitems = new ArrayList();\n \tFile f=new File(filename);\n \tint rowNum=0;\n \tif(!f.exists() && !f.canRead() && !f.isFile()){\n \t System.err.println(\"Error: \" + filename + \" is not a valid file and|or is not readable.\");\n \t return null;\n \t}\n \ttry{\n \t BufferedReader in = new BufferedReader(new FileReader(filename));\n \t String line;\n \t StringBuffer sb=new StringBuffer();\n \t while((line=in.readLine()) != null){\n \t\tif(line.length()>0 && line.charAt(0) != ' ') {\n sb.append(\"__NEWFIELD__\");\n }\n \t\tsb.append(line);\n \t }\n \t in.close();\n \t String items[]=sb.toString().split(\"<[0-9]+>\");\n \n \t for(int i =1; i<items.length; i++){\n \t\tHashMap h=new HashMap();\n \t\tString[] fields=items[i].split(\"__NEWFIELD__\");\n \t\tfor(int j=0; j<fields.length; j++){\n \t\t fields[j]=fields[j].trim();\n \t\t if(fields[j].indexOf(\"Author\") == 0 && fields[j].indexOf(\"Author Keywords\") ==-1\n \t\t && fields[j].indexOf(\"Author e-mail\") ==-1){\n \t\t\tString author;\n \t\t\tboolean isComma=false;\n \t\t\tif( fields[j].indexOf(\";\") > 0){ //LN FN; [LN FN;]*\n \t\t\t author = fields[j].substring(7,fields[j].length()).replaceAll(\"[^\\\\.A-Za-z,;\\\\- ]\",\"\").replaceAll(\";\",\" and \");\n \t\t\t}\n \t\t\telse{// LN FN. [LN FN.]*\n \t\t\t isComma=true;\n \t\t\t author = fields[j].substring(7,fields[j].length()).replaceAll(\"\\\\.\",\" and\").replaceAll(\" and$\",\"\");\n \n \t\t\t}\n \t\t\tif(author.split(\" and \").length > 1){ // single author or no \";\"\n h.put(\"author\", fixAuthor_lastnameFirst( author) );\n \t\t\t /* if(isComma==false)\n \n \t\t\t else\n \t\t\t\th.put(\"author\", fixAuthor_nocomma( author) );*/\n \t\t\t}\n \t\t\telse\n \t\t\t h.put(\"author\",author);\n \t\t }\n \t\t else if(fields[j].indexOf(\"Title\") == 0)\n \t\t\th.put(\"title\", fields[j].substring(6,fields[j].length()).replaceAll(\"\\\\[.+\\\\]\",\"\") );\n \t\t else if(fields[j].indexOf(\"Source\") == 0){\n System.out.println(fields[j]);\n \t\t\tString s=fields[j];\n \t\t\tMatcher matcher = ovid_src_pat.matcher(s);\n \t\t\tboolean matchfound = matcher.find();\n \t\t\tif(matchfound){\n \t\t\t h.put(\"journal\", matcher.group(1));\n \t\t\t h.put(\"volume\", matcher.group(2));\n \t\t\t h.put(\"issue\", matcher.group(3));\n \t\t\t h.put(\"pages\", matcher.group(4));\n \t\t\t h.put(\"year\", matcher.group(5));\n \t\t\t}else{// may be missing the issue\n \t\t\t matcher = ovid_src_pat_no_issue.matcher(s);\n \t\t\t matchfound = matcher.find();\n \t\t\t if(matchfound){\n \t\t\t\th.put(\"journal\", matcher.group(1));\n \t\t\t\th.put(\"volume\", matcher.group(2));\n \t\t\t\th.put(\"pages\", matcher.group(3));\n \t\t\t\th.put(\"year\", matcher.group(4));\n \t\t\t }\n \t\t\t}\n \n \t\t }\n \t\t else if(fields[j].indexOf(\"Abstract\")==0)\n \t\t\th.put(\"abstract\",fields[j].substring(9,fields[j].length()));\n \t\t //else if(fields[j].indexOf(\"References\")==0)\n \t\t //\th.put(\"references\", fields[j].substring( 11,fields[j].length()));\n \t\t}\n \t\tBibtexEntry b=new BibtexEntry(Globals.DEFAULT_BIBTEXENTRY_ID,\n \t\t\t\t\t\t\t\t\t Globals.getEntryType(\"article\")); // id assumes an existing database so don't create one here\n \t\tb.setField( h);\n \n \t\tbibitems.add( b );\n \n \t }\n \n \t}\n \tcatch(IOException ex){\n \t return null;\n \n \t}\n \treturn bibitems;\n }", "public static ArrayList readData(){\n ArrayList alr = new ArrayList();\n try{\n ArrayList stringArray = (ArrayList)read(filename);\n for (int i = 0; i < stringArray.size(); i++){\n String st = (String)stringArray.get(i);\n StringTokenizer star = new StringTokenizer(st, SEPARATOR);\n int movieID = Integer.parseInt(star.nextToken().trim());\n String email = star.nextToken().trim();\n String comment = star.nextToken().trim();\n Review review = new Review(movieID, email, comment);\n alr.add(review);\n }\n }\n catch (IOException e){\n System.out.println(\"Exception > \" + e.getMessage());\n }\n return alr;\n }", "private void readFile() {\n try (BufferedReader br = new BufferedReader(new FileReader(\"../CS2820/src/production/StartingInventory.txt\"))) {\n String line = br.readLine();\n while (line != null) {\n line = br.readLine();\n this.items.add(line);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public ArrayList<String> loadToRead() {\n\n\t\tSAVE_FILE = TO_READ_FILE;\n\t\tArrayList<String> list = new ArrayList<String>();\n\t\tlist = loadIds();\n\t\treturn list;\n\t}", "private void loadCheckingAccounts(String checkingAccountFileName)\n {\n try\n {\n /* Open the file to read */\n File inputFile = new File(checkingAccountFileName);\n\n /* Create a scanner to begin reading from file */\n Scanner input = new Scanner(inputFile);\n\n while (input.hasNextLine())\n {\n //reading...\n String currentLine = input.nextLine();\n\n //parse on commas\n String[] splitLine = currentLine.split(\",\");\n\n //DateFormat class to parse Date from file\n DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.SHORT);\n\n //parsing out data...\n int accountId = Integer.parseInt(splitLine[0]);\n double balance = Double.parseDouble(splitLine[1]);\n String ssn = splitLine[2];\n double interestRate = Double.parseDouble(splitLine[3]);\n Date dateOpened = dateFormat.parse(splitLine[4]);\n int overdraftSavingsAccountId = Integer.parseInt(splitLine[5]);\n boolean isGoldDiamond = Boolean.parseBoolean(splitLine[6]);\n\n Checking checkingAccount = new Checking(accountId,\n balance,\n ssn,\n interestRate,\n dateOpened,\n overdraftSavingsAccountId,\n isGoldDiamond);\n\n ArrayList<Transaction> accountTransactions = transactionHashMap.get(accountId);\n checkingAccount.setTransactions(accountTransactions);\n\n //add checking account...\n accounts.add(checkingAccount);\n }\n\n input.close();\n\n } catch (Exception e)\n {\n e.printStackTrace();\n }\n }", "public void loadVehicles() throws IOException {\n File veFile = new File(VE_FILE);\n\n //Checks is file created\n if (!veFile.exists()) {\n veFile.createNewFile(); //If not, creates new file\n System.out.print(\"The data file vehicles.txt is not exits. \" +\n \"Creating new data file vehicles.txt... \" +\n \"Done!\");\n this.numberOfVehicle = 0; //New data file with the number of Vehicle is 0\n } else {\n //If file is existed, so loading this data file\n System.out.print(\"The data file vehicles.txt is found. \" +\n \"Data of vehicles is loading...\");\n\n //Loads text file into buffer\n try (BufferedReader br = new BufferedReader(new FileReader(VE_FILE))) {\n String line, contractId, type, licensePlate, chassisId, enginesId;\n\n //Reads number of vehicles\n line = br.readLine();\n if (line == null) return;\n this.numberOfVehicle = Integer.parseInt(line);\n\n for (int i = 0; i < this.numberOfVehicle; i++) {\n //Reads Vehicle's information\n contractId = br.readLine();\n type = br.readLine();\n licensePlate = br.readLine();\n chassisId = br.readLine();\n enginesId = br.readLine();\n\n\n //Create new instance of Vehicle and adds to Vehicle bank\n this.vehicles.add(new Vehicle(Integer.parseInt(contractId), type, licensePlate, chassisId, enginesId));\n }\n }\n System.out.print(\"Done!\");\n }\n }", "public void readFile()\n {\n try {\n fileName = JOptionPane.showInputDialog(null,\n \"Please enter the file you'd like to access.\"\n + \"\\nHint: You want to access 'catalog.txt'!\");\n \n File aFile = new File(fileName);\n Scanner myFile = new Scanner(aFile);\n \n String artist, albumName; \n while(myFile.hasNext())\n { //first we scan the document\n String line = myFile.nextLine(); //for the next line. then we\n Scanner myLine = new Scanner(line); //scan that line for our info.\n \n artist = myLine.next();\n albumName = myLine.next();\n ArrayList<Track> tracks = new ArrayList<>();\n \n while(myLine.hasNext()) //to make sure we get all the tracks\n { //that are on the line.\n Track song = new Track(myLine.next());\n tracks.add(song);\n }\n myLine.close();\n Collections.sort(tracks); //sort the list of tracks as soon as we\n //get all of them included in the album.\n Album anAlbum = new Album(artist, albumName, tracks);\n catalog.add(anAlbum);\n }\n myFile.close();\n }\n catch (NullPointerException e) {\n System.err.println(\"You failed to enter a file name!\");\n System.exit(1);\n }\n catch (FileNotFoundException e) {\n System.err.println(\"Sorry, no file under the name '\" + fileName + \"' exists!\");\n System.exit(2);\n }\n }", "private void loadSavingsAccounts(String savingsAccountFileName)\n {\n try\n {\n /* Open the file to read */\n File inputFile = new File(savingsAccountFileName);\n\n /* Create a scanner to begin reading from file */\n Scanner input = new Scanner(inputFile);\n\n while (input.hasNextLine())\n {\n //read...\n String currentLine = input.nextLine();\n\n //parse on commas...\n String[] splitLine = currentLine.split(\",\");\n\n //DateFormat class to parse Date from file\n DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.SHORT);\n\n //parsing out data...\n int accountId = Integer.parseInt(splitLine[0]);\n double balance = Double.parseDouble(splitLine[1]);\n String ssn = splitLine[2];\n double interestRate = Double.parseDouble(splitLine[3]);\n Date dateOpened = dateFormat.parse(splitLine[4]);\n int overdraftAccountId = Integer.parseInt(splitLine[5]);\n\n Savings savingsAccount = new Savings(accountId,\n balance,\n ssn,\n interestRate,\n dateOpened,\n overdraftAccountId);\n\n ArrayList<Transaction> accountTransactions = transactionHashMap.get(accountId);\n savingsAccount.setTransactions(accountTransactions);\n\n //add savings account...\n accounts.add(savingsAccount);\n }\n\n input.close();\n\n } catch (Exception e)\n {\n e.printStackTrace();\n }\n }", "public void readFromFile(String path) {\n try {\n ArrayList<String> list = new ArrayList<>(Files.readAllLines(Paths.get(path)));\n\n for (String info: list) {\n AddressEntry entry = new AddressEntry();\n ArrayList<String> entryList = new ArrayList<>(Arrays.asList(info.split(\",\")));\n entry.setFirstName(entryList.get(0).trim());\n entry.setLastName(entryList.get(1).trim());\n entry.setStreet(entryList.get(2).trim());\n entry.setCity(entryList.get(3).trim());\n entry.setState(entryList.get(4).trim());\n entry.setZip(Integer.parseInt(entryList.get(5).trim()));\n entry.setPhone(entryList.get(6).trim());\n entry.setEmail(entryList.get(7).trim());\n add(entry);\n }\n\n System.out.println(\"Read in \" + list.size() + \" new Addresses. Successfully loaded\");\n System.out.println(\"There are currently \" + addressEntryList.size() + \" Addresses in the Address Book.\");\n }\n catch (IOException e) {\n System.out.println(e);\n }\n }", "public ArrayList<Auction> readAuctions()\n {\n String dataLines[]; /* Data read from line */\n int countAuction = 0; /* No. of auction */\n boolean bNotNull = true; /* Indicate line null error */ \n \n ArrayList<Auction> auctionList = new ArrayList<Auction>();\n \n /* Open file. If cannot open, return null; */\n TextFileReader reader = new TextFileReader(auctionFileName);\n if (reader.open() == false)\n return null;\n \n /* Read number of data */\n String line;\n line = reader.readLine();\n try\n {\n countAuction = Integer.parseInt(line);\n }\n catch (Exception e)\n {\n return null;\n }\n \n /* Loop get auction, loop get bid, and add to list */\n int numTag = tagAuction.length;\n for (int i = 0; i < countAuction && bNotNull; i++)\n {\n /* Get Auction */\n dataLines = new String[numTag];\n for (int j = 0; j < numTag && bNotNull; j++)\n {\n dataLines[j] = reader.readLine();\n if (dataLines[j] == null)\n bNotNull = false;\n }\n Auction auction = parseAuction(dataLines);\n if (auction != null) /* If data is correct, add to auction list */\n {\n auctionList.add(auction);\n readBids(reader, auction);\n }\n }\n reader.close();\n return auctionList;\n }", "public void load_from_file() {\r\n // prompting file name from user\r\n System.out.print(\"Enter in FileName:\\n>\");\r\n\r\n // taking user input of file name\r\n String filename = Menu.sc.next();\r\n Scanner input;\r\n\r\n // try to open file, if fails throws exception and returns to main menu\r\n try {\r\n input = new Scanner(new FileReader(filename));\r\n } catch (FileNotFoundException e) {\r\n System.out.println(\"Unable to open file!!\");\r\n System.out.println();\r\n return;\r\n }\r\n\r\n int count = 0; // variable to count number of address entry read\r\n\r\n /* reading data until end of file */\r\n while (input.hasNextLine()) {\r\n String firstName = \"\", lastName = \"\", street = \"\", city = \"\", state = \"\", email = \"\", phone = \"\";\r\n int zip = 0;\r\n if (input.hasNextLine())\r\n firstName = input.nextLine();\r\n if (input.hasNextLine())\r\n lastName = input.nextLine();\r\n if (input.hasNextLine())\r\n street = input.nextLine();\r\n if (input.hasNextLine())\r\n city = input.nextLine();\r\n if (input.hasNextLine())\r\n state = input.nextLine();\r\n if (input.hasNextLine())\r\n zip = Integer.parseInt(input.nextLine());\r\n if (input.hasNextLine())\r\n phone = input.nextLine();\r\n if (input.hasNext())\r\n email = input.nextLine();\r\n if (input.hasNext())\r\n input.nextLine();\r\n addressEntryList.add(new AdressEntry(firstName, lastName, street, city, state, zip, phone, email));\r\n count++;\r\n }\r\n\r\n /*\r\n printing number of address entry variables\r\n and printing total number of AddressEntry in the list\r\n */\r\n System.out.println(\"Read in \" + count + \" new Addresses, successfully loaded, currently \"\r\n + addressEntryList.size() + \" Addresses\");\r\n input.close();\r\n System.out.println();\r\n }", "public static void loadcars() {\n Cars xx = new Cars();\n System.out.println(\"Load cars\");\n listcars.clear();\n try {\n File fileload = new File(\"cars.csv\");\n BufferedReader in = new BufferedReader(new FileReader(fileload));\n String st;\n while((st = in.readLine()) != null) {\n String[] strs = st.split(\"[,//;]\");\n addcar(strs[0], strs[1], strs[2],Integer.parseInt(strs[3]));\n }\n in.close();\n System.out.println(\"cars data restored from cars.csv\");\n } catch (IOException i) {\n i.printStackTrace();\n }\n\n\n }", "public List<BookData> getAllBooks() throws Exception{\n\t\tList<BookData> list = new ArrayList<>();\n\t\tStatement myStmt = null;\n\t\tResultSet myRs = null;\n\t\t\n\t\ttry {\n\t\t\tmyStmt = myConn.createStatement();\n\t\t\tmyRs = myStmt.executeQuery(\"select title, author_name, publisher_name, book_id from books natural join book_authors\");\n\t\t\t\n\t\t\twhile (myRs.next()) {\n\t\t\t\tBookData tempbook = convertRowToBook(myRs);\n\t\t\t\tlist.add(tempbook);\n\t\t\t}\n\t\t\t\n\t\t\treturn list;\n\t\t}\n\t\tfinally {\n\t\t\tmyRs.close();\n\t\t\tmyStmt.close();\n\t\t\t\n\t\t}\n\t\t\n\t}", "private void loadFromFile() {\n\t\ttry {\n\t\t\tFileInputStream fis = openFileInput(FILENAME);\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(fis));\n\t\t\tString line = in.readLine();\n\t\t\tGson gson = new Gson();\n\t\t\twhile (line != null) {\n\t\t\t\tCounterModel counter = gson.fromJson(line, CounterModel.class);\n\t\t\t\tif (counterModel.getCounterName().equals(counter.getCounterName())) {\n\t\t\t\t\tcounterListModel.addCounterToList(counterModel);\n\t\t\t\t\tcurrentCountTextView.setText(Integer.toString(counterModel.getCount()));\n\t\t\t\t} else {\n\t\t\t\t\tcounterListModel.addCounterToList(counter);\n\t\t\t\t}\n\t\t\t\tline = in.readLine();\n\t\t\t} \n\t\t\tfis.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public List<Book> getAllBooks()\n {\n List<Book> books = new LinkedList<Book>();\n\n //1. Query para la consulta\n String query = \"Select * FROM \"+ BookReaderContract.FeedBook.TABLE_NAME;\n\n //2. Obtener la referencia a la DB\n SQLiteDatabase db = this.getWritableDatabase();\n Cursor cursor = db.rawQuery(query, null);\n\n //3. Recorrer el resultado y crear un objeto Book\n Book book = null;\n if(cursor.moveToFirst()){\n do{\n book = new Book();\n book.setId(Integer.parseInt(cursor.getString(0)));\n book.setTitle(cursor.getString(1));\n book.setAuthor(cursor.getString(2));\n books.add(book);\n }while(cursor.moveToNext());\n }\n Log.d(\"getAllBooks\",books.toString());\n return books;\n }", "public void parseJson() {\n\n try {\n JSONParser parser = new JSONParser();\n jsonReader = new BufferedReader(new InputStreamReader(getClass().getResourceAsStream(\"/resources/bangor-library.json\")));\n JSONObject jsonObj = (JSONObject) parser.parse(jsonReader);\n \n String name = (String) jsonObj.get(\"name\");\n libraryName = name;\n JSONArray extractedBooks = (JSONArray) jsonObj.get(\"books\");\n\n Iterator i = extractedBooks.iterator();\n while (i.hasNext()) {\n rec = new LibraryRecord();\n rec.setLib_name(libraryName);\n JSONObject innerObj = (JSONObject) i.next();\n rec.setBook_name(innerObj.get(\"name\").toString());\n rec.setAuth_name(innerObj.get(\"author\").toString());\n rec.setCat_name(innerObj.get(\"category\").toString());\n\n if (!LibraryAccess.bookShelves.isEmpty()) {\n for (LibraryRecord bookSaved : LibraryAccess.bookShelves) {\n if (this.rec.getHashOfContent() == bookSaved.getHashOfContent()) {\n duplicate = true;\n rec = null;\n }\n }\n if (!duplicate) {\n LibraryAccess.addRecord(rec);\n }\n duplicate = false;\n\n } else {\n System.out.println(\"Library empty : Adding records...\");\n LibraryAccess.addRecord(this.rec);\n }\n }\n\n } catch (FileNotFoundException ex) {\n Logger.getLogger(JsnParser.class.getName()).log(Level.SEVERE, null, ex);\n } catch (IOException ex) {\n Logger.getLogger(JsnParser.class.getName()).log(Level.SEVERE, null, ex);\n } catch (ParseException ex) {\n Logger.getLogger(JsnParser.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public void loadData () {\n // create an ObjectInputStream for the file we created before\n ObjectInputStream ois;\n try {\n ois = new ObjectInputStream(new FileInputStream(\"DB/Guest.ser\"));\n\n int noOfOrdRecords = ois.readInt();\n Guest.setMaxID(ois.readInt());\n System.out.println(\"GuestController: \" + noOfOrdRecords + \" Entries Loaded\");\n for (int i = 0; i < noOfOrdRecords; i++) {\n guestList.add((Guest) ois.readObject());\n //orderList.get(i).getTable().setAvailable(false);\n }\n } catch (IOException | ClassNotFoundException e1) {\n // TODO Auto-generated catch block\n e1.printStackTrace();\n }\n }", "@Override\n\tpublic List<Book> getAllBooks() {\n\t\treturn bookList;\n\t}", "private void loadFromFile() {\n try {\n FileInputStream fis = openFileInput(FILENAME);\n BufferedReader in = new BufferedReader(new InputStreamReader(fis));\n\n Gson gson = new Gson();\n Type listType = new TypeToken<ArrayList<Sub>>(){}.getType();\n subList = gson.fromJson(in, listType);\n\n } catch (FileNotFoundException e) {\n subList = new ArrayList<Sub>();\n }\n }", "public void initiateStore() {\r\n\t\tURLConnection urlConnection = null;\r\n\t\tBufferedReader in = null;\r\n\t\tURL dataUrl = null;\r\n\t\ttry {\r\n\t\t\tdataUrl = new URL(URL_STRING);\r\n\t\t\turlConnection = dataUrl.openConnection();\r\n\t\t\tin = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));\r\n\t\t\tString inputLine;\r\n\t\t\twhile ((inputLine = in.readLine()) != null) {\r\n\t\t\t\tString[] splittedLine = inputLine.split(\";\");\r\n\t\t\t\t// an array of 4 elements, the fourth element\r\n\t\t\t\t// the first three elements are the properties of the book.\r\n\t\t\t\t// last element is the quantity.\r\n\t\t\t\tBook book = new Book();\r\n\t\t\t\tbook.setTitle(splittedLine[0]);\r\n\t\t\t\tbook.setAuthor(splittedLine[1]);\r\n\t\t\t\tBigDecimal decimalPrice = new BigDecimal(splittedLine[2].replaceAll(\",\", \"\"));\r\n\t\t\t\tbook.setPrice(decimalPrice);\r\n\t\t\t\tfor(int i=0; i<Integer.parseInt(splittedLine[3]); i++)\r\n\t\t\t\t\tthis.addBook(book);\r\n\t\t\t}\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} finally {\r\n\t\t\ttry {\r\n\t\t\t\tif(!in.equals(null)) in.close();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n\tpublic ArrayList<Question> loadQuestions() {\n\n\t\tArrayList<Question> questionArray = new ArrayList<Question>();\n\t\ttry {\n\t\t\tFileInputStream fileInputStream = context\n\t\t\t\t\t.openFileInput(QUESTION_BANK);\n\t\t\tInputStreamReader inputStreamReader = new InputStreamReader(\n\t\t\t\t\tfileInputStream);\n\t\t\tType listType = new TypeToken<ArrayList<Question>>() {\n\t\t\t}.getType();\n\t\t\tGsonBuilder builder = new GsonBuilder();\n\n\t\t\t// Gson does not serialize/deserialize dates with milisecond\n\t\t\t// precision unless specified\n\t\t\tGson gson = builder.setDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\")\n\t\t\t\t\t.create();\n\t\t\tbuilder.serializeNulls(); // Show fields with null values\n\n\t\t\tArrayList<Question> list = gson.fromJson(inputStreamReader,\n\t\t\t\t\tlistType);\n\t\t\tquestionArray = list;\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn questionArray;\n\t}", "public void readFile() {\r\n\t\tBufferedReader br = null;\r\n\r\n\t\ttry {\r\n\r\n\t\t\tString currentLine;\r\n\r\n\t\t\tbr = new BufferedReader(new FileReader(fileName));\r\n\r\n\t\t\twhile ((currentLine = br.readLine()) != null) {\r\n\r\n\t\t\t\tif (!currentLine.equals(\"\")) {\r\n\t\t\t\t\tString[] paragraphs = currentLine.split(\"\\\\n\\\\n\");\r\n\r\n\t\t\t\t\tfor (String paragraphEntry : paragraphs) {\r\n\t\t\t\t\t\t//process(paragraphEntry);\r\n\t\t\t\t\t\t//System.out.println(\"Para:\"+paragraphEntry);\r\n\t\t\t\t\t\tParagraph paragraph = new Paragraph();\r\n\t\t\t\t\t\tparagraph.process(paragraphEntry);\r\n\t\t\t\t\t\tthis.paragraphs.add(paragraph);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} finally {\r\n\t\t\ttry {\r\n\t\t\t\tif (br != null)br.close();\r\n\t\t\t} catch (IOException ex) {\r\n\t\t\t\tex.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "public void listBooks() {\n for (int g = 0; g < books.length; g++) {\n books[g].toString();\n }\n// List all books in Bookstore\n }", "public ArrayList<Book> getListBook();", "public void initializeBookStore() throws IOException{\r\n //creates new file called \"Book.txt\". \r\n file = new File(\"Book.txt\");\r\n //adds/writes into the file created. \r\n in = new FileWriter(\"Book.txt\", true);\r\n write = new BufferedWriter(in);\r\n \r\n if(file.length() == 0){\r\n write.write(data);\r\n write.newLine();\r\n write.close();\r\n }\r\n }", "public List<Event> fillArrayList()\r\n {\r\n List<Event> list1=new ArrayList<>();\r\n FileReader fr=null;\r\n \r\n try{\r\n \r\n fr=new FileReader(\"./event.txt\");\r\n BufferedReader bf=new BufferedReader(fr);\r\n String s;\r\n \r\n while((s=bf.readLine())!=null)\r\n {\r\n Event event=new Event();\r\n String s1[]=new String[7];\r\n for(int i=0;i<s1.length;i++)\r\n {\r\n s1=s.split(\",\");\r\n \r\n event.setId(Integer.parseInt(s1[0]));\r\n \r\n event.setName(s1[1]);\r\n \r\n event.setOrganizer(s1[2]);\r\n \r\n Date date=Date.valueOf(s1[3]);\r\n \r\n event.setDate(date);\r\n \r\n event.setFees(Double.parseDouble(s1[4]));\r\n \r\n } \r\n list1.add(event);\r\n }\r\n \r\n bf.close();\r\n \r\n }catch(Exception e){e.printStackTrace();}\r\n return list1;\r\n\r\n }", "public void readFile() {\n try\n {\n tasksList.clear();\n\n FileInputStream file = new FileInputStream(\"./tasksList.txt\");\n ObjectInputStream in = new ObjectInputStream(file);\n\n boolean cont = true;\n while(cont){\n Task readTask = null;\n try {\n readTask = (Task)in.readObject();\n } catch (Exception e) {\n }\n if(readTask != null)\n tasksList.add(readTask);\n else\n cont = false;\n }\n\n if(tasksList.isEmpty()) System.out.println(\"There are no todos.\");\n in.close();\n file.close();\n }\n\n catch(IOException ex)\n {\n ex.printStackTrace();\n }\n }", "public void loadList () {\r\n ArrayList<String> list = fileManager.loadWordList();\r\n if (list != null) {\r\n for (String s : list) {\r\n addWord(s);\r\n }\r\n }\r\n }", "public static ArrayList readJStorFile(String filename) {\n ArrayList bibitems = new ArrayList();\n File f = new File(filename);\n if (!f.exists() || !f.canRead() || !f.isFile()) {\n System.err.println(\"Error: \" + filename + \" is not a valid file and|or is not readable.\");\n return null;\n }\n \n String s = \"\";\n try {\n BufferedReader in = new BufferedReader(new FileReader(filename));\n \n while (!s.startsWith(\"Item Type\"))\n s = in.readLine();\n \n mainloop: while ((s = in.readLine()) != null) {\n if (s.equals(\"\"))\n continue;\n if (s.startsWith(\"-----------------------------\"))\n break mainloop;\n String[] fields = s.split(\"\\t\");\n BibtexEntry be = new BibtexEntry(Util.createNeutralId());\n try {\n if (fields[0].equals(\"FLA\"))\n be.setType(BibtexEntryType.getType(\"article\"));\n setIfNecessary(be, \"title\", fields[2]);\n setIfNecessary(be, \"author\", fields[4].replaceAll(\"; \", \" and \"));\n setIfNecessary(be, \"journal\", fields[7]);\n setIfNecessary(be, \"volume\", fields[9]);\n setIfNecessary(be, \"number\", fields[10]);\n String[] datefield = fields[12].split(\" \");\n setIfNecessary(be, \"year\", datefield[datefield.length-1]);\n //for (int i=0; i<fields.length; i++)\n // Util.pr(i+\": \"+fields[i]);\n setIfNecessary(be, \"pages\", fields[13].replaceAll(\"-\", \"--\"));\n setIfNecessary(be, \"url\", fields[14]);\n setIfNecessary(be, \"issn\", fields[15]);\n setIfNecessary(be, \"abstract\", fields[16]);\n setIfNecessary(be, \"keywords\", fields[17]);\n setIfNecessary(be, \"copyright\", fields[21]);\n } catch (ArrayIndexOutOfBoundsException ex) {}\n bibitems.add(be);\n }\n \n } catch (IOException ex) {\n Util.pr(\"Err: \"+s);\n }\n return bibitems;\n }", "public void setLoadItems(String borrowedFileName) \n\t{\n\t\trecordCount = RESET_VALUE;\n\n\t\ttry \n\t\t{\n\t\t\tScanner infile = new Scanner(new FileInputStream(borrowedFileName));\n\n\t\t\twhile(infile.hasNext() == true && recordCount < MAX_ITEMS) \n\t\t\t{\n\t\t\t\titemIDs[recordCount] = infile.nextInt();\n\t\t\t\titemNames[recordCount] = infile.next(); \n\t\t\t\titemPrices[recordCount] = infile.nextDouble(); \n\t\t\t\tinStockCounts[recordCount] = infile.nextInt();\n\t\t\t\trecordCount++;\n\t\t\t}\n\n\t\t\tinfile.close();\n\n\t\t\t//sort parallel arrays by itemID\n\t\t\tsetBubbleSort();\n\n\t\t}//END try\n\n\t\tcatch(IOException ex) \n\t\t{\n\t\t\trecordCount = NOT_FOUND;\n\t\t}\n\t}", "private void loadTermLoanAccounts(String termLoanAccountFileName)\n {\n try\n {\n /* Open the file to read */\n File inputFile = new File(termLoanAccountFileName);\n\n /* Create a scanner to begin reading from file */\n Scanner input = new Scanner(inputFile);\n\n while (input.hasNextLine())\n {\n //reading...\n String currentLine = input.nextLine();\n\n //parsing out on commas...\n String[] splitLine = currentLine.split(\",\");\n\n //DateFormat class to parse Date from file\n DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.SHORT);\n\n //parsing out data...\n int accountId = Integer.parseInt(splitLine[0]);\n double balance = Double.parseDouble(splitLine[1]);\n String ssn = splitLine[2];\n double interestRate = Double.parseDouble(splitLine[3]);\n Date dateOpened = dateFormat.parse(splitLine[4]);\n Date dueDate = dateFormat.parse(splitLine[5]);\n Date dateNotified = dateFormat.parse(splitLine[6]);\n double currentPaymentDue = Double.parseDouble(splitLine[7]);\n Date lastPaymentDate = dateFormat.parse(splitLine[8]);\n boolean missedPayment = Boolean.parseBoolean(splitLine[9]);\n char loanType = splitLine[10].charAt(0);\n TermLoanType termLoanType;\n\n //this determines whether the loan is long or short.\n if (loanType == 'S')\n {\n termLoanType = TermLoanType.SHORT;\n }\n else\n {\n termLoanType = TermLoanType.LONG;\n }\n\n int years = Integer.parseInt(splitLine[11]);\n\n TermLoan termLoanAccount = new TermLoan(accountId,\n balance,\n ssn,\n interestRate,\n dateOpened,\n dueDate,\n dateNotified,\n currentPaymentDue,\n lastPaymentDate,\n missedPayment,\n termLoanType,\n years);\n\n ArrayList<Transaction> accountTransactions = transactionHashMap.get(accountId);\n termLoanAccount.setTransactions(accountTransactions);\n\n //adds term loan accounts\n accounts.add(termLoanAccount);\n }\n\n input.close();\n\n } catch (Exception e)\n {\n e.printStackTrace();\n }\n }", "public List<Book> getAllBooks(){\n\t\treturn this.bRepo.findAll();\n\t}", "private void loadDataFromMemory(String filename){\n shoppingList.clear();\n new ReadFromMemoryAsync(filename, getCurrentContext(), new ReadFromMemoryAsync.AsyncResponse(){\n\n @Override\n public void processFinish(List<ShoppingItem> output) {\n shoppingList.addAll(output);\n sortItems();\n }\n }).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);\n// for (ShoppingItem item: items) {\n// shoppingList.add(item);\n// }\n// sortItems();\n }", "private ArrayList<BookLikedByUser> loadBooksLikedByUser(InputStream is) throws IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(is));\r\n\t\tStringBuilder jsonFileContent = new StringBuilder();\r\n\t\t//read line by line from file\r\n\t\tString nextLine = null;\r\n\t\twhile ((nextLine = br.readLine()) != null){\r\n\t\t\tjsonFileContent.append(nextLine);\r\n\t\t}\r\n\r\n\t\tGson gson = new Gson();\r\n\t\t//this is a require type definition by the Gson utility so Gson will \r\n\t\t//understand what kind of object representation should the json file match\r\n\t\tType type = new TypeToken<ArrayList<BookLikedByUser>>(){}.getType();\r\n\t\tArrayList<BookLikedByUser> bookLikedByUser = gson.fromJson(jsonFileContent.toString(), type);\r\n\t\t//close\r\n\t\tbr.close();\t\r\n\t\treturn bookLikedByUser;\r\n\t}", "public static void init() {\n\t\tList<Object> objects = FileManager.readObjectFromFile(\"student.dat\");\n\t\tfor (Object o : objects)\n\t\t\tStudentList.add((Student) o);\n\t}", "public List<Book> listBooks() {\n\t\tArrayList<Book> books = new ArrayList<>();\n\t\ttry (Connection con = LibraryConnection.getConnection()) {\n\t\t\tPreparedStatement stmt = con.prepareStatement(\"SELECT * FROM book\");\n\n\t\t\tResultSet rs = stmt.executeQuery();\n\t\t\twhile (rs.next()) {\n\t\t\t\tbooks.add(new Book(rs.getString(\"isbn\"), rs.getString(\"title\")));\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn books;\n\t}", "private void readFile() {\r\n\t\tcsvEntrys = new ArrayList<>();\r\n\t\tString line = \"\";\r\n\t\ttry (BufferedReader br = new BufferedReader(new FileReader(new File(filepath)))) {\r\n\t\t\twhile ((line = br.readLine()) != null) {\r\n\t\t\t\tif (!line.contains(\"id\")) {\r\n\t\t\t\t\tcsvEntrys.add(line);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "@Override\n public void loadDataFromFile(File file) {\n Gson gson = new Gson();\n try {\n Scanner scanner = new Scanner(file);\n while (scanner.hasNextLine()){\n IndividualCustomer customer =\n gson.fromJson(scanner.nextLine(),IndividualCustomer.class);\n customerList.add(customer);\n }\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n\n }", "public static ArrayList<Student> loadListOfStudents(String fileName) {\n ArrayList<Student> students = new ArrayList<>();\r\n String str = TextReader.StringFromFile(fileName);//Uses the method that returns a complete string with newlines for each studentline.\r\n if (validateInput(str)) {//Uses the validation method to check that the input is valid.\r\n String[] lines = str.split(\"\\n\");\r\n String[] lineParameters;\r\n int countFor = 0;\r\n for (String line : lines) {\r\n if(countFor > 1){\r\n lineParameters = line.split(\",\");\r\n Vote vote = new Vote(new Subject(lineParameters[1]), new Subject(lineParameters[2]), new Subject(lineParameters[3]), new Subject(lineParameters[4]));\r\n Student newStudent = new Student(lineParameters[0], vote);\r\n students.add(newStudent);\r\n }\r\n countFor++;\r\n }\r\n }\r\n\r\n return students;\r\n }", "private void loadSavedCourses() {\n courseList = new CourseList(new ArrayList<>());\n try {\n courseList = reader.readCourseList();\n } catch (IOException ioe) {\n System.err.println(\"Course File Missing\");\n } catch (JSONException je) {\n System.err.println(\"Empty File - Course\");\n System.out.println(je);\n }\n }", "static void loadCourse() {\n\t\tScanner inputStreamC = null; // create object variable for Course\n\n\t\ttry { // create Scanner object & assign to variable\n\t\t\tinputStreamC = new Scanner(new File(\"course.txt\"));\n\t\t\tinputStreamC.useDelimiter(\",\");\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"No Course Infomation was Loaded\");\n\t\t\t// System.exit(0);\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\twhile (inputStreamC.hasNext()) {\n\n\t\t\t\tString readCourseID = inputStreamC.next();\n\t\t\t\tString readCourseName = inputStreamC.next();\n\t\t\t\tString readCourseUserName = inputStreamC.next();\n\t\t\t\t\n\t\t\t\tCourse c1 = new Course(readCourseID, readCourseName, readCourseUserName);\n\t\t\t\tcourseInfoArray.add(c1);\n\t\t\t\t//System.out.println(\"Read a Course \" + c1.getCourseID() + \" \" + c1.getCourseName() + \" \"\t+ c1.getCoordinatorUserID());\n\t\t\t\t\n\t\t\t} //eo while\n\t\t} catch (IllegalStateException e) {\n\t\t\tSystem.err.println(\"Could not read from the file\");\n\t\t} catch (InputMismatchException e) {\n\t\t\tSystem.err.println(\"Something wrong happened while reading the file\");\n\t\t}\n\t\tinputStreamC.close();\n\t}", "public BookListings(Book[] bookList) {\r\n bookListings = new Vector <Association <Book, Vector>> ();\r\n\r\n // Load the books into the BookListings\r\n for (int i = 0; i < bookList.length; i++) {\r\n Association <Book, ListingVector>> assoc = bookListings.get(i);\r\n assoc.getKey() = bookList(i);\r\n assoc.getValue() = new Vector<Listing>();\r\n }\r\n }", "public static void main(String[] args) throws IOException, ClassNotFoundException {\n FileInputStream fis =new FileInputStream(\"test.txt\");\n BufferedInputStream bis=new BufferedInputStream(fis);\n ObjectInputStream ois=new ObjectInputStream(bis);\n ArrayList<Goods> list = (ArrayList<Goods>)ois.readObject();\n for (int i = 0; i < list.size(); i++) {\n Goods goods = list.get(i);\n System.out.println(goods);\n }\n\n // Goods goods= (Goods)ois.readObject();\n // System.out.println(goods);\n ois.close();\n\n }", "public void readDataFromFile(){\n try {\n weatherNow.clear();\n // Open File\n Scanner scan = new Scanner(context.openFileInput(fileSaveLoc));\n\n // Find all To Do items\n while (scan.hasNextLine()) {\n String line = scan.nextLine();\n\n // if line is not empty it is data, add item.\n if (!line.isEmpty()) {\n // first is the item name and then the item status.\n String[] readList = line.split(\",\");\n String city = readList[0];\n String countryCode = readList[1];\n double temp = Double.parseDouble(readList[2]);\n String id = readList[3];\n String description = readList[4];\n\n weatherNow.add(new WeatherNow(city,countryCode, temp, id, description));\n }\n }\n\n // done\n scan.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public ArrayList<String> loadRead() {\n\n\t\tSAVE_FILE = READ_FILE;\n\t\tArrayList<String> list = new ArrayList<String>();\n\t\tlist = loadIds();\n\t\treturn list;\n\t}", "private static void initializeLists() {\n\t\t\n\t\t//read from serialized files to assign array lists\n\t\t//customerList = (ArrayList<Customer>) readObject(customerFile);\n\t\t//employeeList = (ArrayList<Employee>) readObject(employeeFile);\n\t\t//applicationList = (ArrayList<Application>) readObject(applicationFile);\n\t\t//accountList = (ArrayList<BankAccount>) readObject(accountFile);\n\t\t\n\t\t//read from database to assign array lists\n\t\temployeeList = (ArrayList<Employee>)employeeDao.readAll();\n\t\tcustomerList = (ArrayList<Customer>)customerDao.readAll();\n\t\taccountList = (ArrayList<BankAccount>) accountDao.readAll();\n\t\tapplicationList = (ArrayList<Application>)applicationDao.readAll();\n\t\t\n\t\tassignBankAccounts();\n\t}", "@SuppressWarnings(\"unchecked\")\n\tpublic static ArrayList<Tweet> load(String fname) {\n\t\tArrayList<Tweet> tweets = new ArrayList<Tweet>();\n\t\n\t\ttry {\n\t\t FileInputStream fin = new FileInputStream(fname);\n\t\t ObjectInputStream ois = new ObjectInputStream(fin);\n\t\t tweets = (ArrayList<Tweet>) (ois.readObject());\n\t\t ois.close();\n\t\t} catch (FileNotFoundException ex) {\n\t\t ex.printStackTrace();\n\t\t} catch (IOException ioex) {\n\t\t ioex.printStackTrace();\n\t\t}\n\t\tcatch (ClassNotFoundException classex) {\n\t\t classex.printStackTrace();\n\t\t}\n\t\treturn tweets;\n }", "private ArrayList<Review> loadReviews(InputStream is) throws IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(is));\r\n\t\tStringBuilder jsonFileContent = new StringBuilder();\r\n\t\t//read line by line from file\r\n\t\tString nextLine = null;\r\n\t\twhile ((nextLine = br.readLine()) != null){\r\n\t\t\tjsonFileContent.append(nextLine);\r\n\t\t}\r\n\r\n\t\tGson gson = new Gson();\r\n\t\t//this is a require type definition by the Gson utility so Gson will \r\n\t\t//understand what kind of object representation should the json file match\r\n\t\tType type = new TypeToken<ArrayList<Review>>(){}.getType();\r\n\t\tArrayList<Review> reviews = gson.fromJson(jsonFileContent.toString(), type);\r\n\t\t//close\r\n\t\tbr.close();\t\r\n\t\treturn reviews;\r\n\t}", "public static ArrayList readBiblioscapeTagFile(String filename) {\n ArrayList bibitems = new ArrayList();\n File f = new File(filename);\n if (!f.exists() || !f.canRead() || !f.isFile()) {\n System.err.println(\"Error: \" + filename + \" is not a valid file and|or is not readable.\");\n return null;\n }\n \n try {\n BufferedReader in = new BufferedReader(new FileReader(filename));\n String line;\n HashMap hm = new HashMap();\n HashMap lines = new HashMap();\n StringBuffer previousLine = null;\n while ((line = in.readLine()) != null) {\n // entry delimiter -> item complete\n if (line.equals(\"------\")) {\n String[] type = new String[2];\n String[] pages = new String[2];\n String country = null;\n String address = null;\n Vector comments = new Vector();\n // add item\n Object[] l = lines.entrySet().toArray();\n for (int i = 0; i < l.length; ++i) {\n Map.Entry entry = (Map.Entry)l[i];\n if (entry.getKey().equals(\"AU\")) hm.put(\"author\",entry.getValue().toString());\n else if (entry.getKey().equals(\"TI\")) hm.put(\"title\",entry.getValue().toString());\n else if (entry.getKey().equals(\"ST\")) hm.put(\"booktitle\",entry.getValue().toString());\n else if (entry.getKey().equals(\"YP\")) hm.put(\"year\",entry.getValue().toString());\n else if (entry.getKey().equals(\"VL\")) hm.put(\"volume\",entry.getValue().toString());\n else if (entry.getKey().equals(\"NB\")) hm.put(\"number\",entry.getValue().toString());\n else if (entry.getKey().equals(\"PS\")) pages[0] = entry.getValue().toString();\n else if (entry.getKey().equals(\"PE\")) pages[1] = entry.getValue().toString();\n else if (entry.getKey().equals(\"KW\")) hm.put(\"keywords\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"RM\")) hm.put(\"\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"RU\")) hm.put(\"\",entry.getValue().toString());\n else if (entry.getKey().equals(\"RT\")) type[0] = entry.getValue().toString();\n else if (entry.getKey().equals(\"SB\")) comments.add(\"Subject: \" + entry.getValue().toString());\n else if (entry.getKey().equals(\"SA\")) comments.add(\"Secondary Authors: \" + entry.getValue().toString());\n else if (entry.getKey().equals(\"NT\")) hm.put(\"note\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"PP\")) hm.put(\"\",entry.getValue().toString());\n else if (entry.getKey().equals(\"PB\")) hm.put(\"publisher\",entry.getValue().toString());\n else if (entry.getKey().equals(\"TA\")) comments.add(\"Tertiary Authors: \" + entry.getValue().toString());\n else if (entry.getKey().equals(\"TT\")) comments.add(\"Tertiary Title: \" + entry.getValue().toString());\n else if (entry.getKey().equals(\"ED\")) hm.put(\"edition\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"DP\")) hm.put(\"\",entry.getValue().toString());\n else if (entry.getKey().equals(\"TW\")) type[1] = entry.getValue().toString();\n else if (entry.getKey().equals(\"QA\")) comments.add(\"Quaternary Authors: \" + entry.getValue().toString());\n else if (entry.getKey().equals(\"QT\")) comments.add(\"Quaternary Title: \" + entry.getValue().toString());\n else if (entry.getKey().equals(\"IS\")) hm.put(\"isbn\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"LA\")) hm.put(\"\",entry.getValue().toString());\n else if (entry.getKey().equals(\"AB\")) hm.put(\"abstract\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"DI\")) hm.put(\"\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"DM\")) hm.put(\"\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"AV\")) hm.put(\"\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"PR\")) hm.put(\"\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"LO\")) hm.put(\"\",entry.getValue().toString());\n else if (entry.getKey().equals(\"AD\")) address = entry.getValue().toString();\n else if (entry.getKey().equals(\"LG\")) hm.put(\"language\",entry.getValue().toString());\n else if (entry.getKey().equals(\"CO\")) country = entry.getValue().toString();\n else if (entry.getKey().equals(\"UR\") || entry.getKey().equals(\"AT\")) {\n String s = entry.getValue().toString().trim();\n hm.put(s.startsWith(\"http://\") || s.startsWith(\"ftp://\") ? \"url\" : \"pdf\",\n entry.getValue().toString());\n }\n else if (entry.getKey().equals(\"C1\")) comments.add(\"Custom1: \" + entry.getValue().toString());\n else if (entry.getKey().equals(\"C2\")) comments.add(\"Custom2: \" + entry.getValue().toString());\n else if (entry.getKey().equals(\"C3\")) comments.add(\"Custom3: \" + entry.getValue().toString());\n else if (entry.getKey().equals(\"C4\")) comments.add(\"Custom4: \" + entry.getValue().toString());\n //else if (entry.getKey().equals(\"RD\")) hm.put(\"\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"MB\")) hm.put(\"\",entry.getValue().toString());\n else if (entry.getKey().equals(\"C5\")) comments.add(\"Custom5: \" + entry.getValue().toString());\n else if (entry.getKey().equals(\"C6\")) comments.add(\"Custom6: \" + entry.getValue().toString());\n //else if (entry.getKey().equals(\"FA\")) hm.put(\"\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"CN\")) hm.put(\"\",entry.getValue().toString());\n else if (entry.getKey().equals(\"DE\")) hm.put(\"annote\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"RP\")) hm.put(\"\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"DF\")) hm.put(\"\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"RS\")) hm.put(\"\",entry.getValue().toString());\n else if (entry.getKey().equals(\"CA\")) comments.add(\"Categories: \" + entry.getValue().toString());\n //else if (entry.getKey().equals(\"WP\")) hm.put(\"\",entry.getValue().toString());\n else if (entry.getKey().equals(\"TH\")) comments.add(\"Short Title: \" + entry.getValue().toString());\n //else if (entry.getKey().equals(\"WR\")) hm.put(\"\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"EW\")) hm.put(\"\",entry.getValue().toString());\n else if (entry.getKey().equals(\"SE\")) hm.put(\"chapter\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"AC\")) hm.put(\"\",entry.getValue().toString());\n //else if (entry.getKey().equals(\"LP\")) hm.put(\"\",entry.getValue().toString());\n }\n \n String bibtexType = \"misc\";\n if (type[1] != null) { // first check TW\n type[1] = type[1].toLowerCase();\n if (type[1].indexOf(\"article\") >= 0) bibtexType = \"article\";\n else if (type[1].indexOf(\"book\") >= 0) bibtexType = \"book\";\n else if (type[1].indexOf(\"conference\") >= 0) bibtexType = \"inproceedings\";\n else if (type[1].indexOf(\"proceedings\") >= 0) bibtexType = \"inproceedings\";\n else if (type[1].indexOf(\"report\") >= 0) bibtexType = \"techreport\";\n else if (type[1].indexOf(\"thesis\") >= 0\n && type[1].indexOf(\"master\") >= 0) bibtexType = \"mastersthesis\";\n else if (type[1].indexOf(\"thesis\") >= 0) bibtexType = \"phdthesis\";\n } else if (type[0] != null) { // check RT\n type[0] = type[0].toLowerCase();\n if (type[0].indexOf(\"article\") >= 0) bibtexType = \"article\";\n else if (type[0].indexOf(\"book\") >= 0) bibtexType = \"book\";\n else if (type[0].indexOf(\"conference\") >= 0) bibtexType = \"inproceedings\";\n else if (type[0].indexOf(\"proceedings\") >= 0) bibtexType = \"inproceedings\";\n else if (type[0].indexOf(\"report\") >= 0) bibtexType = \"techreport\";\n else if (type[0].indexOf(\"thesis\") >= 0\n && type[0].indexOf(\"master\") >= 0) bibtexType = \"mastersthesis\";\n else if (type[0].indexOf(\"thesis\") >= 0) bibtexType = \"phdthesis\";\n }\n \n // concatenate pages\n if (pages[0] != null || pages[1] != null)\n hm.put(\"pages\",(pages[0] != null ? pages[0] : \"\")\n + (pages[1] != null ? \"--\" + pages[1] : \"\"));\n \n // concatenate address and country\n if (address != null)\n hm.put(\"address\",address + (country != null ? \", \" + country : \"\"));\n \n if (comments.size() > 0) { // set comment if present\n StringBuffer s = new StringBuffer();\n for (int i = 0; i < comments.size(); ++i)\n s.append((i > 0 ? \"; \" : \"\")+ comments.elementAt(i).toString());\n hm.put(\"comment\",s.toString());\n }\n BibtexEntry b = new BibtexEntry(\n Globals.DEFAULT_BIBTEXENTRY_ID,\n Globals.getEntryType(bibtexType));\n b.setField(hm);\n bibitems.add(b);\n \n hm.clear();\n lines.clear();\n previousLine = null;\n \n continue;\n }\n // new key\n if (line.startsWith(\"--\") && line.length() >= 7 && line.substring(4,7).equals(\"-- \")) {\n lines.put(line.substring(2,4),previousLine = new StringBuffer(line.substring(7)));\n continue;\n }\n // continuation (folding) of previous line\n if (previousLine == null) // sanity check; should never happen\n return null;\n previousLine.append(line.trim());\n }\n } catch (IOException e) {\n return null;\n }\n \n return bibitems;\n }", "private static boolean loadStudents() throws IOException{\n\t\tBufferedReader reader = new BufferedReader(new FileReader(STUDENTS_FILE));\n\t\tboolean error_loading = false; //stores whether there was an error loading a student\n\t\t\n\t\tString line = reader.readLine(); //read the properties of each student in the students.txt file\n\t\t/*read students.txt file, set the input for each studentDetails object and add each StudentDetails object to ALL_STUDENTS ArrayList*/\n\t\twhile(line != null){\n\t\t\tStudentDetails student = new StudentDetails();\n\t\t\tString[] details = line.split(\"\\t\"); //the properties of each StudentDetails object are separated by tab spaces in the students.txt file\n\t\t\tfor(int i = 0; i < details.length; i ++){\n\t\t\t\tif(!setStudentInput(i, details[i], student)){ //checks if there was an error in setting the StudentDetails object's properties with the values in the students.txt file\n\t\t\t\t\tSystem.out.println(\"ERROR Loading Students\");\n\t\t\t\t\terror_loading = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(error_loading) //if there was an error loading a book then stop the process of loading books\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tALL_STUDENTS.add(student);\n\t\t\t/*Add Students who have been fined (total fine > 0) to the FINED_STUDENTS Hashtable*/\n\t\t\taddFinedStudentsToTable(student);\n\t\t\tline = reader.readLine();\n\t\t}\n\t\treader.close();\n\t\t\n\t\tif(!error_loading){\n\t\t\tSystem.out.println(\"Loading Students - Complete!\");\n\t\t\treturn true;\n\t\t}\n\t\treturn false; //error encountered while loading books\n\t}", "private void loadFromFile() {\n try {\n /* Load in the data from the file */\n FileInputStream fIn = openFileInput(FILENAME);\n BufferedReader inRead = new BufferedReader(new InputStreamReader(fIn));\n\n /*\n * access from the GSON file\n * Taken from lonelyTwitter lab code\n */\n Gson gson = new Gson();\n Type listType = new TypeToken<ArrayList<Counter>>() {}.getType();\n counters = gson.fromJson(inRead, listType);\n\n } catch (FileNotFoundException e) {\n counters = new ArrayList<Counter>();\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }", "public ArrayList<Item> loadItems(String filename) {\n ArrayList<Item> itemsList = new ArrayList<>();\n try {\n File file = new File(filename);\n BufferedReader reader= new BufferedReader(new InputStreamReader(new FileInputStream(file), \"UTF-8\"));\n String line= reader.readLine();\n while (line != null){\n String[] splitedLine = line.split(\"=\");\n String name = splitedLine[0];\n int weight = Integer.parseInt(splitedLine[1]) / 1000; // on convertit en tonnes\n itemsList.add(new Item(name,weight));\n line = reader.readLine();\n }\n reader.close(); //pour arreter la memoire tampon\n }\n catch(IOException e)\n {\n e.printStackTrace();\n }\n\n return itemsList;\n }", "public void load(){\n // Recover docIDs\n try(Reader reader = new FileReader(\"postings/docIDs.json\")){\n this.docIDs = (new Gson()).fromJson(reader,\n new TypeToken<Map<String, String>>(){}.getType());\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n try(Reader reader = new FileReader(\"postings/docLengths.json\")){\n this.docLengths = (new Gson()).fromJson(reader,\n new TypeToken<Map<String, Integer>>(){}.getType());\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n try(Reader reader = new FileReader(\"postings/titleToNumber.json\")){\n this.titleToNumber = (new Gson()).fromJson(reader,\n new TypeToken<Map<String, Integer>>(){}.getType());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public ArrayList<Book> getBookList()\r\n {\r\n ArrayList<Book> bookCopy = new ArrayList<Book>();\r\n //Add code here to copy the bookList ArrayList elements into the local variable bookCopy and return bookCopy\r\n //Hint: You will use the 2-arg Book constructor and the getters or you can add a copy constructor to the Book\r\n //Class\r\n for(Book book: bookList){\r\n Book bk = new Book(book.getTitle(), book.getPrice());\r\n bookCopy.add(bk);\r\n }\r\n return bookCopy;\r\n }", "public static ArrayList<String> readBook(String filename)\n throws FileNotFoundException {\n ArrayList<String> words = new ArrayList<>();\n Scanner in = new Scanner(new File(filename));\n while (in.hasNext()) {\n words.add(in.next());\n }\n return words;\n }", "private void readListFromFile() {\n // clear existing list\n if (listArr == null || listArr.size() > 0) {\n listArr = new ArrayList<>();\n }\n\n try {\n Scanner scan = new Scanner(openFileInput(LIST_FILENAME));\n\n while (scan.hasNextLine()) {\n String line = scan.nextLine();\n listArr.add(line);\n }\n\n if (listAdapter != null) {\n listAdapter.notifyDataSetChanged();\n }\n\n } catch (IOException ioe) {\n Log.e(\"ReadListFromFile\", ioe.toString());\n }\n\n }", "private void populateItems() {\n \t try {\n \t File myObj = new File(\"items.txt\");\n \t Scanner myReader = new Scanner(myObj);\n \t while (myReader.hasNextLine()) {\n\t \t String data = myReader.nextLine();\n\t \t String[] variables = data.split(\",\");\n\t \t int price = (int) Math.floor(Math.random() * 100); \n\t \t \n\t \t itemList += variables[0] + \",\"+ variables[1] +\",\" + \"0\" + \", \"+ \",\"+price + \",\";\n\t \t Item x = new Item(variables[0], 0, \"\", price, variables[1]);\n\t \t items.add(x);\n \t }\n \t myReader.close();\n \t } catch (FileNotFoundException e) {\n \t System.out.println(\"An error occurred.\");\n \t e.printStackTrace();\n \t }\n\t\t\n\t}", "private void setBooksInfo () {\n infoList = new ArrayList<> ();\n\n\n // item number 1\n\n Info info = new Info ();// this class will help us to save data easily !\n //set the title >> it can be Book name or Topic title ...\n info.setInfoTitle (\"ما هي اضطرابات طيف التوحد؟\");\n\n //set the description of the Topic or the website ....\n info.setInfoDescription (\"سيساعدك هذا المستند على معرفة اضطراب طيف التوحد بشكل عام\");\n\n // we can add book url or download >>\n info.setInfoPageURL (\"https://firebasestorage.googleapis.com/v0/b/autismapp-b0b6a.appspot.com/o/material%2FInfo-Pack-for\"\n + \"-translation-Arabic.pdf?alt=media&token=69b19a8d-8b4c-400a-a0eb-bb5c4e5324e6\");\n\n infoList.add (info); //adding item 1 to list\n\n\n/* // item number 2\n info = new Info ();// save the second Book\n //set the title >> it can be Book name or Topic title ...\n info.setInfoTitle (\"Solve My Autism\");\n\n //set the description of the Topic or the website ....\n info.setInfoDescription (\"this Book has will help patient of Autism to get better by communicate with experts ...\");\n\n // we can add the url >>\n info.setInfoPageURL (\"https://material.io/\");\n\n infoList.add (info);//adding item number 2 to list\n\n\n // item 3\n info = new Info ();// save the third Book\n //set the title >> it can be website name or Topic title ...\n info.setInfoTitle (\"Autism Community\");\n\n //set the description of the Topic or the website ....\n info.setInfoDescription (\"this an Book about patient of Autism and how to help them get better ...\");\n\n // we can add the url >>\n info.setInfoPageURL (\"https://www.tutorialspoint.com/android/index.html\");\n infoList.add (info);// adding item 3 to list\n\n // item number 4\n info = new Info ();// save the second Book\n //set the title >> it can be Book name or Topic title ...\n info.setInfoTitle (\"Solve My Autism part 2\");\n\n //set the description of the Topic or the website ....\n info.setInfoDescription (\"this Book has will help patient of Autism to get better by communicate with experts ...\");\n\n // we can add the url >>\n info.setInfoPageURL (\"https://material.io/\");\n\n infoList.add (info);//adding item number 4 to list\n\n\n // item 5\n info = new Info ();// save the third Book\n //set the title >> it can be website name or Topic title ...\n info.setInfoTitle (\"Autism Community 2\");\n\n //set the description of the Topic or the website ....\n info.setInfoDescription (\"this an Book about patient of Autism and how to help them get better ...\");\n\n // we can add the url >>\n info.setInfoPageURL (\"https://www.tutorialspoint.com/android/index.html\");\n infoList.add (info);// adding item 5 to list*/\n\n\n displayInfo (infoList);\n\n }", "private void get_rooms() throws FileNotFoundException\n {\n Scanner room_all = new Scanner(new FileInputStream(db_rooms));\n room_all.nextLine();\n while(room_all.hasNextLine())\n {\n String [] searcher = (room_all.nextLine()).split(\"\\\"\");\n if(!searcher[7].equals(\"empty\"))\n data_set.add(new Room(searcher[3], searcher[5], (searcher[7].equals(\"booked\") ? 1 : 2), Integer.valueOf(searcher[1])));\n else\n data_set.add(new Room(Integer.valueOf(searcher[1])));\n }\n room_all.close();\n }", "private void readSavedFile() {\n\n String[] files = new String[0];\n \n // On récupère la liste des fichiers\n File file = new File(folderName);\n\n // check if the specified pathname is directory first\n if(file.isDirectory()){\n //list all files on directory\n files = file.list();\n }\n\n if (files != null) {\n for(String currentFile : files) {\n Vehicule voiture;\n try {\n FileInputStream fileIn = new FileInputStream(folderName + \"/\" + currentFile);\n ObjectInputStream in = new ObjectInputStream(fileIn);\n voiture = (Vehicule) in.readObject();\n addVoitureToList(voiture);\n in.close();\n fileIn.close();\n } catch (IOException i) {\n i.printStackTrace();\n return;\n } catch (ClassNotFoundException c) {\n System.out.println(\"#Erreur : Impossible de récupérer l'objet \" + currentFile);\n c.printStackTrace();\n return;\n }\n }\n }\n }", "List<Book> getAllBooks();", "static void readRecipes() {\n\t\tBufferedReader br = null;\n\t\tString line = \"\";\n\t\tString cvsSplitBy = \",\";\n\t\ttry {\n\n\t\t\tbr = new BufferedReader(new FileReader(inputFileLocation));\n\t\t\twhile ((line = br.readLine()) != null) {\n\n\t\t\t\tString[] currentLine = line.split(cvsSplitBy);\n\t\t\t\tRecipe currentRecipe = new Recipe(currentLine[0]);\n\t\t\t\t/*\n\t\t\t\t * String[] recipe=new String[currentLine.length-1];\n\t\t\t\t * System.arraycopy(currentLine,1,recipe,0,recipe.length-2);\n\t\t\t\t */\n\t\t\t\tString[] recipe = java.util.Arrays.copyOfRange(currentLine, 1,\n\t\t\t\t\t\tcurrentLine.length);\n\t\t\t\tArrayList<String> ingredients = new ArrayList<String>();\n\t\t\t\tfor (String a : recipe) {\n\t\t\t\t\tingredients.add(a);\n\t\t\t\t}\n\t\t\t\tcurrentRecipe.setIngredients(ingredients);\n\t\t\t\tRecipes.add(currentRecipe);\n\t\t\t}\n\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\tif (br != null) {\n\t\t\t\ttry {\n\t\t\t\t\tbr.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "public void readFile() throws IOException {\r\n File file = new File(\"employee_list.txt\"); //Declaration and initialization of file object\r\n Scanner textFile = new Scanner(file); //Creates Scanner object and parse in the file\r\n\r\n while(textFile.hasNextLine()){ //Stay in a loop until there is no written line in the text file\r\n String line = textFile.nextLine(); //Read line and store in a String variable 'line'\r\n String[] words = line.split(\",\"); //Split the whole line at commas and store those in a simple String array\r\n Employee employee = new Employee(words[0],words[1],words[2]); //Create Employee object\r\n this.listOfEmployees.add(employee); //Add created Employee object to listOfEmployees ArrayList\r\n if(!this.listOfDepartments.contains(words[1])){ //This just adds all the department names to an ArrayList\r\n this.listOfDepartments.add(words[1]);\r\n }\r\n }\r\n }", "@SuppressWarnings(\"unchecked\")\r\n\tpublic static ArrayList<Item> loadItems(String filename)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tObjectInputStream ois = new ObjectInputStream(new FileInputStream(new File(filename)));\r\n\t\t\tArrayList<Item> items = (ArrayList<Item>)ois.readObject();\r\n\t\t\tois.close();\r\n\t\t\tSystem.out.println(\"Loaded items from disk: \" + items.size());\r\n\t\t\treturn items;\r\n\t\t} \r\n\t\tcatch (FileNotFoundException e2) \r\n\t\t{\r\n\t\t\tSystem.err.println(\"No locally saved \" + filename + \" - creating a new one: \" + e2.getMessage());\r\n\t\t}\r\n\t\tcatch (IOException e2) \r\n\t\t{\r\n\t\t\tSystem.err.println(\"IO Error: \" + e2.getMessage());\r\n\t\t} \r\n\t\tcatch (ClassNotFoundException e1) \r\n\t\t{\r\n\t\t\tSystem.err.println(\"This copy of the program is missing some files: \" + e1.getMessage());\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public ObservableList<Object> selectAllBooks(){\n System.out.println(\"Printing all books...\");\n dbmanager.open();\n ObservableList<Object> books = FXCollections.observableArrayList();\n\n try{\n try (DBIterator keyIterator = dbmanager.getDB().iterator()) {\n keyIterator.seekToFirst();\n while (keyIterator.hasNext()) {\n String key = asString(keyIterator.peekNext().getKey());\n String[] splittedString = key.split(\"-\");\n\n dbmanager.incrementNextId(Integer.parseInt(splittedString[1]));\n\n if(!\"book\".equals(splittedString[0])){\n keyIterator.next();\n continue;\n }\n String resultAttribute = asString(dbmanager.getDB().get(bytes(key)));\n JSONObject jbook = new JSONObject(resultAttribute);\n\n Book book = new Book(jbook);\n \n book.setPublisher(dbmanager.getPmanager().read(jbook.getInt(\"publisher\")));\n \n JSONArray jauthors = jbook.getJSONArray(\"authors\");\n List<Author> authors = new ArrayList();\n for(int i=0; i<jauthors.length(); i++){\n \n int a=-1;\n a=jauthors.getInt(i);\n if(a>=0){ \n authors.add(dbmanager.getAmanager().read(a));\n }else{\n System.out.println(\"A book has mysterious author\"); \n }\n \n }\n \n book.setAuthors(authors);\n books.add(book);\n keyIterator.next();\n }\n }\n } catch(IOException e){\n e.printStackTrace();\n }\n dbmanager.close();\n return books;\n }" ]
[ "0.783587", "0.74125993", "0.7207613", "0.7119802", "0.7114854", "0.7083925", "0.7078321", "0.704903", "0.70198953", "0.6710541", "0.6647761", "0.6564026", "0.64211303", "0.6415608", "0.63600415", "0.63249063", "0.632207", "0.63007027", "0.6272683", "0.6236058", "0.6169568", "0.6148178", "0.61367494", "0.61244553", "0.61078817", "0.60979855", "0.60958487", "0.60483855", "0.6048106", "0.60375935", "0.6028986", "0.6028609", "0.60121375", "0.60072786", "0.60056466", "0.5981064", "0.5979521", "0.59674716", "0.595658", "0.5932533", "0.59297985", "0.59232306", "0.591515", "0.5910048", "0.5904359", "0.58892727", "0.5887618", "0.5876806", "0.58423024", "0.5834894", "0.5833512", "0.58275723", "0.5827392", "0.5821237", "0.5811183", "0.5807871", "0.5805658", "0.57956016", "0.57945347", "0.57913715", "0.579119", "0.57872516", "0.5786513", "0.57717645", "0.57703304", "0.5761718", "0.57603514", "0.57575005", "0.5757379", "0.57509786", "0.5739923", "0.57387316", "0.5734186", "0.571948", "0.57127446", "0.57109153", "0.57108724", "0.570598", "0.5703659", "0.57011306", "0.570032", "0.5699503", "0.5699197", "0.5686899", "0.56836826", "0.56814086", "0.56809264", "0.56808263", "0.56791043", "0.56773454", "0.5668273", "0.5652981", "0.5646999", "0.5639168", "0.56370264", "0.5636635", "0.5629327", "0.5617253", "0.56126815", "0.5610732" ]
0.7081112
6
/This method sets a BookDetails object's respective property based on the index of i.
private static boolean setBookInput(int i, String value, BookDetails book){ switch (i){ case 0: book.setBookId(Integer.parseInt(value)); return true; case 1: book.setBookTitle(value); return true; case 2: return book.setAuthorFirstName(value); //returns false if name input was invalid (contains non-alphabet characters) case 3: return book.setAuthorMiddleName(value); //returns false if name input was invalid (contains non-alphabet characters) case 4: return book.setAuthorLastName(value); //returns false if name input was invalid (contains non-alphabet characters) case 5: book.setPublisher(value); return true; case 6: return book.setGenre(value); //returns false if value for Genre is invalid case 7: return book.setCondition(value); //returns false if value for Condition is invalid case 8: book.setStudentBorrowed(Integer.parseInt(value)); return true; case 9: String[] date = value.split("/"); //Dates are stored in the format yyyy/MM/dd int year = Integer.parseInt(date[0]); int month = Integer.parseInt(date[1]); int day = Integer.parseInt(date[2]); book.setDateToReturn(year,month,day); return true; case 10: boolean status = Boolean.parseBoolean(value); book.setBorrowed(status); return true; default: //error input, a book can only have up to 11 fields System.out.println("Invalid Property"); return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void updateBookData() {\n\t\tList<Book> bookList = dao.findByHql(\"from Book where bookId > 1717\",null);\n\t\tString bookSnNumber = \"\";\n\t\tfor(Book book:bookList){\n\t\t\tfor (int i = 1; i <= book.getLeftAmount(); i++) {\n\t\t\t\t// 添加图书成功后,根据ISBN和图书数量自动生成每本图书SN号\n\t\t\t\tBookSn bookSn = new BookSn();\n\t\t\t\t// 每本书的bookSn号根据书的ISBN号和数量自动生成,\n\t\t\t\t// 如书的ISBN是123,数量是3,则每本书的bookSn分别是:123-1,123-2,123-3\n\t\t\t\tbookSnNumber = \"-\" + i;//book.getIsbn() + \"-\" + i;\n\t\t\t\tbookSn.setBookId(book.getBookId());\n\t\t\t\tbookSn.setBookSN(bookSnNumber);\n\t\t\t\t// 默认书的状态是0表示未借出\n\t\t\t\tbookSn.setStatus(new Short((short) 0));\n\t\t\t\t// 添加bookSn信息\n\t\t\t\tbookSnDao.save(bookSn);\n\t\t\t}\n\t\t}\n\t}", "public void setBook(Book book) {\n this.book = book;\n }", "private void setBooksInfo () {\n infoList = new ArrayList<> ();\n\n\n // item number 1\n\n Info info = new Info ();// this class will help us to save data easily !\n //set the title >> it can be Book name or Topic title ...\n info.setInfoTitle (\"ما هي اضطرابات طيف التوحد؟\");\n\n //set the description of the Topic or the website ....\n info.setInfoDescription (\"سيساعدك هذا المستند على معرفة اضطراب طيف التوحد بشكل عام\");\n\n // we can add book url or download >>\n info.setInfoPageURL (\"https://firebasestorage.googleapis.com/v0/b/autismapp-b0b6a.appspot.com/o/material%2FInfo-Pack-for\"\n + \"-translation-Arabic.pdf?alt=media&token=69b19a8d-8b4c-400a-a0eb-bb5c4e5324e6\");\n\n infoList.add (info); //adding item 1 to list\n\n\n/* // item number 2\n info = new Info ();// save the second Book\n //set the title >> it can be Book name or Topic title ...\n info.setInfoTitle (\"Solve My Autism\");\n\n //set the description of the Topic or the website ....\n info.setInfoDescription (\"this Book has will help patient of Autism to get better by communicate with experts ...\");\n\n // we can add the url >>\n info.setInfoPageURL (\"https://material.io/\");\n\n infoList.add (info);//adding item number 2 to list\n\n\n // item 3\n info = new Info ();// save the third Book\n //set the title >> it can be website name or Topic title ...\n info.setInfoTitle (\"Autism Community\");\n\n //set the description of the Topic or the website ....\n info.setInfoDescription (\"this an Book about patient of Autism and how to help them get better ...\");\n\n // we can add the url >>\n info.setInfoPageURL (\"https://www.tutorialspoint.com/android/index.html\");\n infoList.add (info);// adding item 3 to list\n\n // item number 4\n info = new Info ();// save the second Book\n //set the title >> it can be Book name or Topic title ...\n info.setInfoTitle (\"Solve My Autism part 2\");\n\n //set the description of the Topic or the website ....\n info.setInfoDescription (\"this Book has will help patient of Autism to get better by communicate with experts ...\");\n\n // we can add the url >>\n info.setInfoPageURL (\"https://material.io/\");\n\n infoList.add (info);//adding item number 4 to list\n\n\n // item 5\n info = new Info ();// save the third Book\n //set the title >> it can be website name or Topic title ...\n info.setInfoTitle (\"Autism Community 2\");\n\n //set the description of the Topic or the website ....\n info.setInfoDescription (\"this an Book about patient of Autism and how to help them get better ...\");\n\n // we can add the url >>\n info.setInfoPageURL (\"https://www.tutorialspoint.com/android/index.html\");\n infoList.add (info);// adding item 5 to list*/\n\n\n displayInfo (infoList);\n\n }", "public void setBook_id(int book_id) {\n\tthis.book_id = book_id;\n}", "public void addBook(int index, Book book)\r\n\t{\r\n\t\tif(index == -1) {\r\n\t\t\tindex++;\r\n\t\t}\r\n\t\tList<Book> oldValue = items;\r\n\t\titems = new ArrayList<Book>(items);\r\n\t\titems.add(index, book);\r\n\t\tfirePropertyChange(\"books\", oldValue, items);\r\n\t\tfirePropertyChange(\"itemsCount\", oldValue.size(), items.size());\r\n\t}", "public void getBookDetails() {\n\t}", "public void setBookID(int bookID) {\n this.bookID = bookID;\n }", "public void addBook(String string, int i) {\n\t\tBook b= new Book(string,i);\r\n\t\tarlist.add(b);\r\n\t\t\r\n\t}", "@Override\r\n\tpublic int updateBookInfo(Book book, int book_id) {\n\t\treturn 0;\r\n\t}", "public static ArrayList<Book> fillBooksArray(ArrayList<Book> bookArrayList){\n\n bookArrayList.add(PrepareData.book1);\n bookArrayList.add(PrepareData.book2);\n bookArrayList.add(PrepareData.book3);\n bookArrayList.add(PrepareData.book4);\n bookArrayList.add(PrepareData.book5);\n bookArrayList.add(PrepareData.book6);\n\n\n return bookArrayList;\n\n\n\n }", "public void setBookid(Integer bookid) {\n this.bookid = bookid;\n }", "public void setBookid(Integer bookid) {\n this.bookid = bookid;\n }", "@Override\r\n\tpublic void updatebook(BookDto book) {\n\t\tsqlSession.update(ns + \"updatebook\", book);\r\n\t}", "static void editDetails(int index, List<String> data){\n people.get(index).setFirstName(data.get(0));\n people.get(index).setLastName(data.get(1));\n people.get(index).setHeight(Short.parseShort(data.get(2)));\n people.get(index).setWeight(Double.parseDouble(data.get(3)));\n people.get(index).setBirthDate(LocalDate.of(\n Integer.parseInt(data.get(4)),\n Integer.parseInt(data.get(5)),\n Integer.parseInt(data.get(6))));\n people.get(index).setSex(checkSex(data.get(7)));\n people.get(index).setPosition(data.get(8));\n people.get(index).setHireDate(LocalDate.of(\n Integer.parseInt(data.get(9)),\n Integer.parseInt(data.get(10)),\n Integer.parseInt(data.get(11))));\n ;\n }", "public Book(String bookAuthor, String bookTitle, int bookPages, String getDetails)\n {\n author = bookAuthor;\n title = bookTitle;\n pages = bookPages;\n details = author,title,pages;\n Number = \"\";\n }", "public void setElementAt(Object obj, int index);", "public void setBookDetails(String[] details) throws MalformedURLException, IOException {\n String bookTitle = details[0];\n String author = details[1];\n String path = details[2];\n String description = \"<html> \" + details[3];\n\n title.setText(bookTitle);\n authors.setText(author);\n descriptionLabel.setText(description);\n\n // Read in the imgae from URL path\n URL url = new URL(path);\n BufferedImage image = ImageIO.read(url);\n // Set the ImageIcon of the label\n ImageIcon icon = new ImageIcon(image);\n iconLabel.setIcon(icon);\n iconLabel.setText(\"\");\n }", "public void setAuthorInfo(int i, String n, String s, String e)\r\n {\r\n name = n;\r\n idAuthor = i;\r\n surname = s;\r\n email = e;\r\n }", "public void setBookId(Integer bookId) {\n this.bookId = bookId;\n }", "public void setBookId(Integer bookId) {\n this.bookId = bookId;\n }", "public void setBookId(Integer bookId) {\n this.bookId = bookId;\n }", "private void putDataIntoTable(List<Book> books)\n {\n for(int i = 0; i<books.size(); i++)\n {\n bookTable.addItem(new Object[]{books.get(i).getId(), books.get(i).getBookName(), books.get(i).getAuthorName(), books.get(i).getDescription(), books.get(i).getBookGenreString()}, i+1);\n }\n }", "public BookList(ObservableList<Book> oList){\r\n //Instantiate the bookList attribute\r\n bookList = new ArrayList<Book>();\r\n //if the parameter oList is not null, then loop through it and create a new Book object from each element,\r\n //using the getters. The enhanced for-loop works great here See Chapter 7.13. Add the new Book to the attribute\r\n //called bookList\r\n if(oList != null){\r\n for(Book bk: oList){\r\n bookList.add(new Book(bk.getTitle(), bk.getPrice()));\r\n }\r\n }\r\n\r\n }", "@Override\n\tpublic int editBook(bookInfo bookinfo) {\n\t\treturn 0;\n\t}", "@Override\n\tpublic void modify(BookInfoVO vo) {\n\t\tbookInfoDao.modify(vo);\n\t}", "public BookAuthor(int i, String n, String s, String e)\r\n {\r\n name = n;\r\n idAuthor = i;\r\n surname = s;\r\n email = e;\r\n }", "public void setBookid(Integer bookid) {\r\n\t\tthis.bookid = bookid;\r\n\t}", "private void setORM_Book(i_book.Book value) {\r\n\t\tthis.book = value;\r\n\t}", "public void setBooks(List<Book> books) {\r\n\t\tthis.books = books;\r\n\t}", "void addInBookNo(Object newInBookNo);", "private void setAll(int bnr){\n BookingManager bm = new BookingManager();\n Booking b = bm.getBooking(bnr);\n name = b.getName();\n hotelName = b.getHotel().getName();\n address = b.getHotel().getAddress();\n nrPeople = b.getRoom().getCount();\n price = b.getRoom().getPrice();\n dateFrom = b.getDateFrom();\n dateTo = b.getDateTo();\n \n \n jName.setText(name);\n jHotelName.setText(hotelName);\n jHotelAddress.setText(\"\" + address);\n jNrPeople.setText(\"\" + nrPeople);\n jPrice.setText(\"\" + price);\n jDateFrom.setText(\"\" + dateFrom);\n jDateTo.setText(\"\" + dateTo);\n }", "public void setBookStatus(Integer bookStatus) {\n this.bookStatus = bookStatus;\n }", "public void setBookStatus(Integer bookStatus) {\n this.bookStatus = bookStatus;\n }", "public void setBookStatus(Integer bookStatus) {\n this.bookStatus = bookStatus;\n }", "public BookListings(Book[] bookList) {\r\n bookListings = new Vector <Association <Book, Vector>> ();\r\n\r\n // Load the books into the BookListings\r\n for (int i = 0; i < bookList.length; i++) {\r\n Association <Book, ListingVector>> assoc = bookListings.get(i);\r\n assoc.getKey() = bookList(i);\r\n assoc.getValue() = new Vector<Listing>();\r\n }\r\n }", "void addbook(String book){\n\t\tthis.books[no_of_books]=book;\n\t\tno_of_books++;\n\t\tSystem.out.println(book+\" ...add\");\n\n\t}", "public void setItem(Object item, int i)\n {\n items.setElementAt(item, i);\n }", "public Books(int booknum, String title, String author) {\n\t\t// super();\n\n\t\tthis.booknum = booknum;\n\t\tthis.setAuthor(author);\n\t\tthis.title = title;\n\t}", "private BookDetailResponse convertBookDetail(Book book) {\n BookDetailResponse response = new BookDetailResponse();\n BeanUtils.copyProperties(book, response);\n BookCategory thirdCategory = book.getCategory();\n if (thirdCategory != null) {\n response.setThirdCategoryId(thirdCategory.getId());\n BookCategory secondCategory = thirdCategory.getParent();\n if (secondCategory != null) {\n response.setSecondCategoryId(secondCategory.getId());\n BookCategory firstCategory = secondCategory.getParent();\n if (firstCategory != null) {\n response.setFirstCategoryId(firstCategory.getId());\n }\n }\n }\n if (StringUtils.isBlank(book.getFileName()) && book.getSource() != null) {\n response.setFileName(FilenameUtils.getName(book.getSource()));\n }\n return response;\n }", "public abstract CustomerOrder setOrderDetails(CustomerOrder customerOrder, Iterable<Long> orderDetails);", "@Override\n public void success(List<Book> book, Response response) {\n\n List<Book> ep = book;\n /*Example[] array = ep.toArray(new Example[ep.size()]);\n List<Example> listsample = ep.getSaleDate();*/\n listView.setAdapter(new BookListAdapter(ep));\n\n }", "@Override\n public void success(List<Book> book, Response response) {\n\n List<Book> ep = book;\n /*Example[] array = ep.toArray(new Example[ep.size()]);\n List<Example> listsample = ep.getSaleDate();*/\n listView.setAdapter(new BookListAdapter(ep));\n\n }", "public void addBook(Book book) {\n\t\tboolean notFound = true;\n\t\tfor (Item item : items) {\n\t\t\tif(item.getName().equals(book.getName())) {\n\t\t\t\t// Found\n\t\t\t\tnotFound = false;\n\t\t\t\titem.updateQuantity();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(notFound) {\n\t\t\tItem item = new Item(book, 1);\n\t\t\titems.add(item);\n\t\t}\n\t}", "public void addBook(Book book) {\n \tset.add(book);\n }", "public static void convertBookVOToBook() {\n\n\t}", "@Override\n public Object getItem(int position) {\n return listBook.get(position);\n }", "public int getBook_id() {\n\treturn book_id;\n}", "public Book getBook(int index)\r\n\t{\r\n\t\tBook book = null;\r\n\t\ttry {\r\n\t\t\tbook = items.get(index);\r\n\t\t} catch(IndexOutOfBoundsException e) {\r\n\t\t}\r\n\t\treturn book;\r\n\t}", "public void setIndex(int i){\n\t\tthis.index = i;\r\n\t}", "void setObjectDefinitionArray(int i, com.exacttarget.wsdl.partnerapi.ObjectDefinition objectDefinition);", "public void setIndex(int i) {\n\t\t\n\t}", "private static void parseBookObject(JSONObject book){\r\n BookManager.books.add(new Book(Integer.parseInt((String) book.get(\"id\")),(String) book.get(\"name\"),(String) book.get(\"author\")));\r\n }", "public void setIndexEditAttributeValue() throws ServiceException {\r\n\t\t\tString index = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get(\"index\");\r\n\t\t\tif(CommonUtils.isStringNotEmpty(index)){\r\n\t\t\t\tLong record = Integer.valueOf(index).longValue();\r\n\t\t\t\twsrdModel.setIndex(record);\r\n\t\t\t\tUiAirplaneModel model = uiAirplaneModel.getAirplaneList().get(Integer.valueOf(index));\r\n\t\t\t\t\r\n\t\t\t\tif(ObjectUtil.isListNotEmpty(model.getApNamesList())){\r\n\t\t\t\t\tfor(UiAirplaneModel val : model.getApNamesList()){\r\n\t\t\t\t\t\tval.setInputDisplayItem(false);\r\n\t\t\t\t\t\tval.setOutputDisplayItem(true);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tuiAirplaneModel.setSelectedEditGrp(showGroupsName(model));\r\n\t\t\t\tuiAirplaneModel.setApNamesList(model.getApNamesList());\r\n\t\t\t}else{\r\n\t\t\t\twsrdModel.setIndex(null);\r\n\t\t\t\tUiAirplaneModel model = uiAirplaneModel.getNewAirplane().get(0);\r\n\t\t\t\tloadAirPopup(model.getAirplaneNames());\r\n\t\t\t\tuiAirplaneModel.setSelectedGrp(showGroupsName(model));\r\n\t\t\t}\r\n\t\t\twsrdModel.setDuplicateErrorMsg(\"showPop1('AirplaneNamesPanel')\");\r\n\t\t}", "void sell(String bookTitle, int numOfCopies){\n for(int i = 0;i<books.size();i++)\r\n {\r\n Book bk = books.get(i);\r\n if(bk.bookTitle == bookTitle)\r\n {\r\n bk.numOfCopies -= numOfCopies; \r\n }\r\n }\r\n \r\n }", "void setTvAttrib() {\r\n obj1.brandname = \"PANASONIC\"; //setting brandname for obj1\r\n obj1.size = 65; //setting size for obj1\r\n vendor.add(obj1); //adding to arraylist vendor\r\n\r\n obj2.brandname = \"KELVIN\"; //setting brandname for obj2\r\n obj2.size = 51; //setting size for obj2\r\n vendor.add(obj2); //adding to arraylist vendor\r\n\r\n obj3.brandname = \"SONY\"; //setting size for obj2\r\n obj3.size = 42; //setting size for obj2\r\n vendor.add(obj3); //adding to arraylist vendor\r\n\r\n }", "public Book getBook() \t\t{ return this.myBook; }", "private void populateDetails(int index, int imageView, int name, int age, int friendly,\n int job, int hobby) {\n if (animals.size() > 0) {\n\n ImageView ivw = (ImageView)findViewById(imageView);\n TextView _name = (TextView)findViewById(name);\n TextView _age = (TextView)findViewById(age);\n TextView _friendly = (TextView)findViewById(friendly);\n TextView _job = (TextView)findViewById(job);\n TextView _hobby = (TextView)findViewById(hobby);\n\n ivw.setImageResource(animals.get(index).getImageID());\n _name.setText(animals.get(index).getName());\n String strAge = animals.get(index).getAge() + \" years old\";\n _age.setText(strAge);\n if (animals.get(index).getFriendly()) {\n _friendly.setText(R.string._friendly);\n } else {\n _friendly.setText(R.string._unfriendly);\n }\n\n _job.setText(animals.get(index).getJob());\n _hobby.setText(animals.get(index).getHobby());\n }\n }", "private void loadBookInformation(String rawPage, Document doc, Book book) {\n BookDetailParser parser = new BookDetailParser();\n SwBook swBook = parser.parseDetailPage(rawPage);\n book.setContributors(swBook.getContributors());\n book.setCover_url(coverUrlParser.parse(doc));\n book.setShort_description(descriptionShortParser.parse(doc));\n book.addPrice(swBook.getPrice().getPrices().get(0));\n book.setTitle(titleParser.parse(doc));\n }", "public static void main(String[] args) {\n\t\tAuthor au1=new Author(\"Ma Ma\",\"ma@gmail.com\",'F');\r\n\t\tAuthor au2=new Author(\"Mg Mg\",\"mg@gmail.com\",'M');\r\n\t\tAuthor au3=new Author(\"Su Su\",\"su@gmail.com\",'F');\r\n\t\tBook b1=new Book(\"Software Engineering\",au1,7000);\r\n\t\tBook b2=new Book(\"Java\",au1,8000,2);\r\n\t\tSystem.out.println(\"BookInfo writing by Ma Ma:\");\r\n\t\tSystem.out.println(\"BookName:\"+b1.name+\"\\nAuthor:\"+au1.name+\"\\nPrice:\"+b1.price);\r\n\t\tSystem.out.println(\"BookName:\"+b2.name+\"\\nAuthor:\"+au1.name+\"\\nPrice:\"+b2.price+\"\\nQty:\"+b2.qty);\r\n\t\tSystem.out.println();\r\n\t\tBook b3=new Book(\"Digital\",au2,4000);\r\n\t\tBook b4=new Book(\"Management\",au2,6000,3);\r\n\t\tSystem.out.println(\"BookInfo writing by Mg Mg:\");\r\n\t\tSystem.out.println(\"BookName:\"+b3.name+\"\\nAuthor:\"+au2.name+\"\\nPrice:\"+b3.price);\r\n\t\tSystem.out.println(\"BookName:\"+b4.name+\"\\nAuthor:\"+au2.name+\"\\nPrice:\"+b4.price+\"\\nQty:\"+b4.qty);\r\n\t\tSystem.out.println();\r\n\t\tBook b5=new Book(\"Accounting\",au3,5000);\r\n\t\tBook b6=new Book(\"Javascript\",au3,9000,4);\r\n\t\tSystem.out.println(\"BookInfo writing by Su Su:\");\r\n\t\tSystem.out.println(\"BookName:\"+b5.name+\"\\nAuthor:\"+au3.name+\"\\nPrice:\"+b5.price);\r\n\t\tSystem.out.println(\"BookName:\"+b6.name+\"\\nAuthor:\"+au3.name+\"\\nPrice:\"+b6.price+\"\\nQty:\"+b6.qty);\r\n\t}", "public static void main(String[] args) {\n Book book0 = new Book(\"Ulysses\", \"James Joyce\", 732);\n Book book0copy2 = new Book(\"Ulysses\", \"James Joyce\", 732);\n Book book1 = new Book(\"Ender's Game\", \"Orson S. Card\", 324);\n Book book3; //just creates unassigned reference\n Book[] lotr = new Book[3];\n lotr[0] = new Book(\"The Fellowship of the Ring\", \"J.R.R. Tolkien\", 432);\n lotr[1] = new Book(\"The Two Towers\", \"J.R.R. Tolkien\", 322);\n lotr[2] = new Book(\"The Return of the King\", \"J.R.R. Tolkien\", 490);\n\n book0.ripOutPage();\n System.out.print(book0); //calls toString() object method\n\n book1.setAuthor(\"Orson Scott Card\");\n\n for(Book b : lotr) {\n System.out.print(b);\n }\n\n if (book0.isLong()) {\n System.out.println(book0.getTitle() + \" is a long book.\");\n } else {\n System.out.println(book0.getTitle() + \" is a short book.\");\n }\n \n System.out.printf(\"The title of %s by %s is %d characters long.%n\", \n book0.getTitle(), book0.getAuthor(), book0.getTitleLength());\n\n System.out.println(book0.equals(book0copy2));\n System.out.println(book0.equals(book1));\n }", "public void set(int index, Object value) {\n\n\t\t// the right portion of values of the array -> room is not available\n\t\tif(index >= arr.length) {\n\t\t\tObject[] tmpArr = new Object[index+1]; // keep all values of the variable arr\n\t\t\t\n\t\t\t// keep all items of arr\n\t\t\tfor(int i=0; i<arr.length; i++) {\n\t\t\t\ttmpArr[i] = arr[i];\n\t\t\t}\n\t\t\t\n\t\t\tarr = tmpArr; // exchange addresses\n \t\t}\t\n\t\t\n\t\tarr[index] = value;\n\t\t\n\t}", "public Book getBook() {\n return book;\n }", "@Override\r\n\tpublic Book update(Book book) {\r\n\t\treturn null;\r\n\t}", "public void setData(Item i)\r\n\t{\r\n\t\ttheItem = i;\r\n\t}", "public static void convertBookToBookVO() {\n\t\t// TODDO\n\t}", "private void setValues() {\n for (int i = 0; i < name.length; i++) {\n TagViewDetailsModel listModel = new TagViewDetailsModel();\n listModel.setItemImage(image[i]);\n listModel.setItemName(name[i]);\n listModel.setDistance(distance[i]);\n listModel.setTags(tags[i]);\n listModel.setRating(rating[i]);\n savedListModels.add(listModel);\n }\n savedListAdapter = new TagViewDetailsAdapter(TagViewDetailsActivity.this, savedListModels);\n rvTagViewDetails.setAdapter(savedListAdapter);\n }", "public void loadBook() {\n List<Book> books = new ArrayList<>();\n for (int i = 0; i < 5; i++) {\n Book book = new Book(\"Book-\" + i, \"Test book \" + i);\n books.add(book);\n }\n this.setBooks(books);\n }", "@Override\r\n\tpublic Book updateBook(Book book) {\n\t\treturn bd.save(book);\r\n\t}", "private void populateUI(BookEntry book) {\n // Return if the task is null\n if (book == null) {\n return;\n }\n // Use the variable book to populate the UI\n mNameEditText.setText(book.getBook_name());\n mQuantityTextView.setText(Integer.toString(book.getQuantity()));\n mPriceEditText.setText(Double.toString(book.getPrice()));\n mPhoneEditText.setText(Integer.toString(book.getSupplier_phone_number()));\n mSupplier = book.getSupplier_name();\n switch (mSupplier) {\n case BookEntry.SUPPLIER_ONE:\n mSupplierSpinner.setSelection(1);\n break;\n case BookEntry.SUPPLIER_TWO:\n mSupplierSpinner.setSelection(2);\n break;\n default:\n mSupplierSpinner.setSelection(0);\n break;\n }\n mSupplierSpinner.setSelection(mSupplier);\n }", "@PutMapping(\"/books/{id}\")\n\tpublic ResponseEntity<Book> updateBook(@PathVariable Long id,@RequestBody Book bookDetails)\n\t{\n\t\tBook book = bookRepository.findById(id)\n\t\t\t\t.orElseThrow(() -> new ResourceNotFoundException(\"Book Not found with id\" + id));\n\t\tbook.setTitle(bookDetails.getTitle());\n\t\tbook.setAuthors(bookDetails.getAuthors());\n\t\tbook.setYear(bookDetails.getYear());\n\t\tbook.setPrice(bookDetails.getPrice());\n\t\t\n\t\tBook updatedBook = bookRepository.save(book);\n\t\treturn ResponseEntity.ok(updatedBook);\n\t}", "public void addBook(Book book)\r\n\t{\r\n\t\tList<Book> oldValue = items;\r\n\t\titems = new ArrayList<Book>(items);\r\n\t\titems.add(book);\r\n\t\tfirePropertyChange(\"books\", oldValue, items);\r\n\t\tfirePropertyChange(\"itemsCount\", oldValue.size(), items.size());\r\n\t}", "public int getBookID() {\n return bookID;\n }", "public void setEmployee(int index, Person emp) {\n if (index >= 0 && index < employees.length) {\n employees[index] = emp;\n }\n }", "public void setInfo(int i)\r\n\t{\r\n\t\tinfo = i;\r\n\t}", "void set(int index, Object element);", "@Override\r\n\tpublic void writeItem(BooksClass books, ArrayList<BooksClass> array,\r\n\t\t\tString address) {\n\t\t\r\n\t}", "public void setObjGameInfo(GameInfo objGameInfo) {\n this.objGameInfo = objGameInfo;\n Pintu.setObjGameInfo(objGameInfo);\n Penjaga.setObjGameInfo(objGameInfo);\n\n for (Item objItem : arrItem) {\n objItem.setObjGameInfo(objGameInfo);\n }\n }", "public Integer getBookid() {\r\n\t\treturn bookid;\r\n\t}", "public Integer getBookId() {\n return bookId;\n }", "public Integer getBookId() {\n return bookId;\n }", "public Integer getBookId() {\n return bookId;\n }", "@Override\n public void update(BookUpdateViewModel viewModel) {\n Book bookDb = repository.findById(viewModel.getId())\n .orElseThrow(RecordNotFoundException::new);\n\n\n // check the validity of the fields\n if (viewModel.getTitle().strip().length() < 5) {\n throw new DomainValidationException();\n }\n\n // apply the update\n BeanUtils.copyProperties(viewModel, bookDb);\n\n // save and flush\n repository.saveAndFlush(bookDb);\n }", "public int setNote(int index,ObjectListElement e){\n\t\t\n\t\tif (index < 0)\n\t\t\tthrow new IllegalArgumentException(\"Index of an ObjectListElement object cannot be a negative number\");\n\t\tObjectListElement orgElement= allNotes.get(index);\n\t\tif (orgElement!=e)\n\t\t\tthrow new IllegalArgumentException(\"New ObjectListElements holds different object.\");\n\n\t\tallNotes.set(index, e);\n\t\treturn index;\n\t}", "public void setBookCopy(ArrayList<BookCopy> bookCopy) {\n\t\tthis.bookCopy = bookCopy;\n\t}", "public void setBookId(long bookId) {\n _sTransaction.setBookId(bookId);\n }", "@Test\n void setWith1PersonInList() {\n //given index, and person chnage person in address book\n //doNothing().when(addressBookMock).set(0,test_Person);\n controllerTest.add(test_Person);\n controllerTest.set(0,test_Person);\n\n assertEquals(controllerTest.get(0),test_Person);\n }", "@Override\n public void onBindViewHolder(LoreBookSelectionViewHolder holder, int position) {\n LoreBookSelectionInformation current = bookSelectionData.get(position);\n\n holder.bookIcon.setImageResource(current.getBookIconID());\n holder.bookName.setText(current.getBookName());\n }", "void issuebook(String book){\n\t\tfor(int i=0;i<books.length;i++)\n\t\t{\n\t\t\tif(books[i]!=null && this.books[i].equals(book)){\n\t\t\t\tSystem.out.println(\"this book issue\");\n\t\t\t\tthis.books[i]=null;\n\t\t\t\treturn;\n\t\t}\t\t\t}System.out.println(\"this book not available\");\n\n\t}", "@Override\r\n\tpublic Book getBookInfo(int book_id) {\n\t\treturn null;\r\n\t}", "public Integer getBookid() {\n return bookid;\n }", "public Integer getBookid() {\n return bookid;\n }", "@Override\r\n\t\t\tpublic Object getItem(int i) {\n\t\t\t\treturn i;\r\n\t\t\t}", "public void setBorrowBookDetailsToTable() {\n\n try {\n Connection con = databaseconnection.getConnection();\n Statement st = con.createStatement();\n ResultSet rs = st.executeQuery(\"select * from lending_book where status= '\" + \"pending\" + \"'\");\n\n while (rs.next()) {\n String id = rs.getString(\"id\");\n String bookName = rs.getString(\"book_name\");\n String studentName = rs.getString(\"student_name\");\n String lendingDate = rs.getString(\"borrow_date\");\n String returnDate = rs.getString(\"return_book_datte\");\n String status = rs.getString(\"status\");\n\n Object[] obj = {id, bookName, studentName, lendingDate, returnDate, status};\n\n model = (DefaultTableModel) tbl_borrowBookDetails.getModel();\n model.addRow(obj);\n\n }\n } catch (Exception e) {\n JOptionPane.showMessageDialog(this, \"Error\");\n }\n }", "@Override\n\tpublic Book update(Book dto) {\n\t\treturn null;\n\t}", "public static MovieInfoObject getItemAtIndex(int i) {\n return mCurrentMovies.get(i - 1);\n }", "public void setBookId(String bookId) {\n this.bookId = bookId;\n }", "public void setBookName(java.lang.String value);", "public Book() {\n this.bookName = \"Five Point Someone\";\n this.bookAuthorName = \"Chetan Bhagat\";\n this.bookIsbnNumber = \"9788129104595\";\n\n }", "public void setIndex(int index)\n/* */ {\n/* 39 */ this.index = index;\n/* */ }", "public void addBooks(Books book){\n\n /*\n * If the book you want to add is not an instance of this Books class then you add it...\n * Don't think that's what it's supposed to do?\n */\n if (!(book instanceof Books)) {\n Books[] result = new Books[books.length + 1];\n for (int i = 0; i < books.length; i++) {\n result[i] = books[i];\n }\n result[result.length - 1] = (Books) book; // your if statement is wrong, that's why intellij warns this will always be null.\n books = result;\n }\n }" ]
[ "0.5886254", "0.57302886", "0.5483414", "0.54637706", "0.54550695", "0.53176004", "0.5231897", "0.51762235", "0.51688623", "0.51667756", "0.5146502", "0.5146502", "0.51300865", "0.5129739", "0.5122102", "0.50884163", "0.50532067", "0.50313383", "0.500775", "0.500775", "0.500775", "0.4991746", "0.49821022", "0.495207", "0.49391502", "0.49313048", "0.4931115", "0.4929191", "0.49077213", "0.48891574", "0.4874331", "0.48737565", "0.48737565", "0.48737565", "0.48529243", "0.48461854", "0.48354578", "0.48276702", "0.4824566", "0.479371", "0.479084", "0.479084", "0.47693595", "0.47670805", "0.4763577", "0.4756789", "0.4747217", "0.47466308", "0.47267163", "0.47263438", "0.47183675", "0.4712972", "0.47122812", "0.47011507", "0.46953416", "0.4692679", "0.46888083", "0.46884578", "0.46881053", "0.4687842", "0.46782213", "0.46669412", "0.46651372", "0.4662331", "0.46553892", "0.465491", "0.46545637", "0.46539518", "0.46538687", "0.46531588", "0.4652627", "0.46446916", "0.46442246", "0.46438408", "0.4634982", "0.46343368", "0.463053", "0.4626333", "0.4620278", "0.4620278", "0.4620278", "0.46194017", "0.46138784", "0.4604664", "0.46042204", "0.45995206", "0.4595587", "0.45952678", "0.45936015", "0.45885986", "0.45885986", "0.4588553", "0.45880353", "0.45873126", "0.45838028", "0.45731035", "0.45661157", "0.45639724", "0.45569173", "0.45513055" ]
0.5453136
5
/This loads all students in the students.txt file and stores each StudentDetails object in the ALL_Students ArrayList
private static boolean loadStudents() throws IOException{ BufferedReader reader = new BufferedReader(new FileReader(STUDENTS_FILE)); boolean error_loading = false; //stores whether there was an error loading a student String line = reader.readLine(); //read the properties of each student in the students.txt file /*read students.txt file, set the input for each studentDetails object and add each StudentDetails object to ALL_STUDENTS ArrayList*/ while(line != null){ StudentDetails student = new StudentDetails(); String[] details = line.split("\t"); //the properties of each StudentDetails object are separated by tab spaces in the students.txt file for(int i = 0; i < details.length; i ++){ if(!setStudentInput(i, details[i], student)){ //checks if there was an error in setting the StudentDetails object's properties with the values in the students.txt file System.out.println("ERROR Loading Students"); error_loading = true; break; } } if(error_loading) //if there was an error loading a book then stop the process of loading books break; ALL_STUDENTS.add(student); /*Add Students who have been fined (total fine > 0) to the FINED_STUDENTS Hashtable*/ addFinedStudentsToTable(student); line = reader.readLine(); } reader.close(); if(!error_loading){ System.out.println("Loading Students - Complete!"); return true; } return false; //error encountered while loading books }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static ArrayList<Student> loadListOfStudents(String fileName) {\n ArrayList<Student> students = new ArrayList<>();\r\n String str = TextReader.StringFromFile(fileName);//Uses the method that returns a complete string with newlines for each studentline.\r\n if (validateInput(str)) {//Uses the validation method to check that the input is valid.\r\n String[] lines = str.split(\"\\n\");\r\n String[] lineParameters;\r\n int countFor = 0;\r\n for (String line : lines) {\r\n if(countFor > 1){\r\n lineParameters = line.split(\",\");\r\n Vote vote = new Vote(new Subject(lineParameters[1]), new Subject(lineParameters[2]), new Subject(lineParameters[3]), new Subject(lineParameters[4]));\r\n Student newStudent = new Student(lineParameters[0], vote);\r\n students.add(newStudent);\r\n }\r\n countFor++;\r\n }\r\n }\r\n\r\n return students;\r\n }", "public static void init() {\n\t\tList<Object> objects = FileManager.readObjectFromFile(\"student.dat\");\n\t\tfor (Object o : objects)\n\t\t\tStudentList.add((Student) o);\n\t}", "@SuppressWarnings(\"unchecked\")\r\n\tpublic List<Student> retrieveAllStudentObjects() {\r\n\t\tList<Student> listOfStudents = new ArrayList<Student>();\r\n\r\n\t\ttry {\r\n\t\t\tlistOfStudents = readSerializedObject();\r\n\r\n\t\t\tif (listOfStudents == null) {\r\n\t\t\t\tSystem.out.println(\"Unable to read from file!\");\r\n\t\t\t\tthrow new Exception();\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn listOfStudents;\r\n\t}", "private static List<Student> loadStudentList(File file) throws IOException {\n return loadStudentList(new FileInputStream(file));\n }", "public void importStudents(String fileName) throws FileNotFoundException\n {\n Scanner inf = new Scanner(new File(fileName));\n while(inf.hasNextLine())\n {\n String first = inf.nextLine();\n String last = inf.nextLine();\n String password = inf.nextLine();\n String p1 = inf.nextLine();\n String p2 = inf.nextLine();\n String p3 = inf.nextLine();\n String p4 = inf.nextLine();\n String p5 = inf.nextLine();\n String p6 = inf.nextLine();\n String p7 = inf.nextLine();\n String p8 = inf.nextLine();\n \n students.add(new Student(first, last, password, p1, p2, p3, p4, p5, p6, p7, p8, this));\n }\n }", "private static List<Student> getStudents() {\n \t\n List<Student> studentList = new ArrayList<>();\n Scanner readStudents=null;\n try {\n\t\t\treadStudents = new Scanner(new File(\"src/Student.csv\"));\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tSystem.out.println(\"Student file not found.\");\n\t\t}\n\t\twhile(readStudents.hasNextLine()) {\n\t\t\tString[] studentLine = readStudents.nextLine().split(\",\");\n\t\t\tlong studentId= Long.parseLong(studentLine[0]);\n\t\t\tint age = Integer.parseInt(studentLine[4]);\n\t\t\tlong recordId = Long.parseLong(studentLine[5]);\n \tStudent newStudent = new Student(studentId,age,studentLine[1],studentLine[2],studentLine[3],recordId);\n \tstudentList.add(newStudent);\n\t\t}\n \n readStudents.close();\n return studentList;\n }", "public void read() {\n\t\tFileInputStream fis;\n\t\ttry {\n\t\t\tfis = new FileInputStream(\"studentData.dat\");\n\n\t\t\tObjectInputStream ois;\n\t\t\ttry {\n\t\t\t\tois = new ObjectInputStream(fis);\n\t\t\t\ttry {\n\t\t\t\t\tstudentList = (ArrayList<Student>) ois.readObject();\n\t\t\t\t} catch (ClassNotFoundException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\tois.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void loadData() throws Exception {\n List<Student> listOfStudents = new ArrayList<>();\n DocumentBuilderFactory documentBuilderFactory =\n DocumentBuilderFactory.newInstance();\n\n DocumentBuilder documentBuilder =\n documentBuilderFactory.newDocumentBuilder();\n Document document = documentBuilder.parse(XMLfile);\n Element root = document.getDocumentElement();\n\n NodeList nodes = root.getChildNodes();\n int len = nodes.getLength();\n for (int i = 0; i < len; i++) {\n Node studentNode = nodes.item(i);\n if (studentNode instanceof Element) {\n Student b = createStudent((Element) studentNode);\n listOfStudents.add(b);\n }\n }\n Map<Long, Student> map= new HashMap<>();\n for (Student s : listOfStudents){\n map.putIfAbsent(s.getId(),s);\n }\n this.setEntities(map);\n }", "@SuppressWarnings({ \"rawtypes\", \"unchecked\"})\n\tpublic static ArrayList<StudentCourse> initStudentCourses() throws IOException, ParseException {\n\t\t// read String from text file\n\t\tArrayList<String> stringArray = (ArrayList) IO.read(Main.studentcoursepath.toString());\n\t\t\t\n\t\tif (stringArray.size() == 0){\n\t\t\treturn new ArrayList<StudentCourse>();\n\t\t}\n for (int i = 0 ; i < stringArray.size() ; i++) {\n\t\t\t\tString field = (String) stringArray.get(i);\n\n\t\t\t\t// get individual 'fields' of the string separated by SEPARATOR\n\t\t\t\t// pass in the string to the string tokenizer using delimiter \",\"\n\t\t\t\tStringTokenizer tokenizer = new StringTokenizer(field, SEPARATOR);\n\n\t\t\t\t//first to fifth tokens\n\t\t\t\tString userID = tokenizer.nextToken().trim();\n\t\t\t\tString userName = tokenizer.nextToken().trim();\n\t\t\t\tString courseID = tokenizer.nextToken().trim();\n\t\t\t\tint indexID = Integer.parseInt(tokenizer.nextToken().trim());\n\t\t\t\tString registerStatus = tokenizer.nextToken().trim();\n\n\t\t\t\t// create Course object from file data\n\t\t\t\tStudentCourse course = new StudentCourse(userID, userName, courseID, indexID, registerStatus);\n\t\t\t\t// add to Courses list\n\t\t\t\tstudentCourseList.add(course) ;\n\t\t}\n\t\treturn studentCourseList ;\n\t}", "public List<Student> importStudent(String filename) throws FileNotFoundException {\n List<Student> students = new ArrayList<>();\n FileReader fileReader = new FileReader(DATA_PATH + filename);\n Scanner scanner = new Scanner(fileReader);\n //skip first line\n String firstLine = scanner.nextLine();\n Log.i(\"first line: \" + firstLine);\n\n while (scanner.hasNextLine()) {\n String[] s = scanner.nextLine().split(\",\");\n String fullName = s[0];\n int yearLevel = Integer.parseInt(s[1]);\n Student student = new Student(fullName, yearLevel);\n students.add(student);\n }\n\n scanner.close();\n return students;\n }", "public List<Student> getAllStudents() throws IOException {\n\t\tstudentList = studentListGenerator.generateList(\"StudentList.txt\");\n\t\treturn studentList;\n\t}", "public void createStudents(String fileContents) {\r\n\t\tplot = false;\r\n\t\tif (this.students != null) {\r\n\t\t\tstudents.clear();\r\n\t\t}\r\n\t\tdates.clear();\r\n\t\tattendancePos = 0;\r\n\t\tdataLoaded = 0;\r\n\t\tthis.students = new ArrayList<Student>();\r\n\t\tString[] studentString = fileContents.split(\"\\n\");\r\n\t\tfor (int i=0; i<studentString.length; i++) {\r\n\t\t\tString[] studentInfo = studentString[i].split(\",\");\r\n\t\t\tArrayList<Integer> attendance = new ArrayList<Integer>();\r\n\t\t\ttry {\r\n\t\t\t\tStudent toAdd = new Student(studentInfo[0], studentInfo[1], studentInfo[2], studentInfo[3], studentInfo[4], studentInfo[5], attendance);\r\n\t\t\t\tstudents.add(toAdd);\r\n\t\t\t} catch (ArrayIndexOutOfBoundsException e) {\r\n\t\t\t\tJOptionPane.showMessageDialog(null, \"File Format is incorrect\", \"Error\", 2);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\tsetChanged();\r\n\t\tnotifyObservers();\r\n\t}", "public List<Student> getAllStudentData() {\r\n\t\tList<Student> list = new ArrayList<Student>();\r\n\t\ttry {\r\n\t\t\tConnection con = DatabaseUtility.getCon(inputStream);\r\n\t\t\tPreparedStatement ps = con.prepareStatement(\"select * from student\");\r\n\t\t\tResultSet rs = ps.executeQuery();\r\n\t\t\twhile (rs.next()) {\r\n\t\t\t\tStudent stud = new Student();\r\n\r\n\t\t\t\tstud.setRollno(rs.getInt(1));\r\n\t\t\t\tstud.setFname(rs.getString(2));\r\n\t\t\t\tstud.setLname(rs.getString(3));\r\n\t\t\t\tstud.setEmail(rs.getString(4));\r\n\t\t\t\tstud.setGender(rs.getString(5));\r\n\t\t\t\tstud.setDOB(rs.getString(6));\r\n\t\t\t\tstud.setAddress(rs.getString(7));\r\n\t\t\t\tstud.setContact(rs.getString(8));\r\n\r\n\t\t\t\tlist.add(stud);\r\n\t\t\t}\r\n\t\t\tcon.close();\r\n\t\t} catch (Exception ex) {\r\n\t\t\tSystem.out.println(ex);\r\n\t\t}\r\n\r\n\t\treturn list;\r\n\t}", "public void fillFromFile()\n\t{\n\t\tJFileChooser fc = new JFileChooser();\t//creates a new fileChooser object\n\t\tint status = fc.showOpenDialog(null);\t//creates a var to catch the dialog output\n\t\tif(status == JFileChooser.APPROVE_OPTION)\t\n\t\t{\n\t\t\tFile selectedFile = fc.getSelectedFile ( );\n\t\t\tthis.fileName = selectedFile;\n\t\t\tScanner file = null; //scans the file looking for information to load\n\n\t\t\tif(selectedFile.exists())\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tfile = new Scanner(fileName); //scans the input file\n\t\t\t\t}\n\t\t\t\tcatch(Exception IOException)\n\t\t\t\t{\n\t\t\t\t\tJOptionPane.showConfirmDialog (null, \"Unable to import data from the list\");\n\t\t\t\t\tSystem.exit (-1);\n\t\t\t\t}//if there was an error it will pop up this message\n\t\t\t\t\n\t\t\t\tString str = file.nextLine ( ); //names the line\n\t\t\t\tString [] header = str.split (\"\\\\|\"); //splits the line at the |\n\t\t\t\tsetCourseNumber(header[1]);\n\t\t\t\tsetCourseName(header[0]);\n\t\t\t\tsetInstructor(header[2]);\n\t\t\t\t\n\t\t\t\twhile(file.hasNextLine ( ))\n\t\t\t\t{\n\t\t\t\t\tstr = file.nextLine ( ); //names the line\n\t\t\t\t\tString [] tokens = str.split (\"\\\\|\"); //splits the line at the |\n\t\t\t\t\tStudent p = new Student();\n\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tp.setStrNameLast (String.valueOf (tokens[0]));\n\t\t\t\t\t\tp.setStrNameFirst (String.valueOf (tokens[1]));\n\t\t\t\t\t\tp.setStrMajor (String.valueOf (tokens[2]));\n\t\t\t\t\t\tp.setClassification (tokens[3]);\n\t\t\t\t\t\tp.setiHoursCompleted (new Integer (tokens[4]).intValue ( ));\n\t\t\t\t\t\tp.setfGPA (new Float (tokens[5]).floatValue ( ));\n\t\t\t\t\t\tp.setStrStudentPhoto (String.valueOf (tokens[6]));\n\t\t\t\t\t//creates a person object and then populates it with an array of scanned input values\n\t\t\t\t\t\tclassRoll.add (p);\n\t\t\t\t\t\t}//creates a person object and then populates it with an array of scanned input values\n\t\t\t\t\t\tcatch(Exception IOException)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tIOException.printStackTrace ( );\n\t\t\t\t\t\t\tJOptionPane.showMessageDialog (null, \"Bad input record: '\" + str + \"'\" + IOException.getMessage());\n\t\t\t\t\t\t}//pops up a message if there were any errors reading from the file\n\t\t\t\t}//continues through the file until there are no more lines to scan\n\t\t\tfile.close ( ); //closes the file\n\n\t\t\t\tif(selectedFile.exists ( )==false)\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new Exception();\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Exception IOException)\n\t\t\t\t\t{\n\t\t\t\t\t\tJOptionPane.showMessageDialog (null, \"Bad input record: '\" + selectedFile + \"' \" + IOException.getMessage());\n\t\t\t\t\t}\n\t\t\t\t}//if the user picks a file that does not exist this error message will be caught.\n\t\t\t}\n\t\t}//if the input is good it will load the information from the selected file to and Array List\n\t\t\telse\n\t\t\t{\n\t\t\t\tSystem.exit (0);\n\t\t\t}\n\t\tthis.saveNeed = true;\n\n\t\t}", "public static ArrayList<Student> read(String filename){\n\t\t\n\t\tArrayList<Student> students = new ArrayList<>();\n\n\t\tBufferedReader br;\n\t\ttry {\n\t\t\tbr = new BufferedReader(new FileReader(filename));\n\t\t\tString line;\n\t\t\twhile ((line = br.readLine()) != null) {\n\t\t\t\tif (line.contains(\" \")){\n\t\t\t\t\tstudents.add(new Student(getGpaFromLine(line), getSatFromLine(line)));\n\t\t\t\t}\n\t\t\t}\n\t\t\tbr.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e){\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn students;\n\t}", "ArrayList retrievestudentdata() throws ClassNotFoundException;", "public void loadStudents(File filePath){\r\n Index.resetIndex();\r\n List<Student> students = DataConvert.loadStudentsDataFromCSV(filePath);\r\n List<String> errorMessage = new ArrayList<>();\r\n students.forEach(student -> {\r\n try{\r\n addStudent(student);\r\n } catch (ValidationException ex){\r\n errorMessage.add(\"=========================================\\n\");\r\n errorMessage.add(student.toString() + \" - \" + ex.getMessage());\r\n errorMessage.add(\"=========================================\\n\");\r\n }\r\n });\r\n if(!errorMessage.isEmpty()){\r\n String error = errorMessage.stream().reduce(\"\", (s1, s2)-> s1 += s2);\r\n throw new ValidationException(error);\r\n }\r\n }", "public void loadStaffList(String fileName) {\n try {\n BufferedReader in = new BufferedReader(new FileReader(fileName));\n maxStaff = Integer.parseInt(in.readLine());\n staffList = new Staff[maxStaff];\n int numStaffInFile = Integer.parseInt(in.readLine());\n \n for (int i = 0; i < numStaffInFile; i++){\n \n String staffType = in.readLine();\n if (staffType.equals(\"Labourer\")) {\n staffList[i] = new Labourer(in.readLine(), Integer.parseInt(in.readLine()), in.readLine(), Double.parseDouble(in.readLine()), Integer.parseInt(in.readLine()));\n numStaff++;\n } else if (staffType.equals(\"Manager\")) /*;*/\n {\n staffList[i] = new Manager(in.readLine(), Integer.parseInt(in.readLine()), in.readLine(), Double.parseDouble(in.readLine()));\n numStaff++;\n }\n }\n \n } catch (IOException iox) {\n System.out.println(\"Error reading \" + fileName);\n \n } catch (NumberFormatException ex) {\n System.out.println(\"Problem with file formatting. Please check the file and try again.\");\n }\n }", "static Student[] readStudentsFromFile(String filename, int num) {\n\t\ttry (Scanner in = new Scanner(new File(filename))) {\n\t\t\tStudent[] students = new Student[num];\n\t\t\tint index = 0; //prevents ArrayIndexOutOfBounds\n\t\t\tString line;\n\t\t\tString[] input;\n\n\t\t\twhile (in.hasNextLine()) {\n\t\t\t\tline = in.nextLine();\n\t\t\t\tinput = line.split(\",\"); //Splits each String input by the character ','\n\t\t\t\tstudents[index++] = new Student(input[0], Integer.parseInt(input[1]), input[2]);\n\t\t\t}\n\t\t\treturn students;\n\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}", "private void inflateFromFile() {\n\t\t\n\t\tFile file = null;\t\t\n\t\ttry {\n\t\t\tfile = new File(FILE_PATH);\n\t\t} catch (NullPointerException e) {\n\t\t\tSystem.exit(1);\n\t\t}\n\t\t\n\t\tFileReader reader = null;\t\t\n\t\ttry {\n\t\t\treader = new FileReader(file);\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"Can't find source (json file)\");\n\t\t\tSystem.err.println(e.getMessage());\n\t\t\tSystem.exit(1);\n\t\t\t\n\t\t}\n\t\t\n\t\tJSONObject jsonObject = new JSONObject(\n\t\t\t\tnew JSONTokener(reader)\n\t\t\t\t);\n\t\t\n\t\tJSONArray array = jsonObject.getJSONArray(\"students\");\n\t\t\n\t\tfor (int i = 0; i < array.length(); i++) {\t\t\t\n\t\t\tJSONObject student = array.getJSONObject(i);\t\t\t\n\t\t\tString name = student.getString(\"name\");\n\t\t\tString secondName = student.getString(\"secondName\");\n\t\t\tString surname = student.getString(\"surname\");\n\t\t\tString birthday = student.getString(\"birthday\");\n\t\t\tString facultet = student.getString(\"facultet\");\n\t\t\tint groupNumber = student.getInt(\"groupNumber\");\n\t\t\t\n\t\t\tDate dateBirthday = null; \n\t\t\t//делаем Date из строки\t\t\t\n\t\t\ttry {\n\t\t\t\tdateBirthday = new SimpleDateFormat(\"dd.MM.yyyy\").parse(birthday);\n\t\t\t} catch(ParseException e) {\n\t\t\t\tSystem.err.println(\"Can't understand the date format from source.\");\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\tstudents.add(\n\t\t\t\t\tStudent.get(name, secondName, surname, dateBirthday, facultet, groupNumber)\n\t\t\t\t\t);\t\t\t\n\t\t}\t\t\t\n\t}", "static List<Student> loadStudentList(InputStream in) {\n return new BufferedReader(new InputStreamReader(in, StandardCharsets.UTF_8))\n .lines()\n .skip(1)\n .map(Student::fromCsv)\n .collect(Collectors.toList());\n }", "public static String loadStudentList() {\n\n // Variable used to organize code and allow buffered reader to close\n String bufferedStudentList = \" \"; \n\n // The try...catch block handles the possible error that may occur if \n // there was an issue with accessing the file. \n try {\n BufferedReader bufferedReader = new BufferedReader(new FileReader(Constants.STUDENT_LIST));\n bufferedStudentList = bufferedReader.readLine();\n bufferedReader.close();\n } catch (IOException exception) {\n System.out.println(exception);\n } \n return bufferedStudentList; \n }", "public void loadDataFromFile(String name) throws FileNotFoundException {\n\t\tFileReader reader = new FileReader(name);\n\t\tScanner in = new Scanner(reader);\n\t\twhile(in.hasNextLine()) {\n\t\t\tString readName = \"\";\n\t\t\tString readScore = \"\";\n\t\t\tint intScore = 0;\n\t\t\treadName = in.nextLine();\n\t\t\treadScore = in.nextLine();\n\t\t\ttry {\n\t\t\tintScore = Integer.parseInt(readScore);\n\t\t\t}\n\t\t\tcatch(NumberFormatException e){\n\t\t\t\tSystem.out.println(\"Incorrect format for \" + readName + \" not a valid score: \" + readScore);\n\t\t\t\tSystem.out.println();\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tstudents.add(new Student(readName,intScore));\n\t\t}\n\t}", "public static ArrayList<Student> get_student_users() throws IOException {\n\t\tArrayList<Student> studentList = new ArrayList<Student>();\n\t\tReadCSV readStudentlist = new ReadCSV(\"students.csv\");\n\t\ttry {\n\t\t\t// auto-generated primary key for authors table\n\t\t\t\n\t\t\twhile (true) {\n\t\t\t\tList<String> tuple = readStudentlist.next();\n\t\t\t\tif (tuple == null) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t//Reads each value in from our string list and inserts them into the appropriate attribute of our student object\n\t\t\t\tIterator<String> i = tuple.iterator();\n\t\t\t\tStudent students = new Student();\n\t\t\t\tstudents.setName(i.next());\n\t\t\t\tString password = MD5.getMd5(i.next());\n\t\t\t\tstudents.setPassword(password);\n\t\t\t\tstudents.setEmail(i.next());\n\t\t\t\tstudents.set_faculty_code(i.next());\n\t\t\t\tstudents.setType(Integer.parseInt(i.next()));\n\t\t\t\tstudentList.add(students);\n\t\t\t}\n\t\t\treturn studentList;\n\t\t} finally {\n\t\t\treadStudentlist.close();\n\t\t}\n\t}", "public static void loadArrayList() throws IOException\n\t{\n\t\tString usersXPFile = \"UsersXP.txt\";\n\t\t\n\t\tFile file = new File(usersXPFile);\n\t\t\n\t\tScanner fileReader;\n\t\t\n\t\tif(file.exists())\n\t\t{\n\t\t\tfileReader = new Scanner(file);\n\t\t\twhile(fileReader.hasNext())\n\t\t\t\tuserDetail1.add(userData.addNewuser(fileReader.nextLine().trim()));\n\t\t\tfileReader.close();\n\t\t}\n\t\telse overwriteFile(usersXPFile, \"\");\n\t\t\n\t\t\n\t}", "public void readFile(File inputFile) throws FileNotFoundException, IOException, ClassNotFoundException {\n\n ArrayList<Student> studentList = null;\n int noOfStudents = 1; int noOfProjects = 0;\n int count = 1;\n String title; String school; String supervisor; Project project = null; \n ArrayList<Project> projectList = new ArrayList<>();\n\n Scanner scan = new Scanner(new FileReader(inputFile));\n String line = null;\n\n while (scan.hasNextLine()) {\n studentList = new ArrayList<>();\n \n if (count == 1) {\n line = scan.nextLine();\n noOfProjects = Integer.parseInt(line);\n System.out.println(line);\n }\n\n line = scan.nextLine();\n String[] projectInfo = line.split(\",\", 5);\n noOfStudents = Integer.parseInt(projectInfo[3]);\n String[] studentInfo = projectInfo[4].split(\",\");\n\n Student student = null;\n \n for (int k = 0; k < studentInfo.length; k+=4) {\n //new Student(AdminNo, Name, Course, Gender)\n student = new Student(studentInfo[k], studentInfo[k+1], studentInfo[k+2], studentInfo[k+3]);\n studentList.add(student); //Add new Student to List\n }\n\n title = projectInfo[0];\n school = projectInfo[1];\n supervisor = projectInfo[2];\n project = new Project(title, school, supervisor, noOfStudents, studentList);\n \n System.out.println(line);\n count++;\n \n projectList.add(project);\n }\n\n for (Student stud: studentList) {\n System.out.println(stud.getAdminNo() + stud.getCourse() + stud.getGender() + stud.getName());\n }\n \n writeToFile(project);\n \n scan.close();\n }", "public void readUserFile (){\n try {\n FileReader reader = new FileReader(fileName);\n BufferedReader bufferedReader = new BufferedReader(reader);\n String line;\n while ((line = bufferedReader.readLine()) != null) {\n Scanner s = new Scanner(line); //use of a scanner to parse the line and assign its tokens to different variables\n//each line corresponds to the values of a User object\n while(s.hasNext()){\n String usrname = s.next();\n String pass = s.next();\n User u = new User(usrname,pass);\n userlist.add(u);//added to the list\n }\n \n }\n reader.close();\n \n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void processFiles(){\n\t\tfor(String fileName : files) {\n\t\t\ttry {\n\t\t\t\tloadDataFromFile(fileName);\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\tSystem.out.println(\"Can't open file: \" + fileName);\n\t\t\t\tSystem.out.println();\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tprintInOrder();\n\t\t\tstudents.clear();\n\t\t}\n\t}", "@Override\n public void loadDataFromFile(File file) {\n Gson gson = new Gson();\n try {\n Scanner scanner = new Scanner(file);\n while (scanner.hasNextLine()){\n IndividualCustomer customer =\n gson.fromJson(scanner.nextLine(),IndividualCustomer.class);\n customerList.add(customer);\n }\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n\n }", "@Override\n\tpublic List<Personne> generateStudents(MultipartFile file) throws IllegalStateException, IOException{\n\t\tList<Personne> students=new ArrayList<Personne>();\n\t\tPersonne student=new Personne();\n\t\tString line = \"\";\n\t\tfile.transferTo(new File(\"D:\\\\files\\\\\" + file.getOriginalFilename()));\n\t\ttry {\n\t\t\tBufferedReader br;\n\t\t\tbr = new BufferedReader( new FileReader(\"D:\\\\files\\\\\" + file.getOriginalFilename()));\n\t\t\twhile((line = br.readLine())!=null)\n\t\t\t{\n\t\t\t\tString [] data =line.split(\",\");\n\t\t\t\tPersonne etudiant = new Personne();\n\t\t\t // etudient.setId((long) Integer.parseInt(data[0]));\n\t\t\t\tetudiant.setNom(data[0]);\n\t\t\t\tetudiant.setPrenom(data[1]);\n\t\t\t\tetudiant.setCin(data[2]);\n\t\t\t\tetudiant.setCin(data[2]);\n\t\t\t\tetudiant.setCin(data[2]);\n\t\t\t\tetudiant.setCin(data[2]);\n\t\t\t\tetudiant.setCin(data[2]);\n\t\t\t\t//etudiant.setNom(data[3]);\n\t\t\t\tstudent=persoRepo.save(etudiant);\n\t\t\t\tif(student !=null) {\n\t\t\t\t\tstudents.add(student);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tbr.close();\n\t\t\t\n\t\t}\n\t\tcatch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn students;\n\t\t\n\t}", "private void readFile() {\r\n\t\tScanner sc = null; \r\n\t\ttry {\r\n\t\t\tsc = new Scanner(inputFile);\t\r\n\t\t\twhile(sc.hasNextLine()){\r\n\t\t\t\tgrade.add(sc.nextLine());\r\n\t } \r\n\t\t}\r\n\t\tcatch (FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\tsc.close();\r\n\t\t}\t\t\r\n\t}", "static void loadCourse() {\n\t\tScanner inputStreamC = null; // create object variable for Course\n\n\t\ttry { // create Scanner object & assign to variable\n\t\t\tinputStreamC = new Scanner(new File(\"course.txt\"));\n\t\t\tinputStreamC.useDelimiter(\",\");\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"No Course Infomation was Loaded\");\n\t\t\t// System.exit(0);\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\twhile (inputStreamC.hasNext()) {\n\n\t\t\t\tString readCourseID = inputStreamC.next();\n\t\t\t\tString readCourseName = inputStreamC.next();\n\t\t\t\tString readCourseUserName = inputStreamC.next();\n\t\t\t\t\n\t\t\t\tCourse c1 = new Course(readCourseID, readCourseName, readCourseUserName);\n\t\t\t\tcourseInfoArray.add(c1);\n\t\t\t\t//System.out.println(\"Read a Course \" + c1.getCourseID() + \" \" + c1.getCourseName() + \" \"\t+ c1.getCoordinatorUserID());\n\t\t\t\t\n\t\t\t} //eo while\n\t\t} catch (IllegalStateException e) {\n\t\t\tSystem.err.println(\"Could not read from the file\");\n\t\t} catch (InputMismatchException e) {\n\t\t\tSystem.err.println(\"Something wrong happened while reading the file\");\n\t\t}\n\t\tinputStreamC.close();\n\t}", "private void importStudent(ClassPathResource studentFile) throws IOException {\n\t\t//System.out.println(studentFile.getFilename());\n\t\tFileInputStream fileInputStream = new FileInputStream(resourceStudent.getFile());\n\t\t@SuppressWarnings(\"resource\")\n\t\tWorkbook workbook = new XSSFWorkbook(fileInputStream);\n\t\tSheet sheet = workbook.getSheetAt(0);\n\t\tboolean validate = studentReader.validdateFile(sheet);\n\t\tMainClass mainClass = null;\n\t\tList<Student> students = null;\n\t\tif(!validate) {\n\t\t\tSystem.out.println(\"STUDENT SEEDING ERROR!\");\n\t\t\treturn;\n\t\t}\n\t\tmainClass = students.get(0).getMainClass();\n\t\tFaculty faculty = mainClass.getFaculty();\n\t\tLecturer lecturer = mainClass.getLecturer();\n\t\tif(!facultyService.findById(faculty.getFacultyId()).isPresent())\n\t\t\tfacultyService.save(faculty);\n\t\telse\n\t\t\tfaculty = facultyService.findById(faculty.getFacultyId()).get();\n\t\tmainClass.setFaculty(faculty);\n\t\tif(!lecturerService.existsById(lecturer.getId()))\n\t\t\tlecturerService.save(lecturer);\n\t\telse\n\t\t\tlecturer = lecturerService.findById(lecturer.getId()).get();\n\t\tmainClass.setLecturer(lecturer);\n\t\tmainClassService.save(mainClass);\n\t\tstudentService.saveAll(students);\n\t\texcelFileHandlerService.getStudents().clear();\n\t}", "private ObservableList<Saucer> loadSaucers(){\r\n try {\r\n File file = new File(\"src/data/saucers.txt\");\r\n FileInputStream fis = new FileInputStream(file);\r\n ObjectInputStream input = new ObjectInputStream(fis);\r\n List<Saucer> list = (List<Saucer>) input.readObject();\r\n ObservableList<Saucer> saucers = FXCollections.observableArrayList(list);\r\n\r\n return saucers;\r\n } catch (Exception ex){\r\n ex.printStackTrace();\r\n\r\n return null;\r\n }\r\n }", "public static void readData(ArrayList<Student> students, ArrayList<Course> courses)\r\n {\r\n //emfanizie mnm ston xrhsth,dexetai apanthsh apo ton xrhsth\r\n //kai thn apanthsh thn epistrefei ws alfarithmitiko\r\n\r\n //String answer= JOptionPane.showInputDialog(\"Enter your name:\");\r\n\r\n boolean more= true;\r\n\r\n while(more)\r\n {\r\n\r\n String selection= JOptionPane.showInputDialog(\"1:Student 2:Graduate\");\r\n int choice =Integer.parseInt(selection);\r\n\r\n String name= JOptionPane.showInputDialog(\"Name: \");\r\n String id= JOptionPane.showInputDialog(\"Id: \");\r\n\r\n //to arxikopoiw ws null gia na mhn vgazei error\r\n //ayto symvanei dioti an mpei mesa sto if pernei mai timh an omws den mpei den tha parei timh kai tha vgazei error\r\n String supervisor=null;\r\n\r\n if(choice == 2)\r\n {\r\n supervisor= JOptionPane.showInputDialog(\"Supervisor: \");\r\n }\r\n\r\n Student student;\r\n if(choice==1)\r\n {\r\n student= new Student(name,id);\r\n }\r\n else\r\n {\r\n student= new Graduate(name,id,supervisor);\r\n }\r\n\r\n String coursename =JOptionPane.showInputDialog(\"Enter course name: \");\r\n\r\n //ftiaxnoume ena for wste na diatreksw ola ta mathimata poy exie mesa h lista\r\n //sthn synexeia tha sygkrinw to mathima me thn epilogh tou xrhsth\r\n for (Course course:courses)\r\n {\r\n if(course.getName().equals(coursename))\r\n {\r\n student.addCourses(course);\r\n }\r\n\r\n }\r\n\r\n //ton foithth ton topothetoume sthn lista poy yparxeis thn main kai thn pernei ws orisma h synarthsh\r\n students.add(student);\r\n\r\n String answer= JOptionPane.showInputDialog(\"More Students (Y/N)\");\r\n //gia string tha mporousa na kanw==\"n\"\r\n if(answer.equals(\"N\"))\r\n {\r\n more= false;\r\n }\r\n\r\n }\r\n\r\n\r\n }", "public void displayStatistics() {\n FileInputStream fInStr;\n ObjectInputStream objInStr = null;\n File file = new File(\"clubData.txt\");\n if (file.exists()) {\n try {\n fInStr = new FileInputStream(\"clubData.txt\");\n while ( fInStr.available() > 0) {\n objInStr = new ObjectInputStream( fInStr);\n ArrayList<FootballClub> readedArray = (ArrayList<FootballClub>) objInStr.readObject();\n footballClubArrayList = readedArray;\n\n\n }\n if (objInStr != null) {\n objInStr.close();\n }\n } catch (IOException | ClassNotFoundException e) {\n e.printStackTrace();\n }\n\n }\n\n }", "public static ArrayList<Subject> loadListOfPools(String fileName) {\n ArrayList<Subject> subject = new ArrayList<>();\r\n String str = TextReader.StringFromPools(fileName);//Uses the method that returns a complete string with newlines for each studentline.\r\n if (validateInputFromPool(str)) {//Uses the validation method to check that the input is valid.\r\n String[] lines = str.split(\"\\n\");\r\n String[] lineParameters;\r\n int countFor = 0;\r\n for (String line : lines) {\r\n if(countFor > 1){\r\n lineParameters = line.split(\",\");\r\n Subject sub = new Subject(lineParameters[0],lineParameters[1]);\r\n subject.add(sub);\r\n }\r\n countFor++;\r\n }\r\n }\r\n\r\n return subject;\r\n }", "public static void read(String fname){\r\n\t\t\t\r\n\t\t\tString line = \"\";\r\n\t\t\ttry {\r\n\t // FileReader reads text files in the default encoding.\r\n\t FileReader fileReader = new FileReader(fname);\r\n\t \r\n\t // Always wrap FileReader in BufferedReader.\r\n\t BufferedReader bufferedReader = new BufferedReader(fileReader);\r\n\t header=bufferedReader.readLine();\r\n\t \r\n\t data = new ArrayList<alldata>();\r\n\r\n\t while((line = bufferedReader.readLine()) != null) {\r\n\t \t\r\n\t //parse line and divide data by comma\r\n\t \r\n\t \t\r\n\t \tString[] lineStr = line.split(\",\");\r\n\t \t\r\n\t //create object row into which data from each line is stored and then added to array list\t\r\n\t \t\r\n\t if(lineStr.length >0) {\r\n\t \talldata row = new alldata();\r\n\t \trow.Name = lineStr[0]+ \",\" + lineStr[1];\r\n\t \trow.Num = lineStr[2];\r\n\t \trow.State = lineStr[3];\r\n\t \trow.Zip = lineStr[4];\r\n\t \trow.Age = Integer.parseInt(lineStr[6]);\r\n\t \trow.Sex = lineStr[7];\r\n\t \t\r\n\t \tdata.add(row);\r\n\t }\r\n\t \r\n\t \r\n\t } \r\n\t bufferedReader.close(); // Always close files. \r\n\t }catch(FileNotFoundException ex) {\r\n\t System.out.println(\"Unable to open file '\" + fname + \"'\"); \r\n\t }catch(IOException ex) {\r\n\t System.out.println(\"Error reading file '\" + fname + \"'\"); \r\n\t }\r\n\t\t\tSystem.out.println(\"Finish reading data from file \"+ fname);\r\n\t\t}", "@Override\n\t// read registration records from dataFile\n\tpublic synchronized Info readInfoFromFile(){\n\t\tInfo new_StudInfo = null;\n\t\ttry{\n\t\t\t\tString newLine = br.readLine();\t// read a line from file\n\t\t\t\tif(newLine!=null){\n\t\t\t\t\t// split a record into 3 strings and an integer\n\t\t\t\t\tregInfoLine = newLine.split(\" \");\t\n\t\t\t\t\tnew_StudInfo = new StudentInfo(\n\t\t\t\t\t\t\t\t\t\tregInfoLine[0],\n\t\t\t\t\t\t\t\t\t\tregInfoLine[1],\n\t\t\t\t\t\t\t\t\t\tregInfoLine[2],\n\t\t\t\t\t\t\t\t\t\t(Integer.parseInt(regInfoLine[3])));\n\t\t\t\t}\n\t\t}\n\t\tcatch(IOException e)\n\t\t{\n\t\t\tSystem.out.println(e);\n\t\t\tSystem.exit(1);\n\t\t}\n\t\treturn new_StudInfo;\n\t}", "public void loadEmployees(String fileName)\r\n\t{\r\n\t\t//try block to attempt to open the file\r\n\t\ttry\r\n\t\t{\r\n\t\t\t//declare local variables for the file name and data fields within the employeelist text file\r\n\t\t\t//these will all be Strings when pulled from the file, and then converted to the proper data type when they are assigned to the Employee objects\r\n\t\t\tString empID = \"\";\r\n\t\t\tString empLastName = \"\";\r\n\t\t\tString empFirstName = \"\";\r\n\t\t\tString empType = \"\";\t\r\n\t\t\tString empSalary = \"\"; //will convert to double\r\n\t\t\t\r\n\t\t\t//scan for file\r\n\t\t\tScanner infile = new Scanner(new FileInputStream(fileName));\r\n\t\t\t\r\n\t\t\t//while loop searching file records\r\n\t\t\twhile(infile.hasNext())\r\n\t\t\t{\r\n\t\t\t\t//split the field into segments with the comma (,) being the delimiter (employee ID, Last Name, First Name, employee type, and employee salary)\r\n\t\t\t\tString line = infile.nextLine();\r\n\t\t\t\tString[] fields = line.split(\",\");\r\n\t\t\t\tempID = fields[0];\r\n\t\t\t\tempLastName = fields[1];\r\n\t\t\t\tempFirstName = fields[2];\r\n\t\t\t\tempType = fields[3];\r\n\t\t\t\tempSalary = fields[4];\r\n\t\t\t\t\r\n\t\t\t\t//create a selection structure that creates the type of employee based on the empType\r\n\t\t\t\tif(empType.equalsIgnoreCase(\"H\"))\r\n\t\t\t\t{\r\n\t\t\t\t\t//create an HourlyEmployee and convert empSalary to a double\r\n\t\t\t\t\tHourlyEmployee hourlyEmp = new HourlyEmployee(empID, empLastName, empFirstName, Double.parseDouble(empSalary));\r\n\t\t\t\t\t\r\n\t\t\t\t\t//add hourlyEmp to the Employee ArrayList empList\r\n\t\t\t\t\tempList.add(hourlyEmp);\r\n\t\t\t\t}//end create hourly employee\r\n\t\t\t\t\r\n\t\t\t\t//else if create an exempt employee for E\r\n\t\t\t\telse if(empType.equalsIgnoreCase(\"E\"))\r\n\t\t\t\t{\r\n\t\t\t\t\t//create an exempt employee (salary) and convert the empSalary to a double\r\n\t\t\t\t\tExemptEmployee salaryEmp = new ExemptEmployee(empID, empLastName, empFirstName, Double.parseDouble(empSalary));\r\n\t\t\t\t\t\r\n\t\t\t\t\t//add salaryEmp to the Employee ArrayList empList\r\n\t\t\t\t\tempList.add(salaryEmp);\r\n\t\t\t\t}//end create exempt (salary) employee\r\n\t\t\t\t\r\n\t\t\t\t//else if create a contractor \r\n\t\t\t\telse if(empType.equalsIgnoreCase(\"C\"))\r\n\t\t\t\t{\r\n\t\t\t\t\t//create a contract employee and convert the empSalary to a double\r\n\t\t\t\t\tContractEmployee contractEmp = new ContractEmployee(empID, empLastName, empFirstName, Double.parseDouble(empSalary));\r\n\t\t\t\t\t\r\n\t\t\t\t\t//add contractEmp to the Employee ArrayList empList\r\n\t\t\t\t\tempList.add(contractEmp);\r\n\t\t\t\t}//end create contractor employee\r\n\t\t\t\t\r\n\t\t\t\t//else if create a day laborer\r\n\t\t\t\telse if(empType.equalsIgnoreCase(\"d\"))\r\n\t\t\t\t{\r\n\t\t\t\t\t//create a day laborer and convert the empSalary to a double\r\n\t\t\t\t\tDayLaborer laborer = new DayLaborer(empID, empLastName, empFirstName, Double.parseDouble(empSalary));\r\n\t\t\t\t\t\r\n\t\t\t\t\t//add laborer to the Employee ArrayList empList\r\n\t\t\t\t\tempList.add(laborer);\r\n\t\t\t\t}//end create day laborer employee\r\n\t\t\t\t\r\n\t\t\t\t//else ignore the employee (looking at you Greyworm!)\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t//save the employee type and id to return as an error\r\n\t\t\t\t\tempTypeError = empType;\r\n\t\t\t\t\tempIDError = empID;\r\n\t\t\t\t\t\r\n\t\t\t\t\t//ignore the employee \r\n\t\t\t\t\tempType = null;\r\n\t\t\t\t}//end ignore X employee\r\n\t\t\t}//end while loop cycling the records in the employeelist\r\n\t\t\t\r\n\t\t\t//close infile when done\r\n\t\t\tinfile.close();\r\n\t\t}//end of try block opening employeelist.txt file\r\n\t\t\r\n\t\t//catch block if file not found\r\n\t\tcatch(IOException ex)\r\n\t\t{\r\n\t\t\t//call ex object and display message\r\n\t\t\tex.printStackTrace();\r\n\t\t}//end of catch for file not found\r\n\t}", "private static void writeToStudentsFile() throws IOException{\n\t\tFileWriter fw = new FileWriter(STUDENTS_FILE, false); //overwrites the students.txt file\n\t\tBufferedWriter bw = new BufferedWriter(fw);\n\t\t\n\t\tIterator<StudentDetails> iter = ALL_STUDENTS.listIterator(1); //Get all StudentDetails objects from index 1 of ALL_STUDENTS. This is because the value at index 0 is just a dummy student\n\t\twhile(iter.hasNext()){\n\t\t\tStudentDetails student = iter.next();\n\t\t\tbw.write(student.ParseForTextFile()); //writes the Parsed Form of the StudentDetails object to the students.txt file\n\t\t}\n\t\t\n\t\tbw.close();\n\t}", "public void populateListFromFile() \n\t{\n\t\tBufferedReader bufferedReader = null;\n\t\tallQuestions = new ArrayList<ArrayList<String>>();\n\t\tquestionAndAnswers = new ArrayList<String>();\n\n\t\ttry {\n\t\t bufferedReader = new BufferedReader(new FileReader(\"questions.txt\"));\n\t\t String line = \"\";\n\t\t \n\t\t while ((line = bufferedReader.readLine()) != null) \n\t\t {\t\t\t \t\n\t\t \tif(line.length() > 0)\n\t\t \t\tquestionAndAnswers.add(line);\n\t\t \telse if (line.length() == 0)\n\t\t \t{\n\t\t \t\tallQuestions.add(questionAndAnswers);\n\t\t \t\tquestionAndAnswers = new ArrayList<String>();\n\t\t \t}\n\t\t } \n\t\t} catch (IOException e) {\n\t\t e.printStackTrace();\n\t\t}\n\t}", "private StudentController() {\n\t\tstudents = new ArrayList<Student>();\n\t\tinflateFromFile();\n\t}", "public static ArrayList readData(){\n ArrayList alr = new ArrayList();\n try{\n ArrayList stringArray = (ArrayList)read(filename);\n for (int i = 0; i < stringArray.size(); i++){\n String st = (String)stringArray.get(i);\n StringTokenizer star = new StringTokenizer(st, SEPARATOR);\n int movieID = Integer.parseInt(star.nextToken().trim());\n String email = star.nextToken().trim();\n String comment = star.nextToken().trim();\n Review review = new Review(movieID, email, comment);\n alr.add(review);\n }\n }\n catch (IOException e){\n System.out.println(\"Exception > \" + e.getMessage());\n }\n return alr;\n }", "public static void getXMLUserList() {\n\t\t// Make some local arrays to use below\n\t\tArrayList<Student> activeList = new ArrayList<Student>();\n\t\tArrayList<Student> archiveList = new ArrayList<Student>();\n\t\ttry {\n\t\t\tFile xmlFile = new File(\"Users.xml\");\n\t\t\tDocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\n\t\t\tDocumentBuilder builder = factory.newDocumentBuilder();\n\t\t\tDocument users = builder.parse(xmlFile);\n\t\t\t\n\t\t NodeList studentNodes = users.getElementsByTagName(\"student\");\n\t\t for(int i = 0; i < studentNodes.getLength(); i++) { // Go through each student node\n\t\t \t\n\t\t Node studentNode = studentNodes.item(i);\n\t\t if(studentNode.getNodeType() == Node.ELEMENT_NODE) {\n\t\t Element studentEl = (Element) studentNode;\n\t\t // Get the student's info (and convert types when necessary)\n\t\t String fn = studentEl.getElementsByTagName(\"firstName\").item(0).getTextContent();\n\t\t String ln = studentEl.getElementsByTagName(\"lastName\").item(0).getTextContent();\n\t\t String id = studentEl.getElementsByTagName(\"ucid\").item(0).getTextContent();\n\t\t int ucid = Integer.parseInt(id);\n\t\t String cB = studentEl.getElementsByTagName(\"currentBorrowing\").item(0).getTextContent();\n\t\t int cb = Integer.parseInt(cB);\n\t\t String iA = studentEl.getElementsByTagName(\"isActive\").item(0).getTextContent();\n\t\t boolean ia = Boolean.parseBoolean(iA);\n\t\t String username = studentEl.getElementsByTagName(\"username\").item(0).getTextContent();\n\t\t String pW = studentEl.getElementsByTagName(\"password\").item(0).getTextContent();\n\t\t String iL = studentEl.getElementsByTagName(\"isLibrarian\").item(0).getTextContent();\n\t\t boolean isLib = Boolean.parseBoolean(iL);\n\t\t \n\t\t // And then create all a new instance of Student with the info\n\t\t\t Student newStudent = new Student(fn, ln, ucid, cb, ia, username, pW, isLib);\n\t\t\t // Put the newly created student in the right list\n\t\t\t if(ia) {\n\t\t\t \tactiveList.add(newStudent);\n\t\t\t } else {\n\t\t\t \tarchiveList.add(newStudent);\n\t\t\t }\n\t\t }\n\t\t }\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Something went wrong with the Users.xml parsing\");\n\t\t\tSystem.out.println(e);\n\t\t}\n\t\t// Store our arrays so they are accessible elsewhere\n\t\tManageUsers.setActiveList(activeList);\n\t\tManageUsers.setArchiveList(archiveList);\n\t}", "private ArrayList<String> saveText(){\n FileReader loadDetails = null;\n String record;\n record = null;\n\n //Create an ArrayList to store the lines from text file\n ArrayList<String> lineKeeper = new ArrayList<String>();\n\n try{\n loadDetails=new FileReader(\"employees.txt\");\n BufferedReader bin=new BufferedReader (loadDetails);\n record=new String();\n while (((record=bin.readLine()) != null)){//Read the file and store it into the ArrayList line by line*\n lineKeeper.add(record);\n }//end while\n bin.close();\n bin=null;\n }//end try\n catch (IOException ioe) {}//end catc\n\n return lineKeeper;\n\n }", "public static int loadSchools(ArrayList<School> H) {\n\n\t\tboolean isValid = false;\n\n\t\tString values[] = new String[4002];\n\n\t\tString line = \"\";\n\t\tString strLine = \"\";\n\t\tdouble alpha = 0.00;\n\t\tint i = 0;\n\t\tint successfulSchools = 0;\n\t\tschoolsEntered = 0; // as soon as loadSchools is called\n\t\t// schoolsEntered += loadedSchoolsNum;\n\n\t\tString school_file = \"\";\n\n\t\tdo {\n\t\t\tisValid = true;\n\n\t\t\ttry {\n\t\t\t\tSystem.out.print(\"Enter school file name (0 to cancel): \");\n\t\t\t\tschool_file = input.readLine();\n\t\t\t\tif (school_file.equalsIgnoreCase(\"0\")) {\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t\tSystem.out.println(\"File loading process canceled.\");\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\n\t\t\t\tBufferedReader fin = new BufferedReader(new FileReader(\n\t\t\t\t\t\tschool_file));\n\t\t\t\t// After file has been read, we'll start parsing through it and\n\t\t\t\t// populating our School Object with the relevant data.\n\t\t\t\t// get number of schools with a while loop\n\t\t\t\twhile ((line = fin.readLine()) != null) {\n\n\t\t\t\t\tvalues = line.split(\",\");\n\t\t\t\t\tif (values.length == 3) {\n\n\t\t\t\t\t\tif ((Double.parseDouble(values[1]) <= 1.00)\n\t\t\t\t\t\t\t\t&& (Double.parseDouble(values[1]) >= 0.00)) {\n\t\t\t\t\t\t\t// H[schoolsEntered] = new School( values[0],\n\t\t\t\t\t\t\t// Double.parseDouble(values[1]), numStudentsAdded);\n\t\t\t\t\t\t\t// System.out.println(H[schoolsEntered].getName());\n\t\t\t\t\t\t\tif (Integer.parseInt(values[2]) >= 1) {\n\t\t\t\t\t\t\t\t// took out loadedSchoolsNum\n\t\t\t\t\t\t\t\tH.add(new School(values[0], Double\n\t\t\t\t\t\t\t\t\t\t.parseDouble(values[1]),\n\t\t\t\t\t\t\t\t\t\tnumStudentsAdded, Integer\n\t\t\t\t\t\t\t\t\t\t\t\t.parseInt(values[2])));\n\t\t\t\t\t\t\t\tloadedSchoolsNum++;\n\t\t\t\t\t\t\t\tsuccessfulSchools++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tschoolsEntered++;\n\t\t\t\t}\n\n\t\t\t\tfin.close();\n\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\tSystem.out.println(\"\");\n\t\t\t\tSystem.out.println(\"ERROR: File not found!\");\n\t\t\t\tSystem.out.println(\"\");\n\t\t\t\tisValid = false;\n\t\t\t} catch (IOException e) {\n\n\t\t\t}\n\n\t\t} while (!isValid);\n\n\t\tSystem.out.println(\"\");\n\t\tSystem.out.println(successfulSchools + \" of \" + schoolsEntered\n\t\t\t\t+ \" schools loaded!\");\n\t\tSystem.out.println(\"\");\n\n\t\treturn successfulSchools;\n\n\t}", "public void readFile() throws IOException {\r\n File file = new File(\"employee_list.txt\"); //Declaration and initialization of file object\r\n Scanner textFile = new Scanner(file); //Creates Scanner object and parse in the file\r\n\r\n while(textFile.hasNextLine()){ //Stay in a loop until there is no written line in the text file\r\n String line = textFile.nextLine(); //Read line and store in a String variable 'line'\r\n String[] words = line.split(\",\"); //Split the whole line at commas and store those in a simple String array\r\n Employee employee = new Employee(words[0],words[1],words[2]); //Create Employee object\r\n this.listOfEmployees.add(employee); //Add created Employee object to listOfEmployees ArrayList\r\n if(!this.listOfDepartments.contains(words[1])){ //This just adds all the department names to an ArrayList\r\n this.listOfDepartments.add(words[1]);\r\n }\r\n }\r\n }", "public ArrayList<StudentTuitionModel> getAllTution(String file){\n\t\t\t aFile = file;\n\t\t\t allTuition = new ArrayList();\n\t\t\t try {\n\t\t\t\t BufferedReader reader = new BufferedReader(new FileReader(aFile));\n\t\t\t\t String line = reader.readLine();\n\t\t\t\t while(line != null) {\n\t\t\t\t\tif (line.length() != 0) {\n\t\t\t\t\t String[] arr = line.split(\"\\\\,\");\n\t\t\t\t\t StudentTuitionModel sdam = new StudentTuitionModel (arr[0].trim(), arr[1].trim(),arr[2].trim(),arr[3].trim(), arr[4].trim());\n\t\t\t\t\t if( sdam.getStudFirstName().equals(firstName) &&\n\t\t\t\t\t\t sdam.getStudLastName().equals(lastName) &&\n\t\t\t\t\t\t sdam.getStudSerialNum().equals(studNum) )\n\n\t\t\t\t\t\t allTuition.add(sdam);\n\t\t\t\t\t}\n\t\t\t\t\tline = reader.readLine();\n\t\t\t\t }\n\t\t\t }\n\t\t\t catch(FileNotFoundException exc){\n\t\t\t\t exc.printStackTrace();\n\t\t\t\t System.exit(1);\n\t\t\t }\n\t\t\t catch(IOException exc){\n\t\t\t\t exc.printStackTrace();\n\t\t\t\t System.exit(1);\n\t\t\t }\n\t\t\t return allTuition;\n\t\t }", "public void readFileContent(String path) {\n\t\ttry (FileReader fr = new FileReader(path); BufferedReader br = new BufferedReader(fr);) {\n\t\t\tString line;\n\t\t\twhile ((line = br.readLine()) != null) {\n\t\t\t\tStudent student = this.convertStringToStudent(line);\n\t\t\t\tthis.addStudent(student);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tthrow new RuntimeException(\"File read failed.\", e);\n\t\t}\n\t}", "public void createArrayList() throws IOException,ParseException\r\n\t {\n\t \t\r\n\t try(ICsvBeanReader beanReader = new CsvBeanReader(new FileReader(CSV_FILENAME), \r\n\t \t\tCsvPreference.STANDARD_PREFERENCE))\r\n\t {\r\n\t // the header elements are used to map the values to the bean\r\n\t final String[] headers = beanReader.getHeader(true);\r\n\t final CellProcessor[] processors = getProcessors();\r\n\t Complete customer;\r\n\t String gender,fullname;\r\n\t while ((customer = beanReader.read(Complete.class, headers, processors)) != null)\r\n\t {\r\n\t fullname = customer.getFirstname() + \" \" + customer.getLastname();\r\n\t if(customer.getGender().equals(\"f\"))\r\n\t \t gender = \"female\";\r\n\t \telse\r\n\t gender = \"male\";\r\n\t Date dob=new SimpleDateFormat(\"MM/dd/yyyy\").parse(customer.getDob()); \r\n\t String pattern = \"dd/MM/yyyy\";\r\n\t SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);\r\n \tString date = simpleDateFormat.format(dob);\r\n\t String age = calcAge(date);\r\n\t if(customer.getCategory().equals(\"student\"))\r\n\t {\r\n\t \tString grade = calcGrade(customer.getSec_percent());\r\n\t \tstudentList.add(new Student(customer.getId(),fullname,gender,date,age,customer.getAadhar_number(),customer.getCity(),\r\n\t \tcustomer.getContact_number(),Integer.parseInt(customer.getRoll_no()),customer.getClass_no(),Integer.parseInt(customer.getTotal_marks())\r\n\t \t,grade,Integer.parseInt(customer.getSec_percent()),customer.getHs_stream()));\r\n\t \t\t\r\n\t } \r\n\t else //for teacher\r\n\t {\r\n\t \tDate doj=new SimpleDateFormat(\"MM/dd/yyyy\").parse(customer.getDoj()); \r\n\t \tString pattern1 = \"dd/MM/yyyy\";\r\n\t SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat(pattern);\r\n \tString join_date = simpleDateFormat.format(doj);\r\n\t \tString str_sub_teachers = customer.getSubject_teaches();\r\n\t \tString service_period = calService(join_date);\r\n\t \tList<String> sub_teachers = new ArrayList<String>(Arrays.asList(str_sub_teachers.split(\"-\")));\r\n\t \t\t\t\r\n\t \t\tteacherList.add(new Teacher(customer.getId(),fullname,gender,date,age,customer.getAadhar_number(),customer.getCity(),\r\n \t\t\t\tcustomer.getContact_number(),customer.getEmp_no(),customer.getClass_teacher_of(),join_date,service_period\r\n \t\t\t\t,customer.getPrevious_school(),customer.getPost(),Integer.parseInt(customer.getSalary()),sub_teachers));\r\n }\r\n\t \r\n\t } //while\r\n\t }\r\n\t System.out.println(\"ArrayList Sucessfully Created\");\t\r\n\t \t\r\n\t }", "public Student[] constructArray(String fileName)throws IOException{\n \n Student[] ans = new Student[10];\n Scanner Sc = new Scanner(new File(fileName));\n Sc.useDelimiter(\"\\t|\\n\");\n this.amount = 0;\n while(Sc.hasNext()){\n if(this.amount == ans.length){\n ans = doubler(ans);\n }\n String ID = Sc.next();\n String SName = Sc.next();\n String Email = Sc.next();\n String SClass = Sc.next();\n String major = Sc.next();\n ans[this.amount] = new Student(ID, SName, Email, SClass, major);\n amount++;\n }\n return ans;\n }", "public ArrayList<Student> retrieveAllCurrent() {\r\n\t\tArrayList<Student> students = new ArrayList<Student>();\r\n\t\tHashMap<String, ArrayList<String>> map = MySQLConnector.executeMySQL(\"select\", \"SELECT * FROM `is480-matching`.users inner join `is480-matching`.students on users.id=students.id WHERE users.type LIKE 'Student';\");\r\n\t\tSet<String> keySet = map.keySet();\r\n\t\tIterator<String> iterator = keySet.iterator();\r\n\t\t\r\n\t\tDate date = new Date();\r\n\t\tCalendar cal = Calendar.getInstance();\r\n\t\tcal.setTime(date);\r\n\t\t\r\n\t\tint currYear = cal.get(cal.YEAR);\r\n\t\tint currMth = cal.get(cal.MONTH);\r\n\t\t\r\n\t\tint year = 0;\r\n\t\t\r\n\t\twhile (iterator.hasNext()){\r\n\t\t\tString key = iterator.next();\r\n\t\t\tArrayList<String> array = map.get(key);\t\r\n\t\t\tint id \t\t\t\t= Integer.parseInt(array.get(0));\r\n\t\t\tString username \t= array.get(1);\r\n\t\t\tString fullName \t= array.get(2);\r\n\t\t\tString contactNum \t= array.get(3);\r\n\t\t\tString email \t\t= array.get(4);\r\n\t\t\tString type\t\t\t= array.get(5);\r\n\t\t\tString secondMajor \t= array.get(7);\r\n\t\t\tint role \t\t\t= Integer.parseInt(array.get(8));\r\n\t\t\tint teamId \t\t\t= Integer.parseInt(array.get(9));\r\n\t\t\tint prefRole \t\t= Integer.parseInt(array.get(10));\r\n\t\t\t\r\n\t\t\ttry{\r\n\t\t\t\tint matricYear = Integer.parseInt(username.substring(username.length() - 4, username.length()));\r\n\t\t\t\t\r\n\t\t\t\tyear = currYear - matricYear;\r\n\t\t\t\t\r\n\t\t\t\tStudent student = new Student(id, username, fullName, contactNum, email, type, secondMajor, role, teamId, prefRole);\r\n\t\t\t\t\r\n\t\t\t\tif(currMth > 8){\r\n\t\t\t\t\tyear++;\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(year == 3 || year == 4){\r\n\t\t\t\t\tstudents.add(student);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}catch(Exception e){}\r\n\t\t}\r\n\t\t\r\n\t\treturn students;\r\n\t}", "public static ArrayList<Stue> getStueData() {\n ArrayList<Stue> fillArray = new ArrayList<>();\n\n try {\n File fileIn = new File(\"Stuedata.txt\");\n\n Scanner in = new Scanner(fileIn);\n\n while (in.hasNext()) {\n Stue stueData = new Stue();\n stueData.idRum = in.next();\n stueData.navn = in.next();\n stueData.motto = in.next();\n stueData.etage = in.next();\n fillArray.add(stueData);\n }\n in.close(); //WHYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY?\n } catch (IOException i) {\n i.printStackTrace();\n System.exit(0);\n }\n return fillArray;\n }", "public void readFromFile(){\n\t\ttry {\r\n\t\t\tFile f = new File(\"E:\\\\Study\\\\Course\\\\CSE215L\\\\Project\\\\src\\\\Railway.txt\");\r\n\t\t\tScanner s = new Scanner(f);\r\n\t\t\tpersons = new Person2 [50]; \r\n\t\t\tint i = 0;\r\n\t\t\t\r\n\t\t\twhile(s.hasNextLine()){\r\n\t\t\t\tString a = s.nextLine();\r\n\t\t\t\tString b = s.nextLine();\r\n\t\t\t\tString c = s.nextLine();\r\n\t\t\t\tString d = s.nextLine();\r\n\t\t\t\tString e = s.nextLine();\r\n\t\t\t\tString g = s.nextLine();\r\n\t\t\t\tString h = s.nextLine();\r\n\t\t\t\tString j = s.nextLine();\r\n\t\t\t\tPerson2 temp = new Person2 (a,b,c,d,e,g,h,j);\r\n\t\t\t\tpersons[i] = temp;\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t}\r\n\t}", "private ArrayList<Book> readBookCollection() {\n File file = new File(\"books.txt\");\n ArrayList<Book> collection = new ArrayList<Book>();\n try {\n FileReader fileReader = new FileReader(file);\n BufferedReader reader = new BufferedReader(fileReader);\n while (true) {\n String line = reader.readLine();\n if (line == null) break;\n line = line.trim();\n if (line.equals(\"\")) continue; // ignore possible blank lines\n String[] bookInfo = line.split(\" :: \");\n collection.add(new Book(bookInfo[0], bookInfo[1]));\n }\n }\n catch (IOException e) {\n System.out.println(e.getMessage());\n }\n return collection;\n }", "private void loadSavedCourses() {\n courseList = new CourseList(new ArrayList<>());\n try {\n courseList = reader.readCourseList();\n } catch (IOException ioe) {\n System.err.println(\"Course File Missing\");\n } catch (JSONException je) {\n System.err.println(\"Empty File - Course\");\n System.out.println(je);\n }\n }", "public static ArrayList<Medicine> readMedicine()\n {\n ArrayList<Medicine> newMedicine = new ArrayList<>();\n \n \n try\n {\n FileReader fread = new FileReader(\"Medicine.txt\");\n BufferedReader bread = new BufferedReader(fread);\n \n String Med = \"1\";\n\n while ((Med = bread.readLine()) != null) {\n \n Medicine user = new Medicine(Med);\n newMedicine.add(user); \n }\n bread.close();\n fread.close(); \n } \n catch(Exception error)\n {\n System.out.println(\"Error\" + error);\n }\n \n return (newMedicine);\n }", "public void read(String fileName)\n\t{\n\t\tString line = \"\";\n\t\tint headCount = 0;\n\t\tEmployee helperEmployee;\n\t\t\n\t\ttry\n\t\t{\n\t\t\t//FileReader is in charge of reading text files\n\t\t\tFileReader fileReader = new FileReader(fileName);\n\t\t\t\n\t\t\t//Wrapping FileReader in BufferedReader\n\t\t\tBufferedReader bufferedReader = new BufferedReader(fileReader);\n\t\t\t\n\t\t\t//Continue reading until we reach end of file\n\t\t\twhile( (line = bufferedReader.readLine()) != null)\n\t\t\t{\n\t\t\t\tString[] lineString = line.split(\",\");\n\t\t\t\t//Get the header information and arrange it just once, then read the rest of the information\n\t\t\t\tif(headCount == 0)\n\t\t\t\t{\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\thelperEmployee = new Employee();\n\t\t\t\t\thelperEmployee.setEmployeeName(lineString[0] + \"\" + lineString[1]); \n\t\t\t\t\thelperEmployee.setEmployeeNumber(Integer.parseInt(lineString[2]));\n\t\t\t\t\thelperEmployee.setEmployeeState(lineString[3]);\n\t\t\t\t\thelperEmployee.setEmployeeZipCode(Integer.parseInt(lineString[4]));\n\t\t\t\t\thelperEmployee.setEmployeeAge(Integer.parseInt(lineString[6]));\n\t\t\t\t\tadd(helperEmployee);\n\t\t\t\t}\n\t\n\t\t\t\t//Keep track of number of employees\n\t\t\t\theadCount++;\n\t\t\t}\n\t\t\t\n\t\t\t//Close file as good practice\n\t\t\tbufferedReader.close();\n\t\t}\n\t\tcatch(FileNotFoundException ex)\n\t\t{\n\t\t\tSystem.out.println(\"Unable to open the file named '\" + fileName + \"'\");\n\t\t}\n\t\tcatch(IOException ex)\n\t\t{\n\t\t\tSystem.out.println(\"Error when reading the file \" + fileName + \"'\");\n\t\t}\n\t}", "private void CreateStudentList() {\r\n\t\tStudentList=new ArrayList<Student>();\t\r\n}", "public static void processInput () throws IllegalArgumentException {\n \n File inputDataFile = null;\n Scanner inputFile = null; \n String line = \"\";\n \n try {\n inputDataFile = new File (INPUT_FILE);\n inputFile = new Scanner(inputDataFile);\n }\n catch (FileNotFoundException e) {\n System.out.println(\"File not found.\");\n System.exit (0);\n }\n \n while (inputFile.hasNextLine()) {\n for (int i = 0; i >= 15; i++) {\n \n \n \n Student[] newStudent = line.split (\",\", 10);\n \n inputFile.close();\n \n \n \n \n\n \n\n}// End processInput\n\n//*****************************************************************************\n\npublic static void processStudentData (String[] info) throws IllegalArgumentException {\n\n \n\n}// End processStudentData \n\n//*****************************************************************************\n\npublic static void processGradeItemData (String[] info) throws \n IllegalArgumentException {\n\n}// End processGradeItemData\n\n//*****************************************************************************\n\npublic static void generateReport () {\n\n\n}// End generateReport\n\n\n} // End JedidiahPrallNicholasRyan_03", "public void initAttendances() {\n\t\t\n\t\tFileReader attendancesReader = null;\n\t\ttry\t{\n\t\t\ttry {\n\t\t\t\tattendancesReader = new FileReader(attendancesFile);\n\t\t\t\tScanner attendancesScanner = new Scanner(attendancesReader);\n\n\t\t\t\twhile (attendancesScanner.hasNextLine() ) {\n\t\t\t\t\tString attendancesLine = attendancesScanner.nextLine();\n\t\t\t\t\tString [] attendanceTokens = attendancesLine.split(\"\\\\s+\");\n\t\t\t\t\tString currentClassID = attendanceTokens[0];\n\n\t\t\t\t\tfc = fitnessProg.getFitnessClassWithID(currentClassID);\n\t\t\t\t\tint attendance1 = Integer.parseInt(attendanceTokens[1]);\n\t\t\t\t\tint attendance2 = Integer.parseInt(attendanceTokens[2]);\n\t\t\t\t\tint attendance3 = Integer.parseInt(attendanceTokens[3]);\n\t\t\t\t\tint attendance4 = Integer.parseInt(attendanceTokens[4]);\n\t\t\t\t\tint attendance5 = Integer.parseInt(attendanceTokens[5]);\n\t\t\t\t\tint [] passAttendances = {attendance1, attendance2, attendance3, attendance4, attendance5};\n\t\t\t\t\tfc.setAttendanceRecords(passAttendances);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tfinally {\n\n\t\t\t\tif (attendancesReader != null) {\n\t\t\t\t\tattendancesReader.close();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\tcatch (IOException ioe) {\n\t\t\tJOptionPane.showMessageDialog(null, \"File not found\",\n\t\t\t\t\t\"Error\", JOptionPane.ERROR_MESSAGE);\n\n\t\t}\n\t\tcatch (InputMismatchException e) {\n\t\t\tJOptionPane.showMessageDialog(null, \"Invalid file content\",\n\t\t\t\t\t\"Error\", JOptionPane.ERROR_MESSAGE);\n\t\t}\t\n\t}", "private void loadFromFile(){\n try {\n FileInputStream fis = openFileInput(FILENAME);\n BufferedReader in = new BufferedReader(new InputStreamReader(fis));\n Gson gson = new Gson();\n Type listType = new TypeToken<ArrayList<Countbook>>() {}.getType();\n countbookList = gson.fromJson(in, listType);\n } catch (FileNotFoundException e) {\n countbookList = new ArrayList<Countbook>();\n }\n }", "private void loadMasterData()\r\n\t{\r\n\t\tlistOfMasterStud.clear();\r\n\t\tString qu = \"SELECT * FROM MASTERSTUDENT\";\r\n\t\tResultSet resultM = databaseHandler.execQuery(qu);\r\n\t\ttry {\r\n\t\t\t// retrieve student information form database\r\n\t\t\twhile(resultM.next())\r\n\t\t\t{\r\n\t\t\t\tString studIDM = resultM.getString(\"studentNoM\");\r\n\t\t\t\tString studNameM = resultM.getString(\"nameM\");\r\n\t\t\t\tString studSurnameM = resultM.getString(\"surnameM\");\r\n\t\t\t\tString studSupervisorM = resultM.getString(\"supervisorM\");\r\n\t\t\t\tString studEmailM = resultM.getString(\"emailM\");\r\n\t\t\t\tString studCellphoneM = resultM.getString(\"cellphoneNoM\");\r\n\t\t\t\tString studStationM = resultM.getString(\"stationM\");\r\n\t\t\t\tString studCourseM = resultM.getString(\"courseM\");\r\n\r\n\t\t\t\tlistOfMasterStud.add(new StudentProperty(studIDM, studNameM, studSurnameM,\r\n\t\t\t\t\t\tstudSupervisorM, studEmailM, studCellphoneM, studStationM, studCourseM));\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tmasterStudTable.setItems(listOfMasterStud);\r\n\t}", "public List<Event> fillArrayList()\r\n {\r\n List<Event> list1=new ArrayList<>();\r\n FileReader fr=null;\r\n \r\n try{\r\n \r\n fr=new FileReader(\"./event.txt\");\r\n BufferedReader bf=new BufferedReader(fr);\r\n String s;\r\n \r\n while((s=bf.readLine())!=null)\r\n {\r\n Event event=new Event();\r\n String s1[]=new String[7];\r\n for(int i=0;i<s1.length;i++)\r\n {\r\n s1=s.split(\",\");\r\n \r\n event.setId(Integer.parseInt(s1[0]));\r\n \r\n event.setName(s1[1]);\r\n \r\n event.setOrganizer(s1[2]);\r\n \r\n Date date=Date.valueOf(s1[3]);\r\n \r\n event.setDate(date);\r\n \r\n event.setFees(Double.parseDouble(s1[4]));\r\n \r\n } \r\n list1.add(event);\r\n }\r\n \r\n bf.close();\r\n \r\n }catch(Exception e){e.printStackTrace();}\r\n return list1;\r\n\r\n }", "public static void readFromFile(ArrayList<String> sArrayList, Context context){\n\n int i=0;\n try{\n InputStream inputStream = context.openFileInput(TxtName);\n\n if(inputStream!=null) {\n InputStreamReader inputStreamReader = new InputStreamReader(inputStream);\n BufferedReader bufferedReader = new BufferedReader(inputStreamReader);\n String receivedString = \"\";\n\n while((receivedString = bufferedReader.readLine())!=null){\n sArrayList.set(i,receivedString);\n Log.d(\"fileContent\", \"readFromFile: \"+sArrayList.get(i)+\"\\n\");\n i++;\n }\n inputStream.close();\n }\n\n } catch (FileNotFoundException e) {\n Log.e(\"login activity\", \"File not found: \" + e.toString());\n } catch (IOException e) {\n Log.e(\"login activity\", \"Can not read file: \" + e.toString());\n }\n\n }", "public void readPatient() {\n\t\tBufferedReader br;\n\t\tString s;\n\t\ttry {\n\t\t\tbr = new BufferedReader(new FileReader(\"patients.txt\"));\n\n\t\t\twhile ((s = br.readLine()) != null) {\n\t\t\t\tString[] fields = s.split(\", \");\n\n\t\t\t\tString ssn = fields[0];\n\t\t\t\tString name = fields[1];\n\t\t\t\tString address = fields[2];\n\t\t\t\tString phoneNum = fields[3];\n\t\t\t\tString insurance = fields[4];\n\t\t\t\tString currentMeds = fields[5];\n\t\t\t\tPatient patient = new Patient(ssn, name, address, phoneNum, insurance, currentMeds);\n\t\t\t\tpat.add(patient);\n\t\t\t}\n\t\t\tbr.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\n\t}", "void readFromFile(String file)\n {\n try\n {\n employees.clear();\n FileReader inputFile = new FileReader(fileName);\n BufferedReader input = new BufferedReader(inputFile);\n String line = input.readLine();\n \n while(line != null)\n {\n Employee worker = new Employee();\n StringTokenizer stringParser = new StringTokenizer(line, \",\");\n while(stringParser.hasMoreElements())\n {\n worker.setName(stringParser.nextElement().toString());\n worker.setHours(Integer.parseInt(stringParser.nextElement().toString()));\n worker.setRate(Float.parseFloat(stringParser.nextElement().toString()));\n }\n employees.add(worker);\n line = input.readLine();\n }\n inputFile.close();\n }\n catch(FileNotFoundException e)\n {\n e.getStackTrace();\n }\n catch(IOException e)\n {\n e.getStackTrace();\n }\n }", "public ArrayList getStudents();", "public ArrayList<Student> getAllStudentInfo(String student_id,\n\t\t\tString roll_no) {\n\t\tArrayList<Student> studentList = new ArrayList<Student>();\n\t\t// Select All Query\n\t\tString selectQuery = \"SELECT * FROM \" + TABLE_TEACHER_ASSIGNMENT\n\t\t\t\t+ \" WHERE \" + KEY_STUDENT_ID + \"=\" + student_id + \" AND \"\n\t\t\t\t+ KEY_ROLL_NO + \"=\" + roll_no;\n\t\tCursor cursor = db.rawQuery(selectQuery, null);\n\n\t\t// looping through all rows and adding to list\n\t\tcursor.moveToFirst();\n\t\twhile (cursor.isAfterLast() == false) {\n\t\t\tStudent info = new Student();\n\t\t\tinfo.row_id = Integer.parseInt(cursor.getString(0));\n\t\t\tinfo.id = cursor.getString(1);\n\t\t\tinfo.name = cursor.getString(2);\n\t\t\tinfo.roll_no = cursor.getString(3);\n\t\t\tinfo.section_id = cursor.getString(4);\n\t\t\tinfo.subject_id = cursor.getString(5);\n\t\t\tinfo.teacher_id = cursor.getString(6);\n\t\t\t// Adding contact to list\n\t\t\tstudentList.add(info);\n\t\t\tcursor.moveToNext();\n\t\t}\n\t\tcursor.close();\n\t\t// return contact list\n\t\treturn studentList;\n\t}", "private ArrayList<User> loadUsers(InputStream is) throws IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(is));\r\n\t\tStringBuilder jsonFileContent = new StringBuilder();\r\n\t\t//read line by line from file\r\n\t\tString nextLine = null;\r\n\t\twhile ((nextLine = br.readLine()) != null){\r\n\t\t\tjsonFileContent.append(nextLine);\r\n\t\t}\r\n\r\n\t\tGson gson = new Gson();\r\n\t\t//this is a require type definition by the Gson utility so Gson will \r\n\t\t//understand what kind of object representation should the json file match\r\n\t\tType type = new TypeToken<ArrayList<User>>(){}.getType();\r\n\t\tArrayList<User> users = gson.fromJson(jsonFileContent.toString(), type);\r\n\t\t//close\r\n\t\tbr.close();\t\r\n\t\treturn users;\r\n\t}", "public void readFromEmployeeListFile()\r\n {\r\n try(ObjectInputStream fromEmployeeListFile = \r\n new ObjectInputStream(new FileInputStream(\"listfiles/employeelist.dta\")))\r\n {\r\n employeeList = (EmployeeList) fromEmployeeListFile.readObject();\r\n employeeList.setSavedStaticEmpRunNR(fromEmployeeListFile);\r\n }\r\n catch(ClassNotFoundException cnfe)\r\n {\r\n employeeList = new EmployeeList();\r\n JOptionPane.showMessageDialog(null, \"Fant ikke definisjon av ansatt \"\r\n + \"objektene.\\nOppretter tomt ansattregister.\\n\"\r\n + cnfe.getMessage(), \"Feilmelding\", \r\n JOptionPane.ERROR_MESSAGE);\r\n }\r\n catch(FileNotFoundException fnfe)\r\n {\r\n employeeList = new EmployeeList();\r\n JOptionPane.showMessageDialog(null, \"Finner ikke angitt fil.\\n\"\r\n + \"Oppretter tomt ansattregister.\\n\" \r\n + fnfe.getMessage(), \"Feilmelding\", \r\n JOptionPane.ERROR_MESSAGE);\r\n }\r\n catch(IOException ioe)\r\n\t{\r\n employeeList = new EmployeeList();\r\n JOptionPane.showMessageDialog(null, \"Fikk ikke lest fra filen.\\n\"\r\n + \"Oppretter tomt ansattregister.\\n\"\r\n + ioe.getMessage(), \"Feilmelding\", \r\n JOptionPane.ERROR_MESSAGE);\r\n\t}\r\n }", "private ArrayList<BookOfUser> loadBooksOfUser(InputStream is) throws IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(is));\r\n\t\tStringBuilder jsonFileContent = new StringBuilder();\r\n\t\t//read line by line from file\r\n\t\tString nextLine = null;\r\n\t\twhile ((nextLine = br.readLine()) != null){\r\n\t\t\tjsonFileContent.append(nextLine);\r\n\t\t}\r\n\r\n\t\tGson gson = new Gson();\r\n\t\t//this is a require type definition by the Gson utility so Gson will \r\n\t\t//understand what kind of object representation should the json file match\r\n\t\tType type = new TypeToken<ArrayList<BookOfUser>>(){}.getType();\r\n\t\tArrayList<BookOfUser> bookOfUser = gson.fromJson(jsonFileContent.toString(), type);\r\n\t\t//close\r\n\t\tbr.close();\t\r\n\t\treturn bookOfUser;\r\n\t}", "public void readFile() {\n try\n {\n tasksList.clear();\n\n FileInputStream file = new FileInputStream(\"./tasksList.txt\");\n ObjectInputStream in = new ObjectInputStream(file);\n\n boolean cont = true;\n while(cont){\n Task readTask = null;\n try {\n readTask = (Task)in.readObject();\n } catch (Exception e) {\n }\n if(readTask != null)\n tasksList.add(readTask);\n else\n cont = false;\n }\n\n if(tasksList.isEmpty()) System.out.println(\"There are no todos.\");\n in.close();\n file.close();\n }\n\n catch(IOException ex)\n {\n ex.printStackTrace();\n }\n }", "private void loadSavingsAccounts(String savingsAccountFileName)\n {\n try\n {\n /* Open the file to read */\n File inputFile = new File(savingsAccountFileName);\n\n /* Create a scanner to begin reading from file */\n Scanner input = new Scanner(inputFile);\n\n while (input.hasNextLine())\n {\n //read...\n String currentLine = input.nextLine();\n\n //parse on commas...\n String[] splitLine = currentLine.split(\",\");\n\n //DateFormat class to parse Date from file\n DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.SHORT);\n\n //parsing out data...\n int accountId = Integer.parseInt(splitLine[0]);\n double balance = Double.parseDouble(splitLine[1]);\n String ssn = splitLine[2];\n double interestRate = Double.parseDouble(splitLine[3]);\n Date dateOpened = dateFormat.parse(splitLine[4]);\n int overdraftAccountId = Integer.parseInt(splitLine[5]);\n\n Savings savingsAccount = new Savings(accountId,\n balance,\n ssn,\n interestRate,\n dateOpened,\n overdraftAccountId);\n\n ArrayList<Transaction> accountTransactions = transactionHashMap.get(accountId);\n savingsAccount.setTransactions(accountTransactions);\n\n //add savings account...\n accounts.add(savingsAccount);\n }\n\n input.close();\n\n } catch (Exception e)\n {\n e.printStackTrace();\n }\n }", "public void readPatientListFromFile()\r\n\t{\n\t\tnextPatientLocation = 0;\r\n\t\ttry\r\n\t\t{\r\n\t\t\t//Makes file reader objects and passes filename\r\n\t\t\tFileReader fr = new FileReader(patientMasterfile);\r\n\t\t\tBufferedReader br = new BufferedReader(fr);\r\n\r\n\t\t\t//reads first line and makes a blank patient \r\n\t\t\tString aReadLine = br.readLine();\r\n\t\t\tPatient tempRead = new Patient();\r\n\t\t\t//loops through all lines in the file\r\n\t\t\twhile(aReadLine != null)\r\n\t\t\t{\r\n\t\t\t\t//resets patient to null\r\n\t\t\t\ttempRead = new Patient();\r\n\t\t\t\t//Splits the read in data and assigns that data to the appropriate attribute \r\n\t\t\t\tString[] splitPatientData = aReadLine.split(\"~~\");\r\n\r\n\t\t\t\ttempRead.patientID = splitPatientData[0];\r\n\t\t\t\ttempRead.forename = splitPatientData[1];\r\n\t\t\t\ttempRead.surname = splitPatientData[2];\r\n\t\t\t\ttempRead.username = splitPatientData[3];\r\n\t\t\t\ttempRead.password = splitPatientData[4];\r\n\t\t\t\ttempRead.houseNumber = splitPatientData[5];\r\n\t\t\t\ttempRead.postcode = splitPatientData[6];\r\n\t\t\t\ttempRead.telephoneNumber = splitPatientData[7];\r\n\t\t\t\ttempRead.dob = splitPatientData[8];\r\n\t\t\t\ttempRead.mode = splitPatientData[9];\r\n\t\t\t\t//adds patient to list and gets the next line\r\n\t\t\t\taddPatientToList(tempRead);\r\n\t\t\t\taReadLine = br.readLine();\r\n\t\t\t}\t\r\n\t\t}\r\n\t\t//catches any exceptions trown by reading \r\n\t\tcatch(Exception e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Error reading file, \");\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public ArrayList<Student> studentList()\n {\n ArrayList<Student> studentList = new ArrayList<>();\n try\n {\n DatabaseConnection databaseConnection = new DatabaseConnection();\n String query = \"select * from student\";\n ResultSet rs = databaseConnection.s.executeQuery(query);\n Student student;\n while(rs.next())\n {\n student = new Student(rs.getInt(\"student_id\"), rs.getString(\"student_name\"), rs.getString(\"batch\"), rs.getString(\"student_username\"), rs.getString(\"student_password\"));\n studentList.add(student);\n }\n }\n catch(Exception e)\n {\n JOptionPane.showMessageDialog(null, e);\n }\n return studentList;\n }", "private static void saveStudentsList(List<Student> students, File file) throws IOException {\n saveStudentsList(students, new FileOutputStream(file));\n }", "public static void createAccount()\r\n\t {\r\n\t\t String name;\r\n\t\t String username;\r\n\t\t String password;\r\n\t\t ArrayList<Book> booksLent = null;\r\n\t\t System.out.println(\"Enter your name\");\r\n\t\t Scanner src = new Scanner(System.in);\r\n\t\t name = src.next();\r\n\t\t System.out.println(\"Enter your username\");\r\n\t\t src = new Scanner(System.in);\r\n\t\t username = src.next();\r\n\t\t System.out.println(\"Enter your password\");\r\n\t\t src = new Scanner(System.in);\r\n\t\t password = src.next();\r\n\t\t \r\n\t\t Student stu = new Student(name, username, password, booksLent, 0);\r\n\t\t studentAccount = stu;\r\n\t\t FileReader.getStudents().add(stu);\r\n\t\t FileReader.update();\r\n\t\t Display.studentDisplay(studentAccount);\r\n\t }", "public List<student> getAllStudent() { \n List<student> studentArrayList = new ArrayList<>();\n // Select All Query\n String selectQuery = \"SELECT * FROM \" + table; // PALITAN TO NG TABLE NAME NIYO\n\n SQLiteDatabase db = this.getReadableDatabase();\n Cursor cursor = db.rawQuery(selectQuery, null);\n\n // looping through all rows and adding to list\n if (cursor.moveToFirst()) {\n do {\n student student = new student(); //PALITAN NG MGA DAPAT PALITAN NA VARIABLES\n student.setId(Integer.parseInt(cursor.getString(0)));\n student.setfName(cursor.getString(1));\n student.setlName(cursor.getString(2));\n studentArrayList.add(student);\n } while (cursor.moveToNext());\n }\n\n // return contact list\n return studentArrayList;\n }", "private void loadFromFile() {\n try {\n FileInputStream fis = openFileInput(FILENAME);\n BufferedReader in = new BufferedReader(new InputStreamReader(fis));\n\n Gson gson = new Gson();\n Type listType = new TypeToken<ArrayList<Sub>>(){}.getType();\n subList = gson.fromJson(in, listType);\n\n } catch (FileNotFoundException e) {\n subList = new ArrayList<Sub>();\n }\n }", "public void load_from_file() {\r\n // prompting file name from user\r\n System.out.print(\"Enter in FileName:\\n>\");\r\n\r\n // taking user input of file name\r\n String filename = Menu.sc.next();\r\n Scanner input;\r\n\r\n // try to open file, if fails throws exception and returns to main menu\r\n try {\r\n input = new Scanner(new FileReader(filename));\r\n } catch (FileNotFoundException e) {\r\n System.out.println(\"Unable to open file!!\");\r\n System.out.println();\r\n return;\r\n }\r\n\r\n int count = 0; // variable to count number of address entry read\r\n\r\n /* reading data until end of file */\r\n while (input.hasNextLine()) {\r\n String firstName = \"\", lastName = \"\", street = \"\", city = \"\", state = \"\", email = \"\", phone = \"\";\r\n int zip = 0;\r\n if (input.hasNextLine())\r\n firstName = input.nextLine();\r\n if (input.hasNextLine())\r\n lastName = input.nextLine();\r\n if (input.hasNextLine())\r\n street = input.nextLine();\r\n if (input.hasNextLine())\r\n city = input.nextLine();\r\n if (input.hasNextLine())\r\n state = input.nextLine();\r\n if (input.hasNextLine())\r\n zip = Integer.parseInt(input.nextLine());\r\n if (input.hasNextLine())\r\n phone = input.nextLine();\r\n if (input.hasNext())\r\n email = input.nextLine();\r\n if (input.hasNext())\r\n input.nextLine();\r\n addressEntryList.add(new AdressEntry(firstName, lastName, street, city, state, zip, phone, email));\r\n count++;\r\n }\r\n\r\n /*\r\n printing number of address entry variables\r\n and printing total number of AddressEntry in the list\r\n */\r\n System.out.println(\"Read in \" + count + \" new Addresses, successfully loaded, currently \"\r\n + addressEntryList.size() + \" Addresses\");\r\n input.close();\r\n System.out.println();\r\n }", "public void readFile() \n\t{\n\t\tArrayList<String> tempStations = new ArrayList<>();\n\t\t//create arraylist local variable tempStations which will hold the list of stations temporarily for a specific line to be added to the stations hashmap \n\n\t\tString mtrSystemFile = \"MTRsystem_partial.csv\";\n\t\t//store the csv file name in a string\n\t\tFile file = new File(mtrSystemFile);\n\t\t//create a file object for the MTRSystems csv file\n\n\t\ttry \n\t\t{\n\t\t\tScanner inputStream = new Scanner(file);\n\t\t\t//pass the file through to new scanner object to be scanned\n\n\t\t\twhile (inputStream.hasNext())\n\t\t\t//so long as the scanner object has another token to read from the csv file\n\t\t\t{\n\t\t\t\tString line = inputStream.nextLine();\n\t\t\t\t//store the next line in the string variable\n\t\t\t\tcells = line.split(\",\");\n\t\t\t\t//split each line into cells separated by a comma\n\t\t\t\tint celli = 1;\n\t\t\t\t//assign int index to 1, so that only stations are read excluding line name stored at position 0\n\n\t\t\t\twhile (celli <= cells.length - 1)\n\t\t\t\t//whilst the index is less than or equal the last position of the array\n\t\t\t\t{\n\t\t\t\t\tif (celli == 1 || celli == cells.length - 1)\n\t\t\t\t\t//if the index is at the second position in the array or at the last\n\t\t\t\t\t{\n\t\t\t\t\t\tallTermini.add((cells[celli]));\n\t\t\t\t\t\t//add termini to the ArrayList\n\t\t\t\t\t}\n\t\t\t\t\ttempStations.add(cells[celli]);\n\t\t\t\t\t//add station to the ArrayList\n\t\t\t\t\tcelli++;\n\t\t\t\t}\n\n\t\t\t\taddToStations(cells[0], tempStations);\n\t\t\t\t//add the line name and the list of stations for that line to the hashmap\n\t\t\t\ttempStations.clear();\n\t\t\t\t//Clear the temporary list for the next line\n\n\t\t\t\tcells = null;\n\t\t\t}\n\t\t\tinputStream.close();\n\t\t} catch (FileNotFoundException e) \n\t\t{\n\t\t\tSystem.out.println(\"file not found\");\n\t\t}\n\t}", "@Override\n\tprotected ListEntity parseList(InputStream is) throws Exception {\n\t\tVipStudentList studentList = VipStudentList.parse(is);\n\t\treturn studentList;\n\t}", "public College()\r\n {\r\n students = new ArrayList<Student>();\r\n }", "private void readItems() {\n // open file\n File file = getFilesDir();\n File todoFile = new File(file, \"scores.txt\");\n // try to find items to add\n try {\n items = new ArrayList<>(FileUtils.readLines(todoFile));\n } catch (IOException e) {\n items = new ArrayList<>();\n }\n }", "public ArrayList<Student> getStudents() {\n\n ArrayList<Student> students = new ArrayList<Student>();\n String query = \"SELECT * FROM student\";\n try{\n result = statement.executeQuery(query);\n while(result.next()) {\n\n String id = Integer.toString(result.getInt(\"student_id\"));\n String firstName = result.getString(\"student_first_name\");\n String lastName = result.getString(\"student_last_name\");\n String degree = result.getString(\"degree\");\n String yearOfStudy = result.getString(\"year_of_study\");\n String outcome = result.getString(\"outcome\");\n students.add(new Student(id, firstName, lastName, degree, yearOfStudy, outcome));\n\n }\n }\n catch (SQLException e){\n\n }\n\n return students;\n }", "private void printStudListByCourse() throws Exception {\n String courseID = null;\n ArrayList<Student> studentList = new ArrayList<Student>();\n\n Scanner sc = new Scanner(System.in);\n\n System.out.println(\"\\nPlease enter course ID\");\n courseID = sc.nextLine();\n while(!courseID.matches(\"^[a-zA-Z]{2}[0-9]{4}$\")){\n System.out.println(\"Invalid input! Please enter a valid index number!\");\n courseID = sc.nextLine();\n }\n\n studentList= this.adminManager.getStudentByCourse(courseID);\n if(studentList == null){\n System.out.println(\"\\nThere is no such a course index\\n\\n\");\n System.exit(1);\n }\n if (studentList.isEmpty()){\n System.out.println(\"\\nThere is no student registered for this course ID\\n\\n\");\n return;\n }\n else{\n System.out.println(\"Hang on a moment while we load database.\\n\\n\");\n System.out.println(\"------------------------------------------------------\");\n System.out.println(\" STUDENT NAME GENDER NATIONALITY\");\n System.out.println(\"------------------------------------------------------\");\n //\n for(Student student:studentList){\n System.out.println(String.format(\"%20s %6s %s\",student.getName(),student.getGender(),student.getNationality()));\n }\n\n System.out.println(\"------------------------------------------------------\\n\");\n }\n }", "private void readFile() {\r\n\t\tcsvEntrys = new ArrayList<>();\r\n\t\tString line = \"\";\r\n\t\ttry (BufferedReader br = new BufferedReader(new FileReader(new File(filepath)))) {\r\n\t\t\twhile ((line = br.readLine()) != null) {\r\n\t\t\t\tif (!line.contains(\"id\")) {\r\n\t\t\t\t\tcsvEntrys.add(line);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public void setStudentList(ArrayList<Student> studentList) {\r\n this.studentList = studentList;\r\n }", "static void loadUser() {\n\t\tScanner inputStream = null; // create object variable\n\n\t\ttry { // create Scanner object & assign to variable\n\t\t\tinputStream = new Scanner(new File(\"user.txt\"));\n\t\t\tinputStream.useDelimiter(\",\");\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"No User Infomation was Loaded\");\n\t\t\t// System.exit(0);\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\twhile (inputStream.hasNext()) {\n\n\t\t\t\tString instanceOf = inputStream.next();\n\n\t\t\t\tString readUserName = inputStream.next();\n\t\t\t\tString readPassword = inputStream.next();\n\t\t\t\tString readEmployeeNumber = inputStream.next();\n\t\t\t\tString readName = inputStream.next();\n\t\t\t\tString readPhone = inputStream.next();\n\t\t\t\tString readEmail = inputStream.next();\n\t\t\t\tif (instanceOf.contains(\"*AD*\")) {\n\t\t\t\t\tAdmin a1 = new Admin(readUserName, readPassword, readEmployeeNumber, readName, readPhone,\n\t\t\t\t\t\t\treadEmail);\n\t\t\t\t\tuserInfoArray.add(a1);\n\t\t\t\t\t//System.out.println(\"Read an Admin User: \" + ((User) a1).getUserName() + \" \" + a1.getPassword() + \" \"+ a1.getEmployeeNum());\n\t\t\t\t} else if (instanceOf.contains(\"*CC*\")) {\n\t\t\t\t\tCourseCoordinator a1 = new CourseCoordinator(readUserName, readPassword, readEmployeeNumber,\n\t\t\t\t\t\t\treadName, readPhone, readEmail);\n\t\t\t\t\tuserInfoArray.add(a1);\n\t\t\t\t\t//System.out.println(\"Read an CC User: \" + ((User) a1).getUserName() + \" \" + a1.getPassword() + \" \"+ a1.getEmployeeNum());\n\t\t\t\t} else if (instanceOf.contains(\"*AP*\")) {\n\t\t\t\t\tApproval a1 = new Approval(readUserName, readPassword, readEmployeeNumber, readName, readPhone,\n\t\t\t\t\t\t\treadEmail);\n\t\t\t\t\tuserInfoArray.add(a1);\n\t\t\t\t\t//System.out.println(\"Read an Approval User: \" + ((User) a1).getUserName() + \" \" + a1.getPassword()+ \" \" + a1.getEmployeeNum());\n\t\t\t\t} else if (instanceOf.contains(\"*CA*\")) {\n\t\t\t\t\tCasual a1 = new Casual(readUserName, readPassword, readEmployeeNumber, readName, readPhone,\n\t\t\t\t\t\t\treadEmail);\n\t\t\t\t\ta1.setHrly_rate(inputStream.nextInt());\n\t\t\t\t\tuserInfoArray.add(a1);\n\t\t\t\t\t//System.out.println(\"Read an Casual User: \" + ((User) a1).getUserName() + \" \" + a1.getPassword()+ \" \" + a1.getEmployeeNum());\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (IllegalStateException e) {\n\t\t\tSystem.err.println(\"Could not read from the file\");\n\t\t} catch (InputMismatchException e) {\n\t\t\tSystem.err.println(\"Something wrong happened while reading the file\");\n\t\t}\n\t\tinputStream.close();\n\t}", "public void loadData() {\n\t\tempsList.add(\"Pankaj\");\r\n\t\tempsList.add(\"Raj\");\r\n\t\tempsList.add(\"David\");\r\n\t\tempsList.add(\"Lisa\");\r\n\t}", "public static ArrayList<Student> getAllStudenti() {\n\t\ttry {\n\t\t\tRequestContent rp = new RequestContent();\n\t\t\trp.parameters = new Object[] {};\n\t\t\trp.type = RequestType.GET_ALL_STUDENTS;\n\t\t\tReceiveContent rps = sendReceive(rp);\n\t\t\treturn (ArrayList<Student>) rps.parameters[0];\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"SendNewsLetter error\");\n\t\t}\n\t\treturn new ArrayList<Student>();\n\t}", "public CSCourses(String fileName) {\n this();\n try {\n Scanner scan = new Scanner(new File(fileName));\n while (scan.hasNextLine()) {\n Course c = new Course(scan.nextLine(), scan.nextLine(), scan.nextLine(), scan.nextLine(), scan.nextLine(), scan.nextLine(), scan.nextLine());\n String line = scan.nextLine(); // takes care of the \"#\" \n addCourse(c); // after creating a Course object, it is added to the courseList LinkedList\n }\n }\n catch (IOException e) {\n System.out.println(\"Not able to read file: \" + fileName);\n }\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic static void readUserFile() {\n\t\ttry {\n\t\t\tObjectInputStream readFile = new ObjectInputStream(new FileInputStream(userFile));\n\t\t\tVerify.userList = (ArrayList<User>) readFile.readObject();\n\t\t\treadFile.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (ClassNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t//add contents of file to separate lists\n\t\tfor (int i=0; i<Verify.userList.size(); i++) {\n\t\t\tVerify.userIds.add(Verify.userList.get(i).getUserId());\n\t\t\tVerify.usernames.add(Verify.userList.get(i).getUsername());\n\t\t\tif (Verify.userList.get(i).getAccounts() != null) {\n\t\t\t\tVerify.accountList.addAll(Verify.userList.get(i).getAccounts());\n\t\t\t}\n\t\t\tif (Verify.userList.get(i).getRequests() != null) {\n\t\t\t\tVerify.requestList.addAll(Verify.userList.get(i).getRequests());\t\n\t\t\t}\n\t\t}\n\t\tfor (Account account: Verify.accountList) {\n\t\t\tVerify.accountIds.add(account.getAccountId());\n\t\t}\n\t}", "public void loadData () {\n // create an ObjectInputStream for the file we created before\n ObjectInputStream ois;\n try {\n ois = new ObjectInputStream(new FileInputStream(\"DB/Guest.ser\"));\n\n int noOfOrdRecords = ois.readInt();\n Guest.setMaxID(ois.readInt());\n System.out.println(\"GuestController: \" + noOfOrdRecords + \" Entries Loaded\");\n for (int i = 0; i < noOfOrdRecords; i++) {\n guestList.add((Guest) ois.readObject());\n //orderList.get(i).getTable().setAvailable(false);\n }\n } catch (IOException | ClassNotFoundException e1) {\n // TODO Auto-generated catch block\n e1.printStackTrace();\n }\n }", "public List<Subject> importSubject(String filename) throws FileNotFoundException {\n List<Subject> subjects = new ArrayList<>();\n FileReader fileReader = new FileReader(DATA_PATH + filename);\n Scanner scanner = new Scanner(fileReader);\n //skip first line\n String firstLine = scanner.nextLine();\n Log.i(\"first line: \" + firstLine);\n\n while (scanner.hasNextLine()) {\n String[] s = scanner.nextLine().split(\",\");\n String subjectName = s[0];\n Subject subject = new Subject(subjectName);\n subjects.add(subject);\n }\n\n scanner.close();\n return subjects;\n }", "public static void load(){\n StringBuilder maleNamesString = new StringBuilder();\n try (Scanner maleNamesFile = new Scanner(mnames)){\n while (maleNamesFile.hasNext()) {\n maleNamesString.append(maleNamesFile.next());\n }\n }\n catch(FileNotFoundException e){\n e.printStackTrace();\n return;\n }\n\n //Create a string from the fnames.json file\n StringBuilder femaleNamesString = new StringBuilder();\n try (Scanner femaleNamesFile = new Scanner(fnames)){\n while (femaleNamesFile.hasNext()) {\n femaleNamesString.append(femaleNamesFile.next());\n }\n }\n catch(FileNotFoundException e){\n e.printStackTrace();\n return;\n }\n\n //Create a string from the snames.json file\n StringBuilder surNamesString = new StringBuilder();\n try (Scanner surNamesFile = new Scanner(snames)){\n while (surNamesFile.hasNext()) {\n surNamesString.append(surNamesFile.next());\n }\n\n }\n catch(FileNotFoundException e){\n e.printStackTrace();\n return;\n }\n\n //Create a string from the locations.json file\n StringBuilder locationsString = new StringBuilder();\n try (Scanner locationsFile = new Scanner(locationsJson)){\n while (locationsFile.hasNext()) {\n locationsString.append(locationsFile.next());\n }\n\n }\n catch(FileNotFoundException e){\n e.printStackTrace();\n return;\n }\n\n maleNames = (Names)convertJsonToObject(maleNamesString.toString(), new Names());\n\n femaleNames = (Names)convertJsonToObject(femaleNamesString.toString(), new Names());\n\n surNames = (Names)convertJsonToObject(surNamesString.toString(), new Names());\n\n locations = (Locations)convertJsonToObject(locationsString.toString(), new Locations());\n }", "public ArrayList<Student> selectAllStudents() {\n Connection connection = null;\n Statement statement = null;\n ResultSet resultSet = null;\n ArrayList<Student> studentList = new ArrayList<>();\n try {\n Class.forName(Tools.MYSQL_JDBC_DRIVER);\n\n connection = DriverManager.getConnection(Tools.DB_URL, Tools.USERNAME, Tools.PASSWORD);\n\n statement = connection.createStatement();\n\n String query = \"SELECT * FROM STUDENTS;\";\n\n resultSet = statement.executeQuery(query);\n\n while (resultSet.next()) {\n String id = resultSet.getString(\"STUDENT_ID\");\n String lastName = resultSet.getString(\"LAST_NAME\");\n String firstName = resultSet.getString(\"FIRST_NAME\");\n String dob = resultSet.getString(\"DATE_OF_BIRTH\");\n float fees = resultSet.getFloat(\"TUITION_FEES\");\n Student student = new Student(id, firstName, lastName, dob, fees);\n\n studentList.add(student);\n\n }\n\n } catch (ClassNotFoundException | SQLException e) {\n e.printStackTrace();\n } finally {\n if (resultSet != null) {\n try {\n resultSet.close();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }\n\n if (statement != null) {\n try {\n statement.close();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }\n if (connection != null) {\n try {\n connection.close();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }\n }\n return studentList;\n }", "private void loadFromFile() {\n\t\ttry {\n\t\t\tFileInputStream fis = openFileInput(FILENAME);\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(fis));\n\t\t\tString line = in.readLine();\n\t\t\tGson gson = new Gson();\n\t\t\twhile (line != null) {\n\t\t\t\tCounterModel counter = gson.fromJson(line, CounterModel.class);\n\t\t\t\tif (counterModel.getCounterName().equals(counter.getCounterName())) {\n\t\t\t\t\tcounterListModel.addCounterToList(counterModel);\n\t\t\t\t\tcurrentCountTextView.setText(Integer.toString(counterModel.getCount()));\n\t\t\t\t} else {\n\t\t\t\t\tcounterListModel.addCounterToList(counter);\n\t\t\t\t}\n\t\t\t\tline = in.readLine();\n\t\t\t} \n\t\t\tfis.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}" ]
[ "0.724486", "0.72339976", "0.7161077", "0.71131396", "0.709945", "0.70270914", "0.70195305", "0.68655264", "0.6789532", "0.67220193", "0.6712943", "0.66722864", "0.6656263", "0.64456743", "0.64346844", "0.6385473", "0.6373342", "0.63668156", "0.6348423", "0.63404304", "0.6324716", "0.6301574", "0.62918705", "0.62838364", "0.62752557", "0.6266304", "0.6232063", "0.6230957", "0.62197214", "0.6217468", "0.6200803", "0.6186447", "0.6174292", "0.6117096", "0.60823935", "0.6079226", "0.6078129", "0.6069933", "0.60646653", "0.60468286", "0.60371876", "0.6021582", "0.60106784", "0.6007669", "0.59816986", "0.5979864", "0.5958202", "0.59418267", "0.5938587", "0.5933155", "0.5925939", "0.59246314", "0.5920971", "0.5913557", "0.5863911", "0.585866", "0.58443624", "0.5832604", "0.5824325", "0.58197486", "0.58166265", "0.58155847", "0.5806282", "0.5804282", "0.57910377", "0.5787896", "0.5787063", "0.5757651", "0.5753727", "0.5753106", "0.5752043", "0.57442796", "0.5744228", "0.574336", "0.57387704", "0.5735709", "0.5730282", "0.5717206", "0.57146007", "0.5706549", "0.5703492", "0.57020926", "0.5695582", "0.5693323", "0.56902987", "0.5657668", "0.56564325", "0.5655342", "0.5651382", "0.5649385", "0.5647708", "0.5646633", "0.5644105", "0.5614003", "0.5611427", "0.5596979", "0.55813366", "0.5579626", "0.55771697", "0.5576174" ]
0.714713
3