コード例 #1
0
  public static void main(String[] args) {

    String words = "AS0//s ";
    StringBuffer res = new StringBuffer(words);
    List<String> text = Arrays.asList(words.split("//s"));
    System.out.println(res.charAt(1));
    Collections.shuffle(text);

    SitePage sitepage = new SitePage("SitePage - Name", "SitePage-Descr", "keywords");

    Contacts contacts = new Contacts("Name", "Desc", "Мама мыла раму");
    sitepage.Add(contacts);
    System.out.println(contacts.getKeywords().toString());

    // Initialize four ellipses
    Ellipse ellipse1 = new Ellipse();
    Ellipse ellipse2 = new Ellipse();
    Ellipse ellipse3 = new Ellipse();
    Ellipse ellipse4 = new Ellipse();
    // Initialize three composite graphics
    CompositeGraphic graphic = new CompositeGraphic();
    CompositeGraphic graphic1 = new CompositeGraphic();
    CompositeGraphic graphic2 = new CompositeGraphic();
    // Composes graphics
    graphic1.add(ellipse1);
    graphic1.add(ellipse2);
    graphic1.add(ellipse3);
    graphic2.add(ellipse4);
    graphic.add(graphic1);
    graphic.add(graphic2);
    graphic.print();
  }
コード例 #2
0
 @Override
 public String getName() {
   StringBuffer res = new StringBuffer(name);
   for (Iterator<SitePage> iter = inners.iterator(); iter.hasNext(); ) {
     SitePage innerPage = (SitePage) iter.next();
     res.append("/").append(innerPage.getName());
   }
   return res.toString();
 }